Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5309062rwd; Mon, 5 Jun 2023 01:25:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ76wW9DZmI6xsqVDUB0ksN1J76Zi/XZPEMyWwsPC7Wpevezaw1Pq2kFxD25AcWZV7dz1gcJ X-Received: by 2002:a17:90a:1959:b0:259:5494:db4a with SMTP id 25-20020a17090a195900b002595494db4amr521344pjh.30.1685953506264; Mon, 05 Jun 2023 01:25:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685953506; cv=none; d=google.com; s=arc-20160816; b=zoxMcfvHtudCS6tdydRS/1ndhAlqzwg2GFxou4v5+v92BHzl+vEiimIon8E3Oowa0O rREp+ZpR4Z3SiEyY3bkww0zFiKCP+U58pPENtyPWudLW0E5lzoTcrwGUCwSTCa7fd+mY 7rtHv59uEpokzOKs42IBg/iGmPsUVc5g9IsaW1vkDtUbz+PkDG0MVX4kKcMvIeI4eGQl K16ya0WzdeD1oP4ybIxZ9isc46r0LtUwosLzCHonkZlQVMoni2Iwx7VdCpTgXjGHzz+P soey9P3DjH9Cgs2Qti2TxC/q3AvDcR9UUUCkLr5KCaXJKy0oXg/883X1aIkUs5pmy9vY IFxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=XxBk4ypnkqYXwOw44DslhDRSNb58MKb2UrCUgoOWTYg=; b=DAIdHSOjfk4D+6SSQRxDZhlJKs1QvhmNV3vjky8moPd4Klzsps4PB/ljg7wVfTP87g 2BK3irT18GYLZcLvuNu6EOC1UvYHOzQ4xfQjCb6L5WkGQlF7ih7qLJl2HP0yYcBEC2ly XuY3l3cBTHoqn0lQpGAj5i0ITt/mcnwVFjXDn7HS4xgLTggJFD4TpDOr3RLRdxBXFnRR EjJ4tKsFOsJ5eACwoWylGA8KLGhT/M+BLz1Veno/B09EfulAv0PJdE1G3PRqjTPb5n21 x0UtjK5tCmwZeEZR5WWUfQUAUl7IZWg2SeIudyE9el5wjQ0VQGf12f4XbXwJQw0j4jex 4wfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=tdjx+bWO; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j14-20020a636e0e000000b00541bf36f2d2si5233091pgc.208.2023.06.05.01.24.53; Mon, 05 Jun 2023 01:25:06 -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=pass header.i=@mediatek.com header.s=dk header.b=tdjx+bWO; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229795AbjFEIUw (ORCPT + 62 others); Mon, 5 Jun 2023 04:20:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229614AbjFEIUv (ORCPT ); Mon, 5 Jun 2023 04:20:51 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 062F7AD for ; Mon, 5 Jun 2023 01:20:47 -0700 (PDT) X-UUID: dc94d54c037911eeb20a276fd37b9834-20230605 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=XxBk4ypnkqYXwOw44DslhDRSNb58MKb2UrCUgoOWTYg=; b=tdjx+bWO6z8kOREJ9z6sTH0rbfXnBD40A8uyC2FA0hdpv5ceX9behbqt9p90TjFBWxNNV/zcXyOs3kOeccWo6sWc9RkQGksjG+f7r1tBqtufjuXEIGOytmJxDWvyf7HvZb+DLZdqd34FkOtRLvIFDzTnvMM1tEhr56fdmwh49R0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:ba9e7a9a-0952-4f31-bccd-996ce10d9ba1,IP:0,U RL:0,TC:0,Content:31,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:31 X-CID-META: VersionHash:d5b0ae3,CLOUDID:6c0f0c6e-2f20-4998-991c-3b78627e4938,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:3,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: dc94d54c037911eeb20a276fd37b9834-20230605 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1069655461; Mon, 05 Jun 2023 16:20:42 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Mon, 5 Jun 2023 16:20:41 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Mon, 5 Jun 2023 16:20:41 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , Evelyn Tsai , Bo Jiao , linux-mediatek , StanleyYP Wang , Shayne Chen Subject: [PATCH v2 07/10] wifi: mt76: mt7996: use correct phy for background radar event Date: Mon, 5 Jun 2023 16:19:44 +0800 Message-ID: <20230605081947.12804-7-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230605081947.12804-1-shayne.chen@mediatek.com> References: <20230605081947.12804-1-shayne.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RDNS_NONE,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no 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 From: StanleyYP Wang If driver directly uses the band_idx reported from the radar event to access mt76_phy array, it will get the wrong phy for background radar. Fix this by adjusting the statement. Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: StanleyYP Wang Signed-off-by: Shayne Chen --- drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c index 7eafb5c44a7f..398d27d522ef 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c @@ -339,7 +339,11 @@ mt7996_mcu_rx_radar_detected(struct mt7996_dev *dev, struct sk_buff *skb) if (r->band_idx >= ARRAY_SIZE(dev->mt76.phys)) return; - mphy = dev->mt76.phys[r->band_idx]; + if (dev->rdd2_phy && r->band_idx == MT_RX_SEL2) + mphy = dev->rdd2_phy->mt76; + else + mphy = dev->mt76.phys[r->band_idx]; + if (!mphy) return; -- 2.39.2