linux/drivers/mtd
hujianyang 148ae97d28 UBI: fix soft lockup in ubi_check_volume()
commit 9aa272b492 upstream.

Running mtd-utils/tests/ubi-tests/io_basic.c could cause
soft lockup or watchdog reset. It is because *updatevol*
will perform ubi_check_volume() after updating finish
and this function will full scan the updated lebs if the
volume is initialized as STATIC_VOLUME.

This patch adds *cond_resched()* in the loop of lebs scan
to avoid soft lockup.

Helped by Richard Weinberger <richard@nod.at>

[ 2158.067096] INFO: rcu_sched self-detected stall on CPU { 1}  (t=2101 jiffies g=1606 c=1605 q=56)
[ 2158.172867] CPU: 1 PID: 2073 Comm: io_basic Tainted: G           O 3.10.53 #21
[ 2158.172898] [<c000f624>] (unwind_backtrace+0x0/0x120) from [<c000c294>] (show_stack+0x10/0x14)
[ 2158.172918] [<c000c294>] (show_stack+0x10/0x14) from [<c008ac3c>] (rcu_check_callbacks+0x1c0/0x660)
[ 2158.172936] [<c008ac3c>] (rcu_check_callbacks+0x1c0/0x660) from [<c002b480>] (update_process_times+0x38/0x64)
[ 2158.172953] [<c002b480>] (update_process_times+0x38/0x64) from [<c005ff38>] (tick_sched_handle+0x54/0x60)
[ 2158.172966] [<c005ff38>] (tick_sched_handle+0x54/0x60) from [<c00601ac>] (tick_sched_timer+0x44/0x74)
[ 2158.172978] [<c00601ac>] (tick_sched_timer+0x44/0x74) from [<c003f348>] (__run_hrtimer+0xc8/0x1b8)
[ 2158.172992] [<c003f348>] (__run_hrtimer+0xc8/0x1b8) from [<c003fd9c>] (hrtimer_interrupt+0x128/0x2a4)
[ 2158.173007] [<c003fd9c>] (hrtimer_interrupt+0x128/0x2a4) from [<c0246f1c>] (arch_timer_handler_virt+0x28/0x30)
[ 2158.173022] [<c0246f1c>] (arch_timer_handler_virt+0x28/0x30) from [<c0086214>] (handle_percpu_devid_irq+0x9c/0x124)
[ 2158.173036] [<c0086214>] (handle_percpu_devid_irq+0x9c/0x124) from [<c0082bd8>] (generic_handle_irq+0x20/0x30)
[ 2158.173049] [<c0082bd8>] (generic_handle_irq+0x20/0x30) from [<c000969c>] (handle_IRQ+0x64/0x8c)
[ 2158.173060] [<c000969c>] (handle_IRQ+0x64/0x8c) from [<c0008544>] (gic_handle_irq+0x3c/0x60)
[ 2158.173074] [<c0008544>] (gic_handle_irq+0x3c/0x60) from [<c02f0f80>] (__irq_svc+0x40/0x50)
[ 2158.173083] Exception stack(0xc4043c98 to 0xc4043ce0)
[ 2158.173092] 3c80:                                                       c4043ce4 00000019
[ 2158.173102] 3ca0: 1f8a865f c050ad10 1f8a864c 00000031 c04b5970 0003ebce 00000000 f3550000
[ 2158.173113] 3cc0: bf00bc68 00000800 0003ebce c4043ce0 c0186d14 c0186cb8 80000013 ffffffff
[ 2158.173130] [<c02f0f80>] (__irq_svc+0x40/0x50) from [<c0186cb8>] (read_current_timer+0x4/0x38)
[ 2158.173145] [<c0186cb8>] (read_current_timer+0x4/0x38) from [<1f8a865f>] (0x1f8a865f)
[ 2183.927097] BUG: soft lockup - CPU#1 stuck for 22s! [io_basic:2073]
[ 2184.002229] Modules linked in: nandflash(O) [last unloaded: nandflash]

Signed-off-by: Wang Kai <morgan.wang@huawei.com>
Signed-off-by: hujianyang <hujianyang@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-13 05:17:00 -07:00
..
chips mtd: jedec_probe: fix LH28F640BF definition 2013-08-05 21:04:17 +01:00
devices mtd: devices: elm: fix elm_context_save() and elm_context_restore() functions 2014-07-28 08:06:03 -07:00
lpddr mtd: lpddr: Mark functions as static and remove unused function 2014-01-03 11:22:26 -08:00
maps MTD updates for 3.14: 2014-01-28 18:56:37 -08:00
nand mtd: nand: pxa3xx: Fix PIO FIFO draining 2015-03-26 15:06:56 +01:00
onenand mtd: onenand: Trivial cleanup in samsung.h 2014-01-11 12:00:25 -08:00
tests mtd: tests: abort torturetest on erase errors 2015-01-16 06:59:33 -08:00
ubi UBI: fix soft lockup in ubi_check_volume() 2015-05-13 05:17:00 -07:00
Kconfig mtd: Hide CONFIG_MTD_BLKDEVS from the menu 2014-01-07 10:07:36 -08:00
Makefile mtd: merge mtdchar module with mtdcore 2013-04-05 13:16:54 +01:00
afs.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
ar7part.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
bcm47xxpart.c mtd: bcm47xxpart: alternative MAGIC for board_data partition 2014-01-07 10:07:37 -08:00
bcm63xxpart.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
cmdlinepart.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
ftl.c mtd/ftl: fix the double free of the buffers allocated in build_maps() 2014-09-17 09:19:28 -07:00
inftlcore.c mtd: nand: add a helper to detect the nand type 2013-10-27 16:27:06 -07:00
inftlmount.c mtd: introduce mtd_block_markbad interface 2012-01-09 18:25:48 +00:00
mtd_blkdevs.c block_device_operations->release() should return void 2013-05-07 02:16:21 -04:00
mtdblock.c mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
mtdblock_ro.c mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
mtdchar.c mtd: mtdchar: return expected errors on mmap() call 2013-11-11 11:18:15 -08:00
mtdconcat.c mtd: unify initialization of erase_info->fail_addr 2012-03-27 01:02:24 +01:00
mtdcore.c mtd: convert to use ATTRIBUTE_GROUPS 2014-01-03 11:22:21 -08:00
mtdcore.h mtd: merge mtdchar module with mtdcore 2013-04-05 13:16:54 +01:00
mtdoops.c mtdoops: don't erase flash at each boot 2012-11-15 15:37:51 +02:00
mtdpart.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
mtdsuper.c mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
mtdswap.c mtd: mtdswap: replace strict_strtoul() with kstrtoul() 2013-08-30 21:52:51 +01:00
nftlcore.c mtd: nand: add a helper to detect the nand type 2013-10-27 16:27:06 -07:00
nftlmount.c mtd: introduce mtd_block_markbad interface 2012-01-09 18:25:48 +00:00
ofpart.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
redboot.c mtd: make register_mtd_parser return void 2014-01-03 11:22:22 -08:00
rfd_ftl.c mtd: do not use mtd->sync directly 2012-01-09 18:26:21 +00:00
sm_ftl.c mtd: sm_ftl: heap corruption in sm_create_sysfs_attributes() 2014-05-13 13:32:55 +02:00
sm_ftl.h mtd: sm_ftl: cosmetic, use bool when possible 2010-10-25 01:33:08 +01:00
ssfdc.c mtd: nand: add a helper to detect the nand type 2013-10-27 16:27:06 -07:00