aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2016-11-11 14:22:36 +0000
committerUlf Hansson <ulf.hansson@linaro.org>2016-12-21 08:34:30 +0100
commite85baa8868b016513c0f5738362402495b1a66a5 (patch)
tree36401d0ff54253b9209e8cd832037f295c20cc77 /Documentation
parentmmc: core: Further fix thread wake-up (diff)
downloadlinux-dev-e85baa8868b016513c0f5738362402495b1a66a5.tar.xz
linux-dev-e85baa8868b016513c0f5738362402495b1a66a5.zip
mmc: sd: Meet alignment requirements for raw_ssr DMA
The mmc_read_ssr() function results in DMA to the raw_ssr member of struct mmc_card, which is not guaranteed to be cache line aligned & thus might not meet the requirements set out in Documentation/DMA-API.txt: Warnings: Memory coherency operates at a granularity called the cache line width. In order for memory mapped by this API to operate correctly, the mapped region must begin exactly on a cache line boundary and end exactly on one (to prevent two separately mapped regions from sharing a single cache line). Since the cache line size may not be known at compile time, the API will not enforce this requirement. Therefore, it is recommended that driver writers who don't take special care to determine the cache line size at run time only map virtual regions that begin and end on page boundaries (which are guaranteed also to be cache line boundaries). On some systems where DMA is non-coherent this can lead to us losing data that shares cache lines with the raw_ssr array. Fix this by kmalloc'ing a temporary buffer to perform DMA into. kmalloc will ensure the buffer is suitably aligned, allowing the DMA to be performed without any loss of data. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Fixes: 5275a652d296 ("mmc: sd: Export SD Status via “ssr” device attribute") Cc: <stable@vger.kernel.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions