Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8264670rwr; Wed, 10 May 2023 21:38:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6nx9qdeI+im+eaQzX1yuLf8oRP4F3CdkVCq+u5w+9BVAC/Rt16b1FlVtBNajk11vW68NrD X-Received: by 2002:a05:6a00:2345:b0:63d:3981:313d with SMTP id j5-20020a056a00234500b0063d3981313dmr28573331pfj.10.1683779930083; Wed, 10 May 2023 21:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683779930; cv=none; d=google.com; s=arc-20160816; b=zts28g5NsjMKSNw8XCSq584TVIEiU0mws8f9qNESTho8C//ciBjQWnkcOf8tntNX7Z fp/uybCHV7h756jlToe996QAnUc8fiJRF1RfskkIQBmRhG1dAe3VD1g5e1HPn5n72AHO hcOxP+gbEOd+/WZ67gQDv837+cF0gxiQMEYsTE6Odbb3TJcU69arnTNUprKLprASnCFG +X7hf6gwxRrdovKlrWcOVox/9q8GM0GEcChIB6GvdvkP7M9TqDMv6GobvEDjdO4DBNGI IuUYmEs5IwqIbNNgpFXbTc1r70CeHyGdVXu89sMylMXhMZbSavb7nsgbkWab7fvLr22a UPRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=bF0E8dYTn10kN4jTvi8jZ6DlK/Lu6WpIxNqCFWuU084=; b=a7S1f2HELWyRwwVe9u81ypPJh0hlV3UiwaGqMLJdp+Jspmh3V5otAkUDKMgy+6laX3 1UJGgR/B9DOQsiq8UCtQk268Uo2sn+nMu13Ln31cs9Jx2O+JUxSE7v8Jf3kSG4UR5Rip SpIKUr4X01PG1pBenZ29u7XVK9UkddyHAch936Vjpj18x2UeXOtcMh9xfqfiKfYd/khL CMwqLyfTuA7Gh+kzPG09fgrrzjci7hAtHsh+Y1KgZ66CK1Ycm4GhkI06KFuh06Hjon9z sb82PnHndeOMaWzAzyBopkw2zmBih+im8zfPVZa+e3r+ILUP7PLH3F/v4JsKcgR77+Ba SliA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Eclxmqzp; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q2-20020a637502000000b005307d9f387esi87256pgc.536.2023.05.10.21.38.37; Wed, 10 May 2023 21:38:50 -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=@gmail.com header.s=20221208 header.b=Eclxmqzp; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232165AbjEKEeZ (ORCPT + 62 others); Thu, 11 May 2023 00:34:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231610AbjEKEeX (ORCPT ); Thu, 11 May 2023 00:34:23 -0400 Received: from mail-oa1-x31.google.com (mail-oa1-x31.google.com [IPv6:2001:4860:4864:20::31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2B064C28; Wed, 10 May 2023 21:34:21 -0700 (PDT) Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-192c2569c72so3546637fac.2; Wed, 10 May 2023 21:34:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683779661; x=1686371661; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=bF0E8dYTn10kN4jTvi8jZ6DlK/Lu6WpIxNqCFWuU084=; b=EclxmqzpA765BbSy0RGR1ite70yLvjChBt8piQqgI4KBxHXb+aIjJRwVlUJ5VsUMPj X/NMkVQUp/8nVqB0hBWoluwCo+zhxQjzfgreWnCvVjd6WuaZiMoSpBDfKkYBQ7Ld06UT bsGJBGUw43FUtKmr/SjYXl/IsFwHaHSy6er0InaXDzfnONrcSqsVY4R56InH3IlH3yLX o+tV8Kcej+JaakL1M4/P1y5HEy7xMwJyRYc15z/i8q6v2sqjUcvsLYpySKaXZCUistdg tAKLsUu5o36GwWZ7K1Ezby1WBXG0znZ2pXGjXGYfY5dnSM5FGwwTKJt9b63xRhJbaBJe cIYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683779661; x=1686371661; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bF0E8dYTn10kN4jTvi8jZ6DlK/Lu6WpIxNqCFWuU084=; b=Pb7y3DWWbpy7FaIs3TA3GkVtfCBJpBJDB5Ry8UpqMudWvdqBtRuy2Ehego0QArpO/S oHFImbC6SkqybipFu0Dbu6UKF554Gcz2xMvzc5JdAQ1MVQCyU6wFUp22YL8QIek5qg5d khaKZnbMiJBUXgDjZZrkoaILewaoy7W1mQnNnvDTlhbh4HjJEO84GiFmGI7eU6ZKSPFk muCQ342gxVGPiNm+LH6wODEoPfcMDXv0RhU3L9kd9HKMuyNxZLJVJM/EMrlcQTHv9O4N lI5kW6INn3sl70un2of/BI/OZH4NkfVZW+91XdDF8xGfPd2W/sYUHkdPT+68kvWnhNIr IxTQ== X-Gm-Message-State: AC+VfDx6Myh+EjnUAC2pkc0Rzh0kH5qqKROqJBVDXRpLXRiAuwYxvyLa d294AWaGo3lYoB0JD1JjHQ4= X-Received: by 2002:a05:6870:e14a:b0:187:9d7a:36e3 with SMTP id z10-20020a056870e14a00b001879d7a36e3mr9572079oaa.28.1683779660874; Wed, 10 May 2023 21:34:20 -0700 (PDT) Received: from [10.62.118.118] ([216.130.59.33]) by smtp.gmail.com with ESMTPSA id a6-20020a056870618600b0017197629658sm7701842oah.56.2023.05.10.21.34.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 May 2023 21:34:20 -0700 (PDT) Sender: Larry Finger Message-ID: Date: Wed, 10 May 2023 23:34:19 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH v2] wifi: rtl8xxxu: fix authentication timeout due to incorrect RCR value Content-Language: en-US To: Yun Lu , Jes.Sorensen@gmail.com Cc: kvalo@kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org References: <20230511031825.2125279-1-luyun_611@163.com> From: Larry Finger In-Reply-To: <20230511031825.2125279-1-luyun_611@163.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On 5/10/23 22:18, Yun Lu wrote: > From: Yun Lu > > When using rtl8192cu with rtl8xxxu driver to connect wifi, there is a > probability of failure, which shows "authentication with ... timed out". > Through debugging, it was found that the RCR register has been inexplicably > modified to an incorrect value, resulting in the nic not being able to > receive authenticated frames. > > To fix this problem, add regrcr in rtl8xxxu_priv struct, and store > the RCR value every time the register is writen, and use it the next > time the register need to be modified. > > Signed-off-by: Yun Lu > Link: https://lore.kernel.org/all/20230427020512.1221062-1-luyun_611@163.com > --- > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 + > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 4 +++- > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h > index c8cee4a24755..4088aaa1c618 100644 > --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h > +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h > @@ -1518,6 +1518,7 @@ struct rtl8xxxu_priv { > u32 rege9c; > u32 regeb4; > u32 regebc; > + u32 regrcr; > int next_mbox; > int nr_out_eps; > > diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c > index 620a5cc2bfdd..2fe71933ba08 100644 > --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c > +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c > @@ -4053,6 +4053,7 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw) > RCR_ACCEPT_MGMT_FRAME | RCR_HTC_LOC_CTRL | > RCR_APPEND_PHYSTAT | RCR_APPEND_ICV | RCR_APPEND_MIC; > rtl8xxxu_write32(priv, REG_RCR, val32); > + priv->regrcr = val32; > > if (priv->rtl_chip == RTL8188F) { > /* Accept all data frames */ > @@ -6273,7 +6274,7 @@ static void rtl8xxxu_configure_filter(struct ieee80211_hw *hw, > unsigned int *total_flags, u64 multicast) > { > struct rtl8xxxu_priv *priv = hw->priv; > - u32 rcr = rtl8xxxu_read32(priv, REG_RCR); > + u32 rcr = priv->regrcr; > > dev_dbg(&priv->udev->dev, "%s: changed_flags %08x, total_flags %08x\n", > __func__, changed_flags, *total_flags); > @@ -6319,6 +6320,7 @@ static void rtl8xxxu_configure_filter(struct ieee80211_hw *hw, > */ > > rtl8xxxu_write32(priv, REG_RCR, rcr); > + priv->regrcr = rcr; > > *total_flags &= (FIF_ALLMULTI | FIF_FCSFAIL | FIF_BCN_PRBRESP_PROMISC | > FIF_CONTROL | FIF_OTHER_BSS | FIF_PSPOLL | Acked-by and Tested-by: Larry Finger Thanks, Larry