Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA6AAC4332F for ; Wed, 3 Nov 2021 16:57:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 953EB610EA for ; Wed, 3 Nov 2021 16:57:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232993AbhKCRAM (ORCPT ); Wed, 3 Nov 2021 13:00:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232870AbhKCRAL (ORCPT ); Wed, 3 Nov 2021 13:00:11 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64C5EC061205 for ; Wed, 3 Nov 2021 09:57:34 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id w9-20020a17090a1b8900b001a6b3b7ec17so1754623pjc.3 for ; Wed, 03 Nov 2021 09:57:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IBSuB2sX7yC2N+skcd1kW4OtMhtED2f+hVFLuKO9FNc=; b=wTNdA3Oz63ouFKMX/zm8/Y+znNyrUzRhG2N2tsdnBznIJC7x5jkh5uMDkh4O3Hx8R+ xkPc16Fw0goWAMKBCB4oDaRs+g0w2P+XUtYxRc/62cFMhInyDMUInR/8Qe+kp2VcTqrt J4pd/n5UKfiPNzZ0M0ZGQgirk/w56WXw3BQsOTt8buZp8UBAeP5zoKOeXahykr5KZdxP VBJ3q+FCrhu3i56doXt3CgNFCH2jEbeZB4MUe36rUeXsK1tMD5bsOVnRbV3LhEeG8nT8 pGZK91HbDI1J/NyHRq+bHmKS5nQo5nytN5BQaHsKTkSuPUn9hbNuF54JevIVPuxX8CYu okcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IBSuB2sX7yC2N+skcd1kW4OtMhtED2f+hVFLuKO9FNc=; b=0HKi6xVsKH9igFtwk76VJnvAZctb56Twd7immQhKCMW0EVgPgFXPmxQT8kLDqaBvZa SBnWKRfI6H1J3Czvwn2NAmW1svp0fd9B8GyjRc7YXKYOwY/tTMk2VuIISdRn+1pZkXvq EF4ZxLs8joPOdnue9fZaeO7L92T2iV6aLKMqgMbiLAofphGR1+IalHa4pxk7mofam9Kq 9Tn3D9MFK0BgMeMrQTUp/aSvEok5rw+L2cOQHsnFKIEhjfes9puVqG6va4JNrUO2rE09 NFsS5Elz1nMLoj4eKU8pcwyFVxUFVsJTKQPkQ+22drdR0zFGeysLg6aVbRWFCIZzQqYh D2Qw== X-Gm-Message-State: AOAM531WMWETeh/f/8Bhd9I5bXrkyUIgIfgDKXRLmDXshS29m0HzODcG 1xr6SVpiexWgMojDQJ7Dx9D5GTEchzbc24Fv/SPo4A== X-Google-Smtp-Source: ABdhPJzUnQk5Cmt2i6mzswb2rLjgrcIQaBoi2fOvdvX9lCslbk7TLUjrnsn0nSemd+HWgru1iz0235PqX2K8UC/UTbI= X-Received: by 2002:a17:90a:1190:: with SMTP id e16mr15889288pja.209.1635958653600; Wed, 03 Nov 2021 09:57:33 -0700 (PDT) MIME-Version: 1.0 References: <20211103155543.1037604-1-benl@squareup.com> <20211103155543.1037604-3-benl@squareup.com> In-Reply-To: <20211103155543.1037604-3-benl@squareup.com> From: Loic Poulain Date: Wed, 3 Nov 2021 18:08:15 +0100 Message-ID: Subject: Re: [PATCH v2 2/2] wcn36xx: fix RX BD rate mapping for 5GHz legacy rates To: Benjamin Li Cc: Kalle Valo , "Bryan O'Donoghue" , linux-arm-msm@vger.kernel.org, "David S. Miller" , Jakub Kicinski , wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ben, On Wed, 3 Nov 2021 at 16:56, Benjamin Li wrote: > > The linear mapping between the BD rate field and the driver's 5GHz > legacy rates table (wcn_5ghz_rates) does not only apply for the latter > four rates -- it applies to all eight rates. > > Fixes: 6ea131acea98 ("wcn36xx: Fix warning due to bad rate_idx") > Signed-off-by: Benjamin Li > --- > drivers/net/wireless/ath/wcn36xx/txrx.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c > index f0a9f069a92a9..fce3a6a98f596 100644 > --- a/drivers/net/wireless/ath/wcn36xx/txrx.c > +++ b/drivers/net/wireless/ath/wcn36xx/txrx.c > @@ -272,7 +272,6 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb) > const struct wcn36xx_rate *rate; > struct ieee80211_hdr *hdr; > struct wcn36xx_rx_bd *bd; > - struct ieee80211_supported_band *sband; > u16 fc, sn; > > /* > @@ -350,12 +349,10 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb) > status.enc_flags = rate->encoding_flags; > status.bw = rate->bw; > status.rate_idx = rate->mcs_or_legacy_index; > - sband = wcn->hw->wiphy->bands[status.band]; > status.nss = 1; > > if (status.band == NL80211_BAND_5GHZ && > - status.encoding == RX_ENC_LEGACY && > - status.rate_idx >= sband->n_bitrates) { It looks fine, but can you replace it with a 'status.rate_idx >= 4'. I get sporadic 5Ghz frames reported with rate_idx=0 (firmware miss?), leading to warnings because status.rate_idx is -4(unsigned) in that case. So better to report a wrong rate than a corrupted one. > > + status.encoding == RX_ENC_LEGACY) { > /* no dsss rates in 5Ghz rates table */ > status.rate_idx -= 4; > } > -- Regards, Loic