Return-path: Received: from c60.cesmail.net ([216.154.195.49]:40707 "EHLO c60.cesmail.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754133Ab2BHXCF (ORCPT ); Wed, 8 Feb 2012 18:02:05 -0500 Date: Wed, 8 Feb 2012 18:01:52 -0500 From: Pavel Roskin To: "John W. Linville" , linux-wireless@vger.kernel.org Cc: Felix Fietkau , johannes@sipsolutions.net, arend@broadcom.com Subject: Re: [PATCH] mac80211: do not call rate control .tx_status before .rate_init Message-ID: <20120208180152.082cff4e@mj> (sfid-20120209_000209_905589_AB0AA716) In-Reply-To: <20120208194453.GC2929@tuxdriver.com> References: <1328725031-35464-1-git-send-email-nbd@openwrt.org> <20120208192536.GB2929@tuxdriver.com> <4F32CF18.4010300@openwrt.org> <20120208194453.GC2929@tuxdriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-wireless-owner@vger.kernel.org List-ID: On Wed, 8 Feb 2012 14:44:54 -0500 "John W. Linville" wrote: > On Wed, Feb 08, 2012 at 08:38:00PM +0100, Felix Fietkau wrote: > > On 2012-02-08 8:25 PM, John W. Linville wrote: > > > On Wed, Feb 08, 2012 at 07:17:11PM +0100, Felix Fietkau wrote: > > >> Most rate control implementations assume .get_rate > > >> and .tx_status are only called once the per-station data has > > >> been fully initialized. minstrel_ht crashes if this assumption > > >> is violated. > > >> > > >> Signed-off-by: Felix Fietkau > > >> Tested-by: Arend van Spriel > > >> --- > > >> net/mac80211/rate.h | 2 +- > > >> 1 files changed, 1 insertions(+), 1 deletions(-) > > >> > > >> diff --git a/net/mac80211/rate.h b/net/mac80211/rate.h > > >> index 5fc3135..fbb1efd 100644 > > >> --- a/net/mac80211/rate.h > > >> +++ b/net/mac80211/rate.h > > >> @@ -37,7 +37,7 @@ static inline void > > >> rate_control_tx_status(struct ieee80211_local *local, struct > > >> ieee80211_sta *ista = &sta->sta; void *priv_sta = > > >> sta->rate_ctrl_priv; > > >> - if (!ref) > > >> + if (!ref || !test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) > > >> return; > > >> > > >> ref->ops->tx_status(ref->priv, sband, ista, priv_sta, > > >> skb); > > > > > > Any reason not to apply this for 3.3? Or stable? > > I think 3.3 doesn't have that sta flag, the issue was probably > > introduced with the 3.4 changes. > > I don't remember something like this appearing in earlier versions. > > Cool, thanks. I believe 3.3 is affected. At least it looks like the Fedora bug 768639 (https://bugzilla.redhat.com/show_bug.cgi?id=768639) is caused by calling .tx_status at a wrong time. Fedora kernels use compat-wireless-3.3. I'm going to test the bleeding edge compat-wireless with the patch by Felix to see if it fixes things. The lack of the WLAN_STA_RATE_CONTROL flag doesn't mean that the old behavior was correct. The flag was introduced to correct that behavior. The oldest report is dated 2011-12-17 and it's about Linux 3.2.0-rc5 with compat-wireless-2011-12-01. -- Regards, Pavel Roskin