Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp2880685rwo; Mon, 24 Jul 2023 02:48:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlHRt3qMDTE2FOv7dvMXZoPAL5P8cdTLujEhuTHn6EjJNmraZFonTmETqPyrJ4EwT4ciWJhS X-Received: by 2002:a17:906:1bb1:b0:988:71c8:9f3a with SMTP id r17-20020a1709061bb100b0098871c89f3amr9009590ejg.16.1690192118384; Mon, 24 Jul 2023 02:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690192118; cv=none; d=google.com; s=arc-20160816; b=G/6dNMp/Rw9CBz+tKGDyXPMICW4syji/hhfoGMCa86StqbmUTevQYGcW5kVZdzpjAV G3T8Ej7qidcBxUwOTiRj+pNe2BCkt+JOBJKyr/h9hr1EmfDymojcrjTzcUhZzHyc0XxZ 90BaZ6s7g00QJKocVHVuh0JQx+ze0uX+fxlzpFvOHL2Ld5P/aMum4e5Z+HDomOyoF+O/ qQTnhaCScc37e1wgxemJB1kpLkzIboFHmvuwiut3zouLkWFy9yyQ+0UfZgMFN9HoLHR+ WM3u/Wt8cg1R5gC466KEgjPFRu39rXIXd76lTWrtui+QLcSF7IgzrNJ815LrDy6DIMn0 k5IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nHwERRNohuUhZsb3fsbGJZNV/wqpb0sJjOXJGxj/gFU=; fh=eT6fHx2V5tgUAAeirWn2BFoNbp64/RkPFzpmwJa0b1Y=; b=lSeQh7rOpJTIdSZMOMgqmN8jcA43DWj7/CIJh6pAnbEG4nwBVlG6EMFSfqVP4Krhrz jPxHX7+r7phJmPIwvpwB8ERexEv7PypoP1Mk/0z/oLgJBeD8USRWgERa37gBvBc7N70a lKfbV2th3oMmvujTwfWQGYGTSwni2MUql48FQmMV2E18+ginhc3kr/T/qOZBNlJraNi6 FoZwALEW+JYFxXtP8hU5voCr+l3Rvq0RtATsnmCz57nqwkw7pVb9CQBh4wmkRk0T5ZjY HcCdJioGteQ52og2V9Y5wjNhhhXIs6ovrRqI3VKQHi+JvBGeb4nvA8Bp0Hp2q3m0W1kQ Sgvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=0eTCGmkF; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a12-20020a1709066d4c00b00992bf74c316si6087114ejt.974.2023.07.24.02.48.19; Mon, 24 Jul 2023 02:48:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=0eTCGmkF; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232240AbjGXJXi (ORCPT + 58 others); Mon, 24 Jul 2023 05:23:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230153AbjGXJXh (ORCPT ); Mon, 24 Jul 2023 05:23:37 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 079D8FD; Mon, 24 Jul 2023 02:23:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=nHwERRNohuUhZsb3fsbGJZNV/wqpb0sJjOXJGxj/gFU=; b=0eTCGmkFvYRanCjqIruUc+gFHD eb0YjlozDEULA37j7v5qY4zn7oNzSJHyKS6Mu3lubDRF2RaMczkF4f0lJh//Gw6lfNr0hipZSgCGS JIWlEQVkw7RyvqjD3Uxd4RuJG7sAceLde0p86r2jFr/kdLPlkftX1hnSBOxxVBlLMicc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qNrmC-0026m1-D4; Mon, 24 Jul 2023 11:22:48 +0200 Date: Mon, 24 Jul 2023 11:22:48 +0200 From: Andrew Lunn To: Evan Quan Cc: rafael@kernel.org, lenb@kernel.org, Alexander.Deucher@amd.com, Christian.Koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, johannes@sipsolutions.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, Mario.Limonciello@amd.com, mdaenzer@redhat.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, hdegoede@redhat.com, jingyuwang_vip@163.com, Lijo.Lazar@amd.com, jim.cromie@gmail.com, bellosilicio@gmail.com, andrealmeid@igalia.com, trix@redhat.com, jsg@jsg.id.au, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH V7 4/9] wifi: mac80211: Add support for ACPI WBRF Message-ID: <9b1f45f9-02a3-4c03-b9d5-cc3b9ab3a058@lunn.ch> References: <20230719090020.2716892-1-evan.quan@amd.com> <20230719090020.2716892-5-evan.quan@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230719090020.2716892-5-evan.quan@amd.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org > @@ -1395,6 +1395,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) > debugfs_hw_add(local); > rate_control_add_debugfs(local); > > + ieee80211_check_wbrf_support(local); > + > rtnl_lock(); > wiphy_lock(hw->wiphy); > > +void ieee80211_check_wbrf_support(struct ieee80211_local *local) > +{ > + struct wiphy *wiphy = local->hw.wiphy; > + struct device *dev; > + > + if (!wiphy) > + return; > + > + dev = wiphy->dev.parent; > + if (!dev) > + return; > + > + local->wbrf_supported = wbrf_supported_producer(dev); > + dev_dbg(dev, "WBRF is %s supported\n", > + local->wbrf_supported ? "" : "not"); > +} This seems wrong. wbrf_supported_producer() is about "Should this device report the frequencies it is using?" The answer to that depends on a combination of: Are there consumers registered with the core, and is the policy set so WBRF should take actions. The problem here is, you have no idea of the probe order. It could be this device probes before others, so wbrf_supported_producer() reports false, but a few second later would report true, once other devices have probed. It should be an inexpensive call into the core, so can be made every time the channel changes. All the core needs to do is check if the list of consumers is empty, and if not, check a Boolean policy value. Andrew