On Fri, Nov 20, 2026 at 07:32:15PM -0800, Dimitri Daskalakis wrote:
> From: Dimitri Daskalakis <dask…@meta.com>
>
> TWQ_IDLE, TQS_IDLE and TDE_IDLE have a bit per Tx work queue. Bit 2q
> is for TWQ0, and bit 2q+1 is for TWQ1. fbnic_wait_queue_idle() only
> tests bit q, which belongs to queue q/2. Thus, the wait covers a TWQ
> of the wrong queue (except when q = 0).
>
> Test both of the queue's TWQ bits in those registers.
>
> This bug was found by AI and verified in QEMU.
>
> Forced TWQ1 of Tx queue 3 to never read idle in QEMU, with rx 2 tx 2
> (queue 3 is the XDP Tx queue of rxq 1's vector), and bound devmem to
> rxq 1:
> before: bind succeeds
> after: bind fails with ETIMEDOUT:
> wait for queue Tx3 idle failed 0x0800(0): ffffff7f (mask: 000000c0)
>
> Fixes: da43127a8edc ("eth: fbnic: support queue ops / zero-copy Rx")
> Signed-off-by: Dimitri Daskalakis <dask…@meta.com>
Reviewed-by: Simon Horman <hor…@kernel.org>