2020-12-04 18:37:57

by Ryder Lee

[permalink] [raw]
Subject: [PATCH 1/2] mt76: mt7915: add vif check in mt7915_update_vif_beacon()

This avoids the WARN_ON(1) calltrace in station mode.

[ 4522.024382] ieee80211_tx_dequeue+0x1258/0x1298 [mac80211]
[ 4522.029868] ieee80211_beacon_get_template+0x10/0x18 [mac80211]
[ 4522.035780] mt7915_mcu_add_beacon+0x2c/0x208 [mt7915e]
[ 4522.040997] mt7915_mcu_get_rx_rate+0x304/0x878 [mt7915e]
[ 4522.046394] ieee80211_delayed_tailroom_dec+0x158/0x180 [mac80211]
[ 4522.052573] ieee80211_iterate_interfaces+0x48/0x68 [mac80211]
[ 4522.058398] mt7915_mac_reset_work+0x3b4/0x630 [mt7915e]
[ 4522.063704] process_one_work+0x1fc/0x390
[ 4522.067703] worker_thread+0x48/0x4d0
[ 4522.071356] kthread+0x120/0x128

Signed-off-by: Ryder Lee <[email protected]>
---
drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
index a7fa6fffffff..98f80e77ad7b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
@@ -1407,7 +1407,13 @@ mt7915_update_vif_beacon(void *priv, u8 *mac, struct ieee80211_vif *vif)
{
struct ieee80211_hw *hw = priv;

- mt7915_mcu_add_beacon(hw, vif, vif->bss_conf.enable_beacon);
+ switch (vif->type) {
+ case NL80211_IFTYPE_MESH_POINT:
+ case NL80211_IFTYPE_ADHOC:
+ case NL80211_IFTYPE_AP:
+ mt7915_mcu_add_beacon(hw, vif, vif->bss_conf.enable_beacon);
+ break;
+ }
}

static void
--
2.18.0


2020-12-04 18:40:19

by Ryder Lee

[permalink] [raw]
Subject: [PATCH 2/2] mt76: mt7615: add vif check in mt7615_update_vif_beacon()

This avoids the WARN_ON(1) calltrace in station mode.

Signed-off-by: Ryder Lee <[email protected]>
---
drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
index 0f360be0b885..49dced019482 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
@@ -2017,7 +2017,14 @@ mt7615_update_vif_beacon(void *priv, u8 *mac, struct ieee80211_vif *vif)
struct ieee80211_hw *hw = priv;
struct mt7615_dev *dev = mt7615_hw_dev(hw);

- mt7615_mcu_add_beacon(dev, hw, vif, vif->bss_conf.enable_beacon);
+ switch (vif->type) {
+ case NL80211_IFTYPE_MESH_POINT:
+ case NL80211_IFTYPE_ADHOC:
+ case NL80211_IFTYPE_AP:
+ mt7615_mcu_add_beacon(dev, hw, vif,
+ vif->bss_conf.enable_beacon);
+ break;
+ }
}

static void
--
2.18.0

2020-12-04 20:48:40

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 1/2] mt76: mt7915: add vif check in mt7915_update_vif_beacon()

Hi Ryder,

I love your patch! Perhaps something to improve:

[auto build test WARNING on wireless-drivers-next/master]
[also build test WARNING on wireless-drivers/master v5.10-rc6 next-20201204]
[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]

url: https://github.com/0day-ci/linux/commits/Ryder-Lee/mt76-mt7915-add-vif-check-in-mt7915_update_vif_beacon/20201205-024232
base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/71ca3f941764d03d97fe0d568c2b26f441410842
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Ryder-Lee/mt76-mt7915-add-vif-check-in-mt7915_update_vif_beacon/20201205-024232
git checkout 71ca3f941764d03d97fe0d568c2b26f441410842
# save the attached .config to linux build tree
make W=1 ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

