Thread (21 messages) 21 messages, 4 authors, 2023-08-14

RE: [PATCH V7 4/9] wifi: mac80211: Add support for ACPI WBRF

From: Quan, Evan <hidden>
Date: 2023-07-25 10:38:30
Also in: amd-gfx, dri-devel, linux-acpi, linux-wireless, lkml

[AMD Official Use Only - General]
-----Original Message-----
From: Limonciello, Mario <Mario.Limonciello@amd.com>
Sent: Monday, July 24, 2023 9:41 PM
To: Andrew Lunn <andrew@lunn.ch>; Quan, Evan <redacted>
Cc: rafael@kernel.org; lenb@kernel.org; Deucher, Alexander
[off-list ref]; Koenig, Christian
[off-list ref]; Pan, Xinhui [off-list ref];
airlied@gmail.com; daniel@ffwll.ch; johannes@sipsolutions.net;
davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
pabeni@redhat.com; mdaenzer@redhat.com;
maarten.lankhorst@linux.intel.com; tzimmermann@suse.de;
hdegoede@redhat.com; jingyuwang_vip@163.com; Lazar, Lijo
[off-list ref]; 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

On 7/24/2023 04:22, Andrew Lunn wrote:
quoted
quoted
@@ -1395,6 +1395,8 @@ int ieee80211_register_hw(struct
ieee80211_hw *hw)
quoted
quoted
   debugfs_hw_add(local);
   rate_control_add_debugfs(local);

+  ieee80211_check_wbrf_support(local);
+
   rtnl_lock();
   wiphy_lock(hw->wiphy);
quoted
+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
No, it's not a combination of whether consumers are registered with the core.
If a consumer probes later it needs to know the current in use frequencies too.

The reason is because of this sequence of events:
1) Producer probes.
2) Producer selects a frequency.
3) Consumer probes.
4) Producer stays at same frequency.

If the producer doesn't notify the frequency because a consumer isn't yet
loaded then the consumer won't be able to get the current frequency.
Yes, exactly.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help