All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC v1 1/1] mtd_blkdevs: avoid soft lockups with some mtd/spi devices
@ 2022-01-26  8:57 ` David Decotigny
  0 siblings, 0 replies; 6+ messages in thread
From: David Decotigny @ 2022-01-26  8:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, linux-mtd,
	David Decotigny

From: David Decotigny <ddecotig@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@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


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-01-26  9:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-26  8:57 [PATCH RFC v1 1/1] mtd_blkdevs: avoid soft lockups with some mtd/spi devices David Decotigny
2022-01-26  8:57 ` David Decotigny
2022-01-26  9:08 ` Richard Weinberger
2022-01-26  9:08   ` Richard Weinberger
     [not found]   ` <CAG88wWZYbMLYRa9iebAeWtBdLtNWdL4djbPRq36EHrXeNzMsiw@mail.gmail.com>
2022-01-26  9:43     ` Richard Weinberger
2022-01-26  9:43       ` Richard Weinberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.