Re: [PATCH] soc: fsl: qbman: flush the private memory before enabling QMan and BMan
From: Anthony Pighin
Date: Fri Dec 04 2026 - 13:11:05 EST
Hi Vladimir,
On Fri, Dec 04, 2026 at 07:06:03PM +0200, Vladimir Oltean wrote:
> If I'm right it also means your patch does not fix the bug you're
> actually trying to track down, correct?
Correct. Thanks for pushing back on the FBPR theory. It was wrong, and
your questions are what got us to the real bug.
> There is clearly a misunderstanding here. I never said an all-zero frame
> descriptor. I said the buffer address is zero.
Understood, I misread you there.
> I have a suspicion that your problem may be fixed by the patch below.
> Please try.
It is, and thanks for digging into bman_release() to find it. Your
analysis showed exactly where to force the race, which is what made
a reproducer possible.
I tested on an LS1043A board running v6.18.62 with CONFIG_PREEMPT=y,
where dpaa_bp_seed() runs during probe in udevd task context.
First, without your patch, I added a debug hook to bman_release() just
before the second get_affine_portal(), where bm_rcr_start() has already
returned an entry but the portal is no longer held. The hook acts only
on the first two releases from dpaa_bp_seed().
On the first release the hook migrated the task to another CPU.
bman_release() filled the entry in the old CPU's RCR, then committed
the current entry of the new CPU's RCR, which had never been written.
bman-dbg: migrate udevd/125 cpu 3 -> 0 (now 0), ret 0
bman-dbg: pool 0 filled ffff800081225000 slot 0, committing ffff800080eb9000 slot 0 on cpu 0: bpid 0 bufs 0 0 0 0 0 0 0 0
On the second it made a nested bman_release() on the same portal, the
case your commit message describes. The entry the outer call committed
was all zeroes, as you expected.
bman-dbg: pool 0 filled ffff800080eb9040 slot 1, committing ffff800080eb9080 slot 2 on cpu 0: bpid 0 bufs 0 0 0 0 0 0 0 0
That put 16 zero addresses into BPID 0, and FMan received 16 frames
into them 1.5 s after link up.
[ 25.765468] fsl_dpaa_mac 1ae4000.ethernet mgmt: Link is Up - 1Gbps/Full - flow control off
[ 27.236335] rx_default_dqrr(mgmt): NULL buffer! format=0, offset=256, length=1514, status=0x4
... 15 more identical lines
With your patch, the hook at the same point found preemption and IRQs
disabled and could not act. Each committed entry was the one just
filled, there were no NULL buffers, and mgmt passed traffic normally.
The footprint matches our field reports. Recent hits on v6.6.59 and
v6.12.57 all come at boot, on mgmt, within a few seconds of link up,
with real lengths and parse status. For example:
[ 31.769753] fsl_dpaa_mac 1ae4000.ethernet mgmt: Link is Up - 1Gbps/Full - flow control off
[ 32.939955] rx_default_dqrr(mgmt): NULL buffer! format=0, offset=256, length=1514, status=0x4
[ 32.939982] rx_default_dqrr(mgmt): NULL buffer! format=0, offset=256, length=1514, status=0x4
[ 32.939989] rx_default_dqrr(mgmt): NULL buffer! format=0, offset=256, length=1514, status=0x4
[ 32.939995] rx_default_dqrr(mgmt): NULL buffer! format=0, offset=256, length=1514, status=0x4
[ 32.940002] rx_default_dqrr(mgmt): NULL buffer! format=0, offset=256, length=1514, status=0x4
Those logs can't tell which of the two cases occurred. The migration
case needs no second caller, only a preemption in the window. Nothing
else releases buffers during probe on our board, so it is the likelier
of the two. You may want to add it to your commit message.
Tested-by: Anthony Pighin <anthony.pighin@xxxxxxxxx>
That leaves the QMan part of my patch, which you said you were already
writing a fix for. Having the full PFDR fix in one commit from you may
be the better approach. Or would you prefer a v2 from me with only the
QMan change?
Thanks,
Anthony