RE: [PATCH net-next 5/5] net: phy: microchip_t1 : Add initialization of ptp for lan887x

From: Divya.Koppera
Date: Tue Nov 05 2024 - 01:18:38 EST


Hi Andrew,

Thanks for the comments.

> -----Original Message-----
> From: Andrew Lunn <andrew@xxxxxxx>
> Sent: Monday, November 4, 2024 7:34 PM
> To: Divya Koppera - I30481 <Divya.Koppera@xxxxxxxxxxxxx>
> Cc: Arun Ramadoss - I17769 <Arun.Ramadoss@xxxxxxxxxxxxx>;
> UNGLinuxDriver <UNGLinuxDriver@xxxxxxxxxxxxx>; hkallweit1@xxxxxxxxx;
> linux@xxxxxxxxxxxxxxx; davem@xxxxxxxxxxxxx; edumazet@xxxxxxxxxx;
> kuba@xxxxxxxxxx; pabeni@xxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; richardcochran@xxxxxxxxx
> Subject: Re: [PATCH net-next 5/5] net: phy: microchip_t1 : Add initialization of
> ptp for lan887x
>
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
>
> > static int lan937x_dsp_workaround(struct phy_device *phydev, u16
> > ereg, u8 bank) @@ -1472,6 +1478,12 @@ static int lan887x_probe(struct
> > phy_device *phydev)
> >
> > phydev->priv = priv;
> >
> > + priv->clock = mchp_ptp_probe(phydev, MDIO_MMD_VEND1,
> > + MCHP_PTP_LTC_BASE_ADDR,
> > + MCHP_PTP_PORT_BASE_ADDR);
>
> In general, PHY interrupts are optional, since phylib will poll the PHY once per
> second for changes in link etc. Does mchp_ptp_probe() do the right thing if
> the PHY does not have an interrupt?
>

Interrupts must be enabled by integrating platform(MAC/Switch).
Currently mchp_ptp_probe() is not checking for interrupts flag and also irq might not be initialized by the time probe is called.

To handle this, mchp_ptp_probe need to be called once from config_init instead of probe where a valid irq is available.
Based on IRQ number, we can skip ptp enabling from config_init and set default_timestamp=false.

Let me know if this approach is acceptable in interrupts disabled case.

> Andrew

Thanks,
Divya