diff options
author | Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com> | 2017-11-03 05:36:28 -0400 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2017-11-07 07:42:53 -0500 |
commit | 1f27ddf0b50b45eaf0f95565125cf10f9c821746 (patch) | |
tree | 460b1ce27843012f6f6f785da84f357ad967ba5d | |
parent | 379777297cb130b8b23f82b34ea889c31e828a8c (diff) |
mmc: tmio: Replace msleep() of 20ms or less with usleep_range()
As documented in Documentation/timers/timers-howto.txt
as follows, replace msleep() with usleep_range().
msleep(1~20) may not do what the caller intends, and
will often sleep longer (~20 ms actual sleep for any
value given in the 1~20ms range). In many cases this
is not the desired behavior.
Signed-off-by: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/host/tmio_mmc_core.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 4c8198f8b04a..583bf3262df5 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c | |||
@@ -167,11 +167,11 @@ static void tmio_mmc_clk_start(struct tmio_mmc_host *host) | |||
167 | 167 | ||
168 | /* HW engineers overrode docs: no sleep needed on R-Car2+ */ | 168 | /* HW engineers overrode docs: no sleep needed on R-Car2+ */ |
169 | if (!(host->pdata->flags & TMIO_MMC_MIN_RCAR2)) | 169 | if (!(host->pdata->flags & TMIO_MMC_MIN_RCAR2)) |
170 | msleep(10); | 170 | usleep_range(10000, 11000); |
171 | 171 | ||
172 | if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) { | 172 | if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) { |
173 | sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100); | 173 | sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100); |
174 | msleep(10); | 174 | usleep_range(10000, 11000); |
175 | } | 175 | } |
176 | } | 176 | } |
177 | 177 | ||
@@ -179,7 +179,7 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host) | |||
179 | { | 179 | { |
180 | if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) { | 180 | if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) { |
181 | sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0000); | 181 | sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0000); |
182 | msleep(10); | 182 | usleep_range(10000, 11000); |
183 | } | 183 | } |
184 | 184 | ||
185 | sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~CLK_CTL_SCLKEN & | 185 | sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~CLK_CTL_SCLKEN & |
@@ -187,7 +187,7 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host) | |||
187 | 187 | ||
188 | /* HW engineers overrode docs: no sleep needed on R-Car2+ */ | 188 | /* HW engineers overrode docs: no sleep needed on R-Car2+ */ |
189 | if (!(host->pdata->flags & TMIO_MMC_MIN_RCAR2)) | 189 | if (!(host->pdata->flags & TMIO_MMC_MIN_RCAR2)) |
190 | msleep(10); | 190 | usleep_range(10000, 11000); |
191 | } | 191 | } |
192 | 192 | ||
193 | static void tmio_mmc_set_clock(struct tmio_mmc_host *host, | 193 | static void tmio_mmc_set_clock(struct tmio_mmc_host *host, |
@@ -219,7 +219,7 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, | |||
219 | sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL)); | 219 | sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL)); |
220 | sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, clk & CLK_CTL_DIV_MASK); | 220 | sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, clk & CLK_CTL_DIV_MASK); |
221 | if (!(host->pdata->flags & TMIO_MMC_MIN_RCAR2)) | 221 | if (!(host->pdata->flags & TMIO_MMC_MIN_RCAR2)) |
222 | msleep(10); | 222 | usleep_range(10000, 11000); |
223 | 223 | ||
224 | tmio_mmc_clk_start(host); | 224 | tmio_mmc_clk_start(host); |
225 | } | 225 | } |
@@ -230,11 +230,11 @@ static void tmio_mmc_reset(struct tmio_mmc_host *host) | |||
230 | sd_ctrl_write16(host, CTL_RESET_SD, 0x0000); | 230 | sd_ctrl_write16(host, CTL_RESET_SD, 0x0000); |
231 | if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) | 231 | if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) |
232 | sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0000); | 232 | sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0000); |
233 | msleep(10); | 233 | usleep_range(10000, 11000); |
234 | sd_ctrl_write16(host, CTL_RESET_SD, 0x0001); | 234 | sd_ctrl_write16(host, CTL_RESET_SD, 0x0001); |
235 | if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) | 235 | if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG) |
236 | sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0001); | 236 | sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0001); |
237 | msleep(10); | 237 | usleep_range(10000, 11000); |
238 | 238 | ||
239 | if (host->pdata->flags & TMIO_MMC_SDIO_IRQ) { | 239 | if (host->pdata->flags & TMIO_MMC_SDIO_IRQ) { |
240 | sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK, host->sdio_irq_mask); | 240 | sd_ctrl_write16(host, CTL_SDIO_IRQ_MASK, host->sdio_irq_mask); |