Am 08.09.2023 um 15:11 schrieb Sascha Hauer:
> 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 <[email protected]>

Tested-by: Gerald Loacker <[email protected]>

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

Reply via email to