Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp151794pxb; Mon, 31 Jan 2022 17:58:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKN9G+dQrmYW5ENzb8vF9stkYknFCTzOfYEoo+HVsa1jQbaQd1iVfwupDUtkHrhROptcFe X-Received: by 2002:a17:907:3f97:: with SMTP id hr23mr18933048ejc.578.1643680718163; Mon, 31 Jan 2022 17:58:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643680718; cv=none; d=google.com; s=arc-20160816; b=em3G+cBAufsLABYSvJrHc6Emmy2ZMjTRi+hsgh2KfB9TGb93+BK2VD3vrlpuLiZkyw yZiHdEr4C+5UJceO1JWa00KO8rHpOz6zU/WTioBjzvHVTahexTFfAgwonP8OB1Dts8yS VSxIZQhZCcPFPxHZEw6M6ck5aErZALv3K4eO+xFVCiFdlS1PEgoMkrw4rSl+vPG9fQKd ZwC9iP4THbyh+6GJb1mEhZKN5Ubp3Rh2Tbk/kOyPPdWZX9eb2PKRS0K+fUG9qWqRTCGs GYd09mdAsTx6AUxw5irkPGzBT0R4jkXs803UsMS1LFjDPpdFZMgFrmFUSDgageFn4eCB 67tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:cc:to:from; bh=6cG3nvTvvdgj5JK5leIvOIupA9vp/qQRZfU829D5ilc=; b=pfo4kIECXmdT0XDxT8HjvE3ssAaAmcHw6bfRhZdgjQgl0VnLkGwc6PBRB6afcbO4sm H5LzxlT4ESlmMikQQfc/f3UyPOjmbjqiqn2PnRvTdTvSF7tSm3lq/+hFPmCpJZnFJzAA Cl1kn5SfgA8Nd5x4xVjyfhe/AInr7xDrsxQzGDi0n1ahrQWsgb6VS6zBEubAODDIcgXQ H6V682DFpAw4ZY0aVotjNVDB8azS28KDGPH71n0K5fNMTsw0zCuJbtEacUZ8oqTLHly8 KgXUM/UMdD5PVkTUYlukuWpI9EB7HleVs2UWidvHkdqBpkWXI8yJkHOVR05hAohBgvjP ++Kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw12si8905439ejc.992.2022.01.31.17.58.20; Mon, 31 Jan 2022 17:58:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237398AbiA2LQe (ORCPT + 71 others); Sat, 29 Jan 2022 06:16:34 -0500 Received: from paleale.coelho.fi ([176.9.41.70]:37880 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237233AbiA2LQc (ORCPT ); Sat, 29 Jan 2022 06:16:32 -0500 Received: from 91-156-4-210.elisa-laajakaista.fi ([91.156.4.210] helo=kveik.lan) by farmhouse.coelho.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1nDliY-0002ji-5V; Sat, 29 Jan 2022 13:16:31 +0200 From: Luca Coelho To: kvalo@kernel.org Cc: luca@coelho.fi, linux-wireless@vger.kernel.org Date: Sat, 29 Jan 2022 13:16:16 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220129111622.678447-1-luca@coelho.fi> References: <20220129111622.678447-1-luca@coelho.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on farmhouse.coelho.fi X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, TVD_RCVD_IP autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH 06/12] iwlwifi: mvm: align locking in D3 test debugfs Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg Since commit a05829a7222e ("cfg80211: avoid holding the RTNL when calling the driver") we're not only holding the RTNL when going in and out of suspend, but also the wiphy->mtx. Add that to the D3 test debugfs in iwlwifi since it's required for various calls to mac80211. Fixes: a05829a7222e ("cfg80211: avoid holding the RTNL when calling the driver") Signed-off-by: Johannes Berg Fixes: a05829a7222e ("cfg80211: avoid holding the RTNL when calling the driver") Signed-off-by: Luca Coelho --- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c index 9f0e436f11f3..a995bba0ba81 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -2697,7 +2697,9 @@ static int iwl_mvm_d3_test_open(struct inode *inode, struct file *file) /* start pseudo D3 */ rtnl_lock(); + wiphy_lock(mvm->hw->wiphy); err = __iwl_mvm_suspend(mvm->hw, mvm->hw->wiphy->wowlan_config, true); + wiphy_unlock(mvm->hw->wiphy); rtnl_unlock(); if (err > 0) err = -EINVAL; @@ -2753,7 +2755,9 @@ static int iwl_mvm_d3_test_release(struct inode *inode, struct file *file) iwl_fw_dbg_read_d3_debug_data(&mvm->fwrt); rtnl_lock(); + wiphy_lock(mvm->hw->wiphy); __iwl_mvm_resume(mvm, true); + wiphy_unlock(mvm->hw->wiphy); rtnl_unlock(); iwl_mvm_resume_tcm(mvm); -- 2.34.1