[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8363b94ee45c49c0996b12010c18b9f0@realtek.com>
Date: Fri, 1 Nov 2024 04:22:19 +0000
From: Ping-Ke Shih <pkshih@...ltek.com>
To: "Guilherme G. Piccoli" <gpiccoli@...lia.com>,
"linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>
CC: "kvalo@...nel.org" <kvalo@...nel.org>,
"linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>,
"kernel@...ccoli.net" <kernel@...ccoli.net>,
"kernel-dev@...lia.com" <kernel-dev@...lia.com>,
"rtl8821cerfe2@...il.com"
<rtl8821cerfe2@...il.com>,
"stable@...r.kernel.org" <stable@...r.kernel.org>,
"syzbot+edd9fe0d3a65b14588d5@...kaller.appspotmail.com"
<syzbot+edd9fe0d3a65b14588d5@...kaller.appspotmail.com>
Subject: RE: [PATCH V3] wifi: rtlwifi: Drastically reduce the attempts to read efuse in case of failures
Guilherme G. Piccoli <gpiccoli@...lia.com> wrote:
> diff --git a/drivers/net/wireless/realtek/rtlwifi/efuse.c
> b/drivers/net/wireless/realtek/rtlwifi/efuse.c
> index 82cf5fb5175f..0ff553f650f9 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/efuse.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/efuse.c
> @@ -162,9 +162,19 @@ void efuse_write_1byte(struct ieee80211_hw *hw, u16 address, u8 value)
> void read_efuse_byte(struct ieee80211_hw *hw, u16 _offset, u8 *pbuf)
> {
> struct rtl_priv *rtlpriv = rtl_priv(hw);
> + u16 retry, max_attempts;
> u32 value32;
> u8 readbyte;
> - u16 retry;
> +
> + /*
> + * In case of USB devices, transfer speeds are limited, hence
> + * efuse I/O reads could be (way) slower. So, decrease (a lot)
> + * the read attempts in case of failures.
> + */
> + if (rtlpriv->rtlhal.interface == INTF_PCI)
> + max_attempts = 10000;
> + else
> + max_attempts = 10;
As your comment, setting max_atttempts to 10 under condition of INTF_USB would
be more reasonable, like
u16 max_attempts = 10000;
if (rtlpriv->rtlhal.interface == INTF_USB)
max_attempts = 10;
Powered by blists - more mailing lists