Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3885991rwi; Sat, 22 Oct 2022 01:33:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5iuITJEDK3/psEN/5SkYgDCNA09BQwrtBGCUkynj11mNvlaFc9iXeg/Ks7Rzk35uUNOtvQ X-Received: by 2002:a17:907:60c8:b0:78d:bc8d:8457 with SMTP id hv8-20020a17090760c800b0078dbc8d8457mr18724095ejc.418.1666427604542; Sat, 22 Oct 2022 01:33:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427604; cv=none; d=google.com; s=arc-20160816; b=wTixb/Eezue8e9RPfNmNcs2h2umNZzFgJOu58MhI3G7m3V3lV/Yka6Iq/bVzxSm2D/ cpSdm+EvSIAqCzz+JTFxu3F47jBkgKU1dvEl0qZ2EKcAxu+3oGJG9/3EXErj8Q+layXn MgfS3A0A3bIJswon9jR1Xl956oBWVGkcBa9j5wTpljCEORhkeUPfpwEuHSu2Zj/nD3If UpLMDGZNT0qJUPuE/2u50u08yEZjzhBrm1vWK+Yp3RRa8QjGhvNDEX/+Lwh/CTYW+hzI HbAV6RbSrPXyx4f3i001dCUywsPybxCHN+sL81BYADJUPuk9GGbRregK/5YpvWEpc3np Wg1Q== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b13-20020a056402084d00b0045c98bb5359si27887207edz.590.2022.10.22.01.32.57; Sat, 22 Oct 2022 01:33:24 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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) -- 2.35.1