net: stmmac: dwmac-rk: Provide FIFO sizes for DWMAC 1000
Subsystems (6)
PATCH 1/1 net: stmmac: dwmac-rk: Provide FIFO sizes for DWMAC 1000
From: Chen-Yu Tsai <[email protected]>
The DWMAC 1000 DMA capabilities register does not provide actual FIFO sizes, nor does the driver really care. If they are not provided via some other means, the driver will work fine, only disallowing changing the MTU setting.
The recent commit 8865d22656b4 ("net: stmmac: Specify hardware capability value when FIFO size isn't specified") changed this by requiring the FIFO sizes to be provided, breaking devices that were working just fine.
Provide the FIFO sizes through the driver's platform data, to not only fix the breakage, but also enable MTU changes. The FIFO sizes are confirmed to be the same across RK3288, RK3328, RK3399 and PX30, based on their respective manuals. It is likely that Rockchip synthesized their DWMAC 1000 with the same parameters on all their chips that have it.
---
The reason for stable inclusion is not to fix the device breakage (which only broke in v6.14-rc1), but to provide the values so that MTU changes can work in older kernels.
Since a fix for stmmac in general has already been sent [1] and a revert was also proposed [2], I'll refrain from sending mine.
[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +4 -1
@@ -1966,8 +1966,11 @@ static int rk_gmac_probe(struct platform_device *pdev)/* If the stmmac is not already selected as gmac4, * then make sure we fallback to gmac. */ -if (!plat_dat->has_gmac4) +if (!plat_dat->has_gmac4) { plat_dat->has_gmac = true; + plat_dat->rx_fifo_size =4096 ; + plat_dat->tx_fifo_size =2048 ; + } plat_dat->fix_mac_speed = rk_fix_speed; plat_dat->bsp_priv =rk_gmac_setup (pdev, plat_dat, data);
Signature · 1 line
2.39.5
Quoted 19 lines · Chen-Yu Tsai
From: Chen-Yu Tsai <[email protected]>
The DWMAC 1000 DMA capabilities register does not provide actual FIFO sizes, nor does the driver really care. If they are not provided via some other means, the driver will work fine, only disallowing changing the MTU setting.
The recent commit
8865d22656b4("net: stmmac: Specify hardware capability value when FIFO size isn't specified") changed this by requiring the FIFO sizes to be provided, breaking devices that were working just fine.Provide the FIFO sizes through the driver's platform data, to not only fix the breakage, but also enable MTU changes. The FIFO sizes are confirmed to be the same across RK3288, RK3328, RK3399 and PX30, based on their respective manuals. It is likely that Rockchip synthesized their DWMAC 1000 with the same parameters on all their chips that have it.
Quoted 8 lines
Fixes eaf4fac47807 ("net: stmmac: Do not accept invalid MTU values")Fixes 8865d22656b4 ("net: stmmac: Specify hardware capability value when FIFO size isn't specified")Cc <[email protected]>Signed-off-by Chen-Yu Tsai <[email protected]>---
The reason for stable inclusion is not to fix the device breakage (which only broke in v6.14-rc1), but to provide the values so that MTU changes can work in older kernels.
Allowing the MTU to be changed is probably classed as a new feature, not bug fix.
I _think_ this also allows flow control, which again is a new feature.
Please submit to net-next.
Andrew
Jakub Kicinski
maintainerQuoted 2 lines · On Wed, 5 Feb 2025 00:13:59 +0800 Chen-Yu Tsai wrote:
Since a fix for stmmac in general has already been sent [1] and a revert was also proposed [2], I'll refrain from sending mine.
No, no, please do. You need to _submit_ the revert like a normal patch. With all the usual details in the commit message.
Quoted 7 lines · Jakub Kicinski
Quoted 2 lines · On Wed, 5 Feb 2025 00:13:59 +0800 Chen-Yu Tsai wrote:
Since a fix for stmmac in general has already been sent [1] and a revert was also proposed [2], I'll refrain from sending mine.
No, no, please do. You need to _submit_ the revert like a normal patch. With all the usual details in the commit message.
Mine isn't a revert, but simply downgrading the error to a warning. So... yet another workaround approach.
Simon Horman
reviewerQuoted 11 lines · Chen-Yu Tsai
Quoted 7 lines · Jakub Kicinski
Quoted 2 lines · On Wed, 5 Feb 2025 00:13:59 +0800 Chen-Yu Tsai wrote:
Since a fix for stmmac in general has already been sent [1] and a revert was also proposed [2], I'll refrain from sending mine.
No, no, please do. You need to _submit_ the revert like a normal patch. With all the usual details in the commit message.
Mine isn't a revert, but simply downgrading the error to a warning. So... yet another workaround approach.
I think the point is that someone needs to formally submit the revert. And I assume it should target the net tree.
Quoted 8 lines · Simon Horman
Quoted 6 lines · Chen-Yu Tsai
Quoted 5 lines · Jakub Kicinski
Quoted 2 lines · On Wed, 5 Feb 2025 00:13:59 +0800 Chen-Yu Tsai wrote:
Since a fix for stmmac in general has already been sent [1] and a revert was also proposed [2], I'll refrain from sending mine.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
No, no, please do. You need to _submit_ the revert like a normal patch. With all the usual details in the commit message.
Mine isn't a revert, but simply downgrading the error to a warning. So... yet another workaround approach.
I think the point is that someone needs to formally submit the revert. And I assume it should target the net tree.
Russell sent one a couple hours ago, so I think we're covered.
Quoted 7 lines · Simon Horman
Quoted 6 lines · Chen-Yu Tsai
Quoted 5 lines · Jakub Kicinski
Quoted 2 lines · On Wed, 5 Feb 2025 00:13:59 +0800 Chen-Yu Tsai wrote:
Since a fix for stmmac in general has already been sent [1] and a revert was also proposed [2], I'll refrain from sending mine.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
No, no, please do. You need to _submit_ the revert like a normal patch. With all the usual details in the commit message.
Mine isn't a revert, but simply downgrading the error to a warning. So... yet another workaround approach.
I think the point is that someone needs to formally submit the revert. And I assume it should target the net tree.
For what I think is the third time today (fourth if you include the actual patch...)
https://lore.kernel.org/r/[email protected]
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Simon Horman
reviewerQuoted 1 line · Chen-Yu Tsai
On Thu, Feb 6, 2025 at 1:38 AM Simon Horman <[email protected]> wrote:
...
Quoted 5 lines
Quoted 2 lines
I think the point is that someone needs to formally submit the revert. And I assume it should target the net tree.
Russell sent one a couple hours ago, so I think we're covered.
Quoted 1 line · Russell King (Oracle)
On Wed, Feb 05, 2025 at 05:38:24PM +0000, Simon Horman wrote:
...
Quoted 7 lines
Quoted 2 lines
I think the point is that someone needs to formally submit the revert. And I assume it should target the net tree.
For what I think is the third time today (fourth if you include the actual patch...)
Thanks, I see it now.
Quoted 19 lines · Chen-Yu Tsai
From: Chen-Yu Tsai <[email protected]>
The DWMAC 1000 DMA capabilities register does not provide actual FIFO sizes, nor does the driver really care. If they are not provided via some other means, the driver will work fine, only disallowing changing the MTU setting.
The recent commit
8865d22656b4("net: stmmac: Specify hardware capability value when FIFO size isn't specified") changed this by requiring the FIFO sizes to be provided, breaking devices that were working just fine.Provide the FIFO sizes through the driver's platform data, to not only fix the breakage, but also enable MTU changes. The FIFO sizes are confirmed to be the same across RK3288, RK3328, RK3399 and PX30, based on their respective manuals. It is likely that Rockchip synthesized their DWMAC 1000 with the same parameters on all their chips that have it.
Quoted 4 lines
Fixes eaf4fac47807 ("net: stmmac: Do not accept invalid MTU values")Fixes 8865d22656b4 ("net: stmmac: Specify hardware capability value when FIFO size isn't specified")Cc <[email protected]>Signed-off-by Chen-Yu Tsai <[email protected]>
I think it's better at this stage to apply the revert first. However I've run this on my board (Firefly RK3288) and it works, so when rebased onto the (reverted) revert:
Thanks,
Steve
Quoted 31 lines
---
The reason for stable inclusion is not to fix the device breakage (which only broke in v6.14-rc1), but to provide the values so that MTU changes can work in older kernels.Since a fix for stmmac in general has already been sent [1] and a revert was also proposed [2], I'll refrain from sending mine.
[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +4
-1@@ -1966,8 +1966,11 @@ static int rk_gmac_probe(struct platform_device *pdev)/* If the stmmac is not already selected as gmac4, * then make sure we fallback to gmac. */ -if (!plat_dat->has_gmac4) +if (!plat_dat->has_gmac4) { plat_dat->has_gmac = true; + plat_dat->rx_fifo_size =4096 ; + plat_dat->tx_fifo_size =2048 ; + } plat_dat->fix_mac_speed = rk_fix_speed; plat_dat->bsp_priv =rk_gmac_setup (pdev, plat_dat, data);