linux/drivers/net/mdio
Florian Fainelli 714b846538 net: mdio: mdio-bcm-unimac: Correct rate fallback logic
[ Upstream commit a81649a4ef ]

When the parent clock is a gated clock which has multiple parents, the
clock provider (clk-scmi typically) might return a rate of 0 since there
is not one of those particular parent clocks that should be chosen for
returning a rate. Prior to ee975351cf ("net: mdio: mdio-bcm-unimac:
Manage clock around I/O accesses"), we would not always be passing a
clock reference depending upon how mdio-bcm-unimac was instantiated. In
that case, we would take the fallback path where the rate is hard coded
to 250MHz.

Make sure that we still fallback to using a fixed rate for the divider
calculation, otherwise we simply ignore the desired MDIO bus clock
frequency which can prevent us from interfacing with Ethernet PHYs
properly.

Fixes: ee975351cf ("net: mdio: mdio-bcm-unimac: Manage clock around I/O accesses")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250730202533.3463529-1-florian.fainelli@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-08-15 12:14:06 +02:00
..
acpi_mdio.c net: mdio: fill in missing MODULE_DESCRIPTION()s 2023-11-01 21:50:57 -07:00
fwnode_mdio.c net: mdiobus: fix an OF node reference leak 2024-12-27 14:02:06 +01:00
Kconfig net: mdio: Introduce a regmap-based mdio driver 2023-06-05 09:56:36 +01:00
Makefile net: mdio: Introduce a regmap-based mdio driver 2023-06-05 09:56:36 +01:00
mdio-aspeed.c net: mdio: fill in missing MODULE_DESCRIPTION()s 2023-11-01 21:50:57 -07:00
mdio-bcm-iproc.c net: mdio: bcm-iproc: Convert to platform remove callback returning void 2023-09-20 10:29:33 +01:00
mdio-bcm-unimac.c net: mdio: mdio-bcm-unimac: Correct rate fallback logic 2025-08-15 12:14:06 +02:00
mdio-bitbang.c net: mdio: fill in missing MODULE_DESCRIPTION()s 2023-11-01 21:50:57 -07:00
mdio-cavium.c net: mdio: cavium: Remove unneeded simicolons 2023-01-17 13:19:05 +01:00
mdio-cavium.h net: mdio: cavium: Separate C22 and C45 transactions 2023-01-13 21:40:53 -08:00
mdio-gpio.c net: mdio-gpio: Use device_is_compatible() 2024-04-08 11:05:09 +01:00
mdio-hisi-femac.c net: mdio: hisi-femac: Convert to platform remove callback returning void 2023-09-20 10:29:33 +01:00
mdio-i2c.c net: mdio: i2c: fix rollball accessors 2023-05-15 10:15:57 +01:00
mdio-ipq4019.c net: mdio-ipq4019: add missing error check 2024-12-05 14:02:32 +01:00
mdio-ipq8064.c net: mdio: ipq8064: Convert to platform remove callback returning void 2023-09-20 10:29:34 +01:00
mdio-moxart.c net: mdio: moxart: Convert to platform remove callback returning void 2023-09-20 10:29:34 +01:00
mdio-mscc-miim.c net: mdio: mscc-miim: Handle the switch reset 2024-06-21 12:12:42 +01:00
mdio-mux-bcm-iproc.c net: mdio: mux-bcm-iproc: Use alignment helpers and SZ_4K 2024-01-03 16:40:59 -08:00
mdio-mux-bcm6368.c net: mdio: mux-bcm6368: Convert to platform remove callback returning void 2023-09-20 10:29:34 +01:00
mdio-mux-gpio.c net: mdio: mux-gpio: Convert to platform remove callback returning void 2023-09-20 10:29:34 +01:00
mdio-mux-meson-g12a.c net: mdio: mux-meson-g12a: Convert to platform remove callback returning void 2023-09-20 10:29:34 +01:00
mdio-mux-meson-gxl.c net: mdio: mux-meson-gxl: set reversed bit when using internal phy 2025-05-09 09:50:43 +02:00
mdio-mux-mmioreg.c net: mdio: mux-mmioreg: Simplified with dev_err_probe() 2024-09-03 12:54:43 +02:00
mdio-mux-multiplexer.c net: mdio: mux-multiplexer: Convert to platform remove callback returning void 2023-09-20 10:29:34 +01:00
mdio-mux.c net: mdio-mux: be compatible with parent buses which only support C45 2023-12-14 18:55:38 -08:00
mdio-mvusb.c net: mdio: mvusb: Fix an error handling path in mvusb_mdio_probe() 2023-05-07 14:59:02 +01:00
mdio-octeon.c net: mdio: octeon: Convert to platform remove callback returning void 2023-09-20 10:29:35 +01:00
mdio-regmap.c net: mdio: Introduce a regmap-based mdio driver 2023-06-05 09:56:36 +01:00
mdio-sun4i.c net: mdio: sun4i: Convert to platform remove callback returning void 2023-09-20 10:29:35 +01:00
mdio-thunder.c net: mdio: thunder: Add missing fwnode_handle_put() 2023-03-23 08:46:55 +00:00
mdio-xgene.c net: mdio: xgene: Fix unused xgene_mdio_of_match warning for !CONFIG_OF 2023-10-23 10:16:47 -07:00
of_mdio.c net: mdio: Use of_property_count_u32_elems() to get property length 2024-08-01 18:13:15 -07:00