OSDN Git Service

mtd: mtdoops: panic caused mtdoops to call mtdoops_erase function immediately
authorRay Zhang <sgzhang@google.com>
Mon, 10 Oct 2022 04:55:49 +0000 (04:55 +0000)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 7 Nov 2022 16:08:00 +0000 (17:08 +0100)
commit7cc84e0e07d063c246809ea78f51607f858766bf
tree1c894236c30d0c5abc457cafdd5a2a94fd197062
parent340193e079a899f5527cddccff2b5de2c98bc31b
mtd: mtdoops: panic caused mtdoops to call mtdoops_erase function immediately

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@google.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20221010045549.2221965-4-sgzhang@google.com
drivers/mtd/mtdoops.c