From patchwork Thu Feb 4 10:15:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 12066739 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10F81C433E0 for ; Thu, 4 Feb 2021 10:16:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF39464DE9 for ; Thu, 4 Feb 2021 10:16:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235373AbhBDKQY (ORCPT ); Thu, 4 Feb 2021 05:16:24 -0500 Received: from mail-eopbgr70070.outbound.protection.outlook.com ([40.107.7.70]:11334 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235298AbhBDKQV (ORCPT ); Thu, 4 Feb 2021 05:16:21 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bt6raflU6Y7KKMVzv/UWJLXfQUo+uS9x4vDmgX5qYpd8QQRWJTzsHwkPc24TTSEdpUYQndrGQ0n8Njvt8dfQ7W0UUwjIvrTWtZid/pP1mmS238hvy03qzTFXY/4Py2tvV+RrPkWUkXanb0AFzlSvIOh49lU8If+XCcgnaR51nKl6a30azl0mylO6M1nGUZHi9omm0b1efW28HkoDb2OCMRlPKDxBCtyQnsNSLdZJNgi6H6eYZaEBy6DTljPkFSZQ3PnGzSjJImaKabGQRfuQIrBQjQrhJlGwgZgQ0fCnGmtLdQcDXo4GpsbzFWv106k2F8gSMD5h0Ao6KxuGrH55FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cMF+eIomc07M1aaurkyMl3E56xVyIvVQKQAjRYpKjzo=; b=Vo3gtwUtQNMk71NXzmWpBFZHFXsx9kqYrXzEQ8HKE1fiNHvZ8617aUFfKaub5I1u9gE6CH9VyiTqACMYX86NMzRCXJMo7Zo/nFXewjFpawdaJMvTFnJaTMVcJ7eoPnHv519v1nqncNW+QdsDFOqFdJsYmG/LqiNxqzYQDVK3WalFlM3r1RtOXS0nOm0e/clogKG3lujZt2V1Dkn2/EaGcgzefdL6nNWv7D3s1egcWoTjm+6FKH+IVAQ7Msw6yd0nfCTAnCJsM5Y4TZoyVdt4BFlkVpIrLTpfMhzQ+O6gHcWWGQuqLbYU/fzX1ciDcRWEokTUxRcfc+/GY35c8eGw3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cMF+eIomc07M1aaurkyMl3E56xVyIvVQKQAjRYpKjzo=; b=VGWtKcPT88Mwu+f0lyHqNC3FiqhhWU49KI4I1/qy0UHi8/kVzja3irS4khaQjV8X5WgjKd5wTXa9pYT6MATlGTnmRTR/7XYk9guqV47Ez32MgwfPZoK0nTh25cqgDZyhAjqPpE1d0CMB6o8Rhye6nI1VCOibew/AQycZ+OXte5Q= Authentication-Results: st.com; dkim=none (message not signed) header.d=none;st.com; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB6800.eurprd04.prod.outlook.com (2603:10a6:803:133::16) by VI1PR04MB3055.eurprd04.prod.outlook.com (2603:10a6:802:9::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.17; Thu, 4 Feb 2021 10:15:32 +0000 Received: from VI1PR04MB6800.eurprd04.prod.outlook.com ([fe80::6958:79d5:16bf:5f14]) by VI1PR04MB6800.eurprd04.prod.outlook.com ([fe80::6958:79d5:16bf:5f14%9]) with mapi id 15.20.3825.019; Thu, 4 Feb 2021 10:15:32 +0000 From: Joakim Zhang To: peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com, davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, andrew@lunn.ch, f.fainelli@gmail.com, willemdebruijn.kernel@gmail.com Subject: [PATCH net-next 2/2] net: stmmac: slightly adjust the order of the codes in stmmac_resume() Date: Thu, 4 Feb 2021 18:15:50 +0800 Message-Id: <20210204101550.21595-3-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210204101550.21595-1-qiangqing.zhang@nxp.com> References: <20210204101550.21595-1-qiangqing.zhang@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2P153CA0032.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::19) To VI1PR04MB6800.eurprd04.prod.outlook.com (2603:10a6:803:133::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2P153CA0032.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.1 via Frontend Transport; Thu, 4 Feb 2021 10:15:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a6a35f43-329b-405e-33bf-08d8c8f5ce05 X-MS-TrafficTypeDiagnostic: VI1PR04MB3055: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x5LV8OEMvUN5wIbnaIU8whDEROD4GbgyE4RbPstN8SH8STtDvF4A0aFgF41pQVIkIIOaoYe4yXE6Oo6a/rSoqvbdmotPjgIQzUS424YXCoQpO1BlY9lL5jiAbPReAaXc9lQN8eGfVkzKqsZHsoO6fVK1TucM2cmnTz8IizxYWxgBz63pzAha+B8wCKeCTFHaQOTHWBTeRtJvnWVSlHNEdIDOCf6DQ2dHbIWtu94MaFWlzVoTFTLQA+wWHr5EwoiFupiJMTNYhdv1E6++WufEV2Ga2x/sqM1sQT6NigBqdz31lqiqQxfxfQHlDcB+zqsHcNlwNlHwaeTDMZidalit7afkCWNq5G7B1XMGs1Gv4qmdWgPcchtEDa3e/uJklFyinY9VrccMTMMCGXet01EamRQpPAD3xLIzN0VO7HtWib2skR3+XYoufFoqdP1w51DhiV2H4XhBZjgjIDPMQB9yGVQMOfuVJymornI+8+VCkDkwhivKUsm1ccW0++IUP6wK8OwBzSaJ6Xu52SPeJXAFAHiRKeg7HxYe4Y8D2Uog/lZaMO4WMAAYGPi6eZ9KGqI6sakoEc9WZ4dGg4UgGz3aoA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB6800.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(366004)(396003)(39860400002)(376002)(136003)(6512007)(86362001)(8676002)(83380400001)(8936002)(36756003)(6506007)(6666004)(1076003)(5660300002)(66556008)(478600001)(6486002)(26005)(16526019)(52116002)(66476007)(2906002)(2616005)(956004)(186003)(316002)(69590400011)(4326008)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: l6HdUUYTdQqppz+FB0sJUTglhW71cWNi3PafbexgqJPHCy6l0wxJeSWqTlG4G9kb1afMxD87c9DR6gtvrTNAnCenHcqcvFgj/+rUR2QgNPra8jMt6UuMgCecBVeV47UYSF7OBTvQd5ppSnAuiYiSoG47G7z8e3ui7xqg+C9AtPIdGgCGa0rsIGj2Cr3r8pVyid6LzG8qtVj60DK1P+ifg4mlItu/qayP+sLCpzGetridtwBQcrHN3+FNmYBTRVQWh+SF0zML64s9zfHGefGJliuPQO/Qj/PcbrFTzOh6RepXd+VnsPgnAQjQYc9wHURMbiYAJIFQbsq/De9kd0+kj0LdB/JwpkdtqPZOjnTjaqcHWhxk6p4EgHW+2DfdaNj/S72biOI/GwwvlVDqttamwMJqGRpKv3TkYDefYqF4ANcSfF/PY+vz4znKacyx0JnKZLDXzPtRAqcAcT5B3j2IkhRZ5r6FRzrySU7c3ebksdkMa+VbYMlEKvW8FTOLHFuJGKBwkIok093rrMS0YsBSIyuuZ6A/EXR3HGwNgGcfYicw3AAmFMsS9NMoq12H2H5zlJX9tFteBiamR/8tBi3EPrTZHJMqd5z75bac24J0zpDl0lSxa1KXLaQSM3465G3hkaTKtTEEPlDGIIGzDQLjlVB1/ooGxtZihKz2RdbkmWZDY0xhV12+PW2xVYTqr+Ze4Sv+yqCtMWPLpPD86mi7uYRrcVO7QbLCC4w48B0oND1rqQCb0dodY+0RIbaSuDLYtU10qWHFk7YEfADXu3wdTSOJI80lpRH9hT/g3D3bnUIpmpHDrdhpl0JOO1wJ6OH3IgPcl8SSZkb3GsHFw/npLgKhp6itomnsjXELcAVnpqzNlMvgDaPzGCxjDlK6r+nQBHbT4UD7PJyMHVvMlY3cqvG3kNucoV28BiXuppzmSh/xGDLVm+wL1RtQA8F3fiFHp2pTC4geGcoZE0HRqsGlXqwfpsOMw+FGfnWiEpA9vLs2F3DtLXUKkRxyA9ajNAwbYY3lodRQfcQy2M6wgzAVrHKWoU+IQKUVdgf0S2po1PpBSE8cKWV6LqkDm1WsNmg8 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a6a35f43-329b-405e-33bf-08d8c8f5ce05 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB6800.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2021 10:15:32.6096 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0aRjLkCRYNP8zphRlKjp6qE5TbMRKsj3+fmLh4X4IvzNZTxbCj+VGLKAGWxpeExLe2U+KyedgBr18SE8xDf9/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3055 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Slightly adjust the order of the codes in stmmac_resume(), remove the check "if (!device_may_wakeup(priv->device) || !priv->plat->pmt)". Signed-off-by: Joakim Zhang --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 11e0b30b2e01..94d4f5d294f4 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -5295,6 +5295,12 @@ int stmmac_resume(struct device *dev) /* reset the phy so that it's ready */ if (priv->mii) stmmac_mdio_reset(priv->mii); + + rtnl_lock(); + phylink_start(priv->phylink); + /* We may have called phylink_speed_down before */ + phylink_speed_up(priv->phylink); + rtnl_unlock(); } if (priv->plat->serdes_powerup) { @@ -5305,14 +5311,6 @@ int stmmac_resume(struct device *dev) return ret; } - if (!device_may_wakeup(priv->device) || !priv->plat->pmt) { - rtnl_lock(); - phylink_start(priv->phylink); - /* We may have called phylink_speed_down before */ - phylink_speed_up(priv->phylink); - rtnl_unlock(); - } - rtnl_lock(); mutex_lock(&priv->lock);