diff mbox series

[1/2] mt76: mt7915: add vif check in mt7915_update_vif_beacon()

Message ID 6f63bc0fbba35c3005a9d6999104f41174466cb6.1607104742.git.ryder.lee@mediatek.com (mailing list archive)
State New, archived
Headers show
Series [1/2] mt76: mt7915: add vif check in mt7915_update_vif_beacon() | expand

Commit Message

Ryder Lee Dec. 4, 2020, 6:36 p.m. UTC
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 <ryder.lee@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

kernel test robot Dec. 4, 2020, 8:43 p.m. UTC | #1
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 <lkp@intel.com>

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/kbuild-all@lists.01.org
diff mbox series

Patch

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