diff options
author | Felix Fietkau <nbd@nbd.name> | 2016-07-20 23:29:28 +0200 |
---|---|---|
committer | Zoltan HERPAI <wigyori@uid0.hu> | 2016-07-20 23:29:28 +0200 |
commit | 957808eb4f8bffc9458b6caae05d693fa6b09933 (patch) | |
tree | 2071dc1edf877941533321c638d32dad4219db38 /package | |
parent | 4fbcf30db6f532d7fc690f7ff7898fb8070beabc (diff) | |
download | master-187ad058-957808eb4f8bffc9458b6caae05d693fa6b09933.tar.gz master-187ad058-957808eb4f8bffc9458b6caae05d693fa6b09933.tar.bz2 master-187ad058-957808eb4f8bffc9458b6caae05d693fa6b09933.zip |
mwlwifi: fix excessive use of busy-waiting that was tripping up the flash driver
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package')
-rw-r--r-- | package/kernel/mwlwifi/patches/200-fix_excessive_delays.patch | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/package/kernel/mwlwifi/patches/200-fix_excessive_delays.patch b/package/kernel/mwlwifi/patches/200-fix_excessive_delays.patch new file mode 100644 index 0000000000..43523edee0 --- /dev/null +++ b/package/kernel/mwlwifi/patches/200-fix_excessive_delays.patch @@ -0,0 +1,73 @@ +--- a/fwcmd.c ++++ b/fwcmd.c +@@ -132,7 +132,7 @@ static int mwl_fwcmd_wait_complete(struc + int_code = le16_to_cpu(*((__le16 *)&priv->pcmd_buf[2])); + else + 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) { +@@ -142,7 +142,7 @@ static int mwl_fwcmd_wait_complete(struc + return -EIO; + } + +- mdelay(3); ++ usleep_range(3000, 5000); + + return 0; + } +--- a/fwdl.c ++++ b/fwdl.c +@@ -74,7 +74,7 @@ int mwl_fwdl_download_firmware(struct ie + /* 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); +@@ -95,7 +95,7 @@ int mwl_fwdl_download_firmware(struct ie + + /* 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); +@@ -125,6 +125,7 @@ int mwl_fwdl_download_firmware(struct ie + int_code = readl(priv->iobase1 + 0xc1c); + if (int_code != 0) + break; ++ cond_resched(); + curr_iteration--; + } while (curr_iteration); + +@@ -133,6 +134,7 @@ int mwl_fwdl_download_firmware(struct ie + if ((int_code & MACREG_H2ARIC_BIT_DOOR_BELL) != + MACREG_H2ARIC_BIT_DOOR_BELL) + break; ++ cond_resched(); + curr_iteration--; + } while (curr_iteration); + +@@ -167,12 +169,14 @@ int mwl_fwdl_download_firmware(struct ie + do { + curr_iteration--; + if (priv->mfg_mode && priv->chip_type == MWL8897) { +- mdelay(FW_CHECK_MSECS); ++ usleep_range(FW_CHECK_MSECS * 1000, ++ FW_CHECK_MSECS * 2000); + int_code = readl(priv->iobase1 + 0xc44); + } else { + 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)) |