* [net-next,PATCH 0/2] Fixes for stm32-dwmac driver fails to probe
@ 2024-06-27 8:49 Christophe Roullier
2024-06-27 8:49 ` [net-next,PATCH 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; 6+ messages in thread
From: Christophe Roullier @ 2024-06-27 8:49 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.
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: f261aa15b2ca73d4f9dbb8b116b16743237edad9
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [net-next,PATCH 1/2] net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used before checking clk rate
2024-06-27 8:49 [net-next,PATCH 0/2] Fixes for stm32-dwmac driver fails to probe Christophe Roullier
@ 2024-06-27 8:49 ` Christophe Roullier
2024-06-27 15:06 ` Marek Vasut
2024-06-27 8:49 ` [net-next,PATCH 2/2] net: stmmac: dwmac-stm32: update err status in case different of stm32mp13 Christophe Roullier
2024-06-27 11:58 ` [net-next,PATCH 0/2] Fixes for stm32-dwmac driver fails to probe Mark Brown
2 siblings, 1 reply; 6+ messages in thread
From: Christophe Roullier @ 2024-06-27 8:49 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 but we must add
test before to check if ETHCK is used.
Fixes: 582ac134963e ("net: stmmac: dwmac-stm32: Separate out external clock rate validation")
Signed-off-by: Christophe Roullier <christophe.roullier@foss.st.com>
---
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 b2db0e26c4e4..8b85265ca6cf 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
@@ -195,6 +195,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] 6+ messages in thread
* [net-next,PATCH 2/2] net: stmmac: dwmac-stm32: update err status in case different of stm32mp13
2024-06-27 8:49 [net-next,PATCH 0/2] Fixes for stm32-dwmac driver fails to probe Christophe Roullier
2024-06-27 8:49 ` [net-next,PATCH 1/2] net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used before checking clk rate Christophe Roullier
@ 2024-06-27 8:49 ` Christophe Roullier
2024-06-27 15:08 ` Marek Vasut
2024-06-27 11:58 ` [net-next,PATCH 0/2] Fixes for stm32-dwmac driver fails to probe Mark Brown
2 siblings, 1 reply; 6+ messages in thread
From: Christophe Roullier @ 2024-06-27 8:49 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
Second parameter of syscfg property (mask) is mandatory for MP13 but
optional for all other cases so need to re init err to 0 for this case
to avoid parse issue.
Fixes: 50bbc0393114 ("net: stmmac: dwmac-stm32: add management of stm32mp13 for stm32")
Signed-off-by: Christophe Roullier <christophe.roullier@foss.st.com>
---
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 8b85265ca6cf..d060d1d8bfc6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
@@ -371,10 +371,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] 6+ messages in thread
* Re: [net-next,PATCH 0/2] Fixes for stm32-dwmac driver fails to probe
2024-06-27 8:49 [net-next,PATCH 0/2] Fixes for stm32-dwmac driver fails to probe Christophe Roullier
2024-06-27 8:49 ` [net-next,PATCH 1/2] net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used before checking clk rate Christophe Roullier
2024-06-27 8:49 ` [net-next,PATCH 2/2] net: stmmac: dwmac-stm32: update err status in case different of stm32mp13 Christophe Roullier
@ 2024-06-27 11:58 ` Mark Brown
2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2024-06-27 11:58 UTC (permalink / raw)
To: Christophe Roullier
Cc: 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,
Marek Vasut, netdev, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 385 bytes --]
On Thu, Jun 27, 2024 at 10:49:15AM +0200, Christophe Roullier 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:
These patches resolve the boot issue I'm seeing on this platform:
Tested-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [net-next,PATCH 1/2] net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used before checking clk rate
2024-06-27 8:49 ` [net-next,PATCH 1/2] net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used before checking clk rate Christophe Roullier
@ 2024-06-27 15:06 ` Marek Vasut
0 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2024-06-27 15:06 UTC (permalink / raw)
To: Christophe Roullier, 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
Cc: netdev, devicetree, linux-stm32, linux-arm-kernel, linux-kernel
On 6/27/24 10:49 AM, 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
I think it would be better to add fullstop (.) here , and then continue:
If ETHCK is unused, the ETHCK frequency is 0 Hz and validation fails. It
makes no sense to validate unused ETHCK, so skip the validation.
> but we must add
> test before to check if ETHCK is used.
With the commit message updated a bit
Reviewed-by: Marek Vasut <marex@denx.de>
Thanks !
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [net-next,PATCH 2/2] net: stmmac: dwmac-stm32: update err status in case different of stm32mp13
2024-06-27 8:49 ` [net-next,PATCH 2/2] net: stmmac: dwmac-stm32: update err status in case different of stm32mp13 Christophe Roullier
@ 2024-06-27 15:08 ` Marek Vasut
0 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2024-06-27 15:08 UTC (permalink / raw)
To: Christophe Roullier, 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
Cc: netdev, devicetree, linux-stm32, linux-arm-kernel, linux-kernel
On 6/27/24 10:49 AM, Christophe Roullier wrote:
> Second parameter of syscfg property (mask) is mandatory for MP13 but
> optional for all other cases so need to re init err to 0 for this case
> to avoid parse issue.
What parse issue ? Please expand this part of the commit message.
Basically if this is not MP13, and the dev_dbg() is hit, 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.
With the commit message updated:
Reviewed-by: Marek Vasut <marex@denx.de>
[...]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-06-27 16:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-27 8:49 [net-next,PATCH 0/2] Fixes for stm32-dwmac driver fails to probe Christophe Roullier
2024-06-27 8:49 ` [net-next,PATCH 1/2] net: stmmac: dwmac-stm32: Add test to verify if ETHCK is used before checking clk rate Christophe Roullier
2024-06-27 15:06 ` Marek Vasut
2024-06-27 8:49 ` [net-next,PATCH 2/2] net: stmmac: dwmac-stm32: update err status in case different of stm32mp13 Christophe Roullier
2024-06-27 15:08 ` Marek Vasut
2024-06-27 11:58 ` [net-next,PATCH 0/2] Fixes for stm32-dwmac driver fails to probe Mark Brown
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).