Patchwork [1/1] Fix rtc-mc13xxx lockup

login
register
mail settings
Submitter Arnaud Patard (Rtp)
Date April 4, 2011, 2:52 p.m.
Message ID <20110404145306.000134775@rtp-net.org>
Download mbox | patch
Permalink /patch/89644/
State New
Headers show

Comments

Arnaud Patard (Rtp) - April 4, 2011, 2:52 p.m.
Fix this lock up while booting :


[  240.159703] INFO: task swapper:1 blocked for more than 120 seconds.
[  240.166030] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  240.173976] swapper         D c03e688c     0     1      0 0x00000000
[  240.180483] Backtrace: 
[  240.183066] [<c03e65d0>] (schedule+0x0/0x2f0) from [<c03e72f8>] (__mutex_lock_slowpath+0x88/0xb4)
[  240.192086] [<c03e7270>] (__mutex_lock_slowpath+0x0/0xb4) from [<c03e7588>] (mutex_lock+0x30/0x34)
[  240.201151]  r8:00000001 r7:df83fd8c r6:00000000 r5:df83fd8c r4:dfbd1204
[  240.208091] [<c03e7558>] (mutex_lock+0x0/0x34) from [<c0206644>] (mc13xxx_lock+0x28/0x2c)
[  240.216403]  r4:dfbd1204 r3:ffffffff
[  240.220181] [<c020661c>] (mc13xxx_lock+0x0/0x2c) from [<c0284d08>] (mc13xxx_rtc_read_time+0x24/0xf4)
[  240.229377]  r4:dfbabc40 r3:c0284ce4
[  240.233127] [<c0284ce4>] (mc13xxx_rtc_read_time+0x0/0xf4) from [<c0282bd4>] (__rtc_read_time+0x50/0x5c)
[  240.243441]  r6:00000000 r5:df83fd8c r4:dfb46c00
[  240.248211] [<c0282b84>] (__rtc_read_time+0x0/0x5c) from [<c0282ebc>] (rtc_read_time+0x34/0x48)
[  240.257020]  r5:dfb46c00 r4:dfb46ce0
[  240.260763] [<c0282e88>] (rtc_read_time+0x0/0x48) from [<c0283090>] (__rtc_read_alarm+0x24/0x27c)
[  240.269740]  r7:dfb46c00 r6:dfbdcbd8 r5:dfb46c00 r4:df83fdec
[  240.275582] [<c028306c>] (__rtc_read_alarm+0x0/0x27c) from [<c0282994>] (rtc_device_register+0x160/0x284)
[  240.285320] [<c0282834>] (rtc_device_register+0x0/0x284) from [<c03e54a8>] (mc13xxx_rtc_probe+0x104/0x18c)
[  240.295150] [<c03e53a4>] (mc13xxx_rtc_probe+0x0/0x18c) from [<c01fd7d4>] (platform_drv_probe+0x1c/0x20)
[  240.304651]  r8:00000000 r7:c0540db4 r6:c0540db4 r5:dfbdcb08 r4:dfbdcb08
[  240.311620] [<c01fd7b8>] (platform_drv_probe+0x0/0x20) from [<c01fc388>] (really_probe+0xa0/0x150)
[  240.320730] [<c01fc2e8>] (really_probe+0x0/0x150) from [<c01fc5d0>] (driver_probe_device+0x28/0x34)
[  240.329878]  r7:00000000 r6:c0540db4 r5:dfbdcb3c r4:dfbdcb08
[  240.335725] [<c01fc5a8>] (driver_probe_device+0x0/0x34) from [<c01fc644>] (__driver_attach+0x68/0x8c)
[  240.345907] [<c01fc5dc>] (__driver_attach+0x0/0x8c) from [<c01fb708>] (bus_for_each_dev+0x58/0x88)
[  240.354976]  r6:c01fc5dc r5:df83fee0 r4:c0540db4 r3:df80d4b4
[  240.360870] [<c01fb6b0>] (bus_for_each_dev+0x0/0x88) from [<c01fc1dc>] (driver_attach+0x20/0x28)
[  240.369758]  r7:00000000 r6:c0539c20 r5:dfba9180 r4:c0540db4
[  240.375604] [<c01fc1bc>] (driver_attach+0x0/0x28) from [<c01fbe0c>] (bus_add_driver+0xb4/0x230)
[  240.384453] [<c01fbd58>] (bus_add_driver+0x0/0x230) from [<c01fcbc8>] (driver_register+0xa8/0x128)
[  240.393568] [<c01fcb20>] (driver_register+0x0/0x128) from [<c01fdc48>] (platform_driver_register+0x4c/0x60)
[  240.403469] [<c01fdbfc>] (platform_driver_register+0x0/0x60) from [<c01fdc7c>] (platform_driver_probe+0x20/0x70)
[  240.413816] [<c01fdc5c>] (platform_driver_probe+0x0/0x70) from [<c001b458>] (mc13xxx_rtc_init+0x18/0x24)
[  240.423406]  r5:c002691c r4:c00267e4
[  240.427110] [<c001b440>] (mc13xxx_rtc_init+0x0/0x24) from [<c00304c0>] (do_one_initcall+0xa4/0x174)
[  240.436302] [<c003041c>] (do_one_initcall+0x0/0x174) from [<c00089d4>] (kernel_init+0xa4/0x154)
[  240.445916] [<c0008930>] (kernel_init+0x0/0x154) from [<c0049c74>] (do_exit+0x0/0x250)
[  240.453936]  r5:c0008930 r4:00000000

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>

Patch

Index: imx-test/drivers/rtc/rtc-mc13xxx.c
===================================================================
--- imx-test.orig/drivers/rtc/rtc-mc13xxx.c
+++ imx-test/drivers/rtc/rtc-mc13xxx.c
@@ -349,8 +349,13 @@  static int __devinit mc13xxx_rtc_probe(s
 	if (ret)
 		goto err_alarm_irq_request;
 
+	mc13xxx_unlock(mc13xxx);
+
 	priv->rtc = rtc_device_register(pdev->name,
 			&pdev->dev, &mc13xxx_rtc_ops, THIS_MODULE);
+
+	mc13xxx_lock(mc13xxx);
+
 	if (IS_ERR(priv->rtc)) {
 		ret = PTR_ERR(priv->rtc);