Re: [PATCH net v4 3/3] net: stmmac: Specify hardware capability value when FIFO size isn't specified
From: Steven Price
Date: Fri Jan 31 2025 - 04:46:57 EST
On 27/01/2025 01:38, Kunihiko Hayashi wrote:
> When Tx/Rx FIFO size is not specified in advance, the driver checks if
> the value is zero and sets the hardware capability value in functions
> where that value is used.
>
> Consolidate the check and settings into function stmmac_hw_init() and
> remove redundant other statements.
>
> If FIFO size is zero and the hardware capability also doesn't have upper
> limit values, return with an error message.
This patch breaks my Firefly RK3288 board. It appears that all of the
following are true:
* priv->plat->rx_fifo_size == 0
* priv->dma_cap.rx_fifo_size == 0
* priv->plat->tx_fifo_size == 0
* priv->dma_cap.tx_fifo_size == 0
Simply removing the "return -ENODEV" lines gets this platform working
again (and AFAICT matches the behaviour before this patch was applied).
I'm not sure whether this points to another bug causing these to
all be zero or if this is just an oversight. The below patch gets my
board working:
-----8<-----