RE: [PATCH V3] wifi: rtlwifi: Drastically reduce the attempts to read efuse in case of failures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Guilherme G. Piccoli <gpiccoli@xxxxxxxxxx> 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;








[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux