From: Zhu, Yi Date: Fri, 5 Dec 2008 15:58:38 +0000 (-0800) Subject: iwlwifi: fix time interval misuse in iwl_poll_{direct_}bit X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f056658bb9c3085d5ec52fbdd45b38d55b899cc9;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git iwlwifi: fix time interval misuse in iwl_poll_{direct_}bit The patch fixes the misuse of microsecond with millisecond in the polling mechanism of the iwlwifi driver. The impact of this problem is the unacceptable latency for the whole system (especially during bringing down the wlan interface). Signed-off-by: Zhu Yi Acked-by: Tomas Winkler Signed-off-by: Reinette Chatre Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-io.h b/drivers/net/wireless/iwlwifi/iwl-3945-io.h index 7dea1552a906..2f749432e4bc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-io.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945-io.h @@ -93,7 +93,7 @@ static inline int _iwl3945_poll_bit(struct iwl3945_priv *priv, u32 addr, do { if ((_iwl3945_read32(priv, addr) & mask) == (bits & mask)) return i; - mdelay(10); + udelay(10); i += 10; } while (i < timeout); @@ -276,7 +276,7 @@ static inline int _iwl3945_poll_direct_bit(struct iwl3945_priv *priv, do { if ((_iwl3945_read_direct32(priv, addr) & mask) == mask) return i; - mdelay(10); + udelay(10); i += 10; } while (i < timeout); diff --git a/drivers/net/wireless/iwlwifi/iwl-io.h b/drivers/net/wireless/iwlwifi/iwl-io.h index bc10435d96e5..a5c489af937a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-io.h +++ b/drivers/net/wireless/iwlwifi/iwl-io.h @@ -95,7 +95,7 @@ static inline int _iwl_poll_bit(struct iwl_priv *priv, u32 addr, do { if ((_iwl_read32(priv, addr) & mask) == (bits & mask)) return i; - mdelay(10); + udelay(10); i += 10; } while (i < timeout); @@ -277,7 +277,7 @@ static inline int _iwl_poll_direct_bit(struct iwl_priv *priv, do { if ((_iwl_read_direct32(priv, addr) & mask) == mask) return i; - mdelay(10); + udelay(10); i += 10; } while (i < timeout); diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 18d6cf67d9b7..9d7e45f6a53d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c @@ -628,7 +628,7 @@ void iwl_txq_ctx_stop(struct iwl_priv *priv) iwl_write_direct32(priv, FH_TCSR_CHNL_TX_CONFIG_REG(ch), 0x0); iwl_poll_direct_bit(priv, FH_TSSR_TX_STATUS_REG, FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(ch), - 200); + 1000); } iwl_release_nic_access(priv); spin_unlock_irqrestore(&priv->lock, flags);