All of lore.kernel.org
 help / color / mirror / Atom feed
* get_expected_throughput introduces a kernel oops on sta_set_sinfo calls
@ 2014-07-22  9:11 Jean-Pierre Tosoni
  2014-07-22 13:47 ` Felix Fietkau
  0 siblings, 1 reply; 4+ messages in thread
From: Jean-Pierre Tosoni @ 2014-07-22  9:11 UTC (permalink / raw)
  To: linux-wireless

Hi list,

I am using compat-wireless-20132-04-16 with kernel 3.3.8.
I experienced a kernel oops after applying the "get_expected_throughput"
patches series from Antonio Quartulli.
It happens when a station_dump is issued from userspace while an association
has begun but does not complete immediately due to bad channel.
After some debugging I made this patch which solves the issue:
===========================================================================
--- a/net/mac80211/rc80211_minstrel.c
+++ b/net/mac80211/rc80211_minstrel.c
@@@ -708,6 +708,15 @@ static u32 minstrel_get_expected_throughput(
 	struct minstrel_sta_info *mi = priv_sta;
 	int idx = mi->max_tp_rate[0];
 
+	if (!mi->r) {
+		/*
+		 * Happens if get_expected_throughput() is called by
+		 * ieee80211_dump_station during association from HT
+		 * client to AP, before getting the HT IE from the AP
+		 */
+		printk(KERN_ERR "minstrel: uninitialized station rates");
+		return 0; /* value suggested by J. Berg 25-apr-2014 */
+	}
 	/* convert pkt per sec in kbps (1200 is the average pkt size used
for
 	 * computing cur_tp
 	 */
===========================================================================

With this patch I get this trace (the timeout is expected, since the SNR is
very low):

[  359.798796] wlan0: authenticate with 92:a4:de:21:4f:85

[  359.813180] wlan0: direct probe to 92:a4:de:21:4f:85 (try 1/3)

[  359.922306] wlan0: direct probe to 92:a4:de:21:4f:85 (try 2/3)

[  360.005424] minstrel: uninitialized station rates

[  360.030318] wlan0: direct probe to 92:a4:de:21:4f:85 (try 3/3)

[  360.138294] wlan0: authentication with 92:a4:de:21:4f:85 timed out

Maybe station_dump should not dump the stations just created by an
yet-unanswered authentication request?
Or is my patch the right thing to do?

Regards
Jean-Pierre Tosoni


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: get_expected_throughput introduces a kernel oops on sta_set_sinfo calls
  2014-07-22  9:11 get_expected_throughput introduces a kernel oops on sta_set_sinfo calls Jean-Pierre Tosoni
@ 2014-07-22 13:47 ` Felix Fietkau
  2014-07-22 14:55   ` Jean-Pierre Tosoni
  0 siblings, 1 reply; 4+ messages in thread
From: Felix Fietkau @ 2014-07-22 13:47 UTC (permalink / raw)
  To: Jean-Pierre Tosoni, linux-wireless

On 2014-07-22 11:11, Jean-Pierre Tosoni wrote:
> Hi list,
> 
> I am using compat-wireless-20132-04-16 with kernel 3.3.8.
> I experienced a kernel oops after applying the "get_expected_throughput"
> patches series from Antonio Quartulli.
> It happens when a station_dump is issued from userspace while an association
> has begun but does not complete immediately due to bad channel.
> After some debugging I made this patch which solves the issue:
Please try this patch:
---
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -472,12 +472,15 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
 {
 	struct ieee80211_sub_if_data *sdata = sta->sdata;
 	struct ieee80211_local *local = sdata->local;
-	struct rate_control_ref *ref = local->rate_ctrl;
+	struct rate_control_ref *ref = NULL;
 	struct timespec uptime;
 	u64 packets = 0;
 	u32 thr = 0;
 	int i, ac;
 
+	if (test_sta_flag(sta, WLAN_STA_RATE_CONTROL))
+		ref = local->rate_ctrl;
+
 	sinfo->generation = sdata->local->sta_generation;
 
 	sinfo->filled = STATION_INFO_INACTIVE_TIME |

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: get_expected_throughput introduces a kernel oops on sta_set_sinfo calls
  2014-07-22 13:47 ` Felix Fietkau
@ 2014-07-22 14:55   ` Jean-Pierre Tosoni
  2014-07-22 18:57     ` Felix Fietkau
  0 siblings, 1 reply; 4+ messages in thread
From: Jean-Pierre Tosoni @ 2014-07-22 14:55 UTC (permalink / raw)
  To: 'Felix Fietkau', linux-wireless

Great, it works! No more oops, and my debug printk never appears anymore.

