From patchwork Sat Oct 22 07:21:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7296 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1092948wrr; Sat, 22 Oct 2022 00:55:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7GypDOKveB2u5+9Ux/DLNEKdGlrKLvaBAGzPyYu94KIGXfeE7QQrAK9jyVE7c3MrAgOJkY X-Received: by 2002:a17:90b:17d2:b0:20d:6c68:6df8 with SMTP id me18-20020a17090b17d200b0020d6c686df8mr26406972pjb.54.1666425336678; Sat, 22 Oct 2022 00:55:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425336; cv=none; d=google.com; s=arc-20160816; b=AlLndpeauqO50RJY65TqG7GA+1bl5gwkfZAqVB6qWqGVUi9Yzup+cDi/8HgMjokB7X GHmCXFIxFwtsysHwcpPdPEMiA5VoZ/oOyuME0tNHL3J8jFp6Wwj1QWc/DSe85/JZa6QT fROgDeyqAybhNkv6qdOmeJHtpUMmksxJDfbv2v0EkVVUmc9W+tRpcRddoRmmZ8Suh4Jy mApTxeC4Bvl66XtVenvl+BGYgiVFM6aIC8De5wGrokP4mlkAs/uDu/G9EkcGFeQUM7Ai xGVNw/c7HE3C5tQ6Nnzn56WyQ/i8dMm7KKvmYOnccphS52C598HKz0KkQ8ZQEhAgr1Lz 89pQ== 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=ARsmkf/aRdBd+1A5M86S6RH/hZtqs7mhdylYryiJ+3NcLOwSuIOuj2iuNXHE/PKSoc TUu1BaItqttT6WS+M9AqbaIv1x5/noRFjYq46gjRL350O9WaLTuNcdexRttvS9CkBD55 Gy/AA2YxTiqf7yb96fuzBbuOpwIbqcxnXzpFRJzb/W9CRKPfHZ3VufgvaGrRH8POdF0T kAwuSjgtZDJMT/twK1A1G3pbX8ZLpQq5sF66RsyzZ9+IWONpVgkz7YCDzXOqtzoiQeLw H8pW4blaTHcsWQ4fg7sFDqX+yAKracDgiV6YC0n8zP9JHKl5KAQtMxbs359sdyv8VVAZ tLVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rc9BGQ6K; 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 e12-20020a17090301cc00b00176a16ca9b1si30633478plh.529.2022.10.22.00.55.22; Sat, 22 Oct 2022 00:55:36 -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=rc9BGQ6K; 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 S231810AbiJVHzG (ORCPT + 99 others); Sat, 22 Oct 2022 03:55:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231983AbiJVHv7 (ORCPT ); Sat, 22 Oct 2022 03:51:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0DA92C1735; Sat, 22 Oct 2022 00:46:37 -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 CA12D60ADC; Sat, 22 Oct 2022 07:44:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD1CEC433D6; Sat, 22 Oct 2022 07:44:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424663; bh=HBbeeWj5cCSDh5GVLlnZ/XVO+E/RGuJ2akvlL/0LNDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rc9BGQ6KkGb5FpQq3VY2swsJRoa06cQMNqj7bI3KJArKr8T8iRLeFwO5Fs3fwIS7E zGX++K8t1xwGEHjGvybXWMjt0eRToBlhVPY4Uqm4iTv7nsbeDxTDGUDhxC8gy3u/Ei CuC4JhLBp4aw+YMGm9EaLI4nXgfRylTWARvBx3yk= 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 5.19 200/717] wifi: rtlwifi: 8192de: correct checking of IQK reload Date: Sat, 22 Oct 2022 09:21:19 +0200 Message-Id: <20221022072450.817790259@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747373613459681036?= X-GMAIL-MSGID: =?utf-8?q?1747373613459681036?= 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)