mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] memstick: tifm_ms: use the correct DMA direction on removal
@ 2026-10-30 12:36 Avi Weiss
  0 siblings, 0 replies; only message in thread
From: Avi Weiss @ 2026-10-30 12:36 UTC (permalink / raw)
  To: Alex Dubov, Ulf Hansson
  Cc: Maxim Levitsky, linux-mmc, linux-kernel, Avi Weiss

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.

Fixes: baf8532a147d ("memstick: initial commit for Sony MemoryStick support")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
---
 drivers/memstick/host/tifm_ms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/memstick/host/tifm_ms.c b/drivers/memstick/host/tifm_ms.c
index 0a54586aa54e8..171aadd4ec71a 100644
--- a/drivers/memstick/host/tifm_ms.c
+++ b/drivers/memstick/host/tifm_ms.c
@@ -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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-30 12:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-30 12:36 [PATCH] memstick: tifm_ms: use the correct DMA direction on removal Avi Weiss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®