mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Avi Weiss <thnkslprpt@gmail.com>
To: Alex Dubov <oakad@yahoo.com>, Ulf Hansson <ulfh@kernel.org>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Avi Weiss <thnkslprpt@gmail.com>
Subject: [PATCH] memstick: tifm_ms: use the correct DMA direction on removal
Date: Fri, 30 Oct 2026 14:36:48 +0200	[thread overview]
Message-ID: <20261030123647.2356647-2-thnkslprpt@gmail.com> (raw)

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


                 reply	other threads:[~2026-10-30 12:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261030123647.2356647-2-thnkslprpt@gmail.com \
    --to=thnkslprpt@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=maximlevitsky@gmail.com \
    --cc=oakad@yahoo.com \
    --cc=ulfh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®