From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92FA22F619C for ; Fri, 22 Aug 2025 09:29:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755854952; cv=none; b=uro258f9N+4qFDomnBb6f3dHZPi1zXp9B7wLHZAUrnvLC9Z4j3VS61OMXbkQFo8Xb6iE++WKuN5HQgFy/f5Imv8f59bCA0sOyA3HmyQ/lUInH5YiEgx/jSLKkxhz6EiibhwzEkvsfLrY3fn/FSCSW9wkkP86zQHA5PH81SIQhjs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755854952; c=relaxed/simple; bh=qy1eb80X2+M43XeBimEia04iu3UlKhbOel9Og0vmxV8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CKqgVuvkpoeCYLvcKOusZKD9GlwR8GHN4iLOpDY7eyhm6zo0gCPYHYliILFOcVWNPgBEREN0uTShDxla8h0WQCc7skkr0fD85L3wKwHCCjx93lY0MqrqVePfahJoHQqoCpcifugsbzfDr2aH1ZYxdwt2kBwjTP+3RRw7YOZQ+18= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1upO50-0005bC-AD; Fri, 22 Aug 2025 11:29:02 +0200 Received: from pty.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::c5]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1upO50-001YQR-0H; Fri, 22 Aug 2025 11:29:02 +0200 Received: from ore by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1upO4z-00A50K-34; Fri, 22 Aug 2025 11:29:01 +0200 Date: Fri, 22 Aug 2025 11:29:01 +0200 From: Oleksij Rempel To: "Russell King (Oracle)" Cc: Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net-next v2 1/1] net: phy: Clear link-specific data on link down Message-ID: References: <20250822090947.2870441-1-o.rempel@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Fri, Aug 22, 2025 at 10:19:24AM +0100, Russell King (Oracle) wrote: > On Fri, Aug 22, 2025 at 11:09:47AM +0200, Oleksij Rempel wrote: > > When a network interface is brought down, the associated PHY is stopped. > > However, several link-specific parameters within the phy_device struct > > are not cleared. This leads to userspace tools like ethtool reporting > > stale information from the last active connection, which is misleading > > as the link is no longer active. > > This is not a good idea. Consider the case where the PHY has been > configured with autoneg disabled, and phydev->speed etc specifies > the desired speed. > > When the link goes down, all that state gets cleared, and we lose > the user's settings. > > So no, I don't think this is appropriate. > > I think it is appropriate to clear some of the state, but anything that > the user can configure (such as ->speed and ->duplex) must not be > cleared. Hm... should it be cleared conditionally? If autoneg is used, clear the speed and duplex? -- 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 |