diff options
author | David Lin <dlin@marvell.com> | 2016-06-01 16:58:50 +0800 |
---|---|---|
committer | David Lin <dlin@marvell.com> | 2016-06-01 16:58:50 +0800 |
commit | 03046745b6695b1be935ee698e94e01a0be100f4 (patch) | |
tree | 5a54bed4571e4f08b1a1d2b5d2a688b39d89b6ec | |
parent | 8759b558071b111a7404182cf95e9f8b0ba8cca6 (diff) |
Fixed excessive delays.
Signed-off-by: David Lin <dlin@marvell.com>
-rw-r--r-- | fwcmd.c | 4 | ||||
-rw-r--r-- | fwdl.c | 8 |
2 files changed, 7 insertions, 5 deletions
@@ -120,7 +120,7 @@ static int mwl_fwcmd_wait_complete(struct mwl_priv *priv, unsigned short cmd) do { int_code = le16_to_cpu(*((__le16 *)&priv->pcmd_buf[0])); - mdelay(1); + usleep_range(1000, 2000); } while ((int_code != cmd) && (--curr_iteration)); if (curr_iteration == 0) { @@ -130,7 +130,7 @@ static int mwl_fwcmd_wait_complete(struct mwl_priv *priv, unsigned short cmd) return -EIO; } - mdelay(3); + usleep_range(3000, 5000); return 0; } @@ -66,7 +66,7 @@ int mwl_fwdl_download_firmware(struct ieee80211_hw *hw) /* FW before jumping to boot rom, it will enable PCIe transaction retry, * wait for boot code to stop it. */ - mdelay(FW_CHECK_MSECS); + usleep_range(FW_CHECK_MSECS * 1000, FW_CHECK_MSECS * 2000); writel(MACREG_A2HRIC_BIT_MASK, priv->iobase1 + MACREG_REG_A2H_INTERRUPT_CLEAR_SEL); @@ -87,7 +87,7 @@ int mwl_fwdl_download_firmware(struct ieee80211_hw *hw) /* make sure SCRATCH2 C40 is clear, in case we are too quick */ while (readl(priv->iobase1 + 0xc40) == 0) - ; + cond_resched(); while (size_fw_downloaded < fw->size) { len = readl(priv->iobase1 + 0xc40); @@ -117,6 +117,7 @@ int mwl_fwdl_download_firmware(struct ieee80211_hw *hw) int_code = readl(priv->iobase1 + 0xc1c); if (int_code != 0) break; + cond_resched(); curr_iteration--; } while (curr_iteration); @@ -125,6 +126,7 @@ int mwl_fwdl_download_firmware(struct ieee80211_hw *hw) if ((int_code & MACREG_H2ARIC_BIT_DOOR_BELL) != MACREG_H2ARIC_BIT_DOOR_BELL) break; + cond_resched(); curr_iteration--; } while (curr_iteration); @@ -158,7 +160,7 @@ int mwl_fwdl_download_firmware(struct ieee80211_hw *hw) curr_iteration--; writel(HOSTCMD_SOFTAP_MODE, priv->iobase1 + MACREG_REG_GEN_PTR); - mdelay(FW_CHECK_MSECS); + usleep_range(FW_CHECK_MSECS * 1000, FW_CHECK_MSECS * 2000); int_code = readl(priv->iobase1 + MACREG_REG_INT_CODE); if (!(curr_iteration % 0xff) && (int_code != 0)) wiphy_err(hw->wiphy, "%x;", int_code); |