From patchwork Fri Oct 21 17:45:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kunihiko Hayashi X-Patchwork-Id: 6912 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp826728wrr; Fri, 21 Oct 2022 10:47:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7a3+ku9ohsYcJtsExBVUR/dYqwgz0hRgacZ0B+oFdCKaVyA1nbhn9LOU6FAWGeGO1MxIl0 X-Received: by 2002:a17:903:2351:b0:181:68a8:9f9c with SMTP id c17-20020a170903235100b0018168a89f9cmr20475083plh.115.1666374448202; Fri, 21 Oct 2022 10:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666374448; cv=none; d=google.com; s=arc-20160816; b=gC3lEz802mkLv0+nNI2Ty7pO9RKaQbVGPQNsPQ+2OaLWT9j4yvddSzGmiFonjehSiG /+dTKvSrTnzbCueGJJkyi4LM/LdI4Qoamn7LOfKmeWnhT+osRX/1kd3Igh5odJ+UwlWV ZNXfXsIsmH21xzg1AllXGT4xjQdnrhf2GtHW5vfXyYZVuOqFUnyuppnUn4jTxoUwKnuH gz18Gjww9nJbrMcUHQ97LcgWyr5pw839K6DPTc6DIdexmhCKiZ25Mb1683IBQs2ZLZFs HWKeeynSkST8+4Pj9ij0PHj1beygylRLPPTKoZUVsBz6tltOjiw+P2So9GjxFr7ImwPO C8JQ== 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; bh=CKiwJ2yC1X539pKCUJB/pi2OhDOGFkEXDg0oCIoInPg=; b=LAz4Mc9s6JVj5Wyv3uccNOI27OOUV3ZoZ9Vwnye2a4W5mxIPS4MKpiIe4yg5pYh3YL +L+r+m9qm5qDSd1vRcprSAjoaZM05lOmUXTw3pY7Eb/r0/nBQURfwkMz4fCb7U1b9Ngd LdnlWWAE404qBUyrK+Zr/epaEqmo7mzSn8B+cRimxUcJGUxH5DUgmJFyx8bNybmDWJaF 0BDiQMn6jzta5w2ccNpzHPl/cr/yqFW+NkMIx1N8hFsAcapt8ER6G3Pyifz+IE0PqDQ0 bhvd5P5AGFwsq4aPHjLLsEJpSl0NP77WcJBnoTyBPkZdvaMrMPUWTO0OtjQXFrAAaaRp 0/rg== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 81-20020a630254000000b0046147e930e7si25469612pgc.770.2022.10.21.10.47.14; Fri, 21 Oct 2022 10:47:28 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229494AbiJURqb (ORCPT + 99 others); Fri, 21 Oct 2022 13:46:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbiJURq1 (ORCPT ); Fri, 21 Oct 2022 13:46:27 -0400 Received: from mx.socionext.com (mx.socionext.com [202.248.49.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3628E21E101; Fri, 21 Oct 2022 10:46:17 -0700 (PDT) Received: from unknown (HELO iyokan2-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 22 Oct 2022 02:46:17 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by iyokan2-ex.css.socionext.com (Postfix) with ESMTP id 33C4F20584CE; Sat, 22 Oct 2022 02:46:17 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Sat, 22 Oct 2022 02:46:17 +0900 Received: from plum.e01.socionext.com (unknown [10.212.243.119]) by kinkan2.css.socionext.com (Postfix) with ESMTP id 9DB20B62A4; Sat, 22 Oct 2022 02:46:16 +0900 (JST) From: Kunihiko Hayashi To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kunihiko Hayashi Subject: [PATCH net] net: ethernet: ave: Remove duplicate suspend/resume calls for phy Date: Sat, 22 Oct 2022 02:45:52 +0900 Message-Id: <20221021174552.6828-1-hayashi.kunihiko@socionext.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747320253736242724?= X-GMAIL-MSGID: =?utf-8?q?1747320253736242724?= Since AVE has its own suspend/resume functions, there is no need to call mdio_bus suspend/resume functions. Set phydev->mac_managed_pm to true to avoid the calls. In addition, ave_open() executes __phy_resume() via phy_start() in ave_resume(), so no need to call phy_resume() explicitly. Remove it. Suggested-by: Heiner Kallweit Fixes: 0ba78b4a4989 ("net: ethernet: ave: Add suspend/resume support") Signed-off-by: Kunihiko Hayashi --- drivers/net/ethernet/socionext/sni_ave.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/socionext/sni_ave.c b/drivers/net/ethernet/socionext/sni_ave.c index 14cdd2e8373c..b4e0c57af7c3 100644 --- a/drivers/net/ethernet/socionext/sni_ave.c +++ b/drivers/net/ethernet/socionext/sni_ave.c @@ -1271,6 +1271,8 @@ static int ave_init(struct net_device *ndev) phy_support_asym_pause(phydev); + phydev->mac_managed_pm = true; + phy_attached_info(phydev); return 0; @@ -1806,12 +1808,6 @@ static int ave_resume(struct device *dev) wol.wolopts = priv->wolopts; __ave_ethtool_set_wol(ndev, &wol); - if (ndev->phydev) { - ret = phy_resume(ndev->phydev); - if (ret) - return ret; - } - if (netif_running(ndev)) { ret = ave_open(ndev); netif_device_attach(ndev);