[PATCH net-next 3/7] net: phy: lxt: Mark LXT973 PHYs as having a broken isolate mode

Maxime Chevallier posted 7 patches 2 months, 2 weeks ago
[PATCH net-next 3/7] net: phy: lxt: Mark LXT973 PHYs as having a broken isolate mode
Posted by Maxime Chevallier 2 months, 2 weeks ago
Testing showed that PHYs from the LXT973 family have a non-working
isolate mode, where the MII lines aren't set in high-impedance as would
be expected. Prevent isolating these PHYs.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
 drivers/net/phy/lxt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c
index e3bf827b7959..55cf67391533 100644
--- a/drivers/net/phy/lxt.c
+++ b/drivers/net/phy/lxt.c
@@ -334,6 +334,7 @@ static struct phy_driver lxt97x_driver[] = {
 	.read_status	= lxt973a2_read_status,
 	.suspend	= genphy_suspend,
 	.resume		= genphy_resume,
+	.flags		= PHY_NO_ISOLATE,
 }, {
 	.phy_id		= 0x00137a10,
 	.name		= "LXT973",
@@ -344,6 +345,7 @@ static struct phy_driver lxt97x_driver[] = {
 	.config_aneg	= lxt973_config_aneg,
 	.suspend	= genphy_suspend,
 	.resume		= genphy_resume,
+	.flags		= PHY_NO_ISOLATE,
 } };
 
 module_phy_driver(lxt97x_driver);
-- 
2.46.0
Re: [PATCH net-next 3/7] net: phy: lxt: Mark LXT973 PHYs as having a broken isolate mode
Posted by kernel test robot 2 months, 2 weeks ago
Hi Maxime,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Maxime-Chevallier/net-phy-allow-isolating-PHY-devices/20240912-053106
base:   net-next/main
patch link:    https://lore.kernel.org/r/20240911212713.2178943-4-maxime.chevallier%40bootlin.com
patch subject: [PATCH net-next 3/7] net: phy: lxt: Mark LXT973 PHYs as having a broken isolate mode
config: x86_64-randconfig-121-20240913 (https://download.01.org/0day-ci/archive/20240913/202409131315.SEzdGTvD-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240913/202409131315.SEzdGTvD-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409131315.SEzdGTvD-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/net/phy/lxt.c:331:10: sparse: sparse: Initializer entry defined twice
   drivers/net/phy/lxt.c:337:10: sparse:   also defined here
   drivers/net/phy/lxt.c:343:10: sparse: sparse: Initializer entry defined twice
   drivers/net/phy/lxt.c:348:10: sparse:   also defined here

vim +331 drivers/net/phy/lxt.c

e13647c158307f Richard Cochran      2010-06-07  307  
d5bf9071e71a4d Christian Hohnstaedt 2012-07-04  308  static struct phy_driver lxt97x_driver[] = {
d5bf9071e71a4d Christian Hohnstaedt 2012-07-04  309  {
600991b003039b Uwe Zeisberger       2006-06-25  310  	.phy_id		= 0x78100000,
00db8189d984d6 Andy Fleming         2005-07-30  311  	.name		= "LXT970",
600991b003039b Uwe Zeisberger       2006-06-25  312  	.phy_id_mask	= 0xfffffff0,
dcdecdcfe1fc39 Heiner Kallweit      2019-04-12  313  	/* PHY_BASIC_FEATURES */
00db8189d984d6 Andy Fleming         2005-07-30  314  	.config_init	= lxt970_config_init,
00db8189d984d6 Andy Fleming         2005-07-30  315  	.config_intr	= lxt970_config_intr,
01c4a00bf34797 Ioana Ciornei        2020-11-13  316  	.handle_interrupt = lxt970_handle_interrupt,
d5bf9071e71a4d Christian Hohnstaedt 2012-07-04  317  }, {
600991b003039b Uwe Zeisberger       2006-06-25  318  	.phy_id		= 0x001378e0,
00db8189d984d6 Andy Fleming         2005-07-30  319  	.name		= "LXT971",
600991b003039b Uwe Zeisberger       2006-06-25  320  	.phy_id_mask	= 0xfffffff0,
dcdecdcfe1fc39 Heiner Kallweit      2019-04-12  321  	/* PHY_BASIC_FEATURES */
00db8189d984d6 Andy Fleming         2005-07-30  322  	.config_intr	= lxt971_config_intr,
01c4a00bf34797 Ioana Ciornei        2020-11-13  323  	.handle_interrupt = lxt971_handle_interrupt,
5556fdb0c2ea3a Christophe Leroy     2019-05-23  324  	.suspend	= genphy_suspend,
5556fdb0c2ea3a Christophe Leroy     2019-05-23  325  	.resume		= genphy_resume,
871d1d6b59802a LEROY Christophe     2012-09-24  326  }, {
871d1d6b59802a LEROY Christophe     2012-09-24  327  	.phy_id		= 0x00137a10,
871d1d6b59802a LEROY Christophe     2012-09-24  328  	.name		= "LXT973-A2",
871d1d6b59802a LEROY Christophe     2012-09-24  329  	.phy_id_mask	= 0xffffffff,
dcdecdcfe1fc39 Heiner Kallweit      2019-04-12  330  	/* PHY_BASIC_FEATURES */
871d1d6b59802a LEROY Christophe     2012-09-24 @331  	.flags		= 0,
871d1d6b59802a LEROY Christophe     2012-09-24  332  	.probe		= lxt973_probe,
871d1d6b59802a LEROY Christophe     2012-09-24  333  	.config_aneg	= lxt973_config_aneg,
871d1d6b59802a LEROY Christophe     2012-09-24  334  	.read_status	= lxt973a2_read_status,
5556fdb0c2ea3a Christophe Leroy     2019-05-23  335  	.suspend	= genphy_suspend,
5556fdb0c2ea3a Christophe Leroy     2019-05-23  336  	.resume		= genphy_resume,
c9dd02714c2f91 Maxime Chevallier    2024-09-11  337  	.flags		= PHY_NO_ISOLATE,
d5bf9071e71a4d Christian Hohnstaedt 2012-07-04  338  }, {
e13647c158307f Richard Cochran      2010-06-07  339  	.phy_id		= 0x00137a10,
e13647c158307f Richard Cochran      2010-06-07  340  	.name		= "LXT973",
e13647c158307f Richard Cochran      2010-06-07  341  	.phy_id_mask	= 0xfffffff0,
dcdecdcfe1fc39 Heiner Kallweit      2019-04-12  342  	/* PHY_BASIC_FEATURES */
e13647c158307f Richard Cochran      2010-06-07  343  	.flags		= 0,
e13647c158307f Richard Cochran      2010-06-07  344  	.probe		= lxt973_probe,
e13647c158307f Richard Cochran      2010-06-07  345  	.config_aneg	= lxt973_config_aneg,
5556fdb0c2ea3a Christophe Leroy     2019-05-23  346  	.suspend	= genphy_suspend,
5556fdb0c2ea3a Christophe Leroy     2019-05-23  347  	.resume		= genphy_resume,
c9dd02714c2f91 Maxime Chevallier    2024-09-11  348  	.flags		= PHY_NO_ISOLATE,
d5bf9071e71a4d Christian Hohnstaedt 2012-07-04  349  } };
e13647c158307f Richard Cochran      2010-06-07  350  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH net-next 3/7] net: phy: lxt: Mark LXT973 PHYs as having a broken isolate mode
Posted by Simon Horman 2 months, 2 weeks ago
On Wed, Sep 11, 2024 at 11:27:07PM +0200, Maxime Chevallier wrote:
> Testing showed that PHYs from the LXT973 family have a non-working
> isolate mode, where the MII lines aren't set in high-impedance as would
> be expected. Prevent isolating these PHYs.
> 
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> ---
>  drivers/net/phy/lxt.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c
> index e3bf827b7959..55cf67391533 100644
> --- a/drivers/net/phy/lxt.c
> +++ b/drivers/net/phy/lxt.c
> @@ -334,6 +334,7 @@ static struct phy_driver lxt97x_driver[] = {
>  	.read_status	= lxt973a2_read_status,
>  	.suspend	= genphy_suspend,
>  	.resume		= genphy_resume,
> +	.flags		= PHY_NO_ISOLATE,
>  }, {
>  	.phy_id		= 0x00137a10,
>  	.name		= "LXT973",
> @@ -344,6 +345,7 @@ static struct phy_driver lxt97x_driver[] = {
>  	.config_aneg	= lxt973_config_aneg,
>  	.suspend	= genphy_suspend,
>  	.resume		= genphy_resume,
> +	.flags		= PHY_NO_ISOLATE,
>  } };

