From patchwork Thu Sep 2 10:11:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 506993 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, 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 880C5C432BE for ; Thu, 2 Sep 2021 10:48:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 66B44610CC for ; Thu, 2 Sep 2021 10:48:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244634AbhIBKtv (ORCPT ); Thu, 2 Sep 2021 06:49:51 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:52760 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233801AbhIBKts (ORCPT ); Thu, 2 Sep 2021 06:49:48 -0400 X-Greylist: delayed 2247 seconds by postgrey-1.27 at vger.kernel.org; Thu, 02 Sep 2021 06:49:47 EDT Received: from 91-156-6-193.elisa-laajakaista.fi ([91.156.6.193] helo=kveik.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mLjgW-0003qO-1z; Thu, 02 Sep 2021 13:11:04 +0300 From: Luca Coelho To: torvalds@linux-foundation.org, johannes@sipsolutions.net, kuba@kernel.org Cc: kvalo@codeaurora.org, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, miriam.rachel.korenblitz@intel.com Date: Thu, 2 Sep 2021 13:11:01 +0300 Message-Id: <20210902101101.383243-1-luca@coelho.fi> X-Mailer: git-send-email 2.33.0 In-Reply-To: <635201a071bb6940ac9c1f381efef6abeed13f70.camel@intel.com> References: <635201a071bb6940ac9c1f381efef6abeed13f70.camel@intel.com> MIME-Version: 1.0 Subject: [PATCH] iwlwifi: mvm: add rtnl_lock() in iwl_mvm_start_get_nvm() Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Luca Coelho Due to a rebase damage, we lost the rtnl_lock() when the patch was sent out. This causes an RTNL imbalance and failed assertions, due to missing RTNL protection, for instance: RTNL: assertion failed at net/wireless/reg.c (4025) WARNING: CPU: 60 PID: 1720 at net/wireless/reg.c:4025 regulatory_set_wiphy_regd_sync+0x7f/0x90 [cfg80211] Call Trace: iwl_mvm_init_mcc+0x170/0x190 [iwlmvm] iwl_op_mode_mvm_start+0x824/0xa60 [iwlmvm] iwl_opmode_register+0xd0/0x130 [iwlwifi] init_module+0x23/0x1000 [iwlmvm] Fix this by adding the missing rtnl_lock() back to the code. Fixes: eb09ae93dabf ("iwlwifi: mvm: load regdomain at INIT stage") Signed-off-by: Luca Coelho Acked-by: David S. Miller --- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index 6f60018feed1..77ea2d0a3091 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -686,6 +686,7 @@ static int iwl_mvm_start_get_nvm(struct iwl_mvm *mvm) { int ret; + rtnl_lock(); mutex_lock(&mvm->mutex); ret = iwl_run_init_mvm_ucode(mvm);