On 4/26/23 21:05, Yun Lu wrote:
From: Yun Lu <luyun@xxxxxxxxxx> 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.
I added the attached patch to see what was different between the two values in REG_RCR. To my surprise, nothing was logged.
Please add this one on top of you proposed patch, and send me the output from the log.
Thanks, Larry
diff --git a/Makefile b/Makefile index f5543eef4f82..6d985a175d78 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 -PATCHLEVEL = 3 +PATCHLEVEL = 4 SUBLEVEL = 0 -EXTRAVERSION = +EXTRAVERSION = -rc0 NAME = Hurr durr I'ma ninja sloth # *DOCUMENTATION* diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index 831639d73657..b5212ceb4eb4 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -6504,6 +6504,10 @@ static void rtl8xxxu_configure_filter(struct ieee80211_hw *hw, struct rtl8xxxu_priv *priv = hw->priv; u32 rcr = priv->regrcr; + if (rcr != rtl8xxxu_read32(priv, REG_RCR)) { + pr_info("BEFORE: REG_RCR differs from regrcr: 0x%x insted of 0x%x\n", + rtl8xxxu_read32(priv, REG_RCR), priv->regrcr); + } dev_dbg(&priv->udev->dev, "%s: changed_flags %08x, total_flags %08x\n", __func__, changed_flags, *total_flags); @@ -6547,6 +6551,10 @@ static void rtl8xxxu_configure_filter(struct ieee80211_hw *hw, * FIF_PROBE_REQ ignored as probe requests always seem to be accepted */ + if (rcr != rtl8xxxu_read32(priv, REG_RCR)) { + pr_info("AFTER: REG_RCR differs from regrcr: 0x%x insted of 0x%x\n", + rtl8xxxu_read32(priv, REG_RCR), priv->regrcr); + } rtl8xxxu_write32(priv, REG_RCR, rcr); priv->regrcr = rcr;