diff mbox

[1/2] wlcore: don't WARN_ON in case of existing ROC

Message ID 1457284534-10789-1-git-send-email-eliad@wizery.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

Eliad Peller March 6, 2016, 5:15 p.m. UTC
When working with AP + P2P, it's possible to get into
a state when the AP is in ROC (due to assiciating station)
while trying to ROC on the P2P interface.

Replace the WARN_ON with wl1271_error to avoid warnings
in this case.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/ti/wlcore/main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

kernel test robot March 6, 2016, 5:33 p.m. UTC | #1
Hi Eliad,

[auto build test WARNING on wireless-drivers-next/master]
[also build test WARNING on v4.5-rc6 next-20160304]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Eliad-Peller/wlcore-don-t-WARN_ON-in-case-of-existing-ROC/20160307-011744
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: sparc64-allyesconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=sparc64 

All warnings (new ones prefixed by >>):

   drivers/net/wireless/ti/wlcore/main.c: In function 'wlcore_op_remain_on_channel':
>> drivers/net/wireless/ti/wlcore/main.c:5513:3: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
      wl1271_warning("active roc on role %d",
      ^

vim +5513 drivers/net/wireless/ti/wlcore/main.c

  5497		struct wl1271 *wl = hw->priv;
  5498		int channel, ret = 0;
  5499	
  5500		channel = ieee80211_frequency_to_channel(chan->center_freq);
  5501	
  5502		wl1271_debug(DEBUG_MAC80211, "mac80211 roc %d (%d)",
  5503			     channel, wlvif->role_id);
  5504	
  5505		mutex_lock(&wl->mutex);
  5506	
  5507		if (unlikely(wl->state != WLCORE_STATE_ON))
  5508			goto out;
  5509	
  5510		/* return EBUSY if we can't ROC right now */
  5511		if (wl->roc_vif ||
  5512		    find_first_bit(wl->roc_map, WL12XX_MAX_ROLES) < WL12XX_MAX_ROLES) {
> 5513			wl1271_warning("active roc on role %d",
  5514				       find_first_bit(wl->roc_map, WL12XX_MAX_ROLES));
  5515			ret = -EBUSY;
  5516			goto out;
  5517		}
  5518	
  5519		ret = wl1271_ps_elp_wakeup(wl);
  5520		if (ret < 0)
  5521			goto out;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot March 6, 2016, 5:47 p.m. UTC | #2
Hi Eliad,

[auto build test WARNING on wireless-drivers-next/master]
[also build test WARNING on v4.5-rc6 next-20160304]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Eliad-Peller/wlcore-don-t-WARN_ON-in-case-of-existing-ROC/20160307-011744
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: i386-randconfig-x002-201610 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from include/linux/printk.h:6:0,
                    from include/linux/kernel.h:13,
                    from include/linux/list.h:8,
                    from include/linux/module.h:9,
                    from drivers/net/wireless/ti/wlcore/main.c:23:
   drivers/net/wireless/ti/wlcore/main.c: In function 'wlcore_op_remain_on_channel':
>> include/linux/kern_levels.h:4:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:11:22: note: in expansion of macro 'KERN_SOH'
    #define KERN_WARNING KERN_SOH "4" /* warning conditions */
                         ^
>> include/linux/printk.h:254:9: note: in expansion of macro 'KERN_WARNING'
     printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
            ^
>> include/linux/printk.h:255:17: note: in expansion of macro 'pr_warning'
    #define pr_warn pr_warning
                    ^
>> drivers/net/wireless/ti/wlcore/debug.h:68:2: note: in expansion of macro 'pr_warn'
     pr_warn(DRIVER_PREFIX "WARNING " fmt "\n", ##arg)
     ^
>> drivers/net/wireless/ti/wlcore/main.c:5513:3: note: in expansion of macro 'wl1271_warning'
      wl1271_warning("active roc on role %d",
      ^

vim +/wl1271_warning +5513 drivers/net/wireless/ti/wlcore/main.c

  5497		struct wl1271 *wl = hw->priv;
  5498		int channel, ret = 0;
  5499	
  5500		channel = ieee80211_frequency_to_channel(chan->center_freq);
  5501	
  5502		wl1271_debug(DEBUG_MAC80211, "mac80211 roc %d (%d)",
  5503			     channel, wlvif->role_id);
  5504	
  5505		mutex_lock(&wl->mutex);
  5506	
  5507		if (unlikely(wl->state != WLCORE_STATE_ON))
  5508			goto out;
  5509	
  5510		/* return EBUSY if we can't ROC right now */
  5511		if (wl->roc_vif ||
  5512		    find_first_bit(wl->roc_map, WL12XX_MAX_ROLES) < WL12XX_MAX_ROLES) {
> 5513			wl1271_warning("active roc on role %d",
  5514				       find_first_bit(wl->roc_map, WL12XX_MAX_ROLES));
  5515			ret = -EBUSY;
  5516			goto out;
  5517		}
  5518	
  5519		ret = wl1271_ps_elp_wakeup(wl);
  5520		if (ret < 0)
  5521			goto out;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot March 6, 2016, 7:32 p.m. UTC | #3
Hi Eliad,

[auto build test WARNING on wireless-drivers-next/master]
[also build test WARNING on v4.5-rc6 next-20160304]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Eliad-Peller/wlcore-don-t-WARN_ON-in-case-of-existing-ROC/20160307-011744
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: openrisc-allmodconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=openrisc 

All warnings (new ones prefixed by >>):

   drivers/net/wireless/ti/wlcore/main.c: In function 'wlcore_op_remain_on_channel':
>> drivers/net/wireless/ti/wlcore/main.c:5513:3: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int'

vim +5513 drivers/net/wireless/ti/wlcore/main.c

  5497		struct wl1271 *wl = hw->priv;
  5498		int channel, ret = 0;
  5499	
  5500		channel = ieee80211_frequency_to_channel(chan->center_freq);
  5501	
  5502		wl1271_debug(DEBUG_MAC80211, "mac80211 roc %d (%d)",
  5503			     channel, wlvif->role_id);
  5504	
  5505		mutex_lock(&wl->mutex);
  5506	
  5507		if (unlikely(wl->state != WLCORE_STATE_ON))
  5508			goto out;
  5509	
  5510		/* return EBUSY if we can't ROC right now */
  5511		if (wl->roc_vif ||
  5512		    find_first_bit(wl->roc_map, WL12XX_MAX_ROLES) < WL12XX_MAX_ROLES) {
> 5513			wl1271_warning("active roc on role %d",
  5514				       find_first_bit(wl->roc_map, WL12XX_MAX_ROLES));
  5515			ret = -EBUSY;
  5516			goto out;
  5517		}
  5518	
  5519		ret = wl1271_ps_elp_wakeup(wl);
  5520		if (ret < 0)
  5521			goto out;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index d1109c4..cb2e8b6 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -5506,9 +5506,10 @@  static int wlcore_op_remain_on_channel(struct ieee80211_hw *hw,
 		goto out;
 
 	/* return EBUSY if we can't ROC right now */
-	if (WARN_ON(wl->roc_vif ||
-		    find_first_bit(wl->roc_map,
-				   WL12XX_MAX_ROLES) < WL12XX_MAX_ROLES)) {
+	if (wl->roc_vif ||
+	    find_first_bit(wl->roc_map, WL12XX_MAX_ROLES) < WL12XX_MAX_ROLES) {
+		wl1271_warning("active roc on role %d",
+			       find_first_bit(wl->roc_map, WL12XX_MAX_ROLES));
 		ret = -EBUSY;
 		goto out;
 	}