drivers/net/wireless/mediatek/mt76/mt7915/mac.c: In function 'mt7915_update_vif_beacon':
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1146:2: warning: enumeration value 'NL80211_IFTYPE_UNSPECIFIED' not handled in switch [-Wswitch]
1146 | switch (vif->type) {
| ^~~~~~
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1146:2: warning: enumeration value 'NL80211_IFTYPE_STATION' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1146:2: warning: enumeration value 'NL80211_IFTYPE_AP_VLAN' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1146:2: warning: enumeration value 'NL80211_IFTYPE_WDS' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1146:2: warning: enumeration value 'NL80211_IFTYPE_MONITOR' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1146:2: warning: enumeration value 'NL80211_IFTYPE_P2P_CLIENT' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1146:2: warning: enumeration value 'NL80211_IFTYPE_P2P_GO' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1146:2: warning: enumeration value 'NL80211_IFTYPE_P2P_DEVICE' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1146:2: warning: enumeration value 'NL80211_IFTYPE_OCB' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1146:2: warning: enumeration value 'NL80211_IFTYPE_NAN' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1146:2: warning: enumeration value 'NUM_NL80211_IFTYPES' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7915/mac.c:1146:2: warning: enumeration value 'NL80211_IFTYPE_MAX' not handled in switch [-Wswitch]

vim +/NL80211_IFTYPE_UNSPECIFIED +1146 drivers/net/wireless/mediatek/mt76/mt7915/mac.c

1140
1141 static void
1142 mt7915_update_vif_beacon(void *priv, u8 *mac, struct ieee80211_vif *vif)
1143 {
1144 struct ieee80211_hw *hw = priv;
1145
> 1146 switch (vif->type) {
1147 case NL80211_IFTYPE_MESH_POINT:
1148 case NL80211_IFTYPE_ADHOC:
1149 case NL80211_IFTYPE_AP:
1150 mt7915_mcu_add_beacon(hw, vif, vif->bss_conf.enable_beacon);
1151 break;
1152 }
1153 }
1154

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (3.76 kB)
.config.gz (75.50 kB)
Download all attachments

2020-12-04 21:25:50

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 2/2] mt76: mt7615: add vif check in mt7615_update_vif_beacon()

Hi Ryder,

I love your patch! Perhaps something to improve:

[auto build test WARNING on wireless-drivers-next/master]
[also build test WARNING on wireless-drivers/master v5.10-rc6 next-20201204]
[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]

url: https://github.com/0day-ci/linux/commits/Ryder-Lee/mt76-mt7915-add-vif-check-in-mt7915_update_vif_beacon/20201205-024232
base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/70a2e5dfc5fb443d0827fefd13ce0cb8a3785cf6
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Ryder-Lee/mt76-mt7915-add-vif-check-in-mt7915_update_vif_beacon/20201205-024232
git checkout 70a2e5dfc5fb443d0827fefd13ce0cb8a3785cf6
# save the attached .config to linux build tree
make W=1 ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

drivers/net/wireless/mediatek/mt76/mt7615/mac.c: In function 'mt7615_update_vif_beacon':
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_UNSPECIFIED' not handled in switch [-Wswitch]
2059 | switch (vif->type) {
| ^~~~~~
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_STATION' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_AP_VLAN' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_WDS' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_MONITOR' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_P2P_CLIENT' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_P2P_GO' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_P2P_DEVICE' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_OCB' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_NAN' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NUM_NL80211_IFTYPES' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_MAX' not handled in switch [-Wswitch]

vim +/NL80211_IFTYPE_UNSPECIFIED +2059 drivers/net/wireless/mediatek/mt76/mt7615/mac.c

2052
2053 static void
2054 mt7615_update_vif_beacon(void *priv, u8 *mac, struct ieee80211_vif *vif)
2055 {
2056 struct ieee80211_hw *hw = priv;
2057 struct mt7615_dev *dev = mt7615_hw_dev(hw);
2058
> 2059 switch (vif->type) {
2060 case NL80211_IFTYPE_MESH_POINT:
2061 case NL80211_IFTYPE_ADHOC:
2062 case NL80211_IFTYPE_AP:
2063 mt7615_mcu_add_beacon(dev, hw, vif,
2064 vif->bss_conf.enable_beacon);
2065 break;
2066 }
2067 }
2068

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (3.84 kB)
.config.gz (75.50 kB)
Download all attachments