Subject: Re: [PATCH net-next 1/5] net: txgbe: Identify PHY and SFP module

From: Andrew Lunn <[email-masked]>
Date: Mon, 14 Nov 2022 14:25:47 +0100

> When ethernet driver does a reset to the hardware, like
> 'txgbe_reset_hw', the I2C configuration will be reset.  It needs to
> be reconfigured once. So how could I call the I2C function here? Can
> I treat the I2C driver as a lib?

The I2C driver will be embedded within your MAC driver. So you have
control over it.

How often do you need to call txgbe_reset_hw()?  Hopefully just once
early in the probe? So you can register the I2C bus master with the
I2C core after the reset.

If you need to use txgbe_reset_hw() at other times, you will need a
mutex or similar in .master_xfer function so you don't perform a reset
while an I2C transfer is happening, or start another transfer while a
reset is happening.

	Andrew