[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250829165310.2b97569b@kmaincent-XPS-13-7390>
Date: Fri, 29 Aug 2025 16:53:10 +0200
From: Kory Maincent <kory.maincent@...tlin.com>
To: Horatiu Vultur <horatiu.vultur@...rochip.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
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.
...
> @@ -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
Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Powered by blists - more mailing lists