mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
mtd: st_spi_fsm: Allow loop to run at least once before giving up CPU
Reported-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:
parent
f1919cb852
commit
ea7864bf44
@ -861,8 +861,6 @@ static uint8_t stfsm_wait_busy(struct stfsm *fsm)
|
|||||||
*/
|
*/
|
||||||
deadline = jiffies + FLASH_MAX_BUSY_WAIT;
|
deadline = jiffies + FLASH_MAX_BUSY_WAIT;
|
||||||
while (!timeout) {
|
while (!timeout) {
|
||||||
cond_resched();
|
|
||||||
|
|
||||||
if (time_after_eq(jiffies, deadline))
|
if (time_after_eq(jiffies, deadline))
|
||||||
timeout = 1;
|
timeout = 1;
|
||||||
|
|
||||||
@ -881,6 +879,8 @@ static uint8_t stfsm_wait_busy(struct stfsm *fsm)
|
|||||||
if (!timeout)
|
if (!timeout)
|
||||||
/* Restart */
|
/* Restart */
|
||||||
writel(seq->seq_cfg, fsm->base + SPI_FAST_SEQ_CFG);
|
writel(seq->seq_cfg, fsm->base + SPI_FAST_SEQ_CFG);
|
||||||
|
|
||||||
|
cond_resched();
|
||||||
}
|
}
|
||||||
|
|
||||||
dev_err(fsm->dev, "timeout on wait_busy\n");
|
dev_err(fsm->dev, "timeout on wait_busy\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user