All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "mac80211: add parse regulatory info in 6 GHz operation information"
@ 2023-08-21  8:59 Johannes Berg
  2023-08-21  9:06 ` Johannes Berg
  2023-08-23 21:12 ` kernel test robot
  0 siblings, 2 replies; 9+ messages in thread
From: Johannes Berg @ 2023-08-21  8:59 UTC (permalink / raw)
  To: linux-wireless; +Cc: Wen Gong, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This reverts commit cb751b7a57e5 ("mac80211: add parse regulatory info
in 6 GHz operation information") which added a station type bss_conf
assignment in a parsing helper function, which will corrupt mesh data.

Fixes: cb751b7a57e5 ("mac80211: add parse regulatory info in 6 GHz operation information")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/net/mac80211.h |  2 --
 net/mac80211/util.c    | 14 --------------
 2 files changed, 16 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 3a8a2d2c58c3..813d4a654470 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -637,7 +637,6 @@ struct ieee80211_fils_discovery {
  *	interval.
  * @beacon_tx_rate: The configured beacon transmit rate that needs to be passed
  *	to driver when rate control is offloaded to firmware.
- * @power_type: power type of BSS for 6 GHz
  * @tx_pwr_env: transmit power envelope array of BSS.
  * @tx_pwr_env_num: number of @tx_pwr_env.
  * @pwr_reduction: power constraint of BSS.
@@ -746,7 +745,6 @@ struct ieee80211_bss_conf {
 	struct ieee80211_fils_discovery fils_discovery;
 	u32 unsol_bcast_probe_resp_interval;
 	struct cfg80211_bitrate_mask beacon_tx_rate;
-	enum ieee80211_ap_reg_power power_type;
 	struct ieee80211_tx_pwr_env tx_pwr_env[IEEE80211_TPE_MAX_IE_COUNT];
 	u8 tx_pwr_env_num;
 	u8 pwr_reduction;
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 8a6917cf63cf..7bd3b64ddac6 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -3841,7 +3841,6 @@ bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_sub_if_data *sdata,
 	const struct ieee80211_sta_eht_cap *eht_cap;
 	struct cfg80211_chan_def he_chandef = *chandef;
 	const struct ieee80211_he_6ghz_oper *he_6ghz_oper;
-	struct ieee80211_bss_conf *bss_conf = &sdata->vif.bss_conf;
 	bool support_80_80, support_160, support_320;
 	u8 he_phy_cap, eht_phy_cap;
 	u32 freq;
@@ -3894,19 +3893,6 @@ bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_sub_if_data *sdata,
 					      NL80211_BAND_6GHZ);
 	he_chandef.chan = ieee80211_get_channel(sdata->local->hw.wiphy, freq);
 
-	switch (u8_get_bits(he_6ghz_oper->control,
-			    IEEE80211_HE_6GHZ_OPER_CTRL_REG_INFO)) {
-	case IEEE80211_6GHZ_CTRL_REG_LPI_AP:
-		bss_conf->power_type = IEEE80211_REG_LPI_AP;
-		break;
-	case IEEE80211_6GHZ_CTRL_REG_SP_AP:
-		bss_conf->power_type = IEEE80211_REG_SP_AP;
-		break;
-	default:
-		bss_conf->power_type = IEEE80211_REG_UNSET_AP;
-		break;
-	}
-
 	if (!eht_oper ||
 	    !(eht_oper->params & IEEE80211_EHT_OPER_INFO_PRESENT)) {
 		switch (u8_get_bits(he_6ghz_oper->control,
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "mac80211: add parse regulatory info in 6 GHz operation information"
  2023-08-21  8:59 [PATCH] Revert "mac80211: add parse regulatory info in 6 GHz operation information" Johannes Berg
@ 2023-08-21  9:06 ` Johannes Berg
  2023-08-21 10:36   ` Wen Gong
  2023-08-23 21:12 ` kernel test robot
  1 sibling, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2023-08-21  9:06 UTC (permalink / raw)
  To: linux-wireless; +Cc: Wen Gong

On Mon, 2023-08-21 at 10:59 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> This reverts commit cb751b7a57e5 ("mac80211: add parse regulatory info
> in 6 GHz operation information") which added a station type bss_conf
> assignment in a parsing helper function, which will corrupt mesh data.
> 

Ah crap this won't work, rtw89 already uses this.

Wen please send a fix for this ASAP.

johannes

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "mac80211: add parse regulatory info in 6 GHz operation information"
  2023-08-21  9:06 ` Johannes Berg
@ 2023-08-21 10:36   ` Wen Gong
  2023-08-21 10:57     ` Johannes Berg
  0 siblings, 1 reply; 9+ messages in thread
From: Wen Gong @ 2023-08-21 10:36 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless

On 8/21/2023 5:06 PM, Johannes Berg wrote:
> On Mon, 2023-08-21 at 10:59 +0200, Johannes Berg wrote:
>> From: Johannes Berg <johannes.berg@intel.com>
>>
>> This reverts commit cb751b7a57e5 ("mac80211: add parse regulatory info
>> in 6 GHz operation information") which added a station type bss_conf
>> assignment in a parsing helper function, which will corrupt mesh data.
>>
> Ah crap this won't work, rtw89 already uses this.
>
> Wen please send a fix for this ASAP.
>
> johannes

Hi Johannes,

I looked the patch some times, but I do not know how it corrupt mesh data,

Is there any clue for me?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "mac80211: add parse regulatory info in 6 GHz operation information"
  2023-08-21 10:36   ` Wen Gong
@ 2023-08-21 10:57     ` Johannes Berg
  2023-08-21 11:11       ` Wen Gong
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2023-08-21 10:57 UTC (permalink / raw)
  To: Wen Gong, linux-wireless

On Mon, 2023-08-21 at 18:36 +0800, Wen Gong wrote:
> On 8/21/2023 5:06 PM, Johannes Berg wrote:
> > On Mon, 2023-08-21 at 10:59 +0200, Johannes Berg wrote:
> > > From: Johannes Berg <johannes.berg@intel.com>
> > > 
> > > This reverts commit cb751b7a57e5 ("mac80211: add parse regulatory info
> > > in 6 GHz operation information") which added a station type bss_conf
> > > assignment in a parsing helper function, which will corrupt mesh data.
> > > 
> > Ah crap this won't work, rtw89 already uses this.
> > 
> > Wen please send a fix for this ASAP.
> > 
> > johannes
> 
> Hi Johannes,
> 
> I looked the patch some times, but I do not know how it corrupt mesh data,
> 
> Is there any clue for me?

Hah, no, I'm wrong ... I looked at it and for some reason thought of
u.mgd instead of vif.bss_conf. Sorry!

Still it's not correct though to write to vif.bss_conf in this function
because it's called from mesh_matches_local() to see if it's even
compatible, for example, so the mere calling a "give me the 6 GHz
chandef" function doesn't indicate we actually are going to use it now.

Also it's wrong for multi-link anyway, so maybe it should have an
optional pointer to the bss_conf to fill it in, or just do it outside of
the function.

johannes

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "mac80211: add parse regulatory info in 6 GHz operation information"
  2023-08-21 10:57     ` Johannes Berg
@ 2023-08-21 11:11       ` Wen Gong
  2023-08-21 11:34         ` Johannes Berg
  0 siblings, 1 reply; 9+ messages in thread
From: Wen Gong @ 2023-08-21 11:11 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless

On 8/21/2023 6:57 PM, Johannes Berg wrote:
> On Mon, 2023-08-21 at 18:36 +0800, Wen Gong wrote:
>> On 8/21/2023 5:06 PM, Johannes Berg wrote:
>>> On Mon, 2023-08-21 at 10:59 +0200, Johannes Berg wrote:
>>>> From: Johannes Berg <johannes.berg@intel.com>
>>>>
>>>> This reverts commit cb751b7a57e5 ("mac80211: add parse regulatory info
>>>> in 6 GHz operation information") which added a station type bss_conf
>>>> assignment in a parsing helper function, which will corrupt mesh data.
>>>>
>>> Ah crap this won't work, rtw89 already uses this.
>>>
>>> Wen please send a fix for this ASAP.
>>>
>>> johannes
>> Hi Johannes,
>>
>> I looked the patch some times, but I do not know how it corrupt mesh data,
>>
>> Is there any clue for me?
> Hah, no, I'm wrong ... I looked at it and for some reason thought of
> u.mgd instead of vif.bss_conf. Sorry!
>
> Still it's not correct though to write to vif.bss_conf in this function
> because it's called from mesh_matches_local() to see if it's even
> compatible, for example, so the mere calling a "give me the 6 GHz
> chandef" function doesn't indicate we actually are going to use it now.

Do you mean mesh_matches_local() is only a try to call 
ieee80211_chandef_he_6ghz_oper(),

NOT real use the 6 GHz chandef?

>
> Also it's wrong for multi-link anyway, so maybe it should have an
> optional pointer to the bss_conf to fill it in, or just do it outside of
> the function.
Yes, I also found it just now.
>
> johannes

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "mac80211: add parse regulatory info in 6 GHz operation information"
  2023-08-21 11:11       ` Wen Gong
@ 2023-08-21 11:34         ` Johannes Berg
  2023-08-22  6:17           ` Wen Gong
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2023-08-21 11:34 UTC (permalink / raw)
  To: Wen Gong, linux-wireless

On Mon, 2023-08-21 at 19:11 +0800, Wen Gong wrote:
> On 8/21/2023 6:57 PM, Johannes Berg wrote:
> > On Mon, 2023-08-21 at 18:36 +0800, Wen Gong wrote:
> > > On 8/21/2023 5:06 PM, Johannes Berg wrote:
> > > > On Mon, 2023-08-21 at 10:59 +0200, Johannes Berg wrote:
> > > > > From: Johannes Berg <johannes.berg@intel.com>
> > > > > 
> > > > > This reverts commit cb751b7a57e5 ("mac80211: add parse regulatory info
> > > > > in 6 GHz operation information") which added a station type bss_conf
> > > > > assignment in a parsing helper function, which will corrupt mesh data.
> > > > > 
> > > > Ah crap this won't work, rtw89 already uses this.
> > > > 
> > > > Wen please send a fix for this ASAP.
> > > > 
> > > > johannes
> > > Hi Johannes,
> > > 
> > > I looked the patch some times, but I do not know how it corrupt mesh data,
> > > 
> > > Is there any clue for me?
> > Hah, no, I'm wrong ... I looked at it and for some reason thought of
> > u.mgd instead of vif.bss_conf. Sorry!
> > 
> > Still it's not correct though to write to vif.bss_conf in this function
> > because it's called from mesh_matches_local() to see if it's even
> > compatible, for example, so the mere calling a "give me the 6 GHz
> > chandef" function doesn't indicate we actually are going to use it now.
> 
> Do you mean mesh_matches_local() is only a try to call 
> ieee80211_chandef_he_6ghz_oper(),
> 
> NOT real use the 6 GHz chandef?

Yes, I believe so.

Anyway it would seem better for a utility function to have clearer
defined output, I think?

johannes

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "mac80211: add parse regulatory info in 6 GHz operation information"
  2023-08-21 11:34         ` Johannes Berg
@ 2023-08-22  6:17           ` Wen Gong
  2023-08-22  7:09             ` Johannes Berg
  0 siblings, 1 reply; 9+ messages in thread
From: Wen Gong @ 2023-08-22  6:17 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless

On 8/21/2023 7:34 PM, Johannes Berg wrote:
> On Mon, 2023-08-21 at 19:11 +0800, Wen Gong wrote:
>> On 8/21/2023 6:57 PM, Johannes Berg wrote:
>>> On Mon, 2023-08-21 at 18:36 +0800, Wen Gong wrote:
>>>> On 8/21/2023 5:06 PM, Johannes Berg wrote:
>>>>> On Mon, 2023-08-21 at 10:59 +0200, Johannes Berg wrote:
>>>>>> From: Johannes Berg <johannes.berg@intel.com>
>>>>>>
>>>>>> This reverts commit cb751b7a57e5 ("mac80211: add parse regulatory info
>>>>>> in 6 GHz operation information") which added a station type bss_conf
>>>>>> assignment in a parsing helper function, which will corrupt mesh data.
>>>>>>
>>>>> Ah crap this won't work, rtw89 already uses this.
>>>>>
>>>>> Wen please send a fix for this ASAP.
>>>>>
>>>>> johannes
>>>> Hi Johannes,
>>>>
>>>> I looked the patch some times, but I do not know how it corrupt mesh data,
>>>>
>>>> Is there any clue for me?
>>> Hah, no, I'm wrong ... I looked at it and for some reason thought of
>>> u.mgd instead of vif.bss_conf. Sorry!
>>>
>>> Still it's not correct though to write to vif.bss_conf in this function
>>> because it's called from mesh_matches_local() to see if it's even
>>> compatible, for example, so the mere calling a "give me the 6 GHz
>>> chandef" function doesn't indicate we actually are going to use it now.
>> Do you mean mesh_matches_local() is only a try to call
>> ieee80211_chandef_he_6ghz_oper(),
>>
>> NOT real use the 6 GHz chandef?
> Yes, I believe so.
>
> Anyway it would seem better for a utility function to have clearer
> defined output, I think?
>
> johannes

Do you mean move the logic of set bss_conf->power_type to another new 
function from

ieee80211_chandef_he_6ghz_oper()?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "mac80211: add parse regulatory info in 6 GHz operation information"
  2023-08-22  6:17           ` Wen Gong
@ 2023-08-22  7:09             ` Johannes Berg
  0 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2023-08-22  7:09 UTC (permalink / raw)
  To: Wen Gong, linux-wireless

On Tue, 2023-08-22 at 14:17 +0800, Wen Gong wrote:
> > 
> > Anyway it would seem better for a utility function to have clearer
> > defined output, I think?
> > 
> > johannes
> 
> Do you mean move the logic of set bss_conf->power_type to another new 
> function from
> 
> ieee80211_chandef_he_6ghz_oper()?
> 

No, not really. But we could have a pointer to the bss_conf or even the
particular value, as an obvious output from the function.

johannes

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Revert "mac80211: add parse regulatory info in 6 GHz operation information"
  2023-08-21  8:59 [PATCH] Revert "mac80211: add parse regulatory info in 6 GHz operation information" Johannes Berg
  2023-08-21  9:06 ` Johannes Berg
@ 2023-08-23 21:12 ` kernel test robot
  1 sibling, 0 replies; 9+ messages in thread
From: kernel test robot @ 2023-08-23 21:12 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless; +Cc: oe-kbuild-all, Wen Gong, Johannes Berg

Hi Johannes,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.5-rc7 next-20230823]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Johannes-Berg/Revert-mac80211-add-parse-regulatory-info-in-6-GHz-operation-information/20230821-170019
base:   linus/master
patch link:    https://lore.kernel.org/r/20230821105903.7482379cde47.Ib72645d02fadc24b520db118abd82e861c87316e%40changeid
patch subject: [PATCH] Revert "mac80211: add parse regulatory info in 6 GHz operation information"
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20230824/202308240547.O8ZxrrXI-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230824/202308240547.O8ZxrrXI-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308240547.O8ZxrrXI-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/net/wireless/realtek/rtw89/regd.c: In function 'rtw89_reg_6ghz_power_recalc':
>> drivers/net/wireless/realtek/rtw89/regd.c:514:39: error: 'struct ieee80211_bss_conf' has no member named 'power_type'; did you mean 'txpower_type'?
     514 |                 switch (vif->bss_conf.power_type) {
         |                                       ^~~~~~~~~~
         |                                       txpower_type


vim +514 drivers/net/wireless/realtek/rtw89/regd.c

f6baa1d3d5703f Zong-Zhe Yang 2023-06-02  505  
f6baa1d3d5703f Zong-Zhe Yang 2023-06-02  506  void rtw89_reg_6ghz_power_recalc(struct rtw89_dev *rtwdev,
f6baa1d3d5703f Zong-Zhe Yang 2023-06-02  507  				 struct rtw89_vif *rtwvif, bool active)
f6baa1d3d5703f Zong-Zhe Yang 2023-06-02  508  {
f6baa1d3d5703f Zong-Zhe Yang 2023-06-02  509  	struct ieee80211_vif *vif = rtwvif_to_vif(rtwvif);
f6baa1d3d5703f Zong-Zhe Yang 2023-06-02  510  
f6baa1d3d5703f Zong-Zhe Yang 2023-06-02  511  	lockdep_assert_held(&rtwdev->mutex);
f6baa1d3d5703f Zong-Zhe Yang 2023-06-02  512  
f6baa1d3d5703f Zong-Zhe Yang 2023-06-02  513  	if (active) {
f6baa1d3d5703f Zong-Zhe Yang 2023-06-02 @514  		switch (vif->bss_conf.power_type) {

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-08-23 21:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-21  8:59 [PATCH] Revert "mac80211: add parse regulatory info in 6 GHz operation information" Johannes Berg
2023-08-21  9:06 ` Johannes Berg
2023-08-21 10:36   ` Wen Gong
2023-08-21 10:57     ` Johannes Berg
2023-08-21 11:11       ` Wen Gong
2023-08-21 11:34         ` Johannes Berg
2023-08-22  6:17           ` Wen Gong
2023-08-22  7:09             ` Johannes Berg
2023-08-23 21:12 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.