]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: sdhci: fix dma memory leak in sdhci_pre_req()
authorHaibo Chen <haibo.chen@freescale.com>
Tue, 25 Aug 2015 02:02:11 +0000 (10:02 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Thu, 27 Aug 2015 12:50:49 +0000 (14:50 +0200)
commitd479bba1e81500663f7da00e245a81f420e9a1c4
tree40614c54f02bfece90f8e25dc442451fefb3be77
parent48b6509953941db7dff83ca2c0c86f77b96c2cf5
mmc: sdhci: fix dma memory leak in sdhci_pre_req()

Currently one mrq->data maybe execute dma_map_sg() twice
when mmc subsystem prepare over one new request, and the
following log show up:
sdhci[sdhci_pre_dma_transfer] invalid cookie: 24, next-cookie 25

In this condition, mrq->date map a dma-memory(1) in sdhci_pre_req
for the first time, and map another dma-memory(2) in sdhci_prepare_data
for the second time. But driver only unmap the dma-memory(2), and
dma-memory(1) never unmapped, which cause the dma memory leak issue.

This patch use another method to map the dma memory for the mrq->data
which can fix this dma memory leak issue.

Fixes: dcfab58e7538 ("mmc: sdhci: use pipeline mmc requests to improve performance")
Reported-and-tested-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.h