mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-16 17:23:55 +08:00
spi: Add cond_resched() in main message processing loop
When a controller has only PIO support it is very likely that we will run into use cases where we spend a very large amount of time consuming CPU. Code that does this should call cond_resched() every once in a while to give other tasks more of a chance to run so do that in the main SPI loop, the overhead is negligable if it's not needed. Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
556351f14e
commit
628269704f
@ -1184,6 +1184,9 @@ static void __spi_pump_messages(struct spi_master *master, bool in_kthread)
|
||||
return;
|
||||
}
|
||||
mutex_unlock(&master->bus_lock_mutex);
|
||||
|
||||
/* Prod the scheduler in case transfer_one() was busy waiting */
|
||||
cond_resched();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user