Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1142872pxb; Fri, 6 Nov 2020 02:00:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJysr1+sVFJ63nbKdHm0FpfISq2vtspwtz1NkwHsJ2txOIbrq1vrfedrBx1N+HE8hrZAaMzt X-Received: by 2002:aa7:dd17:: with SMTP id i23mr1151674edv.276.1604656858076; Fri, 06 Nov 2020 02:00:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604656858; cv=none; d=google.com; s=arc-20160816; b=FEUHMmKUR8UtQ9Ah+ahYUt7yS+0VSp9z3BsxUrourHhMfXlW0CVWyc0TlxLltUU1Ak 309aZM1LCMUdtWF53PB5hBYYDD7X5yfKspIrE+X8MNWu1vOdWahQmmOS6xEcKdmYkauh yKumZ48bgt1d5mTzUXqYunclIgckAXuIEhQ3l/LAj83UqptjcXay+XSPaJ44cDh0QzTX 6Mvp9/pBL48jJSC5HykNzhNoBNv8AcLV8OPn/2SciDpNzdcTiVtRtiI18ODREKHYBWF2 hlxpAk6QIJUAKThFlXNmTdj86miZIxwCIhLyolYdgUtvzublwrF8GRYCJkO710ydPT84 YNBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=g3NuoR1GFqAXStjAaqpTXaINKhACeTFquFJekVJbJJc=; b=j71VTDpqfsRmDP4h4lk6n+JeY7xXL54v4BAGYM7j16IUO3HHgh9BtOmB4Qe6weyQrW b4syyLA4wKEi/v7TWIxyLwOWsBpfOjKJrDF7hLkmUQ3F50KSbjvJ/0pmSs1pCegSgVRk sThLzpO8lHl2gcV+AiuS8MgLmXgyjAwodmtC5hz8wApasyFMCVGlXSa+I4+OoXu6EAs9 Pzo7xggVTptrNdXBnU8aqamG+4uD+s2fwE8z3HFoGNU079iKrHyJyBaXow5X0iG/3I+K mRCqxXhrPVkdl53ene3mUR2dYQ4dVP1VpS68Qf25LKQmc4J49zl9xHdYltUKJrSDz9jF FhtA== 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 bq23si496403ejb.529.2020.11.06.02.00.33; Fri, 06 Nov 2020 02:00:58 -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 S1726600AbgKFKAX (ORCPT + 99 others); Fri, 6 Nov 2020 05:00:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726074AbgKFKAX (ORCPT ); Fri, 6 Nov 2020 05:00:23 -0500 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CF6AC0613CF for ; Fri, 6 Nov 2020 02:00:23 -0800 (PST) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1kayXd-002DDq-BR; Fri, 06 Nov 2020 11:00:21 +0100 Message-ID: Subject: Re: [PATCH V6 2/3] mac80211: add support for BSS color change From: Johannes Berg To: John Crispin Cc: linux-wireless@vger.kernel.org Date: Fri, 06 Nov 2020 11:00:20 +0100 In-Reply-To: <20201103092244.1925158-3-john@phrozen.org> References: <20201103092244.1925158-1-john@phrozen.org> <20201103092244.1925158-3-john@phrozen.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, 2020-11-03 at 10:22 +0100, John Crispin wrote: > > @@ -6805,4 +6822,15 @@ struct sk_buff *ieee80211_get_fils_discovery_tmpl(struct ieee80211_hw *hw, > struct sk_buff * > ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw, > struct ieee80211_vif *vif); > +/** > + * ieeee80211_obss_color_collision_notify notify userland about a BSS color > + * collision. missing a "-" here > +static void ieee80211_color_change_bss_config_notify(struct ieee80211_sub_if_data *sdata, > + u8 color, int enable, u32 changed) > +{ > + sdata->vif.bss_conf.he_bss_color.color = color; > + sdata->vif.bss_conf.he_bss_color.enabled = enable; > + changed |= BSS_CHANGED_HE_BSS_COLOR; > + > + ieee80211_bss_info_change_notify(sdata, changed); > + > + if (ieee80211_hw_check(&sdata->local->hw, SUPPORTS_MULTI_BSSID_AP) && > + !sdata->vif.multiple_bssid.parent) { > + struct ieee80211_sub_if_data *child; > + > + rcu_read_lock(); > + list_for_each_entry_rcu(child, &sdata->local->interfaces, list) { > + if (child->vif.multiple_bssid.parent != &sdata->vif) > + continue; > + sdata_lock(child); Err, you can't lock a mutex in an atomic context opened by rcu_read_lock(). I guess you can just take the iflist_mtx or something, but this certainly doesn't seem right. Also, since it's being called under sdata_lock(parent), it'll need some lockdep annotations to be able to do this. > + child->vif.bss_conf.he_bss_color.color = color; > + child->vif.bss_conf.he_bss_color.enabled = enable; > + ieee80211_bss_info_change_notify(child, BSS_CHANGED_HE_BSS_COLOR); And the driver is also allowed to sleep in this IIRC, so you can't call it under rcu_read_lock(). johannes