Return-path: Received: from c60.cesmail.net ([216.154.195.49]:31609 "EHLO c60.cesmail.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750904AbZCAFV4 (ORCPT ); Sun, 1 Mar 2009 00:21:56 -0500 Subject: Re: [ath5k-devel] [PATCH 1/1] ath5k: fix hw rate index condition From: Pavel Roskin To: Bob Copeland Cc: "Luis R. Rodriguez" , Jiri Slaby , "ath5k-devel@venema.h4ckr.net" , "linux-wireless@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "John W. Linville" In-Reply-To: <20090227030608.GA29974@hash.localnet> References: <1235688271-22346-1-git-send-email-jirislaby@gmail.com> <20090226230338.M86894@bobcopeland.com> <49A7236E.2020807@gmail.com> <49A726A7.6090809@gmail.com> <20090227022704.GA29850@hash.localnet> <20090227023912.GF13456@tesla> <20090227030608.GA29974@hash.localnet> Content-Type: text/plain Date: Sun, 01 Mar 2009 00:21:52 -0500 Message-Id: <1235884912.9224.26.camel@mj> (sfid-20090301_062219_991884_55E6B925) Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Thu, 2009-02-26 at 22:06 -0500, Bob Copeland wrote: > On Thu, Feb 26, 2009 at 06:39:12PM -0800, Luis R. Rodriguez wrote: > > Might be worth adding a note why this is the case. Can't we simply avoid > > this by checking earlier for the error or simply assigning it an actual > > default _good_ hw rate value? > > I guess an alternative is to initialize to 0, that would count any rx > packets whose hw rate we don't know about as the base rate, so it would > probably bias the RC to 1mb, but this is already one of those 'should > never happen' cases. I would prefer that we don't hide problems. If we don't know why we cannot get a valid rate, we should use WARN_ON and find out why and when it happens. I'm fine with using a bogus rate with WARN_ON. If we decide that we indeed cannot find the actual rate, then WARN_ON should be removed and the bogus rate replaced with an "unknown rate", that is, a special value that is never translated to a valid rate and never given to any rate control algorithm. Using a bogus rate without a warning is wrong in my opinion. It should be possible to represent "unknown rate" as such. That applies to all drivers. I remember that b43 also failed to report the rate in some cases (for the first received packet or something like that). -- Regards, Pavel Roskin