Thread (17 messages) 17 messages, 3 authors, 2026-01-08

Re: [PATCH net-next 2/9] net: stmmac: dwmac4: fix RX FIFO fill statistics

From: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: 2026-01-07 08:39:21
Also in: netdev


On 06/01/2026 21:31, Russell King (Oracle) wrote:
In dwmac4_debug(), the wrong shift is used with the RXFSTS mask:

 #define MTL_DEBUG_RXFSTS_MASK          GENMASK(5, 4)
 #define MTL_DEBUG_RXFSTS_SHIFT         4
 #define MTL_DEBUG_RRCSTS_SHIFT         1

                       u32 rxfsts = (value & MTL_DEBUG_RXFSTS_MASK)
                                    >> MTL_DEBUG_RRCSTS_SHIFT;

where rxfsts is tested against small integers 1 .. 3. This results in
the tests always failing, causing the "mtl_rx_fifo__fill_level_empty"
statistic counter to always be incremented no matter what the fill
level actually is.

Fix this by using FIELD_GET() and remove the unnecessary
MTL_DEBUG_RXFSTS_SHIFT definition as FIELD_GET() will shift according
to the least siginificant set bit in the supplied field mask.

Signed-off-by: Russell King (Oracle) <redacted>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Maxime

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help