* [net-next,PATCH v2 0/2] Fixes for stm32-dwmac driver fails to probe
@ 2024-07-01 6:48 Christophe Roullier
2024-07-01 6:48 ` [net-next,PATCH v2 1/2] net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used before checking clk rate Christophe Roullier
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Christophe Roullier @ 2024-07-01 6:48 UTC (permalink / raw)
To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Richard Cochran, Jose Abreu, Liam Girdwood,
Mark Brown, Christophe Roullier, Marek Vasut
Cc: netdev, devicetree, linux-stm32, linux-arm-kernel, linux-kernel
Mark Brown found issue during stm32-dwmac probe:
For the past few days networking has been broken on the Avenger 96, a
stm32mp157a based platform. The stm32-dwmac driver fails to probe:
<6>[ 1.894271] stm32-dwmac 5800a000.ethernet: IRQ eth_wake_irq not found
<6>[ 1.899694] stm32-dwmac 5800a000.ethernet: IRQ eth_lpi not found
<6>[ 1.905849] stm32-dwmac 5800a000.ethernet: IRQ sfty not found
<3>[ 1.912304] stm32-dwmac 5800a000.ethernet: Unable to parse OF data
<3>[ 1.918393] stm32-dwmac 5800a000.ethernet: probe with driver stm32-dwmac failed with error -75
which looks a bit odd given the commit contents but I didn't look at the
driver code at all.
Full boot log here:
https://lava.sirena.org.uk/scheduler/job/467150
A working equivalent is here:
https://lava.sirena.org.uk/scheduler/job/466518
I delivered 2 fixes to solve issue.
V2: - remark from Marek (commit msgs)
Christophe Roullier (2):
net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used before
checking clk rate
net: stmmac: dwmac-stm32: update err status in case different of
stm32mp13
drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
base-commit: 30972a4ea092bacb9784fe251327571be6a99f9c
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [net-next,PATCH v2 1/2] net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used before checking clk rate
2024-07-01 6:48 [net-next,PATCH v2 0/2] Fixes for stm32-dwmac driver fails to probe Christophe Roullier
@ 2024-07-01 6:48 ` Christophe Roullier
2024-07-02 13:45 ` Paolo Abeni
2024-07-01 6:48 ` [net-next,PATCH v2 2/2] net: stmmac: dwmac-stm32: update err status in case different of stm32mp13 Christophe Roullier
2024-07-02 13:50 ` [net-next,PATCH v2 0/2] Fixes for stm32-dwmac driver fails to probe patchwork-bot+netdevbpf
2 siblings, 1 reply; 5+ messages in thread
From: Christophe Roullier @ 2024-07-01 6:48 UTC (permalink / raw)
To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Richard Cochran, Jose Abreu, Liam Girdwood,
Mark Brown, Christophe Roullier, Marek Vasut
Cc: netdev, devicetree, linux-stm32, linux-arm-kernel, linux-kernel
When we want to use clock from RCC to clock Ethernet PHY (with ETHCK)
we need to check if value of clock rate is authorized.
If ETHCK is unused, the ETHCK frequency is 0Hz and validation fails.
It makes no sense to validate unused ETHCK, so skip the validation.
Fixes: 582ac134963e ("net: stmmac: dwmac-stm32: Separate out external clock rate validation")
Signed-off-by: Christophe Roullier <christophe.roullier@foss.st.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Mark Brown <broonie@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
index 23cf0a5b047f..d6a268237ca1 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
@@ -206,6 +206,9 @@ static int stm32mp1_validate_ethck_rate(struct plat_stmmacenet_data *plat_dat)
struct stm32_dwmac *dwmac = plat_dat->bsp_priv;
const u32 clk_rate = clk_get_rate(dwmac->clk_eth_ck);
+ if (!dwmac->enable_eth_ck)
+ return 0;
+
switch (plat_dat->mac_interface) {
case PHY_INTERFACE_MODE_MII:
case PHY_INTERFACE_MODE_GMII:
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [net-next,PATCH v2 2/2] net: stmmac: dwmac-stm32: update err status in case different of stm32mp13
2024-07-01 6:48 [net-next,PATCH v2 0/2] Fixes for stm32-dwmac driver fails to probe Christophe Roullier
2024-07-01 6:48 ` [net-next,PATCH v2 1/2] net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used before checking clk rate Christophe Roullier
@ 2024-07-01 6:48 ` Christophe Roullier
2024-07-02 13:50 ` [net-next,PATCH v2 0/2] Fixes for stm32-dwmac driver fails to probe patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: Christophe Roullier @ 2024-07-01 6:48 UTC (permalink / raw)
To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Richard Cochran, Jose Abreu, Liam Girdwood,
Mark Brown, Christophe Roullier, Marek Vasut
Cc: netdev, devicetree, linux-stm32, linux-arm-kernel, linux-kernel
The mask parameter of syscfg property is mandatory for MP13 but
optional for all other cases.
The function should not return error code because for non-MP13
the missing syscfg phandle in DT is not considered an error.
So reset err to 0 in that case to support existing DTs without
syscfg phandle.
Fixes: 50bbc0393114 ("net: stmmac: dwmac-stm32: add management of stm32mp13 for stm32")
Signed-off-by: Christophe Roullier <christophe.roullier@foss.st.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Mark Brown <broonie@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
index d6a268237ca1..c1732955a697 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
@@ -435,10 +435,12 @@ static int stm32_dwmac_parse_data(struct stm32_dwmac *dwmac,
dwmac->mode_mask = SYSCFG_MP1_ETH_MASK;
err = of_property_read_u32_index(np, "st,syscon", 2, &dwmac->mode_mask);
if (err) {
- if (dwmac->ops->is_mp13)
+ if (dwmac->ops->is_mp13) {
dev_err(dev, "Sysconfig register mask must be set (%d)\n", err);
- else
+ } else {
dev_dbg(dev, "Warning sysconfig register mask not set\n");
+ err = 0;
+ }
}
return err;
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [net-next,PATCH v2 1/2] net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used before checking clk rate
2024-07-01 6:48 ` [net-next,PATCH v2 1/2] net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used before checking clk rate Christophe Roullier
@ 2024-07-02 13:45 ` Paolo Abeni
0 siblings, 0 replies; 5+ messages in thread
From: Paolo Abeni @ 2024-07-02 13:45 UTC (permalink / raw)
To: Christophe Roullier, David S . Miller, Eric Dumazet,
Jakub Kicinski, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Maxime Coquelin, Alexandre Torgue, Richard Cochran, Jose Abreu,
Liam Girdwood, Mark Brown, Marek Vasut
Cc: netdev, devicetree, linux-stm32, linux-arm-kernel, linux-kernel
On Mon, 2024-07-01 at 08:48 +0200, Christophe Roullier wrote:
> When we want to use clock from RCC to clock Ethernet PHY (with ETHCK)
> we need to check if value of clock rate is authorized.
> If ETHCK is unused, the ETHCK frequency is 0Hz and validation fails.
> It makes no sense to validate unused ETHCK, so skip the validation.
>
> Fixes: 582ac134963e ("net: stmmac: dwmac-stm32: Separate out external clock rate validation")
>
> Signed-off-by: Christophe Roullier <christophe.roullier@foss.st.com>
Note that you must avoid any empty line in the tag area between the
fixes and the SoB tag.
I'll exceptionally fix the above while applying the patch, but please
run checkpatch before your next submission.
Thanks!
Paolo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [net-next,PATCH v2 0/2] Fixes for stm32-dwmac driver fails to probe
2024-07-01 6:48 [net-next,PATCH v2 0/2] Fixes for stm32-dwmac driver fails to probe Christophe Roullier
2024-07-01 6:48 ` [net-next,PATCH v2 1/2] net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used before checking clk rate Christophe Roullier
2024-07-01 6:48 ` [net-next,PATCH v2 2/2] net: stmmac: dwmac-stm32: update err status in case different of stm32mp13 Christophe Roullier
@ 2024-07-02 13:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-07-02 13:50 UTC (permalink / raw)
To: Christophe Roullier
Cc: davem, edumazet, kuba, pabeni, robh+dt, krzysztof.kozlowski+dt,
conor+dt, mcoquelin.stm32, alexandre.torgue, richardcochran,
joabreu, lgirdwood, broonie, marex, netdev, devicetree,
linux-stm32, linux-arm-kernel, linux-kernel
Hello:
This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Mon, 1 Jul 2024 08:48:36 +0200 you wrote:
> Mark Brown found issue during stm32-dwmac probe:
>
> For the past few days networking has been broken on the Avenger 96, a
> stm32mp157a based platform. The stm32-dwmac driver fails to probe:
>
> <6>[ 1.894271] stm32-dwmac 5800a000.ethernet: IRQ eth_wake_irq not found
> <6>[ 1.899694] stm32-dwmac 5800a000.ethernet: IRQ eth_lpi not found
> <6>[ 1.905849] stm32-dwmac 5800a000.ethernet: IRQ sfty not found
> <3>[ 1.912304] stm32-dwmac 5800a000.ethernet: Unable to parse OF data
> <3>[ 1.918393] stm32-dwmac 5800a000.ethernet: probe with driver stm32-dwmac failed with error -75
>
> [...]
Here is the summary with links:
- [net-next,v2,1/2] net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used before checking clk rate
https://git.kernel.org/netdev/net-next/c/3cd1d4651ceb
- [net-next,v2,2/2] net: stmmac: dwmac-stm32: update err status in case different of stm32mp13
https://git.kernel.org/netdev/net-next/c/f8dbe58e2f1a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-07-02 13:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-01 6:48 [net-next,PATCH v2 0/2] Fixes for stm32-dwmac driver fails to probe Christophe Roullier
2024-07-01 6:48 ` [net-next,PATCH v2 1/2] net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used before checking clk rate Christophe Roullier
2024-07-02 13:45 ` Paolo Abeni
2024-07-01 6:48 ` [net-next,PATCH v2 2/2] net: stmmac: dwmac-stm32: update err status in case different of stm32mp13 Christophe Roullier
2024-07-02 13:50 ` [net-next,PATCH v2 0/2] Fixes for stm32-dwmac driver fails to probe patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).