Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2976909pxp; Mon, 14 Mar 2022 08:28:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+Syd2prMO7DvPiyEEVIzg6A1WpJeo8JmzL7qNTAm409ckwsT3Be0K1JZp+Nab+6jbnUdz X-Received: by 2002:a17:903:4083:b0:153:4103:542d with SMTP id z3-20020a170903408300b001534103542dmr14321775plc.160.1647271718531; Mon, 14 Mar 2022 08:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647271718; cv=none; d=google.com; s=arc-20160816; b=CJmuaJddYP43CtHKOe/eCkqN3Q61D1/d/34caRpEUWVAYX77cuOLc/fzBeYF0MS1k1 b6JGWgkVvtnQCcETome7xYV7h348dRZTwaw8mExFqJOY2SgIXfa1y0fBledWwN8qFFGY wlHhEkpIkC0C5NFCxVqtRVsJr+OKnXLT1q8/liWO8KuBxH39gx4GmQpadSTrfy34W8wy 11xBqZ7vFdxfzcol93oVqRTRadr7pLwrSkV8dNi03dlnkuENfTQgN7KQVw4D/DYATlMN kBxLf5zmxfRFzxRHXqrlrTJ1QAdToBc6gyOh7mE0AJTTGSDp6hkcgyqrK2+WyrAcmgfU nkFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=xNq6R8CjDCXlgfqdVyRSKbiUrrTEQsCB2SHbde1EVIo=; b=CsaI4zoTc86U7Fuj744KwhJ5OvVwtghNDi55Eu3ZXie55JsaJ1VmXRPgARjzu1yh1m 5U5jhFXW6prsZojfvUKWBaagi6c71jnRT6eOSRybbn3/JaAJ6lj4sXNqLNtLdrd8DgNP KekiIzrvE3P3QIQorkUT7ypCBjZwXbIb08wcl6wAq/9rinrIvqNZmSnW1DmKY6avN4Vl DCFpFoKK5VwuZo9LVWMEouot75Scn+Biz/n/vd4gP6akZGz7BoRR/ps9dzE9vI+UtBun jpD07o4LoPzdooS24rPyRou/hYTrB7UmwGLExUoh1CGF5Z3AnZzone0RwUTazIGlqg0u qgHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=ueQzZMLY; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020a17090a7e8300b001bd14e03089si12303403pjl.97.2022.03.14.08.28.26; Mon, 14 Mar 2022 08:28:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=ueQzZMLY; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238911AbiCNOin (ORCPT + 70 others); Mon, 14 Mar 2022 10:38:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229925AbiCNOim (ORCPT ); Mon, 14 Mar 2022 10:38:42 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA5FC3D48B for ; Mon, 14 Mar 2022 07:37:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xNq6R8CjDCXlgfqdVyRSKbiUrrTEQsCB2SHbde1EVIo=; b=ueQzZMLY6sv7oib52NnvNSbThC eWn9zwDVUwopsUyoFCrk2MfooDF2l9LxG1hn4u5BGLF+pgFtlgTj1v+hsDBQ8csOQSgLv221ErlgG 5334gc72PuVvJ6lajzxB/rsgYtXdXt+TBsef4wHnYfrOF4knT1ryeOlelAfIQQF9yQTQ=; Received: from p200300daa7204f006c015a90d6b6c4d6.dip0.t-ipconnect.de ([2003:da:a720:4f00:6c01:5a90:d6b6:c4d6] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1nTlp9-00006D-9L; Mon, 14 Mar 2022 15:37:27 +0100 Message-ID: Date: Mon, 14 Mar 2022 15:37:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] mt76: mt7915: fix MBSS index condition in DBDC mode Content-Language: en-US To: Evelyn Tsai Cc: Lorenzo Bianconi , Ryder Lee , Shayne Chen , linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org, Bo Jiao References: <20220309140249.10285-1-evelyn.tsai@mediatek.com> From: Felix Fietkau In-Reply-To: <20220309140249.10285-1-evelyn.tsai@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 09.03.22 15:02, Evelyn Tsai wrote: > MT7915_MAX_INTERFACES is per-band declartion. > > Signed-off-by: Evelyn Tsai > Signed-off-by: Bo Jiao > --- > drivers/net/wireless/mediatek/mt76/mt76.h | 2 +- > drivers/net/wireless/mediatek/mt76/mt7915/main.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h > index 5e10fe156926..c60af144f611 100644 > --- a/drivers/net/wireless/mediatek/mt76/mt76.h > +++ b/drivers/net/wireless/mediatek/mt76/mt76.h > @@ -727,7 +727,7 @@ struct mt76_dev { > u32 wcid_mask[DIV_ROUND_UP(MT76_N_WCIDS, 32)]; > u32 wcid_phy_mask[DIV_ROUND_UP(MT76_N_WCIDS, 32)]; > > - u32 vif_mask; > + u64 vif_mask; > > struct mt76_wcid global_wcid; > struct mt76_wcid __rcu *wcid[MT76_N_WCIDS]; > diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c > index c3f44d801e7f..9eefc132d77a 100644 > --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c > +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c > @@ -205,7 +205,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw, > phy->monitor_vif = vif; > > mvif->mt76.idx = ffs(~dev->mt76.vif_mask) - 1; > - if (mvif->mt76.idx >= MT7915_MAX_INTERFACES) { > + if (mvif->mt76.idx >= (MT7915_MAX_INTERFACES << dev->dbdc_support)) { This patch is incomplete. There are several other places in the code that are not prepared for vif_mask being 64 bits wide, including the ffs line above. - Felix