Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2334560pxb; Sun, 15 Nov 2020 00:29:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxszIR2lQZzn9xZ5C/9hGVvHelXFLAxfvJHDE6uyk5L6O0jLABArpE4/TeFevORnjlWmxDl X-Received: by 2002:a17:906:29db:: with SMTP id y27mr5829945eje.179.1605428970255; Sun, 15 Nov 2020 00:29:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605428970; cv=none; d=google.com; s=arc-20160816; b=OTZUnb0TX/Atv9LxOvoDnSB+NjYbxaK5QkkICalwmWvtKDAN0F5PxW9wClpK/9iIlU DEAu3wSduWeHPOARW4gr4w6lsz93fxGYNezzsI2g7qmAQp8gaf8+x9mUSVJlijpBnRXP 4h2jiY/MSeIGgAXgIkOmio0/BB8lgtcEcJRNmTtGPO5uSxfvxn9ZYAw4+1vHDKRbUoIc oz7hZAbog+4oDq3KeDrUIAZKbCPofLf+UdXAcHSBWu/0pHD0+6zzKh4i/tH2uSXxSKAQ 56pZU3pNF2o/BbVJyAmv8gmMA24j++m5bRNrJdEYXh0fqstbVKwJd1cVWoXWRlqGluOo LEHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=6m8I8N0E7t8dvhokJc5RtCaLzKnD1KO9jNXsrKfHBmg=; b=rpRlF4zHqPW+O+XCIaIq7nsYhP9Mlcue3JEDH+Yu2MQNcY2LgzIuc8Q2nG+ODZUYcd Rb1u8GHj5/qnecn6uJAReVtEbeWU3R7AOABuIfTYSo2CAG++quxm+VDppBk53WArHaRZ +pkMGr2NX0DBfMaQ3ABA6wSkx49RIN9D/Jrg7I9ddjpQBmgzrPwjsQNqXAmQvrz2wNA9 RLMHkVaAYJ3j7MyL3XGRNcfLVrDBwReyowRi2Pn8D/rlvrEtssFQiWdZIkgNiglQ1k8Y PZ94QrfQgwpqePL8zTSG7d9UQo66OuMNyDR1cl42ceLmU84vZLNuXUurjznoe8JLccVr 2vug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m13si436534edv.80.2020.11.15.00.29.08; Sun, 15 Nov 2020 00:29:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726698AbgKOHjJ (ORCPT + 99 others); Sun, 15 Nov 2020 02:39:09 -0500 Received: from mga04.intel.com ([192.55.52.120]:52336 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726655AbgKOHjJ (ORCPT ); Sun, 15 Nov 2020 02:39:09 -0500 IronPort-SDR: wxyNbdlvlqA8m7aTpOn2KdYWc2WtMTLl4Ng1VPj1Rdj6voDAvkRzInkKgfWf1/jABgDdl8o73Y mJLeVbyaHJBA== X-IronPort-AV: E=McAfee;i="6000,8403,9805"; a="168050188" X-IronPort-AV: E=Sophos;i="5.77,479,1596524400"; d="scan'208";a="168050188" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.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 Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ong Boon Leong , Voon Wei Feng , Wong Vee Khee , Christophe ROULLIER 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(); -- 2.17.0