lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
 <DS7PR11MB6102A376A0EF8727DFAF0088E2E0A@DS7PR11MB6102.namprd11.prod.outlook.com>
Date: Tue, 7 Oct 2025 06:01:12 +0000
From: <Divya.Koppera@...rochip.com>
To: <andrew@...n.ch>
CC: <josef@...chen.org>, <Arun.Ramadoss@...rochip.com>,
	<UNGLinuxDriver@...rochip.com>, <hkallweit1@...il.com>,
	<linux@...linux.org.uk>, <davem@...emloft.net>, <edumazet@...gle.com>,
	<kuba@...nel.org>, <pabeni@...hat.com>, <netdev@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] net: phy: microchip_t1: LAN887X: Fix device init issues.

Hi Andrew,

> -----Original Message-----
> From: Andrew Lunn <andrew@...n.ch>
> Sent: Tuesday, October 7, 2025 12:15 AM
> To: Divya Koppera - I30481 <Divya.Koppera@...rochip.com>
> Cc: josef@...chen.org; Arun Ramadoss - I17769
> <Arun.Ramadoss@...rochip.com>; UNGLinuxDriver
> <UNGLinuxDriver@...rochip.com>; hkallweit1@...il.com;
> linux@...linux.org.uk; davem@...emloft.net; edumazet@...gle.com;
> kuba@...nel.org; pabeni@...hat.com; netdev@...r.kernel.org; linux-
> kernel@...r.kernel.org
> Subject: Re: [PATCH] net: phy: microchip_t1: LAN887X: Fix device init issues.
> 
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
> 
> > phy_sanitize_settings() is supposed to pick the least supported speed
> > from the supported list when speed is not initialized.
> 
> What makes you think it should pick the slowest speed? The kdoc for the
> function is:
> 
> /**
>  * phy_sanitize_settings - make sure the PHY is set to supported speed and
> duplex
>  * @phydev: the target phy_device struct
>  *
>  * Description: Make sure the PHY is set to supported speeds and
>  *   duplexes.  Drop down by one in this order:  1000/FULL,
>  *   1000/HALF, 100/FULL, 100/HALF, 10/FULL, 10/HALF.
> 
> So it should pick 1000Full if available. If not it will try 1000Half, if not 100Full
> etc.
> 

As per code referred below, 
if (!match && p->speed <= speed)     ==> This condition will NEVER meet for any supported speed(p->speed), when speed is not initialized(i.e., speed is -1 and p->speed is 1000 and 100 in lan887x case).
	/* Candidate */
	match = p;

if (!match && !exact)
	match = last;     ==> As there is no match this condition hits and i.e., the LOWEST speed supported as per above documentation.

return match;

For reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/phy/phy-core.c?h=v6.12.43#n305

> And the comment is actually a bit out of date. It will actually start from 800G
> Full, 400G Full, 200G Full, 100G Full, not that anybody does Copper at these
> speeds.
> 

True.

Thanks,
Divya

>         Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