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 26D4E369990; Thu, 9 Apr 2026 10:29:58 +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=1775730602; cv=none; b=mS5+FlPF1HGObvvcH1gYMnNnLuPeU+HjMRo6ZHFz2Wahahc6+OPvCt9edYpklWE+0lsoD7pO/NyUiDhRU8FeGKerQ30HTDaKVqCv9oN7W4EciwaKGX/SC73eOvbmnEm159vxcIuF7kDCplUAkS+Jy0X/FUvpX/ILyTn61IQFMcw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775730602; c=relaxed/simple; bh=XQMr0ep1TiA8hRGkP0LCpMOeww5KjSBVcBwbP5/s68g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tslyJJdgJOEJBtPrjIYkt6aDLKBQhNyDTwDRhyBfblRbgFCryIqsHOM4E6nFP35KDFhDnFfRJCjzKaIbjhCg/zEaA7zx6OUPh9b5BHvD6pwyYne0SxAL50gL5lmDL/iommeuka8e9wwS5GoBmOeil66ldEToVhkw9KSDXp3+WJk= 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=NbrfauJk; 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="NbrfauJk" 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-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To: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=ETzbm7sIzfzQBICo7m9TJCdf/K+1A84nGjCe7ZX0O1E=; b=NbrfauJkCdeUnOIrpcJAhD0c3K NgXe/bjgyQjZYF68VGdkri1xNoXbe11riODHnBNG3B5YS9UHZ6dTDog9WbFSkg2+YomAFLXj7iF5X Bgy62u9/Ma7FAWE4gmNcgUg2ym77Oxe5QhdtWVYRIiPL1ENW52bkuutavBtIYm99NMdelNXf0XWFh i3F50tjeSrlsXuuklVX6mwCQRVw4fh6Ltdz/ntoT+Kg9M3WtJER78d2b8w/irtrcZncdz2csLH2s8 PzeykvlRaX/xAcD7Ks0caX/FOosVKqREW3q3/AkEnIwTzmnTETvqFuAfLv3IOVfXbDnxzSHBUvK1c kQoGQHBQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:46088) 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 1wAmdq-000000003PP-16y2; Thu, 09 Apr 2026 11:29:42 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1wAmdn-000000004Ij-0Yco; Thu, 09 Apr 2026 11:29:39 +0100 Date: Thu, 9 Apr 2026 11:29:38 +0100 From: "Russell King (Oracle)" To: Biju Das Cc: Ovidiu Panait , "andrew@lunn.ch" , "hkallweit1@gmail.com" , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" Subject: Re: [PATCH net v2 2/2] net: phy: micrel: remove ksz9131_resume() Message-ID: References: <20260409095633.70973-1-ovidiu.panait.rb@renesas.com> <20260409095633.70973-3-ovidiu.panait.rb@renesas.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: Russell King (Oracle) On Thu, Apr 09, 2026 at 10:13:10AM +0000, Biju Das wrote: > Hi Ovidu, > > Thanks for the patch. > > > -----Original Message----- > > From: Ovidiu Panait > > Sent: 09 April 2026 10:57 > > Subject: [PATCH net v2 2/2] net: phy: micrel: remove ksz9131_resume() > > > > ksz9131_resume() was added to restore RGMII delays on resume for platforms where the PHY loses power > > during suspend to RAM. However, for s2idle, the PHY stays in Software Power-Down (SPD) during resume. > > In that case, > > ksz9131_config_rgmii_delay() accesses MMD registers before kszphy_resume() clears BMCR_PDOWN. The > > KSZ9131 datasheet states that during SPD, access to the MMD registers is restricted: > > > > - Only access to the standard registers (0 through 31) is supported. > > - Access to MMD address spaces other than MMD address space 1 is > > possible if the spd_clock_gate_override bit is set. > > - Access to MMD address space 1 is not possible. > > > > Additionally, only RGMII delays were restored, while other settings from ksz9131_config_init() were > > not. > > > > Now that the preceding commit ("net: phylink: call phy_init_hw() in phylink resume path") performs a > > phy_init_hw() during phylink resume, > > ksz9131_resume() is no longer needed. > > > > Remove it and use kszphy_resume() directly. > > How to avoid code duplication in this case? > > For eg: phy_init_hw() makes the phy out of SPD state > > and kszphy_resume() unconditionally makes the phy out of SPD state again. > ¬ kszphy_generic_resume > ¬ genphy_resume My question would be... if we mandate that phy_init_hw() must be called before phy_resume() by MAC drivers, then how much of kszphy_resume() becomes redundant? Given that populating drv->soft_reset() with genphy_soft_reset() means the PDOWN bit will be cleared, genphy_resume() becomes redundant. phy_init_hw() will also call drv->config_intr(), so that doesn't need to be done either. It will also call drv->config_init(), which will call kszphy_config_reset(). So most of kszphy_resume() becomes unnecessary. I think the only thing that remains would be the call to kszphy_enable_clk() - and is it fine to call that after phy_init_hw() ? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!