[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zl15fh7y2oZmFfd7@shell.armlinux.org.uk>
Date: Mon, 3 Jun 2024 09:06:22 +0100
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: SkyLake Huang (黃啟澤) <SkyLake.Huang@...iatek.com>
Cc: "andrew@...n.ch" <andrew@...n.ch>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"dqfext@...il.com" <dqfext@...il.com>,
"matthias.bgg@...il.com" <matthias.bgg@...il.com>,
Steven Liu (劉人豪) <steven.liu@...iatek.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"hkallweit1@...il.com" <hkallweit1@...il.com>,
"angelogioacchino.delregno@...labora.com" <angelogioacchino.delregno@...labora.com>,
"daniel@...rotopia.org" <daniel@...rotopia.org>
Subject: Re: [PATCH net-next v5 4/5] net: phy: mediatek: Extend 1G TX/RX link
pulse time
On Mon, Jun 03, 2024 at 03:15:36AM +0000, SkyLake Huang (黃啟澤) wrote:
> On Thu, 2024-05-30 at 17:10 +0100, Russell King (Oracle) wrote:
> >
> > External email : Please do not click links or open attachments until
> > you have verified the sender or the content.
> > On Thu, May 30, 2024 at 04:01:08PM +0000, SkyLake Huang (黃啟澤) wrote:
> > > I'm not going to handle timeout case here. If we can't detect
> > > MTK_PHY_FINAL_SPEED_1000 in 1 second, let it go and we'll detect it
> > > next round.
> >
> > With this waiting up to one second for MTK_PHY_FINAL_SPEED_1000 to be
> > set...
> >
> > > > > +int mtk_gphy_cl22_read_status(struct phy_device *phydev)
> > > > > +{
> > > > > +int ret;
> > > > > +
> > > > > +ret = genphy_read_status(phydev);
> > > > > +if (ret)
> > > > > +return ret;
> > > > > +
> > > > > +if (phydev->autoneg == AUTONEG_ENABLE && !phydev-
> > > > >autoneg_complete) {
> >
> > Are you sure you want this condition like this? When the link is
> > down,
> > and 1G speeds are being advertised, it means that you'll call
> > extend_an_new_lp_cnt_limit(). If MTK_PHY_FINAL_SPEED_1000 doesn't get
> > set, that'll take one second each and every time we poll the PHY for
> > its status - which will be done while holding phydev->lock.
> >
> > This doesn't sound very good.
> >
> > --
> > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> > FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
>
> I add another condition to make sure we enter
> extend_an_new_lp_cnt_limit() only in first few seconds when we plug in
> cable.
>
> It will look like this:
> ===============================================================
> #define MTK_PHY_AUX_CTRL_AND_STATUS 0x14
> #define MTK_PHY_LP_DETECTED_MASK GENMASK(7, 6)
>
> if (phydev->autoneg == AUTONEG_ENABLE && !phydev->autoneg_complete) {
> phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_1);
> ret = __phy_read(phydev, MTK_PHY_AUX_CTRL_AND_STATUS);
> phy_restore_page(phydev, MTK_PHY_PAGE_STANDARD, 0);
We provide a helper for this:
ret = phy_read_paged(phydev, MTK_PHY_PAGE_EXTENDED_1,
MTK_PHY_AUX_CTRL_AND_STATUS);
but please check "ret" for errors.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists