Re: [PATCH] net: phy: realtek: clear interrupt during init for rtl8211f

From: Heiner Kallweit
Date: Tue May 12 2020 - 14:43:50 EST


On 12.05.2020 12:46, Jisheng Zhang wrote:
> The PHY Register Accessible Interrupt is enabled by default, so
> there's such an interrupt during init. In PHY POLL mode case, the
> INTB/PMEB pin is alway active, it is not good. Clear the interrupt by
> calling rtl8211f_ack_interrupt().

As you say "it's not good" w/o elaborating a little bit more on it:
Do you face any actual issue? Or do you just think that it's not nice?
I'm asking because you don't provide a Fixes tag and you don't
annotate your patch as net or net-next.
Once you provide more details we would also get an idea whether a
change would have to be made to phylib, because what you describe
doesn't seem to be specific to this one PHY model.

>
> Signed-off-by: Jisheng Zhang <Jisheng.Zhang@xxxxxxxxxxxxx>
> ---
> drivers/net/phy/realtek.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
> index 2d99e9de6ee1..398607268a3c 100644
> --- a/drivers/net/phy/realtek.c
> +++ b/drivers/net/phy/realtek.c
> @@ -179,6 +179,10 @@ static int rtl8211f_config_init(struct phy_device *phydev)
> u16 val_txdly, val_rxdly;
> int ret;
>
> + ret = rtl8211f_ack_interrupt(phydev);
> + if (ret < 0)
> + return ret;
> +
> switch (phydev->interface) {
> case PHY_INTERFACE_MODE_RGMII:
> val_txdly = 0;
>