public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Wang Kai <morgan.wang@huawei.com>,
	hujianyang <hujianyang@huawei.com>,
	Richard Weinberger <richard@nod.at>
Subject: [PATCH 3.14 24/25] UBI: fix soft lockup in ubi_check_volume()
Date: Mon, 11 May 2015 10:55:25 -0700	[thread overview]
Message-ID: <20150511175450.758766041@linuxfoundation.org> (raw)
In-Reply-To: <20150511175450.007060990@linuxfoundation.org>

3.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: hujianyang <hujianyang@huawei.com>

commit 9aa272b492e7551a9ee0e2c83c720ea013698485 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>

---
 drivers/mtd/ubi/misc.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/mtd/ubi/misc.c
+++ b/drivers/mtd/ubi/misc.c
@@ -74,6 +74,8 @@ int ubi_check_volume(struct ubi_device *
 	for (i = 0; i < vol->used_ebs; i++) {
 		int size;
 
+		cond_resched();
+
 		if (i == vol->used_ebs - 1)
 			size = vol->last_eb_bytes;
 		else



  parent reply	other threads:[~2015-05-11 18:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-11 17:55 [PATCH 3.14 00/25] 3.14.42-stable review Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 01/25] [PATCH] ipv4: Missing sk_nulls_node_init() in ping_unhash() Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 02/25] ALSA: emux: Fix mutex deadlock at unloading Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 03/25] ALSA: emux: Fix mutex deadlock in OSS emulation Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 04/25] ALSA: emu10k1: Fix card shortname string buffer overflow Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 05/25] ALSA: emu10k1: Emu10k2 32 bit DMA mode Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 08/25] serial: of-serial: Remove device_type = "serial" registration Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 09/25] ASoC: dapm: Enable autodisable on SOC_DAPM_SINGLE_TLV_AUTODISABLE Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 10/25] tty/serial: at91: maxburst was missing for dma transfers Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 11/25] rbd: end I/O the entire obj_request on error Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 12/25] ext4: fix data corruption caused by unwritten and delayed extents Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 13/25] 3w-xxxx: fix command completion race Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 14/25] 3w-9xxx: " Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 15/25] 3w-sas: " Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 16/25] drm/radeon: add SI DPM quirk for Sapphire R9 270 Dual-X 2G GDDR5 Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 17/25] usb: musb: use new USB_RESUME_TIMEOUT Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 18/25] usb: host: oxu210hp: " Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 19/25] usb: host: ehci: " Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 20/25] usb: gadget: printer: enqueue printers response for setup request Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 21/25] staging: panel: fix lcd type Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 22/25] Drivers: hv: vmbus: Dont wait after requesting offers Greg Kroah-Hartman
2015-05-11 17:55 ` [PATCH 3.14 23/25] compal-laptop: Fix leaking hwmon device Greg Kroah-Hartman
2015-05-11 17:55 ` Greg Kroah-Hartman [this message]
2015-05-11 17:55 ` [PATCH 3.14 25/25] ARC: signal handling robustify Greg Kroah-Hartman
2015-05-11 20:04 ` [PATCH 3.14 00/25] 3.14.42-stable review Guenter Roeck
2015-05-11 23:40 ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150511175450.758766041@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=hujianyang@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=morgan.wang@huawei.com \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox