From patchwork Mon Nov 4 05:14:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mingyen Hsieh X-Patchwork-Id: 13860916 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3BE49D111A8 for ; Mon, 4 Nov 2024 05:15:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=yUCYHw7khHoCO1t2Y7CbcGcUg+wa95k4lCS42nnuKdY=; b=mkfmJ9REgSiC70dMxpbhTPYAqw +8LxwKoB/B9ftFG0+IwWQpDvF/diwxXIjOnkjhDmQYPTkfB+ELl0jOhutpxwEs+FK+Q43AMExbRzJ 2NDRRtQaHuMYvTM9IHPVH+8aVY2ULaKFEU/b3G/6YPdoCXf8ZfWC0Ar8LhLQCYR15okFpr9s2I7uJ O77SQ/xC+HMNd4b9JJN7AboDVpviclcO6HTUyz3MuKitEBK8SM1zZhSZB18btkn0bEmapJlXahKI3 4yl8WOgtV+2PY56R0yqI8RluJ35rX+uBjFxlz7u/uWyTzTYSPmMfOIKULcoSayrIj7nKQemJGBqBS G/5cLJCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t7pQZ-0000000Cfas-43W4; Mon, 04 Nov 2024 05:14:59 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t7pQX-0000000CfaR-2B0q for linux-mediatek@lists.infradead.org; Mon, 04 Nov 2024 05:14:58 +0000 X-UUID: b91b7e889a6b11ef9048ed6ed365623b-20241103 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=yUCYHw7khHoCO1t2Y7CbcGcUg+wa95k4lCS42nnuKdY=; b=hgpDreY84sBA/hPpOAigP+9lSnnd7qidRiF1vxOs1KavZAyZCJVkaB8o2VtVQKoBqeJylAU0MZBMNEUm1Df1javo28ALp+kZFXj+KSsWQ59UL6dKu359YbmR0PiEJJdRWmLxnrEMZ2z32ezXEez1E6yeeaaFeSqvLEv6PiQ2pHE=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.42,REQID:ffd4c7ce-db4b-4511-85e4-5fac2c717e16,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:b0fcdc3,CLOUDID:1b0ca348-ca13-40ea-8070-fa012edab362,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: b91b7e889a6b11ef9048ed6ed365623b-20241103 Received: from mtkmbs14n1.mediatek.inc [(172.21.101.75)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1932719508; Sun, 03 Nov 2024 22:14:52 -0700 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) 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; Mon, 4 Nov 2024 13:14:48 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Mon, 4 Nov 2024 13:14:48 +0800 From: Mingyen Hsieh To: , CC: , , , , , , , , , , , , , , , Ming Yen Hsieh Subject: [PATCH v2] wifi: mt76: mt7925: fix get wrong chip cap from incorrect pointer Date: Mon, 4 Nov 2024 13:14:47 +0800 Message-ID: <20241104051447.4286-1-mingyen.hsieh@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10-3.791700-8.000000 X-TMASE-MatchedRID: mvQ5OXqkleF3jyG1lXn0RLMjW/sniEQKfiuvKi9huaYFi3R9x/2qQsHt HEmxq9+Y32QTkj7KSP7bCHv011Gy9Uibx2WCCMTIngIgpj8eDcAZ1CdBJOsoY8RB0bsfrpPI0PU 0TdJoUtdOHQWzTBvDVjaZuQtaXB65G+CCkpJR1ck6IRYfe9h6Igm3AqTtXDcfSVcF4gli7G7oM6 wHK262gsECmoVvhxxOslfTc7QVzKWOh+wyNBrFXDJiNuKohDcKzKSG3JdyKAPqtV2AGMNParsc3 Lhg3nYY X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10-3.791700-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 378397D9253B17FAECA106672662722972B3A117A8C14293E4F3F60E155DAC602000:8 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241103_211457_589685_BA9ED515 X-CRM114-Status: UNSURE ( 8.98 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Ming Yen Hsieh Use tlv instead of skb, because using skb will get valid data with wrong offset. Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Signed-off-by: Ming Yen Hsieh --- v2: - Considering the CPU endian order, add le64_to_cpu(). drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index 0c2a2337c313..81ddcf72bcd2 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -823,7 +823,7 @@ mt7925_mcu_get_nic_capability(struct mt792x_dev *dev) mt7925_mcu_parse_phy_cap(dev, tlv->data); break; case MT_NIC_CAP_CHIP_CAP: - memcpy(&dev->phy.chip_cap, (void *)skb->data, sizeof(u64)); + dev->phy.chip_cap = le64_to_cpu(*(__le64 *)tlv->data); break; case MT_NIC_CAP_EML_CAP: mt7925_mcu_parse_eml_cap(dev, tlv->data);