Re: [PATCH v4 3/3] mtd: mtdoops: panic caused mtdoops to call mtdoops_erase function immediately

From: Miquel Raynal
Date: Tue Oct 18 2022 - 05:56:39 EST


On Mon, 2022-10-10 at 04:55:49 UTC, Ray Zhang wrote:
> The panic function disables the local interrupts, preemption, and all
> other processors. When the invoked mtdoops needs to erase a used page,
> calling schedule_work() to do it will not work. Instead, just call
> mtdoops_erase function immediately.
>
> Tested:
> ~# echo c > /proc/sysrq-trigger
> [ 171.654759] sysrq: Trigger a crash
> [ 171.658325] Kernel panic - not syncing: sysrq triggered crash
> ......
> [ 172.406423] mtdoops: not ready 34, 35 (erase immediately)
> [ 172.432285] mtdoops: ready 34, 35
> [ 172.435633] Rebooting in 10 seconds..
>
> Signed-off-by: Ray Zhang <sgzhang@xxxxxxxxxx>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel