From patchwork Wed Oct 19 08:25:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4620 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp211894wrs; Wed, 19 Oct 2022 02:06:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6gzuZKrTKFTY3dVVRLPtcNmz4aV5lr9bZPXmL9zSchD4Xsqsn155Ny0uwJBJdhpdrz4LJ5 X-Received: by 2002:a17:906:cc0f:b0:78e:1208:8796 with SMTP id ml15-20020a170906cc0f00b0078e12088796mr5783983ejb.601.1666170370632; Wed, 19 Oct 2022 02:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666170370; cv=none; d=google.com; s=arc-20160816; b=vlKJamnxEpS3AOOaU1SHCteJqlEOmFv/sOEn9Qtrhp8pVgCHd1b8oM02hoczgroXZN a8WrrQEWz7qVMLam40qjsB3/8IV4Vg7FcfeyVSkfqzvOE6Nb/5sG6GqS6T+MtXMG2x+9 JZbwWGxwEvKkpOMxJ1NzQ/y9WAwBvmDWZnNx451r7AifXoYHFWd1kmpSX1YbNCi+88kM iKdkVA65tQQmoNLlS+GqvU8yv5uNen/p+QxUdjCtlfD39EHHt+KeZQpDc6+X3QVXhJdL J3CX3KFo1blirWM7BeJNdWbYQaJ2eyjoRvPRbjz1hiwvwx/wvh7qymJ61iV2wqjPhAsd fcAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2ju0xb5J/7LgCjsTM1mnaFCYDOqG0uHEgD1DoR6rxkE=; b=A/1fJ9vcZ14sywvdAPN+pM46qh7nIeOqkqnrbviWAGKjcAKgP0UQhQGNIB9tIxMYDq o34dbjV5LcDlV0dVhUUe2VvQR9eh2peN08rewiaVbK9FlHrNrFDBBzjeXebTYvHHcRQD f9E2eKprBADpL7H5zg2NTU4SXpxcH/NM9FWPqxd2g2a99xWUIigwxGk49KmkhB/1H3tN fOEPQLgrosk0LRXGzl0hLL5OBAwxXZmDwNTFhwuGpJ3lBtak3VNCSMmFi9MYedEXQOr+ Gzy0Yz+MKQQRsiKn0cRuBtTP5JJCvdsg4f6RqDrVE0syL/0zwVFjhS7JzdgkRocNG6IX bx2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uvmWQSCU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e13-20020a1709062c0d00b0073d80d8b631si11218448ejh.268.2022.10.19.02.05.38; Wed, 19 Oct 2022 02:06:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=uvmWQSCU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231889AbiJSI4A (ORCPT + 99 others); Wed, 19 Oct 2022 04:56:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232151AbiJSIys (ORCPT ); Wed, 19 Oct 2022 04:54:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2797797EFB; Wed, 19 Oct 2022 01:51:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 287F56183D; Wed, 19 Oct 2022 08:50:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AA5DC433C1; Wed, 19 Oct 2022 08:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169429; bh=HBbeeWj5cCSDh5GVLlnZ/XVO+E/RGuJ2akvlL/0LNDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uvmWQSCUOzlvjBCFL2qs0fqZ4xT3QsuAZ3EfdpHrNKH8p6k3NFJTr8He4JoobnNHv 0+grZVAuAZu4ibt+TdagXPHgWsw997tImiaQLDdR1SdzYkSGR1FjbXejS1fFrNnwa1 WJym1NPmrSpcbomD1XWy31MK/izWwggB01uUNaXE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ping-Ke Shih , Kalle Valo , Sasha Levin Subject: [PATCH 6.0 229/862] wifi: rtlwifi: 8192de: correct checking of IQK reload Date: Wed, 19 Oct 2022 10:25:16 +0200 Message-Id: <20221019083300.185899884@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747106262857124079?= X-GMAIL-MSGID: =?utf-8?q?1747106262857124079?= From: Ping-Ke Shih [ Upstream commit 93fbc1ebd978cf408ef5765e9c1630fce9a8621b ] Since IQK could spend time, we make a cache of IQK result matrix that looks like iqk_matrix[channel_idx].val[x][y], and we can reload the matrix if we have made a cache. To determine a cache is made, we check iqk_matrix[channel_idx].val[0][0]. The initial commit 7274a8c22980 ("rtlwifi: rtl8192de: Merge phy routines") make a mistake that checks incorrect iqk_matrix[channel_idx].val[0] that is always true, and this mistake is found by commit ee3db469dd31 ("wifi: rtlwifi: remove always-true condition pointed out by GCC 12"), so I recall the vendor driver to find fix and apply the correctness. Fixes: 7274a8c22980 ("rtlwifi: rtl8192de: Merge phy routines") Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220801113345.42016-1-pkshih@realtek.com Signed-off-by: Sasha Levin --- drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c index 15e6a6aded31..d18c092b6142 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c @@ -2386,11 +2386,10 @@ void rtl92d_phy_reload_iqk_setting(struct ieee80211_hw *hw, u8 channel) rtl_dbg(rtlpriv, COMP_SCAN, DBG_LOUD, "Just Read IQK Matrix reg for channel:%d....\n", channel); - _rtl92d_phy_patha_fill_iqk_matrix(hw, true, - rtlphy->iqk_matrix[ - indexforchannel].value, 0, - (rtlphy->iqk_matrix[ - indexforchannel].value[0][2] == 0)); + if (rtlphy->iqk_matrix[indexforchannel].value[0][0] != 0) + _rtl92d_phy_patha_fill_iqk_matrix(hw, true, + rtlphy->iqk_matrix[indexforchannel].value, 0, + rtlphy->iqk_matrix[indexforchannel].value[0][2] == 0); if (IS_92D_SINGLEPHY(rtlhal->version)) { if ((rtlphy->iqk_matrix[ indexforchannel].value[0][4] != 0)