Message ID | 1390431296-20568-1-git-send-email-greearb@candelatech.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
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
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 >
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
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 --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);