mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <>
To: Barebox List <>
Cc: Gerald Loacker <>
Subject: [PATCH v2 3/3] net: ksz9477: Add mdio bus slice dependency to i2c/spi device
Date: Fri,  8 Sep 2023 15:11:17 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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 <>
 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);

  parent reply	other threads:[~2023-09-08 13:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-08 13:11 [PATCH v2 1/3] i2c: Add slices for I2C adapters Sascha Hauer
2023-09-08 13:11 ` [PATCH v2 2/3] spi: Add slices for SPI controllers Sascha Hauer
2023-09-11 11:49   ` Gerald Loacker
2023-09-08 13:11 ` Sascha Hauer [this message]
2023-09-11 11:49   ` [PATCH v2 3/3] net: ksz9477: Add mdio bus slice dependency to i2c/spi device Gerald Loacker
2023-09-11 11:48 ` [PATCH v2 1/3] i2c: Add slices for I2C adapters Gerald Loacker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox