Message ID | 20230515025608.2587012-1-f.fainelli@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp6624504vqo; Sun, 14 May 2023 19:58:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5pJiBOO5HzSJO0M/3m29WCc97QoFEIXvbVY+RayFn3UWIy2YDMakZTytLA1iVGw7DYxu4d X-Received: by 2002:a17:90a:2d6:b0:252:a2e5:4c3f with SMTP id d22-20020a17090a02d600b00252a2e54c3fmr11345018pjd.25.1684119480230; Sun, 14 May 2023 19:58:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684119480; cv=none; d=google.com; s=arc-20160816; b=mUnsmAYwaB2QmegcuA1tMD/4UOrKWZ4DCJBsbCvPTjzxh9aaL8aBH4sX6/tSCXzj04 Nc3qN98Zs4x56E6pLo679ntmOuTgUlqy7qpAJdShdmf534HYW5iDBbDQeNNg7nnipZqD P9mJcJnZnro/4/NZj2/ByhtEjCI9iU0Nsv4QmXYCA/wuemteXnMUBeJgMwX7rVreh8CQ 2I3nI4ALyK45Ur4M/E2RNORR+YiyzGo5ebiSi6kRA2st0hhhDj81Z/nIWgaRG4paeFv/ zkSZmdKzrMw0bXP7PJIF+01UrTJNt9NbBXqsQgke0oQrdq9KYqVDRHC1hbfW+2qFabqq FnDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=X4xhz39Eaz6LAnCrMNzbKA/+Cn9J+aJWsPIquB3prFM=; b=kOCqb7O+8v3p8xeYVZiO5ZxGLQ2WvUXKpA+oBq5jj7I8IGwmnvJ/ESKCgGSdRQxDUb tzxFNFVDf5L/i+88SQsUfZm0CpB/PvIXGmfuHhLJYeg8AAXuH/qi+fPEgdjtDwtZxxIK 7FcaCIR+TJo0eFZYCYyERNs6h3HR1TPea/r7rKmc2QEz4nMYtXXGJwl4HZhVd4hs3r4A cqEdO1nxLgS1PIKyxNqVnX2rca1R3fwV9OKiEXe7BC/VZuXXKliWO2S9Ph93fCjUqCk8 aRfuHtae+nacV84Qntf9JHbWGs6rEa1PPmT5yCxboPaYtDy+8zhk/M3cn1ccg53yySUT PQEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=J6n5ChuF; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020a635607000000b0053009feb3c8si13974254pgb.431.2023.05.14.19.57.47; Sun, 14 May 2023 19:58:00 -0700 (PDT) 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=20221208 header.b=J6n5ChuF; 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 S230496AbjEOC4P (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Sun, 14 May 2023 22:56:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229672AbjEOC4N (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 14 May 2023 22:56:13 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87095E78; Sun, 14 May 2023 19:56:12 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-528cdc9576cso8362373a12.0; Sun, 14 May 2023 19:56:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684119371; x=1686711371; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=X4xhz39Eaz6LAnCrMNzbKA/+Cn9J+aJWsPIquB3prFM=; b=J6n5ChuF+lyefafB9qQpBzw//WZCeagGw0SDWgzNgpzkx+cSwJ84iAOI6xRf3DtKPC Waeuj1yjyd/HG6zp6JPxGZJXNT/rVnRvzTExckiLUwJ5KTSDiyhfgNC6GP0/gFNtcihq yboS8kIPV5N48ITOVKYpxq3Us/JOvBnvyCOXx5Zt1Gn/1h7+JX6+GG1RaK6BAiIr6IFD +FfRfZRMXZYSW/d+sAQthDvM5JyNIAxBCkJDh2HmnHEoXPb0lbFBCPrQ8hPCpGHQa7ON lYsgva/ASsKaRhcqn8xUm/V3G8urORLdtNKjPQCcn31noSGe1/luxc4lZaolaQUBiRxA RUrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684119371; x=1686711371; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=X4xhz39Eaz6LAnCrMNzbKA/+Cn9J+aJWsPIquB3prFM=; b=MVF4jWY+R7Jsu8O5Th+RTk35lNXdEo4DLckijRW9kS6vss7N/ULf44XNecbXozGHty 2cfwax/X6r5wMGf7NU6wcbd0082jTBgSfkzHslz1rUYZiWBWlkTZi8m2Wids9/2yyrY8 Gcko0ABGOQyGWT9DN8XlN1FWqJY2fhEKRYJxk9rvNCLssdhTAe0DLYKh8jE5jn8QKLW4 6w+0y20PEH7Y/LrUiTe59mhKeW/A0SSzHVqErjpjjM2iQA+UhF+rh4cdaoGkOa0U2r03 Q6LuqT85VvKsLCuCzKbVppcHKOqGweXBsoaKOuNzf+mfLzNumE/n4s++UxLct+rWoGQX OscA== X-Gm-Message-State: AC+VfDxGHShilZSZgZ1fovQkS+zoE1a4AyG0DREvg97Lx/3XzdllZ1ps toG/UQ7ac1IyqA6hK6fONkT5vV8mxfc= X-Received: by 2002:a17:902:ab5c:b0:1ae:1f8a:8a9c with SMTP id ij28-20020a170902ab5c00b001ae1f8a8a9cmr1091146plb.64.1684119371400; Sun, 14 May 2023 19:56:11 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id h11-20020a170902b94b00b00194d14d8e54sm12201194pls.96.2023.05.14.19.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 May 2023 19:56:10 -0700 (PDT) From: Florian Fainelli <f.fainelli@gmail.com> To: netdev@vger.kernel.org Cc: Florian Fainelli <f.fainelli@gmail.com>, Doug Berger <opendmb@gmail.com>, Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, linux-kernel@vger.kernel.org (open list) Subject: [PATCH net] net: bcmgenet: Restore phy_stop() depending upon suspend/close Date: Sun, 14 May 2023 19:56:07 -0700 Message-Id: <20230515025608.2587012-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765927268086747324?= X-GMAIL-MSGID: =?utf-8?q?1765927268086747324?= |
Series |
[net] net: bcmgenet: Restore phy_stop() depending upon suspend/close
|
|
Commit Message
Florian Fainelli
May 15, 2023, 2:56 a.m. UTC
Removing the phy_stop() from bcmgenet_netif_stop() ended up causing
warnings from the PHY library that phy_start() is called from the
RUNNING state since we are no longer stopping the PHY state machine
during bcmgenet_suspend().
Restore the call to phy_stop() but make it conditional on being called
from the close or suspend path.
Fixes: c96e731c93ff ("net: bcmgenet: connect and disconnect from the PHY state machine")
Fixes: 93e0401e0fc0 ("net: bcmgenet: Remove phy_stop() from bcmgenet_netif_stop()")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
Comments
On Mon, May 15, 2023 at 8:26 AM Florian Fainelli <f.fainelli@gmail.com> wrote: > > Removing the phy_stop() from bcmgenet_netif_stop() ended up causing > warnings from the PHY library that phy_start() is called from the > RUNNING state since we are no longer stopping the PHY state machine > during bcmgenet_suspend(). > > Restore the call to phy_stop() but make it conditional on being called > from the close or suspend path. > > Fixes: c96e731c93ff ("net: bcmgenet: connect and disconnect from the PHY state machine") > Fixes: 93e0401e0fc0 ("net: bcmgenet: Remove phy_stop() from bcmgenet_netif_stop()") > Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> > --- Looks good to me. Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com> PS: I was only curious as to why is it not a v2 (I see only another Fixes got added though) > drivers/net/ethernet/broadcom/genet/bcmgenet.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c > index f28ffc31df22..eca0c92c0c84 100644 > --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c > +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c > @@ -3450,7 +3450,7 @@ static int bcmgenet_open(struct net_device *dev) > return ret; > } > > -static void bcmgenet_netif_stop(struct net_device *dev) > +static void bcmgenet_netif_stop(struct net_device *dev, bool stop_phy) > { > struct bcmgenet_priv *priv = netdev_priv(dev); > > @@ -3465,6 +3465,8 @@ static void bcmgenet_netif_stop(struct net_device *dev) > /* Disable MAC transmit. TX DMA disabled must be done before this */ > umac_enable_set(priv, CMD_TX_EN, false); > > + if (stop_phy) > + phy_stop(dev->phydev); > bcmgenet_disable_rx_napi(priv); > bcmgenet_intr_disable(priv); > > @@ -3485,7 +3487,7 @@ static int bcmgenet_close(struct net_device *dev) > > netif_dbg(priv, ifdown, dev, "bcmgenet_close\n"); > > - bcmgenet_netif_stop(dev); > + bcmgenet_netif_stop(dev, false); > > /* Really kill the PHY state machine and disconnect from it */ > phy_disconnect(dev->phydev); > @@ -4303,7 +4305,7 @@ static int bcmgenet_suspend(struct device *d) > > netif_device_detach(dev); > > - bcmgenet_netif_stop(dev); > + bcmgenet_netif_stop(dev, true); > > if (!device_may_wakeup(d)) > phy_suspend(dev->phydev); > -- > 2.34.1 > >
Hello: This patch was applied to netdev/net.git (main) by Paolo Abeni <pabeni@redhat.com>: On Sun, 14 May 2023 19:56:07 -0700 you wrote: > Removing the phy_stop() from bcmgenet_netif_stop() ended up causing > warnings from the PHY library that phy_start() is called from the > RUNNING state since we are no longer stopping the PHY state machine > during bcmgenet_suspend(). > > Restore the call to phy_stop() but make it conditional on being called > from the close or suspend path. > > [...] Here is the summary with links: - [net] net: bcmgenet: Restore phy_stop() depending upon suspend/close https://git.kernel.org/netdev/net/c/225c657945c4 You are awesome, thank you!
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index f28ffc31df22..eca0c92c0c84 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -3450,7 +3450,7 @@ static int bcmgenet_open(struct net_device *dev) return ret; } -static void bcmgenet_netif_stop(struct net_device *dev) +static void bcmgenet_netif_stop(struct net_device *dev, bool stop_phy) { struct bcmgenet_priv *priv = netdev_priv(dev); @@ -3465,6 +3465,8 @@ static void bcmgenet_netif_stop(struct net_device *dev) /* Disable MAC transmit. TX DMA disabled must be done before this */ umac_enable_set(priv, CMD_TX_EN, false); + if (stop_phy) + phy_stop(dev->phydev); bcmgenet_disable_rx_napi(priv); bcmgenet_intr_disable(priv); @@ -3485,7 +3487,7 @@ static int bcmgenet_close(struct net_device *dev) netif_dbg(priv, ifdown, dev, "bcmgenet_close\n"); - bcmgenet_netif_stop(dev); + bcmgenet_netif_stop(dev, false); /* Really kill the PHY state machine and disconnect from it */ phy_disconnect(dev->phydev); @@ -4303,7 +4305,7 @@ static int bcmgenet_suspend(struct device *d) netif_device_detach(dev); - bcmgenet_netif_stop(dev); + bcmgenet_netif_stop(dev, true); if (!device_may_wakeup(d)) phy_suspend(dev->phydev);