Re: [PATCH v2] usb: core: warn if a GFP zone flag is passed to hcd_buffer_alloc()
From: Oliver Neukum
Date: Tue Apr 15 2025 - 03:53:48 EST
On 14.04.25 09:02, Petr Tesarik wrote:
Hi,
That's the point. AFAICS there are _no_ in-tree callers that would pass
GFP_DMA or GFP_DMA32 to hcd_buffer_alloc(), directly or indirectly. But
nobody should be tempted to add the flag, because I cannot imagine how
that would ever be the right thing to do.
You do not dream about putting USB onto PCMCIA over Thunderbolt?
I can change it back to mem_flags &= ~GFP_ZONEMASK to fix it silently;
I simply thought that driver authors may appreciate a warning that
they're trying to do something silly.
People rarely appreciate warnings. I think we should limit them
to cases where something goes wrong or something unexpected happens.
Whatever works for you, but please keep in mind that there seems to be
agreement among mm people that DMA and DMA32 zones should be removed
from the kernel eventually.
Well, if somebody finds a legitimate use case for these flags, the mm
people should deal with it. They are likelier to find a good solution than
all driver writers being forced into finding individual solutions.
Regards
Oliver