memstick: tifm_ms: use the correct DMA direction on removal
PATCH 1/1 memstick: tifm_ms: use the correct DMA direction on removal
tifm_ms_issue_cmd() maps READ requests with DMA_FROM_DEVICE and WRITE requests with DMA_TO_DEVICE. When a request is active during removal, tifm_ms_remove() unmaps it using the opposite direction.
Use the original mapping direction when unmapping an active request, matching the normal completion path.
--- drivers/memstick/host/tifm_ms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/memstick/host/tifm_ms.c +2 -2
@@ -606,8 +606,8 @@ static void tifm_ms_remove(struct tifm_dev *sock)if (host->use_dma)tifm_unmap_sg (sock, &host->req->sg,1 , host->req->data_dir ==READ - ?DMA_TO_DEVICE - :DMA_FROM_DEVICE ); + ?DMA_FROM_DEVICE + :DMA_TO_DEVICE ); host->req->error = -ETIME ; do {
base-commit: d89e1d186ec9271bf78e62771779e9fc03bf0fc3
Signature · 1 line
2.43.0
Quoted 10 lines · Avi Weiss
tifm_ms_issue_cmd()maps READ requests withDMA_FROM_DEVICEand WRITE requests withDMA_TO_DEVICE. When a request is active during removal,tifm_ms_remove()unmaps it using the opposite direction.Use the original mapping direction when unmapping an active request, matching the normal completion path.
Fixes baf8532a147d ("memstick: initial commit for Sony MemoryStick support")Signed-off-by Avi Weiss <[email protected]>
Applied for next, thanks!
Kind regards
Uffe
Quoted 24 lines
--- drivers/memstick/host/tifm_ms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/memstick/host/tifm_ms.c +2
-2@@ -606,8 +606,8 @@ static void tifm_ms_remove(struct tifm_dev *sock)if (host->use_dma)tifm_unmap_sg (sock, &host->req->sg,1 , host->req->data_dir ==READ - ?DMA_TO_DEVICE - :DMA_FROM_DEVICE ); + ?DMA_FROM_DEVICE + :DMA_TO_DEVICE ); host->req->error = -ETIME ; do {base-commit:
d89e1d186ec9271bf78e62771779e9fc03bf0fc3--
2.43.0