From patchwork Thu May 20 12:51:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 12270241 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,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 5234DC433ED for ; Thu, 20 May 2021 12:57:55 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D40D66101D for ; Thu, 20 May 2021 12:57:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D40D66101D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nr94dx7YIeSUIm7pcWQI9PyZ73r5iUy8Aa8GXtbn/xM=; b=N1Hz3RQY9y50gOe2aJAJWLyTR7 BymWv+rvARQanvtkwsz9SQHmFNvRfNv3O15j0GU1etofGtmiulQWT1RWi189Zd84sVa2qA3XmCoua IQvwyqKQdWIh7Fnms2yt2itrHnKLE+1AxhSMsLV1edaZnbYCTIlcON2tQ1trhzh/j2pZR5gR37Ppw JHf2G1oNGtZ/fiDe3ql3+USgPHCFRSrwkHs5t4VGbet2pitPU6mkseR0OjTQTg/fGP0KjegZR876S 7AX2DfKNsWh2/xZtHSJNQo4ZZ55HdY2V8y9hQfkYsQsnZXacbdijnC5Vpb+C1+Pb5OMZbjw41Z2xm L3+/sRsg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljiDa-00124P-2I; Thu, 20 May 2021 12:56:02 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lji9G-000z1C-27 for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 12:51:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=MIME-Version:Content-Type:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=OyCKQUw31Te1w2jaesK0wy8ITcci/llwDmppkE83LC8=; b=O7KSq+7Rxzqgm6nqGmURJIZoFd +jat28PvbfnOsBiLLpwPJqkzSemXhwb0hDKKlN+t/S56n9AqUF5fXpw2seE+gtoDIjigL8AvTF1L2 0VrU6cJuX+GlZOwLUgpAln2uS6ZTg8r76/NyXUUYMPdM+s73PSRRQB6SDneTVDMUhDgL3TbxD7Bnq 9ai6cNPnSXZIx9BQhLAMV1aZTY1YqZ2eF+nlxOZiewg6eAwUZl9l+X4fTh7Kx4RZ7SqwfbPukFP1w AwGge2OtrzHSv1b1BAqFOptuzFoW62geukRNVjM0hj4+gwm8Ro3wjHW4Cv3rRVppmvODfYJK5z/ss KrtlqTMA==; Received: from mail-am6eur05on2059.outbound.protection.outlook.com ([40.107.22.59] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lji9D-00GL5j-Gr for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 12:51:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oLRAMgOYPEI+JfVrAbQulgbvn/++nH8gtz4hldHdMrrxobSMk2zguzJ6jfB+xWa5a6hgQwYLTiZtLJV2blB8vMSb10wpxVWukAg+1pf+cifl9IcKxFQzY+YKycDTFq8wMTw+OQXiK//6bPyIopsf5czztXW+ODgQIutCsOIg8V+K8IoDuGomTs7U0slFvA8CHMrU6gfoUjUjQs3P0FhgptEXvzKzi31Ml8f+hw3dB4Ck7+YfmLAnYj5NTfGAWLNraEBIA/xbBcqH+lONg3NAZ+TZMzz9eZ4oIvbl4wv14Og9yfZB2aUZ5R3Z5c9veKun43GhzRuUG2DvHO8Few6Pkw== 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=OyCKQUw31Te1w2jaesK0wy8ITcci/llwDmppkE83LC8=; b=Xuq3RGxLJE8K5jf48oDzQQIZyyu+00EVaqKxiVfRG+zpOmiG42lRMqcoctenSuG4L05AtDXk2MHswLS8qt2lCsn0MC63h1i1qIpolXq8TuWiiUady9LuSlfehficeF8UiKrRT3SurZd+zErh4/9oZomMgmwE4TFiFLAt85rtEM9BdGqnDrW8h2FTMnipjk5HVE9OM7b7h11sP/+3H2fPwTU5mNHnODfsAdcwBN9vhoYCVVu84hjs7ve5sT/qkVkhB1Ho2ohff0HWpxjlwJmj0Uj9+yHUCnq48oajqgwLJo4sZPvATuKg2pyud87LyyiN5WgIOBHMwp/tAlhNu9KHbw== 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=OyCKQUw31Te1w2jaesK0wy8ITcci/llwDmppkE83LC8=; b=J4nVDSR7x7fK4ivEXHPUNbkWWE3kpas+OjlPZweMfIRQ1OA7JIaUEfnK9a8RrkxBDZ2kDaNISQOcTgarTfEq22rppAtYSiw9KqZgLzG3mUKkChWHRO+PPDjymUjy+8MtOiDKnIHEt5KQXezYXRiUBFSI0wgXCOWkvd3UJWEqbfg= Authentication-Results: st.com; dkim=none (message not signed) header.d=none;st.com; dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) by DB8PR04MB6345.eurprd04.prod.outlook.com (2603:10a6:10:106::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23; Thu, 20 May 2021 12:51:27 +0000 Received: from DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::3400:b139:f681:c8cf]) by DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::3400:b139:f681:c8cf%9]) with mapi id 15.20.4129.034; Thu, 20 May 2021 12:51:26 +0000 From: Joakim Zhang To: peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, davem@davemloft.net, kuba@kernel.org, mcoquelin.stm32@gmail.com, andrew@lunn.ch Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH net 1/2] net: stmmac: correct clocks enabled in stmmac_vlan_rx_kill_vid() Date: Thu, 20 May 2021 20:51:16 +0800 Message-Id: <20210520125117.1015-2-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210520125117.1015-1-qiangqing.zhang@nxp.com> References: <20210520125117.1015-1-qiangqing.zhang@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR06CA0095.apcprd06.prod.outlook.com (2603:1096:3:14::21) To DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR06CA0095.apcprd06.prod.outlook.com (2603:1096:3:14::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.32 via Frontend Transport; Thu, 20 May 2021 12:51:23 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cafbf416-0caa-46e6-d020-08d91b8dfb06 X-MS-TrafficTypeDiagnostic: DB8PR04MB6345: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:151; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kD+qDhAe2R4q6IB3Hway5ALYSkJYZdVbGm7OFtIIIjh9nezmHfPJmtU2Td5XJ6cuWz5yMWwz6hwofIVk5iz0agce8QXa3riiT5CHVuSOyuTDGpWzhfz4p1ixb0+KNSxDk2dxwVeDA98KVGZpdVIwDJ/t05sOxz/YphJJHoeaBO3xOHwVIJ3y3rwuQuiwAuhOSGwOqVJ96ZIooG7ZJ/hfxbEi7q9/a4nBJ/HGUwaWriBurKN6n56En4paPKSOS9P5321Aox2iEQmSmK5POeB87+jfvB5XSaxzlU4H9C9YxPwBg3IVtNqf9jXww0VMkaqkfGGujmttrfaQ9KBQ9KiCfMrvE0NSQMhOq0fRWU2xp7Vsij+idEyzrkO7CnRc+ps3OfXJueVedJzMnzn3eqWG5zAEzz029SUmuRQoEM6Gx5Bcr6y4HAEIknR6ja0qsZKC1kZSoV1wZSX/JNfajDMwn4xOgABP7pguaXVAoyo+6OjBab3pwt2PswQK7P9YBPgtlDR/m6LSJYTwQeTu7biB1CAvjkbDqkg3pgsE2Ygj8aHkgrZkoJ1JxTLJKA5IRwC+f0Xg3c50YE1s9IzW4kA49+UbtHo04LUMDGL9zFmgoAAA/4n//qWS7L68nGM/55h0i8z/es2ZiSa8InkR9lx6LNgHnewhtDiod3X5VZ/dAAXYLSXE2WVqkOZQdtLTxbN1 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR04MB6795.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(346002)(396003)(366004)(136003)(8936002)(38100700002)(38350700002)(6512007)(956004)(36756003)(52116002)(4326008)(8676002)(7416002)(1076003)(6506007)(5660300002)(86362001)(316002)(26005)(83380400001)(478600001)(2616005)(66946007)(6666004)(66476007)(66556008)(6486002)(2906002)(186003)(16526019)(69590400013); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: qeK/tXs4I++ScpCO6clqbbkQvB+xS9nnRGf8K3rwA1WpYqsAonp0cm2w+49iEYtTfDwrj6j4K8Rxs2deoZU2+IAXRJuZ6bgwbe3l51hFAhgl0pEYDELnpamrQK6bh7nn3diasitJe01Ozdtwcs+XTMxopy04heVmKh/PmWU7x1O0/ZV7PxwlWe5hyh8q6ryqlTk7NZi78PVAnzIui8JOz711SDZ8GkvAPKlBF7rggfsJ83Y58JNS58R0AuppKKSGQ4AuSdkZdIH8ap9joyFlizBy1ZPwMG3ilsC0bDCrosU60g7yeWPjDNd0Ah9t+YLpUAgdoqx5eXx9vcz3v41tbTVh8CB3/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exchange-CrossTenant-AuthSource: DB8PR04MB6795.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 12:51:26.8459 (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: JUS6XcjLH+AsR9CiYEqLJ8kwfUA2AYnC9WRsUZHyCkznw54KnKovczhYfIa6C/9dcgBXKGZMDOzC+c/B2ZBvIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6345 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210520_055131_583762_FDB147A0 X-CRM114-Status: GOOD ( 13.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This should be a mistake to fix conflicts when removing RFC tag to repost the patch. Fixes: 5ec55823438e ("net: stmmac: add clocks management for gmac driver") Signed-off-by: Joakim Zhang --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index fea3bf07ae89..df4ce5977fad 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6191,12 +6191,6 @@ static int stmmac_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid bool is_double = false; int ret; - ret = pm_runtime_get_sync(priv->device); - if (ret < 0) { - pm_runtime_put_noidle(priv->device); - return ret; - } - if (be16_to_cpu(proto) == ETH_P_8021AD) is_double = true; @@ -6222,6 +6216,12 @@ static int stmmac_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vi bool is_double = false; int ret; + ret = pm_runtime_get_sync(priv->device); + if (ret < 0) { + pm_runtime_put_noidle(priv->device); + return ret; + } + if (be16_to_cpu(proto) == ETH_P_8021AD) is_double = true; From patchwork Thu May 20 12:51:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 12270243 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,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 41C52C433ED for ; Thu, 20 May 2021 12:58:44 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C3AD861004 for ; Thu, 20 May 2021 12:58:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3AD861004 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZzFxHWuv0znSNGVW1DhASoQSXlddZWaX+cumkFUbmcU=; b=ET9H9w2oymjuomkS1dt5/mdC9u yrAI/gRg4i9wlskNkqytLbg3ZrZhyWaWrkrK5Og4JPvvUL5To7ybKp/sVvhP5IZbTsrLfOmfhbCNb m8a0nXsXPlKsKG/uXWueGegRN/gEARhUWUs1MIzmWIlFU603GFg1yp4r0Wi1df7H3lJwrEydfaKMI YSOmeYLpcZ/p+MiCnfkqhU5gsYMfImds2wzPtxeuajAv0s0YHBFObNmW8r9FPl0AIhMyodc6Uah77 NWEuqDAkZ50YBgvRGJtt/YkfkrHzTnnMIHrVQiIz9qe1jzSx6pOrAwD52i/1Zyog40GuLbwhRHrdW k2XozwWw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljiEE-0012WH-4J; Thu, 20 May 2021 12:56:43 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lji9H-000z2G-OP for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 12:51:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=MIME-Version:Content-Type:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ipw5TmPIB0VYSze72pR/m0DdVCMChjEwVDAkFx+bL50=; b=nXxCng1ZFvGBIGEZkzpEKdvjC6 7CMQBiXWVDyAFzChl2ZzpKE7MsvmvCkSqKobDyYgFm5dZ7Zu802kFmHzcbES3J+1a8aCPrRNGbDR4 3viP+kYMjnH6NEPPNqj9dhlNtCpFHsHeODgC7ExMqt6pWpHdnafGMnbUqzicX7HV4+dEYkXcGebe7 PfUHTs/bOXwLQCLChjaFCnYBHhHdm1+BoG47OwfL8jOloiVEcMOrWKoopBc1xa6/mh3amsBlu/Wkv zdhgqy4aA9pBY6gORVHvwozGyqCbeoG0ox0eHvMjMKaY1tiUwYcTJtTfjPmJJTNzidD3nFTiGIf1M lFgcCiAQ==; Received: from mail-am6eur05on2059.outbound.protection.outlook.com ([40.107.22.59] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lji9F-00GL5j-3T for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 12:51:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nvWvog/jAXZ+CHu0aKRfssGnwb6nKs+9GD04HaiNpqTOU69f4rnIU32Lg1mA9df9kV3d9MO3mD9cEAr9gqyvnl8PkJD5/+2flJ5XQX1taziXNKf/ks4BGfT2zzPuydKHoDUWB5W55WG8+aK36MgoYYdf3pKUsgVrbwKZkhrJJPvRvh0tVHvc+5fcrxf4XneZ/kRQkv1atjux+u0Jw6jklG7KXPR40w3yHDNZ4rKqywdHQURIu/TX1iAScL38yklWOfeDeG0r+cNJcwN7PA2HoN0V/POacWYCXU3R2ScKM5zDNB+jZ3oUtI4W+8yKlYyRdR9JI8nwR+U+ftt318r46g== 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=ipw5TmPIB0VYSze72pR/m0DdVCMChjEwVDAkFx+bL50=; b=OC4a9FwypnPVZN0Eas7tTjxGTKnDpR00RZQSquCiUIrNhFhqeswBAsgvUz+h7m1veVD9UB/7CcTMvsttjwMLHnmfGvbsw8o/qlLiJeajKgREArxCqJEjScSfg0bG7NKqu61FydAUYGIj3Nc47+GgzqLp09cZRVkZWR3EMZ1141QnSymSl/3ELaVUlZ8HcCId15A8XMFfelkXUQ7dwJKagfHs6dmdDptUXQDWy3Elp6EYa0FLLRSlMTWFAa3XGyHwfIKUPkIU+AOE/erLx8d56kI0oLLlzNDe/eZc6BIFlQG1FAzPv0Ag+LnQxfurhoZaFd7emyoIwjWNK1qZAJ3XMg== 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=ipw5TmPIB0VYSze72pR/m0DdVCMChjEwVDAkFx+bL50=; b=GjaYId9aPEM0ICJgHtPwNDGvL/zxvhyEwVUneQwHtyCgMnlAkwDLLCg+nkutbdF3yEqXIrWDEGY136k0HD4DFhepthDj7dGvfNbOpoueKzLEhgmcje/n3+qaerZDRXakQ5vKOhjwgWCw5YR/dkXERU5uVH9Z3UC3a2/c1cp3w6w= Authentication-Results: st.com; dkim=none (message not signed) header.d=none;st.com; dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) by DB8PR04MB6345.eurprd04.prod.outlook.com (2603:10a6:10:106::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23; Thu, 20 May 2021 12:51:30 +0000 Received: from DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::3400:b139:f681:c8cf]) by DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::3400:b139:f681:c8cf%9]) with mapi id 15.20.4129.034; Thu, 20 May 2021 12:51:30 +0000 From: Joakim Zhang To: peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, davem@davemloft.net, kuba@kernel.org, mcoquelin.stm32@gmail.com, andrew@lunn.ch Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH net 2/2] net: stmmac: fix system hang if change mac address after interface ifdown Date: Thu, 20 May 2021 20:51:17 +0800 Message-Id: <20210520125117.1015-3-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210520125117.1015-1-qiangqing.zhang@nxp.com> References: <20210520125117.1015-1-qiangqing.zhang@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR06CA0095.apcprd06.prod.outlook.com (2603:1096:3:14::21) To DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR06CA0095.apcprd06.prod.outlook.com (2603:1096:3:14::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.32 via Frontend Transport; Thu, 20 May 2021 12:51:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 99d00032-fe4c-465e-096e-08d91b8dfd66 X-MS-TrafficTypeDiagnostic: DB8PR04MB6345: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: weWILU04lxGfCL0thB8HM/nIBV9YKzWKFOmWJCLGAG4Q6kjUoh4WgbGHZrVxmlybLXyClzwbi97zK2PQTJb0ixEwCMi5KAoj9pSUKPcGTKNVRyYxxq0+KlNJCCVO9o0mXip6M7mScBk1o2d4Lb1fHgN/G+hytJN+cZBGhFs08FymOsUMXRxxnhu4mECer2gyZ2dLTty1Iohfl7amEynL0v0DzfV/zpe5+sPJ0EFSDOxy92nmrfZcVBl6Zw1644B64egOfmJ3R5zkAAhJ2NYu8WCcAxpZlWntc4gnhqP4dWRnOhqiVJPriuutjH8j26lCrTpebPTSQpJ1HWEfns6AlZvc5zEu5w58z6FWSe+PXydPwsBa0GDUOqSDTM8hjZd3v5McP7Dg5G2nIj+IPNvoWAD6P/qCAPumpaSUff21DM7Bcuj2u02o/Z8OzoXdabiQwxiyIwcTE8UmnH/4FRhctWfT5x0LNL+FqsafoDofW7/04+eFxqhUg2TwGIjRz5DB14cIKF6DgcpU76SLYCgYJxt7gHED4v5eVELK5AgcwxPCBzQ4nQ0slKzXnsvQk2OCh9kN/HXnX43O9Z26Re9eTvPH7UHxB3xqV80k/ww8As/JJ9LhBytuDUoobcffS431uy1ksHcQZiDZLjOiMfh+ei/sQ3roS3CGnIQPmQ9kZuGLmW7F6CQTcSgvarr5L1fJ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR04MB6795.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(346002)(396003)(366004)(136003)(8936002)(38100700002)(38350700002)(6512007)(956004)(36756003)(52116002)(4326008)(8676002)(7416002)(1076003)(6506007)(5660300002)(86362001)(316002)(26005)(83380400001)(478600001)(2616005)(66946007)(6666004)(66476007)(66556008)(6486002)(2906002)(186003)(16526019)(69590400013); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: o6K9mIckWmq9UfBF+Re6uwQWly3wynROghxGs0eDu4DhZEKe5ttB5WSq/TaSnkQ6bmiRL9vVTSiQfr5cvfO+SjcEBhnI1g3XTKVCdhKukrkN5JGRq85omv+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RiTnJfhP/bhJ/SbxRRZ2ZCjdga0syPOFMkkCWoX9pqtkxtlut8sserwzCtLrzfmeQyiwr1v4tz8uBp6p93zBiAa4QngjpkMp6kZAq/kfr2oBu0XI1snDCIlfGKiRVI1XhG5YZkZxHdj9bGHQpboPpsTl X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99d00032-fe4c-465e-096e-08d91b8dfd66 X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB6795.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 12:51:30.8383 (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: uTWExuoGviA1rfE5TZIinm7rcpC720G2X3nHuuw3UDUFdR82FnW22CG6f9AevWaoUE2OBUh1yiFpUNWUWfgfXA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6345 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210520_055133_166537_98844E69 X-CRM114-Status: GOOD ( 12.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix system hang with below sequences: ~# ifconfig ethx down ~# ifconfig ethx hw ether xx:xx:xx:xx:xx:xx After ethx down, stmmac all clocks gated off and then register access causes system hang. Fixes: 5ec55823438e ("net: stmmac: add clocks management for gmac driver") Signed-off-by: Joakim Zhang --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index df4ce5977fad..5d956a553434 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -5891,12 +5891,21 @@ static int stmmac_set_mac_address(struct net_device *ndev, void *addr) struct stmmac_priv *priv = netdev_priv(ndev); int ret = 0; + ret = pm_runtime_get_sync(priv->device); + if (ret < 0) { + pm_runtime_put_noidle(priv->device); + return ret; + } + ret = eth_mac_addr(ndev, addr); if (ret) - return ret; + goto set_mac_error; stmmac_set_umac_addr(priv, priv->hw, ndev->dev_addr, 0); +set_mac_error: + pm_runtime_put(priv->device); + return ret; }