From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: <andrew@lunn.ch>, <hkallweit1@gmail.com>, <linux@armlinux.org.uk>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next] net: phy: micrel: Add support for lan8842
Date: Wed, 23 Jul 2025 11:01:45 +0200 [thread overview]
Message-ID: <20250723090145.o2kq4vxcjrih54rt@DEN-DL-M31836.microchip.com> (raw)
In-Reply-To: <aIB0VYLqcBKVtAmU@pengutronix.de>
The 07/23/2025 07:34, Oleksij Rempel wrote:
>
> Hi Horatiu,
Hi Olekij,
>
> On Mon, Jul 21, 2025 at 09:14:05AM +0200, Horatiu Vultur wrote:
>
> > +static int lan8842_config_init(struct phy_device *phydev)
> > +{
> > + int val;
> > + int ret;
> > +
> > + /* Reset the PHY */
> > + val = lanphy_read_page_reg(phydev, 4, LAN8814_QSGMII_SOFT_RESET);
>
> It would be good to use defines for MMD pages.
Those are extended pages and not MMD pages. Currently in the entire
source code I can see we used hardcoded values, also in the register
description it looks like all these extended pages do not have really
meaningfull names: Extended Page 0, Extended Page 4, Extended Page 5...
>
> > + if (val < 0)
> > + return val;
> > + val |= LAN8814_QSGMII_SOFT_RESET_BIT;
> > + lanphy_write_page_reg(phydev, 4, LAN8814_QSGMII_SOFT_RESET, val);
>
> Please, do not ignore return values.
Good catch, I will fix that in the next version.
There are few others bellow, I will fix those also.
>
> > +
> > + /* Disable ANEG with QSGMII PCS Host side
> > + * It has the same address as lan8814
> > + */
> > + val = lanphy_read_page_reg(phydev, 5, LAN8814_QSGMII_PCS1G_ANEG_CONFIG);
> > + if (val < 0)
> > + return val;
> > + val &= ~LAN8814_QSGMII_PCS1G_ANEG_CONFIG_ANEG_ENA;
> > + ret = lanphy_write_page_reg(phydev, 5, LAN8814_QSGMII_PCS1G_ANEG_CONFIG,
> > + val);
> > + if (ret < 0)
> > + return ret;
> > +
> > + /* Disable also the SGMII_AUTO_ANEG_ENA, this will determine what is the
> > + * PHY autoneg with the other end and then will update the host side
> > + */
> > + lanphy_write_page_reg(phydev, 4, LAN8842_SGMII_AUTO_ANEG_ENA, 0);
> > +
> > + /* To allow the PHY to control the LEDs the GPIOs of the PHY should have
> > + * a function mode and not the GPIO. Apparently by default the value is
> > + * GPIO and not function even though the datasheet it says that it is
> > + * function. Therefore set this value.
> > + */
> > + lanphy_write_page_reg(phydev, 4, LAN8814_GPIO_EN2, 0);
> > +
> > + /* Enable the Fast link failure, at the top level, at the bottom level
> > + * it would be set/cleared inside lan8842_config_intr
> > + */
> > + val = lanphy_read_page_reg(phydev, 0, LAN8842_FLF);
> > + if (val < 0)
> > + return val;
> > + val |= LAN8842_FLF_ENA | LAN8842_FLF_ENA_LINK_DOWN;
>
> If I see it correctly, FLF support will make link fail after ~1ms, while
> IEEE 802.3 recommends 750ms. Since a link recovery of a PHY with autoneg
> support usually takes multiple seconds, I see the benefit for FLF
> support only mostly for SyncE environment at same time it seems to be
> a disadvantage for other environments.
Why would be a disadvantage?
>
> I would prefer to have IEEE 802.3 recommended link behavior by default
> and have separate Netlink configuration interface for FLF.
>
> Best Regards,
> Oleksij
> --
> Pengutronix e.K. | |
> Steuerwalder Str. 21 | http://www.pengutronix.de/ |
> 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
--
/Horatiu
next prev parent reply other threads:[~2025-07-23 9:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 7:14 Horatiu Vultur
2025-07-21 14:22 ` Andrew Lunn
2025-07-22 6:09 ` Horatiu Vultur
2025-07-22 13:08 ` Andrew Lunn
2025-07-23 5:34 ` Oleksij Rempel
2025-07-23 9:01 ` Horatiu Vultur [this message]
2025-07-23 10:48 ` Oleksij Rempel
2025-07-23 14:28 ` Andrew Lunn
2025-07-24 6:25 ` Horatiu Vultur
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250723090145.o2kq4vxcjrih54rt@DEN-DL-M31836.microchip.com \
--to=horatiu.vultur@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®