Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3415099rdb; Sun, 10 Dec 2023 05:05:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHOKudoXEHffRGMxEJPqMzyladTG/IbQ5DP/EJsprddgHQO/R/mn6a/0nyzYkKZPlNa+3A8 X-Received: by 2002:a05:622a:92:b0:425:9a02:4d76 with SMTP id o18-20020a05622a009200b004259a024d76mr5041089qtw.30.1702213518412; Sun, 10 Dec 2023 05:05:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702213518; cv=none; d=google.com; s=arc-20160816; b=yNG/44RoG03WttyegYSOCW3SdvhrQt/X7kPXPGxYcDvD+cvkuUQ3E1ODef8TaokPFG Tsf0c4NBmV2S8cWXrsPXlQ5nj2BKI3KZOFYVqrmc0hosUGcGTdj1GtFVjtP5DgDh4mqI B1P20o7SwNPTFgeMcHgO69Ivddf8EGcPECdBNeef1QZSsB3L+cL3HcMNnt5/KhuP/8nA V/3p7NT0cX4Gaj1p9K7bQEoaIODi/5PtpGZmcLI/Fmy8XqlfjOjEFdbD6+rRcuGJO6pT 6hf38UdKQ1yFgyAUbd9JX/rW05jTW/uplUTJNosHJfJ3BxjNLfwnTbBzNj5v6ccROcBe M5dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:organization:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=ew3qCEFuygYZQEgetk39rpBolzFXas11OWTVdkrLBF8=; fh=3UyhT8MHEwNnD4YxhXQJEGuBJbCCW9VI4k+GgJ2r7Js=; b=KIuO0F9BXVdJoeLHdk9vPBPXnME0X4OEv/v/0uJNX4R68E9ZS7L7xm+P1BlQYyopMt EJ8Lh/3smssz6NL1Dd1/F1yMIPfgiSPQPRDnwvL1kJFUxG/Rt+yb13FJdT+Yho9u0pQ+ zLInmptx6Q+9/qQcvr9z1+ty5i1dB2Ex/42EYukLD7DGqKD9H0G8YzbKMGRtdA38Y3cR mmoYnHt6G1pDCVb53wQ8KzVUQ0OwruR0Py0WMNGWzMbWblW//juJj5xYtZ+uDG8CNqGZ y7Hi/5fCHdBkD4GXOugMH2eQP8YJCzAO36f3EJFC0b1UwYAyhf3aBBG5gBnHwTN2eWTr rr+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=fHdBDEWJ; spf=pass (google.com: domain of linux-wireless+bounces-598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-598-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w16-20020ac87e90000000b00425bf805d54si1818102qtj.199.2023.12.10.05.05.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 05:05:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=fHdBDEWJ; spf=pass (google.com: domain of linux-wireless+bounces-598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-598-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2FD0A1C20982 for ; Sun, 10 Dec 2023 13:05:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B98DD526; Sun, 10 Dec 2023 13:05:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fHdBDEWJ" X-Original-To: linux-wireless@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3E64C4 for ; Sun, 10 Dec 2023 05:05:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702213508; x=1733749508; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JqmiDlaAZ+gDyxapXv7YMx3OV/sjgctOJrjiKJtSZDw=; b=fHdBDEWJe0oy6xlaPEZ+o/jJ2S0irzdjcuTY/hyPAyA104xgiFYMb3g0 NNTVp9GA/f0XCQYHVfJa7FRPwrQW4DvM5npC/uKZ2zfblIyf0Rg/eBb9n PZFz+Prv5hYfG9NfbH3+BvVNAVFQtFXLhDtOKPXxqw0F7yg9e0jwvo70w /CMT+20WUbYemipbmyoXGBSQcWm/bXeOgOc+JuMYHB0LBVXIUHzjOYyWz 58hq46cCCYJnDqt4Cqfokq/bw2GNvbp2d/JyvMW/1GuQzQOZKl0pFH6IQ dvEYjKRrOWVkoBVl2YcmPpfrJjzN3mDUxIJGm04XMuxTUBNuvKnjxjyDr Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10919"; a="480745659" X-IronPort-AV: E=Sophos;i="6.04,265,1695711600"; d="scan'208";a="480745659" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2023 05:05:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10919"; a="748925496" X-IronPort-AV: E=Sophos;i="6.04,265,1695711600"; d="scan'208";a="748925496" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2023 05:05:06 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Greenman@web.codeaurora.org, Gregory Subject: [PATCH 03/14] wifi: mac80211: update some locking documentation Date: Mon, 11 Dec 2023 09:05:21 +0200 Message-Id: <20231211085121.24fa44c7eeb4.I8c9e030ddd78e07c99dd21fe1d5156555390f92e@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231211070532.2458539-1-miriam.rachel.korenblit@intel.com> References: <20231211070532.2458539-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited Content-Transfer-Encoding: 8bit From: Johannes Berg With the locking rework, more functions need to be called with the wiphy mutex held. Document that, and for that use the "Context" description that shows up more nicely in the generated documentation. Signed-off-by: Johannes Berg Reviewed-by: Greenman, Gregory Signed-off-by: Miri Korenblit --- include/net/mac80211.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 580781ff9dcf..aa8e1055fc3a 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -5809,12 +5809,11 @@ void ieee80211_set_key_rx_seq(struct ieee80211_key_conf *keyconf, * ieee80211_remove_key - remove the given key * @keyconf: the parameter passed with the set key * + * Context: Must be called with the wiphy mutex held. + * * Remove the given key. If the key was uploaded to the hardware at the * time this function is called, it is not deleted in the hardware but * instead assumed to have been removed already. - * - * Note that due to locking considerations this function can (currently) - * only be called during key iteration (ieee80211_iter_keys().) */ void ieee80211_remove_key(struct ieee80211_key_conf *keyconf); @@ -6368,12 +6367,12 @@ ieee80211_txq_airtime_check(struct ieee80211_hw *hw, struct ieee80211_txq *txq); * @iter: iterator function that will be called for each key * @iter_data: custom data to pass to the iterator function * + * Context: Must be called with wiphy mutex held; can sleep. + * * This function can be used to iterate all the keys known to * mac80211, even those that weren't previously programmed into * the device. This is intended for use in WoWLAN if the device - * needs reprogramming of the keys during suspend. Note that due - * to locking reasons, it is also only safe to call this at few - * spots since it must hold the RTNL and be able to sleep. + * needs reprogramming of the keys during suspend. * * The order in which the keys are iterated matches the order * in which they were originally installed and handed to the @@ -7435,6 +7434,9 @@ static inline bool ieee80211_is_tx_data(struct sk_buff *skb) * @vif: interface to set active links on * @active_links: the new active links bitmap * + * Context: Must be called with wiphy mutex held; may sleep; calls + * back into the driver. + * * This changes the active links on an interface. The interface * must be in client mode (in AP mode, all links are always active), * and @active_links must be a subset of the vif's valid_links. @@ -7442,6 +7444,7 @@ static inline bool ieee80211_is_tx_data(struct sk_buff *skb) * If a link is switched off and another is switched on at the same * time (e.g. active_links going from 0x1 to 0x10) then you will get * a sequence of calls like + * * - change_vif_links(0x11) * - unassign_vif_chanctx(link_id=0) * - change_sta_links(0x11) for each affected STA (the AP) @@ -7451,10 +7454,6 @@ static inline bool ieee80211_is_tx_data(struct sk_buff *skb) * - change_sta_links(0x10) for each affected STA (the AP) * - assign_vif_chanctx(link_id=4) * - change_vif_links(0x10) - * - * Note: This function acquires some mac80211 locks and must not - * be called with any driver locks held that could cause a - * lock dependency inversion. Best call it without locks. */ int ieee80211_set_active_links(struct ieee80211_vif *vif, u16 active_links); -- 2.34.1