Re: DMA APIs gumble grumble

From: David Miller
Date: Thu Nov 09 2006 - 22:02:19 EST


From: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 10 Nov 2006 13:55:27 +1100

> > pci_alloc_consistent() is not allowed from atomic contexts.
>
> Yes, but some drivers did it anyway, though I can't remember under which
> circumstances (IDE probe possibly ? It's a usual culprit for that sort
> of thing). This is why most implementations use GFP_ATOMIC (including
> sparc64 :-)

Ok, I see.

> Oh well, I have no problem with leaving sparc32 do GFP_KERNEL indeed, I
> can't remember for sure the reason why we have most architectures do
> GFP_ATOMIC, but it probably never hit sparc32.

I wish sparc32 hadn't used alloc_resource() as a poor-man's bitmap
allocator to keep track of IOMMU mappings. That's where the
GFP_KERNEL requirement comes from.

Just use GFP_KERNEL for now, and someone might find the strength
to remove this problem some day :-)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/