All of lore.kernel.org
 help / color / mirror / Atom feed
* aacraid code passes GFP_DMA32 to kmalloc this will not work
@ 2018-03-29 14:51 Hans de Goede
  2018-04-04 21:56 ` Dave Carroll
  0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2018-03-29 14:51 UTC (permalink / raw)
  To: Adaptec OEM Raid Solutions, James E.J. Bottomley,
	Martin K. Petersen, SCSI development list,
	Linux Kernel Mailing List

Hi All,

Since I made the same mistake myself I've done a quick grep for
GFP_DMA32 in the kernel and drivers/scsi/aacraid/commctrl.c
came up as a result of this grep, it does:

                                 p = kmalloc(sg_count[i], GFP_KERNEL|GFP_DMA32);

But kmalloc always returns memory from the normal memory-zone,
if you need memory from a specific memory-zone like the
DMA32 zone, you must use the dma allocation functions (which
from a quick glance at the code seems appropriate here) or
directly call alloc_page or __get_free_page.

Regards,

Hans

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: aacraid code passes GFP_DMA32 to kmalloc this will not work
  2018-03-29 14:51 aacraid code passes GFP_DMA32 to kmalloc this will not work Hans de Goede
@ 2018-04-04 21:56 ` Dave Carroll
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Carroll @ 2018-04-04 21:56 UTC (permalink / raw)
  To: Hans de Goede, dl-esc-Aacraid Linux Driver, James E.J. Bottomley,
	Martin K. Petersen, SCSI development list,
	Linux Kernel Mailing List

> -----Original Message-----
> From: Hans de Goede [mailto:hdegoede@redhat.com]
> Sent: Thursday, March 29, 2018 8:51 AM
> To: dl-esc-Aacraid Linux Driver <aacraid@microsemi.com>; James E.J.
> Bottomley <jejb@linux.vnet.ibm.com>; Martin K. Petersen
> <martin.petersen@oracle.com>; SCSI development list <linux-
> scsi@vger.kernel.org>; Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
> Subject: aacraid code passes GFP_DMA32 to kmalloc this will not work
> 
> 
> Hi All,
> 
> Since I made the same mistake myself I've done a quick grep for
> GFP_DMA32 in the kernel and drivers/scsi/aacraid/commctrl.c came up as a
> result of this grep, it does:
> 
>                                  p = kmalloc(sg_count[i], GFP_KERNEL|GFP_DMA32);
> 
> But kmalloc always returns memory from the normal memory-zone, if you need
> memory from a specific memory-zone like the
> DMA32 zone, you must use the dma allocation functions (which from a quick
> glance at the code seems appropriate here) or directly call alloc_page or
> __get_free_page.

Hi Hans,

I did run into this issue myself recently ... Thanks for a reminder to send in a patch to
correct this.

-Dave
> 
> Regards,
> 
> Hans

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-04 21:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-29 14:51 aacraid code passes GFP_DMA32 to kmalloc this will not work Hans de Goede
2018-04-04 21:56 ` Dave Carroll

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.