But it looks like one line is missing in your patch, 12/15 lines announced
but only 11/14 lines present?

Thanks you so much!

-----Message d'origine-----
De : Felix Fietkau [mailto:nbd@openwrt.org] 
Envoyé : mardi 22 juillet 2014 15:47
À : Jean-Pierre Tosoni; linux-wireless@vger.kernel.org
Objet : Re: get_expected_throughput introduces a kernel oops on
sta_set_sinfo calls

On 2014-07-22 11:11, Jean-Pierre Tosoni wrote:
> Hi list,
> 
> I am using compat-wireless-20132-04-16 with kernel 3.3.8.
> I experienced a kernel oops after applying the "get_expected_throughput"
> patches series from Antonio Quartulli.
> It happens when a station_dump is issued from userspace while an 
> association has begun but does not complete immediately due to bad
channel.
> After some debugging I made this patch which solves the issue:
Please try this patch:
---
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -472,12 +472,15 @@ static void sta_set_sinfo(struct sta_info *sta, struct
station_info *sinfo)  {
 	struct ieee80211_sub_if_data *sdata = sta->sdata;
 	struct ieee80211_local *local = sdata->local;
-	struct rate_control_ref *ref = local->rate_ctrl;
+	struct rate_control_ref *ref = NULL;
 	struct timespec uptime;
 	u64 packets = 0;
 	u32 thr = 0;
 	int i, ac;
 
+	if (test_sta_flag(sta, WLAN_STA_RATE_CONTROL))
+		ref = local->rate_ctrl;
+
 	sinfo->generation = sdata->local->sta_generation;
 
 	sinfo->filled = STATION_INFO_INACTIVE_TIME |


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: get_expected_throughput introduces a kernel oops on sta_set_sinfo calls
  2014-07-22 14:55   ` Jean-Pierre Tosoni
@ 2014-07-22 18:57     ` Felix Fietkau
  0 siblings, 0 replies; 4+ messages in thread
From: Felix Fietkau @ 2014-07-22 18:57 UTC (permalink / raw)
  To: Jean-Pierre Tosoni, linux-wireless

In your line-wrapped reply there are 11/14 lines. In my original mail,
I'm counting 12/15 ;) The difference is the '{' part.
I will submit this change as a proper patch now, thanks for testing.

- Felix

On 2014-07-22 16:55, Jean-Pierre Tosoni wrote:
> Great, it works! No more oops, and my debug printk never appears anymore.
> 
> But it looks like one line is missing in your patch, 12/15 lines announced
> but only 11/14 lines present?
> 
> Thanks you so much!
> 
> -----Message d'origine-----
> De : Felix Fietkau [mailto:nbd@openwrt.org] 
> Envoyé : mardi 22 juillet 2014 15:47
> À : Jean-Pierre Tosoni; linux-wireless@vger.kernel.org
> Objet : Re: get_expected_throughput introduces a kernel oops on
> sta_set_sinfo calls
> 
> On 2014-07-22 11:11, Jean-Pierre Tosoni wrote:
>> Hi list,
>> 
>> I am using compat-wireless-20132-04-16 with kernel 3.3.8.
>> I experienced a kernel oops after applying the "get_expected_throughput"
>> patches series from Antonio Quartulli.
>> It happens when a station_dump is issued from userspace while an 
>> association has begun but does not complete immediately due to bad
> channel.
>> After some debugging I made this patch which solves the issue:
> Please try this patch:
> ---
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -472,12 +472,15 @@ static void sta_set_sinfo(struct sta_info *sta, struct
> station_info *sinfo)  {
>  	struct ieee80211_sub_if_data *sdata = sta->sdata;
>  	struct ieee80211_local *local = sdata->local;
> -	struct rate_control_ref *ref = local->rate_ctrl;
> +	struct rate_control_ref *ref = NULL;
>  	struct timespec uptime;
>  	u64 packets = 0;
>  	u32 thr = 0;
>  	int i, ac;
>  
> +	if (test_sta_flag(sta, WLAN_STA_RATE_CONTROL))
> +		ref = local->rate_ctrl;
> +
>  	sinfo->generation = sdata->local->sta_generation;
>  
>  	sinfo->filled = STATION_INFO_INACTIVE_TIME |
> 
> --
> 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
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-22 18:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-22  9:11 get_expected_throughput introduces a kernel oops on sta_set_sinfo calls Jean-Pierre Tosoni
2014-07-22 13:47 ` Felix Fietkau
2014-07-22 14:55   ` Jean-Pierre Tosoni
2014-07-22 18:57     ` Felix Fietkau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.