Re: [PATCH net v4 3/3] net: stmmac: Specify hardware capability value when FIFO size isn't specified
From: Guenter Roeck
Date: Sat Feb 01 2025 - 14:14:55 EST
Hi,
On Mon, Jan 27, 2025 at 10:38:20AM +0900, 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.
>
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@xxxxxxxxxxxxx>
This patch breaks qemu's stmmac emulation, for example for
npcm750-evb. The error message is:
stmmaceth f0804000.eth: Can't specify Rx FIFO size
The setup function called for the emulated hardware is dwmac1000_setup().
That function does not set the DMA rx or tx fifo size.
At the same time, the rx and tx fifo size is not provided in the
devicetree file (nuvoton-npcm750.dtsi), so the failure is obvious.
I understand that the real hardware may be based on a more recent
version of the DWMAC IP which provides the DMA tx/rx fifo size, but
I do wonder: Are the benefits of this patch so substantial that it
warrants breaking the qemu emulation of this network interface ?
Thanks,
Guenter