From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 71F0729D279; Wed, 15 Oct 2025 21:57:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760565461; cv=none; b=Vs2pEguLTGxrjGWK/O6G4iJthDxWYPpSz/xhieMIFw/gvG0TqOmpyKWZX+x+Cy8UVTmRBeOt75tEWR9RE1hv4ScI/YkaPf4COSrf91qfNG15YG7JuEHBy+NL1bCHccjsavjm9uccEeRuIlwUYqW7nD+oNCo7L8JSkI5y2wXfPr8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760565461; c=relaxed/simple; bh=WUMK/p1NpKi6lgRs+bVf1M0kCd8OsC05g8BX3feRS7I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gVhFauIrHKH+vM6/5db/oczeg6QexGGCj2HYdQg7DkVU8dGScciG/YpQn4ESi2rVzKKsM0YO0udWvmmaZvVCmQ4u8W8V60FuAfFZOgotavfSK4j02CsTgqYYpOQREyjHqKNo8ONujVlADNH7iMoOCGn5b3QBhjNZWW919YHo+0c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=mn7QF/uG; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="mn7QF/uG" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=w4Vhb+pWajT1Ug9vm6p2q425XInEco8nPyGgnsCFC6I=; b=mn7QF/uGABpKN3xNzZQhmz2z8B o11ld6ctbXR/ky2Bzy9GmguS3MZrXnF1v2rYnkjP5YhUCZo59ImkCcNqhMFbUqqZQngxwTgx92ZgP uUcm3aQsK5C3oeuTJBBTA4Gjy7CdOrDM7lZERKde429KjydqJBEKRvmUAlv4qS4lv/4CxMntHi6Ri B4m95goSjEKH1jPj2ZEIvSgu3K+3K8pRLhYL5jP6gUIBKXXpuBTVy5nhRltxZuXFPSEphg8trRGUe DyxHgnVYT6D5oWp5MRGliTSF6l4qTUbUxfZn86zYEQT44SrSmakBSNxf9lqsMxS+akwDPJ+7/yJjR NxC1+iNw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:33366) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1v99Uh-000000005Vv-0ZMi; Wed, 15 Oct 2025 22:57:15 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1v99Ua-000000002di-3k6X; Wed, 15 Oct 2025 22:57:08 +0100 Date: Wed, 15 Oct 2025 22:57:08 +0100 From: "Russell King (Oracle)" To: Andrew Lunn Cc: Heiner Kallweit , Abhishek Chauhan , Alexandre Torgue , Alexis Lothore , Andrew Lunn , Boon Khai Ng , Choong Yong Liang , Daniel Machon , "David S. Miller" , Drew Fustini , Emil Renner Berthing , Eric Dumazet , Faizal Rahim , Furong Xu <0x1207@gmail.com>, Inochi Amaoto , Jacob Keller , Jakub Kicinski , "Jan Petrous (OSS)" , Jisheng Zhang , Kees Cook , Kunihiko Hayashi , Lad Prabhakar , Ley Foon Tan , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Matthew Gerlach , Maxime Chevallier , Maxime Coquelin , Michal Swiatkowski , netdev@vger.kernel.org, Oleksij Rempel , Paolo Abeni , Rohan G Thomas , Shenwei Wang , Simon Horman , Song Yoong Siang , Swathi K S , Tiezhu Yang , Vinod Koul , Vladimir Oltean , Vladimir Oltean , Yu-Chun Lin Subject: Re: [PATCH net-next 14/14] net: stmmac: convert to phylink PCS support Message-ID: References: <040a2f29-4c95-4561-87c0-2a70308d3f00@lunn.ch> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <040a2f29-4c95-4561-87c0-2a70308d3f00@lunn.ch> Sender: Russell King (Oracle) On Wed, Oct 15, 2025 at 11:31:37PM +0200, Andrew Lunn wrote: > > - create stmmac_pcs.c, which contains the phylink_pcs_ops structure, a > > dummy .pcs_get_state() method which always reports link-down > > I've not followed the PCS code too closely. Why always report link > down? Why is a dummy method needed? If phylink is put into inband mode, and a PCS is supplied to phylink where this method left NULL, the kernel will oops. As the code stands today in mainline, if phylink were to be put into inband mode with the integrated PCS, then there will be no phylink PCS, and so phylink_mac_pcs_get_state() will fall into the "else" path of: pcs = pl->pcs; if (pcs) pcs->ops->pcs_get_state(pcs, pl->pcs_neg_mode, state); else state->link = 0; and force the link down. So, adding this method keeps the status quo - not oopsing the kernel and not allowing the link to come up. No unintended behavioural change in this regard from how it would behave today. :) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!