Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2364903rwd; Fri, 2 Jun 2023 08:26:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ74pXpOGS97t8gvXUFYwe3TKEniLkmfneFcdvI4p5yOUCa8Ie+nkfThrPiIWuKWJGPi0otg X-Received: by 2002:a05:6a20:1583:b0:10f:759d:c5b2 with SMTP id h3-20020a056a20158300b0010f759dc5b2mr10128784pzj.45.1685719576299; Fri, 02 Jun 2023 08:26:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685719576; cv=none; d=google.com; s=arc-20160816; b=cN+vQqrSIoLrA3L3glt86bTrB8iKYitPmZusx6U2ZmMq8juY/Ey+83vIeWkwNgnvbw NktPegC1el/5E9jx63cZXCz1R3UCSU9WxbmMUSrEUF8d0lItT4OYfpoUTFT7d96tjblk z5JLjgKFe6+2rH3qE3/d6wbsgd63FJYD0gkxQ9RV2+0AP96ISDFRfcLugog+V2xqvFv+ LDaH+SqIK23BQ5+QT0c9VCTz6nTM3VUCuUG1k5H6ArS0du1RK45vmbiasPYMfTpcoYrr dBg1fEPtxEzrczs8BogC+cxm2VKF4nZi+tPv31cQa65qwOvMPjucck/aKv6rVI1fniij iZwQ== 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=ft/fewbjIWf+g8/t7x19xDPiG13CNkK4j34oqEeAbXM=; b=iaVxo6tg+PYF5xfln4J+Ar8zyWAU1lWBtHHWjFhtxjeZ6mi2X0F7Sg12iGACEKlPW4 fdygigKjbn+HlA7nmULOJlOtXD06qtTFOLxGbvJXx9e7rRIxbNHqOgXfFCEGZ3yEaXo+ Rr8P6PyLy02bcJZnsYK1Ss5V7lvd5wHMRJa+Cjnn3xnX94aIhfGeF5CFCLxx9lQGCOfF 7aH6ZhDYSYIXvusxC/gVnuwgOxvSfzh6k/aL1FCgJ9wvbQi40UaABDydp+f2LVUfzW9O SV3NSu8F4fkvFskPAnB7icCAOa3DsZH2j7KlGEOiThDdVxotIZyobMkHHkIcqlcpcFpx IJtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=LmMBmTlw; 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 p27-20020a63741b000000b0052c9458bc03si1139168pgc.278.2023.06.02.08.26.09; Fri, 02 Jun 2023 08:26:16 -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=LmMBmTlw; 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 S234594AbjFBPWB (ORCPT + 64 others); Fri, 2 Jun 2023 11:22:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235813AbjFBPV7 (ORCPT ); Fri, 2 Jun 2023 11:21:59 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A84921B7 for ; Fri, 2 Jun 2023 08:21:57 -0700 (PDT) X-UUID: 336950dc015911eeb20a276fd37b9834-20230602 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=ft/fewbjIWf+g8/t7x19xDPiG13CNkK4j34oqEeAbXM=; b=LmMBmTlwxVOvUap+qeTBOtF+XanHnWR12suIEIb2nymAe8/fv2usSSgRDBe2VOH3zKTk67nXOdIg/QPXrR6ZjFpRaHh/vjTkEJ6robFtd8BsVrRRDdUzBYS3xRArSxIjPL8HB9861An8UX4y3lmy9b2evbYB2SijJ6okF8EvHfY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:c09017ab-ee21-4690-b064-14ecdf92d137,IP:0,U RL:0,TC:0,Content:32,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:32 X-CID-META: VersionHash:d5b0ae3,CLOUDID:0cf3da6d-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: 336950dc015911eeb20a276fd37b9834-20230602 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 240138630; Fri, 02 Jun 2023 23:21:52 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.194) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 2 Jun 2023 23:21:51 +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; Fri, 2 Jun 2023 23:21:51 +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 09/12] wifi: mt76: mt7996: use correct phy for background radar event Date: Fri, 2 Jun 2023 23:21:05 +0800 Message-ID: <20230602152108.26860-9-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230602152108.26860-1-shayne.chen@mediatek.com> References: <20230602152108.26860-1-shayne.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED 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 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 52c6c502e9b3..48782b53f5d4 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