Skip to content

Commit 8fede89

Browse files
committed
spi: Make spi_delay_exec() warn if called from atomic context
If the delay used is long enough the spi_delay_exec() will use a sleeping function to implement it. Add a might_sleep() here to help avoid callers using this from an atomic context and running into problems at runtime on other systems. Suggested-by: Serge Semin <[email protected]> Signed-off-by: Mark Brown <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 36f8f18 commit 8fede89

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/spi/spi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,8 @@ int spi_delay_exec(struct spi_delay *_delay, struct spi_transfer *xfer)
11601160
{
11611161
int delay;
11621162

1163+
might_sleep();
1164+
11631165
if (!_delay)
11641166
return -EINVAL;
11651167

0 commit comments

Comments
 (0)