mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	Barebox List <barebox@lists.infradead.org>
Cc: Gerald Loacker <gerald.loacker@wolfvision.net>
Subject: Re: [PATCH 3/3] net: ksz9477: Add mdio bus slice dependency to i2c/spi device
Date: Tue, 12 Sep 2023 14:21:03 +0200	[thread overview]
Message-ID: <bdc3df39-e8ca-3b97-0a17-396fa8cfa303@pengutronix.de> (raw)
In-Reply-To: <20230908130401.1735831-3-s.hauer@pengutronix.de>

On 08.09.23 15:04, Sascha Hauer wrote:
> 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));

Is there no way to do this in the core?

> +
>  	return regmap_multi_register_cdev(priv->regmap[0], priv->regmap[1],
>  					  priv->regmap[2], NULL);
>  }

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




      reply	other threads:[~2023-09-12 12:22 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 ` [PATCH 3/3] net: ksz9477: Add mdio bus slice dependency to i2c/spi device Sascha Hauer
2023-09-12 12:21   ` Ahmad Fatoum [this message]

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=bdc3df39-e8ca-3b97-0a17-396fa8cfa303@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=gerald.loacker@wolfvision.net \
    --cc=s.hauer@pengutronix.de \
    /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