From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Cc: Gerald Loacker <gerald.loacker@wolfvision.net>
Subject: [PATCH 3/3] net: ksz9477: Add mdio bus slice dependency to i2c/spi device
Date: Fri, 8 Sep 2023 15:04:01 +0200 [thread overview]
Message-ID: <20230908130401.1735831-3-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20230908130401.1735831-1-s.hauer@pengutronix.de>
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@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);
}
--
2.39.2
next prev parent reply other threads:[~2023-09-08 13:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-08 13:03 [PATCH 1/3] i2c: Add slices for I2C adapters Sascha Hauer
2023-09-08 13:04 ` [PATCH 2/3] spi: Add slices for SPI controllers Sascha Hauer
2023-09-08 13:04 ` Sascha Hauer [this message]
2023-09-12 12:21 ` [PATCH 3/3] net: ksz9477: Add mdio bus slice dependency to i2c/spi device Ahmad Fatoum
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230908130401.1735831-3-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=gerald.loacker@wolfvision.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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