diff mbox

[1/2] mac80211: Extra debug info for station cleanup case.

Message ID 1390431296-20568-1-git-send-email-greearb@candelatech.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Ben Greear Jan. 22, 2014, 10:54 p.m. UTC
From: Ben Greear <greearb@candelatech.com>

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 net/mac80211/sta_info.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Johannes Berg Jan. 22, 2014, 11:11 p.m. UTC | #1
On Wed, 2014-01-22 at 14:54 -0800, greearb@candelatech.com wrote:
> -		WARN_ON_ONCE(ret != 0);
> +		if (WARN_ON_ONCE(ret != 0))
> +			sdata_info(sdata, "sta-info-destroy: drv-sta-state error: %i, sta: %pM\n",
> +				   ret, sta->sta.addr);

You should put the string into the warning

WARN_ONCE(ret, "sta-info-destroy: ...", ...)

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ben Greear Jan. 22, 2014, 11:58 p.m. UTC | #2
On 01/22/2014 03:11 PM, Johannes Berg wrote:
> On Wed, 2014-01-22 at 14:54 -0800, greearb@candelatech.com wrote:
>> -		WARN_ON_ONCE(ret != 0);
>> +		if (WARN_ON_ONCE(ret != 0))
>> +			sdata_info(sdata, "sta-info-destroy: drv-sta-state error: %i, sta: %pM\n",
>> +				   ret, sta->sta.addr);
> 
> You should put the string into the warning
> 
> WARN_ONCE(ret, "sta-info-destroy: ...", ...)

I wanted it to kernel splat once and print out a message, and after that, only print
messages.

I think your suggestion will only splat _and_ print once?

Thanks,
Ben

> 
> johannes
>
Johannes Berg Jan. 23, 2014, 8:20 a.m. UTC | #3
On Wed, 2014-01-22 at 15:58 -0800, Ben Greear wrote:

> > You should put the string into the warning
> > 
> > WARN_ONCE(ret, "sta-info-destroy: ...", ...)
> 
> I wanted it to kernel splat once and print out a message, and after that, only print
> messages.
> 
> I think your suggestion will only splat _and_ print once?

Hm, that's true, but it shouldn't be happening anyway? So why would you
care about subsequent instances - even the first is a bug?

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ben Greear Jan. 23, 2014, 2:44 p.m. UTC | #4
On 01/23/2014 12:20 AM, Johannes Berg wrote:
> On Wed, 2014-01-22 at 15:58 -0800, Ben Greear wrote:
>
>>> You should put the string into the warning
>>>
>>> WARN_ONCE(ret, "sta-info-destroy: ...", ...)
>>
>> I wanted it to kernel splat once and print out a message, and after that, only print
>> messages.
>>
>> I think your suggestion will only splat _and_ print once?
>
> Hm, that's true, but it shouldn't be happening anyway? So why would you
> care about subsequent instances - even the first is a bug?

Nice to know how often it happens, and under what (other) circumstances it might
be happening.  As you know, these things are not always easy to fix even if you
have a kernel splat....

Thanks,
Ben

>
> johannes
>
diff mbox

Patch

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index decd30c..83238b8 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -877,7 +877,9 @@  static void __sta_info_destroy_part2(struct sta_info *sta)
 	if (sta->uploaded) {
 		ret = drv_sta_state(local, sdata, sta, IEEE80211_STA_NONE,
 				    IEEE80211_STA_NOTEXIST);
-		WARN_ON_ONCE(ret != 0);
+		if (WARN_ON_ONCE(ret != 0))
+			sdata_info(sdata, "sta-info-destroy: drv-sta-state error: %i, sta: %pM\n",
+				   ret, sta->sta.addr);
 	}
 
 	sta_dbg(sdata, "Removed STA %pM\n", sta->sta.addr);