[PATCH 3/3] net: ksz9477: Add mdio bus slice dependency to i2c/spi device

Sascha Hauer s.hauer at pengutronix.de
Fri Sep 8 06:04:01 PDT 2023

On mdio busses the attached phys check for link status in a poller.
Add a slice dependency from the mdio bus to the I2C/SPI controller
so that we do not end up doing bus accesses while we are in a
I2C/SPI access on the same bus already.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
 drivers/net/ksz9477.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ksz9477.c b/drivers/net/ksz9477.c
index 9665e0f723..1abea9d040 100644
--- a/drivers/net/ksz9477.c
+++ b/drivers/net/ksz9477.c
@@ -464,6 +464,13 @@ static int microchip_switch_probe(struct device *dev)
 	if (ret)
 		return ret;
+	if (priv->i2c)
+		slice_depends_on(mdiobus_slice(ds->slave_mii_bus),
+				 i2c_client_slice(priv->i2c));
+	else
+		slice_depends_on(mdiobus_slice(ds->slave_mii_bus),
+				 spi_device_slice(priv->spi));
 	return regmap_multi_register_cdev(priv->regmap[0], priv->regmap[1],
 					  priv->regmap[2], NULL);

More information about the barebox mailing list