[PATCH RFC v1 1/1] mtd_blkdevs: avoid soft lockups with some mtd/spi devices
David Decotigny
decot+git at google.com
Wed Jan 26 00:57:35 PST 2022
From: David Decotigny <ddecotig at google.com>
With some spi devices, the heavy cpu usage due to polling the spi
registers may lead to netdev timeouts, RCU complaints, etc. This can
be acute in the absence of CONFIG_PREEMPT. This patch allows to give
enough breathing room to avoid those false positives.
Signed-off-by: David Decotigny <ddecotig at google.com>
---
I tested this on a 5.10 base (lockdep).
drivers/mtd/mtd_blkdevs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 243f28a3206b4..64d2b093f114b 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -158,6 +158,7 @@ static void mtd_blktrans_work(struct mtd_blktrans_dev *dev)
}
background_done = 0;
+ cond_resched();
spin_lock_irq(&dev->queue_lock);
}
}
--
2.35.0.rc0.227.g00780c9af4-goog
More information about the linux-mtd
mailing list