mmc: block: Add cache barrier support

eMMC cache barrier provides a way to perform delayed
and in-order flushing of cached data. Host can use this
to avoid flushing delays but still maintain the order
between the data requests in cache.

In case the device gets more barrier requests than it
supports, then a barrier request is treated as a normal flush
request in the device.

If the eMMC cache flushing policy is set to 1, then the device
inherently flushes all the cached requests in FIFO order. For such
devices, as per spec, it is redundant to send any barrier requests
to the device. This may add unnecessary overhead to both host and
the device. So make sure to not send barrier requests in such cases.

Change-Id: Ia7af316800a6895942d3cabcd64600d56fab25a6
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[xiaonian@codeaurora.org: fixed trivial merge conflicts,
changed cmd_flags to req_op() in mmc_blk_issue_flush()
and mmc_blk_issue_rq() function to judge if a req
requires flush]
Signed-off-by: Xiaonian Wang <xiaonian@codeaurora.org>
6 files changed