From patchwork Sun Nov 15 07:42:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wong, Vee Khee" X-Patchwork-Id: 11905995 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 E3CC5C2D0E4 for ; Sun, 15 Nov 2020 07:40:13 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 6E2DA2240B for ; Sun, 15 Nov 2020 07:40:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="y92bJH+X" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E2DA2240B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Agt3yNNm768aHNjxwiqeMjIlzaLKMY9xGfyF/ExyCME=; b=y92bJH+XJMbXLs3oz9LjtGyBLq XQGHP2hcq3gUeUV826TM6QEsvEr/amHt33TYMEAADjXK0HzgOJU77McNTpwftPk9YrnWoM1q3FP0C 0KRoDrp/JoyQm0ClE5R/Yfi9GmTmhDrs3L1v1ZI7tMYtpD+9ESny4hni/y6Ty+/CqXNr55COQhMlR Ex6E/VE4Ua0q7SdfU0tGCMqtJw7PFkoJ/Zs7JhzX893OOBmOoahUUNa/TqbslSvR2PYWXGmrsURNC meAep8qAKeK+Ta7FRsGpSwA1+bT0PZ199DGEYgGrgAoXvZqlNdc+Bzqfq1vq6DxwugvNlRFr6gh1u RtJfJcDQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1keCd5-0006ML-1X; Sun, 15 Nov 2020 07:39:19 +0000 Received: from mga09.intel.com ([134.134.136.24]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1keCd2-0006Ls-Br for linux-arm-kernel@lists.infradead.org; Sun, 15 Nov 2020 07:39:17 +0000 IronPort-SDR: F8dPyXWTvdIK4zw6bvtub2a4s0eQIKnUL/YpHUOyIiCC7xC3CfPVlQnwrWelftNTqw4RqpE64b AAM3qWusfl0Q== X-IronPort-AV: E=McAfee;i="6000,8403,9805"; a="170796698" X-IronPort-AV: E=Sophos;i="5.77,479,1596524400"; d="scan'208";a="170796698" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2020 23:39:08 -0800 IronPort-SDR: 1PWLKPx+ILB4Z7PKdGv3btmqqAenr4VbrHzlnTFWgn38go0Cbgb4borWqG52M6ZoGMt2mFoDkq GoXTj+qfzNmw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,479,1596524400"; d="scan'208";a="367367170" Received: from glass.png.intel.com ([172.30.181.98]) by orsmga007.jf.intel.com with ESMTP; 14 Nov 2020 23:39:04 -0800 From: Wong Vee Khee To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Jakub Kicinski , Maxime Coquelin Subject: [PATCH v2 net 1/1] net: stmmac: Use rtnl_lock/unlock on netif_set_real_num_rx_queues() call Date: Sun, 15 Nov 2020 15:42:10 +0800 Message-Id: <20201115074210.23605-1-vee.khee.wong@intel.com> X-Mailer: git-send-email 2.17.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201115_023916_559017_30AF4CC9 X-CRM114-Status: GOOD ( 13.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Voon Wei Feng , Wong Vee Khee , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Christophe ROULLIER , Ong Boon Leong , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix an issue where dump stack is printed on suspend resume flow due to netif_set_real_num_rx_queues() is not called with rtnl_lock held(). Fixes: 686cff3d7022 ("net: stmmac: Fix incorrect location to set real_num_rx|tx_queues") Reported-by: Christophe ROULLIER Tested-by: Christophe ROULLIER Cc: Alexandre TORGUE Reviewed-by: Ong Boon Leong Signed-off-by: Wong Vee Khee --- v2 changelog: - Move rtnl_lock() before priv->lock and release it after to avoid a possible ABBA deadlock scenario. --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index ba855465a2db..c8770e9668a1 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -5272,6 +5272,7 @@ int stmmac_resume(struct device *dev) return ret; } + rtnl_lock(); mutex_lock(&priv->lock); stmmac_reset_queues_param(priv); @@ -5287,6 +5288,7 @@ int stmmac_resume(struct device *dev) stmmac_enable_all_queues(priv); mutex_unlock(&priv->lock); + rtnl_unlock(); if (!device_may_wakeup(priv->device) || !priv->plat->pmt) { rtnl_lock();