* [PATCH] scsi: mvsas: Fix dma_unmap_sg() nents value
@ 2025-06-27 13:48 Thomas Fourier
2025-07-14 17:43 ` Martin K. Petersen
2025-07-22 3:47 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Fourier @ 2025-06-27 13:48 UTC (permalink / raw)
Cc: Thomas Fourier, James E.J. Bottomley, Martin K. Petersen,
Thomas Gleixner, Ingo Molnar, Dr. David Alan Gilbert,
Jeff Garzik, linux-scsi, linux-kernel
The dma_unmap_sg() functions should be called with the same nents as the
dma_map_sg(), not the value the map function returned.
Fixes: b5762948263d ("[SCSI] mvsas: Add Marvell 6440 SAS/SATA driver")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
---
drivers/scsi/mvsas/mv_sas.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c
index 6c46654b9cd9..15b3d9d55a4b 100644
--- a/drivers/scsi/mvsas/mv_sas.c
+++ b/drivers/scsi/mvsas/mv_sas.c
@@ -818,7 +818,7 @@ static int mvs_task_prep(struct sas_task *task, struct mvs_info *mvi, int is_tmf
dev_printk(KERN_ERR, mvi->dev, "mvsas prep failed[%d]!\n", rc);
if (!sas_protocol_ata(task->task_proto))
if (n_elem)
- dma_unmap_sg(mvi->dev, task->scatter, n_elem,
+ dma_unmap_sg(mvi->dev, task->scatter, task->num_scatter,
task->data_dir);
prep_out:
return rc;
@@ -864,7 +864,7 @@ static void mvs_slot_task_free(struct mvs_info *mvi, struct sas_task *task,
if (!sas_protocol_ata(task->task_proto))
if (slot->n_elem)
dma_unmap_sg(mvi->dev, task->scatter,
- slot->n_elem, task->data_dir);
+ task->num_scatter, task->data_dir);
switch (task->task_proto) {
case SAS_PROTOCOL_SMP:
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: mvsas: Fix dma_unmap_sg() nents value
2025-06-27 13:48 [PATCH] scsi: mvsas: Fix dma_unmap_sg() nents value Thomas Fourier
@ 2025-07-14 17:43 ` Martin K. Petersen
2025-07-22 3:47 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2025-07-14 17:43 UTC (permalink / raw)
To: Thomas Fourier
Cc: James E.J. Bottomley, Martin K. Petersen, Thomas Gleixner,
Ingo Molnar, Dr. David Alan Gilbert, Jeff Garzik, linux-scsi,
linux-kernel
Thomas,
> The dma_unmap_sg() functions should be called with the same nents as
> the dma_map_sg(), not the value the map function returned.
Applied to 6.17/scsi-staging, thanks!
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: mvsas: Fix dma_unmap_sg() nents value
2025-06-27 13:48 [PATCH] scsi: mvsas: Fix dma_unmap_sg() nents value Thomas Fourier
2025-07-14 17:43 ` Martin K. Petersen
@ 2025-07-22 3:47 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2025-07-22 3:47 UTC (permalink / raw)
To: Thomas Fourier
Cc: Martin K . Petersen, James E.J. Bottomley, Thomas Gleixner,
Ingo Molnar, Dr. David Alan Gilbert, Jeff Garzik, linux-scsi,
linux-kernel
On Fri, 27 Jun 2025 15:48:18 +0200, Thomas Fourier wrote:
> The dma_unmap_sg() functions should be called with the same nents as the
> dma_map_sg(), not the value the map function returned.
>
>
Applied to 6.17/scsi-queue, thanks!
[1/1] scsi: mvsas: Fix dma_unmap_sg() nents value
https://git.kernel.org/mkp/scsi/c/0141618727bc
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-22 3:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-27 13:48 [PATCH] scsi: mvsas: Fix dma_unmap_sg() nents value Thomas Fourier
2025-07-14 17:43 ` Martin K. Petersen
2025-07-22 3:47 ` Martin K. Petersen
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®