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] [thread-next>] [day] [month] [year] [list]
Message-ID: <9682d619-4af3-4406-bf99-e85203991120@lunn.ch>
Date: Tue, 19 Mar 2024 13:02:29 +0100
From: Andrew Lunn <andrew@...n.ch>
To: "Jan Petrous (OSS)" <jan.petrous@....nxp.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	Heiner Kallweit <hkallweit1@...il.com>,
	Russell King <linux@...linux.org.uk>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next v2] net: phy: don't resume device not in use

On Fri, Mar 15, 2024 at 07:55:48AM +0000, Jan Petrous (OSS) wrote:
> In the case when an MDIO bus contains PHY device not attached to
> any netdev or is attached to the external netdev, controlled
> by another driver and the driver is disabled, the bus, when PM resume
> occurs, is trying to resume also the unattached phydev.
> 
> /* Synopsys DWMAC built-in driver (stmmac) */
> gmac0: ethernet@...3c000 {
> 	compatible = "snps,dwc-qos-ethernet", "nxp,s32cc-dwmac";
> 
> 	phy-handle = <&gmac0_mdio_c_phy4>;
> 	phy-mode = "rgmii-id";
> 
> 	gmac0_mdio: mdio@0 {
> 		compatible = "snps,dwmac-mdio";
> 
> 		/* AQR107 */
> 		gmac0_mdio_c_phy1: ethernet-phy@1 {
> 			compatible = "ethernet-phy-ieee802.3-c45";
> 			reg = <1>;
> 		};
> 
> 		/* KSZ9031RNX */
> 		gmac0_mdio_c_phy4: ethernet-phy@4 {
> 			reg = <4>;
> 		};
> 	};
> };
> 
> /* PFE controller, loadable driver pfeng.ko */
> pfe: pfe@...00000 {
> 	compatible = "nxp,s32g-pfe";
> 
> 	/* Network interface 'pfe1' */
> 	pfe_netif1: ethernet@11 {
> 		compatible = "nxp,s32g-pfe-netif";
> 
> 		phy-mode = "sgmii";
> 		phy-handle = <&gmac0_mdio_c_phy1>;
> 	};
> };
> 
> Because such device didn't go through attach process, internal
> parameters like phy_dev->interface are set to default values, which
> can be incorrect for some drivers. Ie. Aquantia PHY AQR107 doesn't
> support PHY_INTERFACE_MODE_GMII and trying to use phy_init()
> in mdio_bus_phy_resume ends up with the following error caused
> by initial check of supported interfaces in aqr107_config_init():
> 
> [   63.927708] Aquantia AQR113C stmmac-0:08: PM: failed to resume: error -19']
> 
> The fix is intentionally assymetric to support PM suspend of the device.
> 
> Signed-off-by: Jan Petrous <jan.petrous@....nxp.com>

Reviewed-by: Andrew Lunn <andrew@...n.ch>

    Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