[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250901062140.df6pqpvs7dyv564l@DEN-DL-M31836.microchip.com>
Date: Mon, 1 Sep 2025 08:21:40 +0200
From: Horatiu Vultur <horatiu.vultur@...rochip.com>
To: Kory Maincent <kory.maincent@...tlin.com>
CC: <andrew@...n.ch>, <hkallweit1@...il.com>, <linux@...linux.org.uk>,
<davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<pabeni@...hat.com>, <richardcochran@...il.com>,
<Parthiban.Veerasooran@...rochip.com>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next v5 2/2] net: phy: micrel: Add PTP support for
lan8842
The 08/29/2025 16:53, Kory Maincent wrote:
>
> On Fri, 29 Aug 2025 15:48:36 +0200
> Horatiu Vultur <horatiu.vultur@...rochip.com> wrote:
>
> > It has the same PTP IP block as lan8814, only the number of GPIOs is
> > different, all the other functionality is the same. So reuse the same
> > functions as lan8814 for lan8842.
> > There is a revision of lan8842 called lan8832 which doesn't have the PTP
> > IP block. So make sure in that case the PTP is not initialized.
>
> ...
>
> > @@ -5817,6 +5831,43 @@ static int lan8842_probe(struct phy_device *phydev)
> > if (ret < 0)
> > return ret;
> >
> > + /* Revision lan8832 doesn't have support for PTP, therefore don't add
> > + * any PTP clocks
> > + */
> > + ret = lanphy_read_page_reg(phydev, LAN8814_PAGE_COMMON_REGS,
> > + LAN8842_SKU_REG);
> > + if (ret < 0)
> > + return ret;
> > +
> > + priv->rev = ret;
> > + if (priv->rev == 0x8832)
> > + return 0;
>
> Is the lan8832 PHY ID the same as the lan8842? This would be surprising.
> If they have different PHY ID, it will never enter the lan8842 probe function as
> it is not added to mdio_device_id.
> Also you should add a define instead of using several time 0x8832.
They will have the same PHY ID. And it is the LAN8842_SKU_REG which
determines which revision of the PHY it is.
I will add a define for 0x8832.
>
> ...
>
> > @@ -5912,6 +5989,26 @@ static irqreturn_t lan8842_handle_interrupt(struct
> > phy_device *phydev) ret = IRQ_HANDLED;
> > }
> >
> > + /* Phy revision lan8832 doesn't have support for PTP threrefore
>
> nitpick: therefore
Good catch. I will fix this in the next version.
>
> Regards,
> --
> Köry Maincent, Bootlin
> Embedded Linux and kernel engineering
> https://bootlin.com
--
/Horatiu
Powered by blists - more mailing lists