Re: [PATCH net-next] net: stmmac: dwmac-sun8i: set the RX FIFO flow control in the RX mode setup

From: Maxime Chevallier

Date: Thu Dec 03 2026 - 04:05:54 EST


Hi Nicolai,

On 12/3/26 08:59, Nicolai Buchwitz wrote:
> Hi Maxime
>
> On 3.12.2026 08:31, Maxime Chevallier wrote:
>
>> [...]
>
>> Let's move the threshold setup in the DMA configuration path, making it
>> the only piece of code that touches this register. This is OK, as we
>> just set the thresholds, we don't change the FC status. That's also
>> what's done in other glues.
>
> nit: IMHO other functions still touch this register, maybe reword?

Sure, I can reword

>
>>
>> The thresholds are now configured unconditionnally, that's also OK as
>> it doesn't affect anything else that TX FC, and only if it's enabled in
>> HW.
>
> unconditionnally -> unconditionally, that -> than

arg typos, sorry about that.

>
>> [...]
>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
>> index 613199da57c1..5a660d22b219 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
>> @@ -562,6 +562,12 @@ static void sun8i_dwmac_dma_operation_mode_rx(struct stmmac_priv *priv,
>>          else if (mode < 128)
>>              v |= EMAC_RX_TH_128;
>>      }
>> +
>> +    v &= ~(EMAC_RX_FLOW_CTL_TH_ACT | EMAC_RX_FLOW_CTL_TH_DEACT);
>> +    v |= EMAC_RX_FIFO_FLOW_CTL |
>
> This bit is now always set. Is that fine with TX pause off?

yes it's fine, I've tested that. As long as TX_FLOW_CTL_EN is clear
in TX_FLOW_CTL, we don't emit pause frames so we're all good :)

Maxime

>
>> [...]
>
> Thanks,
> Nicolai