Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6765807rwb; Mon, 12 Dec 2022 06:14:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf6DZV11Y6sAke0wPKxwHHEQEyzEr2vhZwC+GhBiUc5K8q7H9LTZ3Kf0R2Qwn7tp3EoiORbn X-Received: by 2002:a17:906:eb5b:b0:7c1:bb3:45e4 with SMTP id mc27-20020a170906eb5b00b007c10bb345e4mr13918406ejb.21.1670854459746; Mon, 12 Dec 2022 06:14:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670854459; cv=none; d=google.com; s=arc-20160816; b=J7fA8uT7+rzBsMnx8zFh/tdEgtnVTp3pocDXbFb9UW9tPrsCXEkJNetC07OKOtk/s0 qXyLFWMcGst7aCKAkT2H5wpzMT+lhPbUOMvfYmyBGUYoRTpO32uxdb/fP4ro1xYxcD4q qGEh9H2Jtt90hnFnBy+3MRi2hK0fk2M83aoOSAABVpRUCwqBvXLx0zucNmDxw+WynboY rqXbPZ4nfGgFROZfR2HfCR0ND/VzoqIX9Y0kWM+ZsVhCUpQ/jtwmF1jbDHaLgddbE7Yq pOGJ8Z7ox97gJ9PHOhfRlQ8YZBVPFCv/qDBqR3bLTCTsKlxX++D5Tz+tulyrffGx7QnA xvwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YrqnHu9WTeRN234a31B5lZIUWTkJP7oJ2r4I37DZ9Cc=; b=ZugXMpjyRpc3xuJGztl443n28OZxjNMBgsv+xIJQYiEfAsSb6unMoWZZky/Pxw78pb c6r1ExjEsytDfa5I/kme73/2+nNXM66KtpuFQNH45kllpLLgsvfHXIUXKCDb8PvOQb78 3KZSajcSZjfra4159GWdzZfsIhTtTMZ30ApsKlfzreI5oNMdPinAEz/f1EuH8WHVf/o5 B2fIzOxW5FtjuEdMGPrAzYP9SYcQ5h2VCxN5DsfZ3TDp/qXxwSqQAzHrckQ8Cm//7TRP cUU7oW1qxDRAIfFP50247aao0TV/myFOUypqPlXauJ5IxZYIma4vbWSRPwm5zLhmp3Ya kDOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=R8JumW17; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz30-20020a1709077d9e00b007c11812c621si6505821ejc.459.2022.12.12.06.14.00; Mon, 12 Dec 2022 06:14:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=R8JumW17; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233245AbiLLNyk (ORCPT + 75 others); Mon, 12 Dec 2022 08:54:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233216AbiLLNyN (ORCPT ); Mon, 12 Dec 2022 08:54:13 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE75C2AF5; Mon, 12 Dec 2022 05:54:12 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id fc4so28096730ejc.12; Mon, 12 Dec 2022 05:54:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=YrqnHu9WTeRN234a31B5lZIUWTkJP7oJ2r4I37DZ9Cc=; b=R8JumW17wBW6T2M+cCmPxYNeoDabzGl6wDAEDaMggdQJyFMhhN8poEKRNTzyq3FO8E 4kgdpM2uc0Qk7FY4QqE0ZQNbOE5Y+K7bYDz5U4NJb8hkyhxO+F5sHPYTmCQWdN1CLVMR Wv328q22uM00GKX0JY1zMRCIPH+me3o/XOYVWtRaNC1BeulnFTnn7/YXe3OOyadiBt+O nehb7iZRqJOoQ4eNVnUdjwpbkHlYFH7dKsg7QKxDjydUKaDVuCJIlQirLfXvtK5RaYxn zC7GlW8ODlX068JBM9NTQSadQoQLP6cQZofeYWLfpXSzFCgiuBYDdFiHnh6Rojo9Ova0 R2Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YrqnHu9WTeRN234a31B5lZIUWTkJP7oJ2r4I37DZ9Cc=; b=LAPWzMol1k76hMEgERFa3sbAwzVSt8Ns04sMNbNg/it2nC3cO+70PIKqJp9YWhPPFL DBVSqGFhjrVKn7IV75Jgo4q65dBIa1tQm87FhPol4HNNddnUByR1rpuLzh4FPx4oqjkV VKnWxYv76tGMiJetAOtkJ6FWz85oMC/mQPI10awDlIa97W7itbMspOrbT4Gc35INLd9f xtAcC+JocRW+irMAKqyzb8iiCAsQK2HE2AsrdPQVSSGUbPsNKVBUyOSM1qCBYJm9FI9s AdGebswSoJiameqEUtVDU69iYZ5Tf9qYB9S/9bIzsrrf7DlAMXCcOGuhszyGPPCbLTen 5xcA== X-Gm-Message-State: ANoB5plnBG79gYKzVALU49pZLLy5fI82mls5MC4R2Zz1weFeeuuOivz8 Iko+44bwrDEnhgNfZyqD5vo= X-Received: by 2002:a17:906:f2d5:b0:7c0:ff76:dc12 with SMTP id gz21-20020a170906f2d500b007c0ff76dc12mr13226446ejb.2.1670853251387; Mon, 12 Dec 2022 05:54:11 -0800 (PST) Received: from skbuf ([188.27.185.63]) by smtp.gmail.com with ESMTPSA id ss2-20020a170907c00200b007c100eba66asm3322351ejc.77.2022.12.12.05.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Dec 2022 05:54:10 -0800 (PST) Date: Mon, 12 Dec 2022 15:54:08 +0200 From: Vladimir Oltean To: Claudiu Beznea Cc: nicolas.ferre@microchip.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk, andrew@lunn.ch, hkallweit1@gmail.com, sergiu.moga@microchip.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] net: phylink: init phydev on phylink_resume() Message-ID: <20221212135408.j23agcjrikiucq4a@skbuf> References: <20221212112845.73290-1-claudiu.beznea@microchip.com> <20221212112845.73290-2-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221212112845.73290-2-claudiu.beznea@microchip.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Claudiu, On Mon, Dec 12, 2022 at 01:28:44PM +0200, Claudiu Beznea wrote: > There are scenarios where PHY power is cut off on system suspend. > There are also MAC drivers which handles themselves the PHY on > suspend/resume path. For such drivers the > struct phy_device::mac_managed_phy is set to true and thus the > mdio_bus_phy_suspend()/mdio_bus_phy_resume() wouldn't do the > proper PHY suspend/resume. For such scenarios call phy_init_hw() > from phylink_resume(). > > Suggested-by: Russell King (Oracle) > Signed-off-by: Claudiu Beznea > --- > > Hi, Russel, > > I let phy_init_hw() to execute for all devices. I can restrict it only > for PHYs that has struct phy_device::mac_managed_phy = true. > > Please let me know what you think. > > Thank you, > Claudiu Beznea > > > drivers/net/phy/phylink.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c > index 09cc65c0da93..6003c329638e 100644 > --- a/drivers/net/phy/phylink.c > +++ b/drivers/net/phy/phylink.c > @@ -2031,6 +2031,12 @@ void phylink_resume(struct phylink *pl) > { > ASSERT_RTNL(); > > + if (pl->phydev) { > + int ret = phy_init_hw(pl->phydev); > + if (ret) > + return; > + } > + If the config_init() method of the driver does things such as this: phydev->mdix_ctrl = ETH_TP_MDI_AUTO; like for example the marvell10g.c driver, won't a user-configured manual MDI setting get overwritten after a suspend/resume cycle? > if (test_bit(PHYLINK_DISABLE_MAC_WOL, &pl->phylink_disable_state)) { > /* Wake-on-Lan enabled, MAC handling */ > > -- > 2.34.1 >