Re: [PATCH] memstick: tifm_ms: use the correct DMA direction on removal
From: Ulf Hansson
Date: Tue Nov 10 2026 - 09:07:06 EST
On Fri, Oct 30, 2026 at 1:36 PM Avi Weiss <thnkslprpt@xxxxxxxxx> wrote:
>
> 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@xxxxxxxxx>
Applied for next, thanks!
Kind regards
Uffe
> ---
> 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
>