Re: [PATCH v2] usb: core: warn if a GFP zone flag is passed to hcd_buffer_alloc()
From: Oliver Neukum
Date: Wed Apr 16 2025 - 04:45:42 EST
On 16.04.25 09:48, Petr Tesarik wrote:
Oh, I do, and that's precisely why these GFP flags are no good. The
address (and other) constraints imposed by different buses may not
(and often do not) match any existing memory zone.
True. So we currently have a non-portable series of flags.
It would we better if we passed a hypothetical 'struct mem_constraint*'.
But we don't for now.
However, zone address ranges are determined statically at compile time,
or latest at boot time (e.g. arm64). It's too late to adjust the limits
when you hotplug a more constrained bus at run-time. And I haven't even
mentioned bus bridges which add a non-zero offset to the address...
Yes. Hence the only time somebody would pass a flag like that would be
on very arch specific code. That means that such a developer would be on
his or her own. Hence I'd say the simplest solution is just to do nothing.
Regards
Oliver