[PATCH] mtd: spi-nor: Reschedule in spi_nor_wait_till_ready()

Michael Walle mwalle at kernel.org
Fri Nov 20 04:27:21 PST 2026


On Fri, 06 Nov 2026 13:04:53 -0800, Bart Van Assche wrote:
> In spi_nor_wait_till_ready_with_timeout(), cond_resched() is only
> called after spi_nor_ready() returns 0. If the flash is already ready on
> the first status check, the function returns before reaching
> cond_resched(). This happens e.g. under QEMU, where SPI NOR page
> programs and sector erases complete synchronously during the MMIO write,
> combined with a controller driver that polls without sleeping.
> Consequently, multi-sector erases in spi_nor_erase() and multi-page
> writes in spi_nor_write() may iterate over thousands of sectors or pages
> without ever yielding the CPU on kernels built without
> CONFIG_PREEMPTION, e.g. ARM32 kernels with CONFIG_PREEMPT_VOLUNTARY=y.
> This triggers soft lockup and RCU stall reports.
> 
> [...]

Applied, thanks!

[1/1] mtd: spi-nor: Reschedule in spi_nor_wait_till_ready()
      commit: bcfbc784fce431f0f2b0a25c238b61feda2b710a

Best regards,
-- 
Michael Walle <mwalle at kernel.org>




More information about the linux-mtd mailing list