Re: Re:Re: [PATCH] scsi: hpsa: fix DMA mapping leak on IOACCEL2 reset path

From: Don.Brace

Date: Wed Jun 24 2026 - 10:11:16 EST


________________________________________
From: haoxiang_li2024 <haoxiang_li2024@xxxxxxx>
Sent: Wednesday, June 24, 2026 1:10 AM
To: Don Brace - C33706 <Don.Brace@xxxxxxxxxxxxx>
Cc: James.Bottomley@xxxxxxxxxxxxxxxxxxxxx <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>; martin.petersen@xxxxxxxxxx <martin.petersen@xxxxxxxxxx>; david.carroll@xxxxxxxxxxxxx <david.carroll@xxxxxxxxxxxxx>; justin.lindley@xxxxxxxxxxxxx <justin.lindley@xxxxxxxxxxxxx>; scott.teel@xxxxxxxxxxxxx <scott.teel@xxxxxxxxxxxxx>; storagedev <storagedev@xxxxxxxxxxxxx>; linux-scsi@xxxxxxxxxxxxxxx <linux-scsi@xxxxxxxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx <linux-kernel@xxxxxxxxxxxxxxx>; stable@xxxxxxxxxxxxxxx <stable@xxxxxxxxxxxxxxx>
Subject: Re:Re: [PATCH] scsi: hpsa: fix DMA mapping leak on IOACCEL2 reset path
 
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

On 2026-06-23 02:26:42,Don.Brace@xxxxxxxxxxxxx wrote:

>Fixes: c5dfd106414f ("scsi: hpsa: correct device resets")
>Cc: stable@xxxxxxxxxxxxxxx
>Signed-off-by: Haoxiang Li <haoxiang_li2024@xxxxxxx>
>
>Acked-by: Don Brace <don.brace@xxxxxxxxxxxxx
>Thanks for your patch. Can fix potential performance issues with devices undergoing resets.
>What about another patch for when call to hpsa_map_ioaccel2_sg_chain_block() fails?
>

>

Thanks for your review! I checked the hpsa_map_ioaccel2_sg_chain_block() failure path. It
already decrements ioaccel_cmds_out and calls  scsi_dma_unmap(cmd). I think this patch
is enough?

Yes, good enough.
Thanks for checking.
>---
> drivers/scsi/hpsa.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
>diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
>index a1b116cd4723..8edad1830abe 100644
>--- a/drivers/scsi/hpsa.c
>+++ b/drivers/scsi/hpsa.c
>@@ -5017,6 +5017,10 @@ static int hpsa_scsi_ioaccel2_queue_command(struct ctlr_info *h,
>
>        if (phys_disk->in_reset) {
>                cmd->result = DID_RESET << 16;
>+               atomic_dec(&phys_disk->ioaccel_cmds_out);
>+               scsi_dma_unmap(cmd);
>+               if (use_sg > h->ioaccel_maxsg)
>+                       hpsa_unmap_ioaccel2_sg_chain_block(h, cp);
>                return -1;
>        }
>
>--
>2.25.1

Thanks,
Haoxiang