Re: [BUG v7.3-rc1] WARNING: mm/page_alloc.c:5340 at __alloc_frozen_pages_noprof

From: Steven Rostedt

Date: Thu Sep 03 2026 - 09:18:09 EST


On Thu, 3 Sep 2026 11:32:33 +0300
Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx> wrote:

> On 9/3/26 10:15, Michal Pecio wrote:
> > On Wed, 2 Sep 2026 14:33:51 -0400, Steven Rostedt wrote:
> >> I'm triggering this warning on boot:
> >>
> >> [ 32.862044] ------------[ cut here ]------------
> >> [ 32.864573] WARNING: mm/page_alloc.c:5340 at __alloc_frozen_pages_noprof+0xd81/0x30d0, CPU#3: swapper/0/1
> >
> > Apparently that's a nonsense allocation size.
> >
> >> [ 32.881048] Modules linked in:
> >> [ 32.883735] CPU: 3 UID: 0 PID: 1 Comm: swapper/0 Not tainted 7.3.0-rc1-test #510 PREEMPT(full)
> >> [ 32.890178] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.17.0-debian-1.17.0-1 04/01/2014
> >
> > Hmm, I recall hearing about QEMU recently.
> >
> > Could this be the "horrible splat" mentioned by 045b5bef916d ?
> >
> > Find it in usb-linus branch at
> > git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
> >
> Yes, this is the case
>
> A patch switching to GENMASK and FIELD_GET has a flaw and changed the parsing of
> the max segments value reported by xHCI host controller.
>
> xHC returns _exponent_ of maximum segments supported, QEMU supports one segment
> so value read is 0. Parsing fails and assumes maximum number of supported ring segments
> is 0. Most hardware xHCI controllers (except some Mediatek) support more than one
> segments so issue is not visible for those
>
> Issue (7.3-rc1):
> 6d45e9556d4a ("usb: xhci: standardize multi bit-field macros") in parsing
>
> Fix: (in Greg's tree, Hopeful it can make make 7.3-rc2)
> 045b5bef916d usb: xhci: Fix HCS_ERST_MAX conversion

I applied the above fix to my tree and sure enough the warning goes away.

Tested-by: Steven Rostedt <rostedt@xxxxxxxxxxx>

Thanks!

-- Steve