Skip to contentSkip to conversation

pmcraid: don't use GFP_DMA in pmcraid_alloc_sglist

PATCH Applied Christoph Hellwig 3 participants 4 messages Dec 22, 2021 – Jan 10, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pmcraid: don't use GFP_DMA in pmcraid_alloc_sglist

The driver doesn't express DMA addressing limitation under 32-bits anywhere else, so remove the spurious GFP_DMA allocation.

---
 drivers/scsi/pmcraid.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/pmcraid.c +2 -2
index 2fe7a0019fff2..928532180d323 100644
@@ -3221,8 +3221,8 @@ static struct pmcraid_sglist *pmcraid_alloc_sglist(int buflen)
 		return NULL;
 
 	sglist->order = order;
-	sgl_alloc_order(buflen, order, false,
-			GFP_KERNEL | GFP_DMA | __GFP_ZERO, &sglist->num_sg);
+	sgl_alloc_order(buflen, order, false, GFP_KERNEL | __GFP_ZERO,
+			&sglist->num_sg);
 
 	return sglist;
 }
Signature · 1 line
2.30.2
#1 lore raw

Christoph,

Quoted 2 lines

The driver doesn't express DMA addressing limitation under 32-bits anywhere else, so remove the spurious GFP_DMA allocation.

Applied to 5.17/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#2 lore raw
In reply to Christoph Hellwig
Quoted 9 lines

The driver doesn't express DMA addressing limitation under 32-bits anywhere else, so remove the spurious GFP_DMA allocation.

---
drivers/scsi/pmcraid.c <https://lore.kernel.org/all/[email protected]/#Z31drivers:scsi:pmcraid.c> | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)

diff

<https://lore.kernel.org/all/[email protected]/#iZ31drivers:scsi:pmcraid.c> --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c > index 2fe7a0019fff2..928532180d323 100644 > --- a/drivers/scsi/pmcraid.c > +++ b/drivers/scsi/pmcraid.c > @@ -3221,8 +3221,8 @@ static struct pmcraid_sglist *pmcraid_alloc_sglist(int buflen) > return NULL;

Review

Quoted 3 lines
(quoted diff) +0 -1
 	sglist->order = order;
-	sgl_alloc_order(buflen, order, false,  > - GFP_KERNEL | GFP_DMA | __GFP_ZERO, &sglist->num_sg); > + 

sgl_alloc_order(buflen, order, false, GFP_KERNEL | __GFP_ZERO, > + &sglist->num_sg); >

Quoted 2 lines

return sglist;
}

Hi,

some time ago I sent a patch because the address returned by
sgl_alloc_order() isn't saved anywhere and really look like a bogus allocation and certainly a memory leak.

See https://lore.kernel.org/linux-kernel/[email protected]/

CJ