* GFP_DMA Janitation
@ 2002-12-14 5:35 Matthew Wilcox
2002-12-16 21:33 ` Matt Domsch
0 siblings, 1 reply; 2+ messages in thread
From: Matthew Wilcox @ 2002-12-14 5:35 UTC (permalink / raw)
To: linux-scsi; +Cc: Janitors
I know there's a lot of clean-up and janitorial work going on at the
moment, so maybe someone already fixed the bogus uses of GFP_DMA in
drivers/scsi? For those who're not aware, GFP_DMA is _only_ a flag,
not a full specifier. ie it should be used as
buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
rather than
buffer = kmalloc(512, GFP_DMA);
which is how sr.c uses it at present.
Current offenders:
drivers/scsi/aha1542.c:703: SCpnt->host_scribble = (unsigned char *) kmalloc(512, GFP_DMA);
drivers/scsi/megaraid.c:5020: _tv = (void *)__get_free_pages(GFP_DMA, order);
drivers/scsi/pluto.c:120: fcs = (struct ctrl_inquiry *) kmalloc (sizeof (struct ctrl_inquiry) * fcscount, GFP_DMA);
drivers/scsi/sd.c:1124: buffer = kmalloc(512, GFP_DMA);
drivers/scsi/sr.c:596: buffer = kmalloc(512, GFP_DMA);
drivers/scsi/sr.c:708: buffer = kmalloc(512, GFP_DMA);
drivers/scsi/sr_ioctl.c:99: bounce_buffer = (char *) kmalloc(cgc->buflen, GFP_DMA);
The other users of GFP_DMA seem to use it correctly.
BTW, not specifing anything with GFP_DMA leads to the allocation currently
being performed as GFP_ATOMIC, only without the permission to access
the emergency pools. A terribly risky situation.
--
"It's not Hollywood. War is real, war is primarily not about defeat or
victory, it is about death. I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: GFP_DMA Janitation
2002-12-14 5:35 GFP_DMA Janitation Matthew Wilcox
@ 2002-12-16 21:33 ` Matt Domsch
0 siblings, 0 replies; 2+ messages in thread
From: Matt Domsch @ 2002-12-16 21:33 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: linux-scsi, Janitors
> I know there's a lot of clean-up and janitorial work going on at the
> moment, so maybe someone already fixed the bogus uses of GFP_DMA in
> drivers/scsi?
> drivers/scsi/megaraid.c:5020: _tv = (void *)__get_free_pages(GFP_DMA, order);
The megaraid 2.00.2 driver (2.00.1 is in -ac right now) gets this right
(in fact, there are no GFP_DMA allocations ever, it uses the PCI DMA API
properly).
Thanks,
Matt
--
Matt Domsch
Sr. Software Engineer, Lead Engineer, Architect
Dell Linux Solutions www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-12-16 21:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-14 5:35 GFP_DMA Janitation Matthew Wilcox
2002-12-16 21:33 ` Matt Domsch
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.