Hi Maxime,

This duplicates setting .flags for each array member
updated by this patch.

>  
>  module_phy_driver(lxt97x_driver);

-- 
pw-bot: cr
Re: [PATCH net-next 3/7] net: phy: lxt: Mark LXT973 PHYs as having a broken isolate mode
Posted by Maxime Chevallier 2 months, 2 weeks ago
Hello Simon,

On Thu, 12 Sep 2024 13:24:51 +0100
Simon Horman <horms@kernel.org> wrote:

> On Wed, Sep 11, 2024 at 11:27:07PM +0200, Maxime Chevallier wrote:
> > Testing showed that PHYs from the LXT973 family have a non-working
> > isolate mode, where the MII lines aren't set in high-impedance as would
> > be expected. Prevent isolating these PHYs.
> > 
> > Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> > ---
> >  drivers/net/phy/lxt.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c
> > index e3bf827b7959..55cf67391533 100644
> > --- a/drivers/net/phy/lxt.c
> > +++ b/drivers/net/phy/lxt.c
> > @@ -334,6 +334,7 @@ static struct phy_driver lxt97x_driver[] = {
> >  	.read_status	= lxt973a2_read_status,
> >  	.suspend	= genphy_suspend,
> >  	.resume		= genphy_resume,
> > +	.flags		= PHY_NO_ISOLATE,
> >  }, {
> >  	.phy_id		= 0x00137a10,
> >  	.name		= "LXT973",
> > @@ -344,6 +345,7 @@ static struct phy_driver lxt97x_driver[] = {
> >  	.config_aneg	= lxt973_config_aneg,
> >  	.suspend	= genphy_suspend,
> >  	.resume		= genphy_resume,
> > +	.flags		= PHY_NO_ISOLATE,
> >  } };  
> 
> Hi Maxime,
> 
> This duplicates setting .flags for each array member
> updated by this patch.

Arg yes you're correct... Don't know how I missed that...

Thanks !

Maxime