Skip to contentSkip to conversation

twl3040-gpio: fix task softlockup warning

PATCH Artem Bityutskiy 3 participants 3 messages Aug 18, 2008 – Aug 19, 2008

lore
Share & tools
lore
#0 lore raw

This patch fixes the following annoying warning:

INFO: task twl4030 gpio:283 blocked for more than 120 seconds.

"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
twl4030 gpio D c027e9dc 0 283 2
[<c027e744>] (schedule+0x0/0x314) from [<c00640f0>] (kthread+0x3c/0x80) [<c00640b4>] (kthread+0x0/0x80) from [<c0052678>] (do_exit+0x0/0x664)
r5:00000000 r4:00000000

Which is printed every 120 seconds by the softlockup code (see 'check_hung_task()' function, introduced by on Jan 2008 by commit 82a1fcb90287052aabfa235e7ffc693ea003fe69).

The reason is that the "twl4030 gpio" kthread is created but is not started immediatelly. And in fact it may never start, because TWL3040 interrupts may never happen and hence, the 'twl4030_gpio_unmask_irqchip()' function is never run. This makes the softlockup detection code unhappy.

Fix this by running the "twl4030 gpio" kernel thread in at the end of the 'gpio_twl4030_init()' initialization function. Since the 'gpio_pending_unmask' global variable is 0 at that time, the tread ('twl4030_gpio_unmask_thread()') will effectively do nothing and go sleep. This makes the softlocup detection code happy.

---
 drivers/i2c/chips/twl4030-gpio.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/i2c/chips/twl4030-gpio.c +1 -0
index 9d17f45..994245c 100644
@@ -748,6 +748,7 @@ static int __init gpio_twl4030_init(void)
 			&twl4030_gpio_module_irq_chip);
 		set_irq_chained_handler(TWL4030_MODIRQ_GPIO,
 			do_twl4030_gpio_module_irq);
+		wake_up_process(gpio_unmask_thread);
 	}
 
 	printk(KERN_INFO "TWL4030 GPIO Demux: IRQ Range %d to %d,"
Signature · 1 line
1.5.4.1
#1 lore raw
Quoted 19 lines · On Mon, 18 Aug 2008 18:54:57 +0300 "ext Artem Bityutskiy"…

This patch fixes the following annoying warning:

INFO: task twl4030 gpio:283 blocked for more than 120 seconds.

"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this
message. twl4030 gpio D c027e9dc 0 283 2
[<c027e744>] (schedule+0x0/0x314) from [<c00640f0>] (kthread +0x3c/0x80) [<c00640b4>] (kthread+0x0/0x80) from [<c0052678>] (do_exit +0x0/0x664) r5:00000000 r4:00000000

Which is printed every 120 seconds by the softlockup code (see 'check_hung_task()' function, introduced by on Jan 2008 by commit 82a1fcb90287052aabfa235e7ffc693ea003fe69).

The reason is that the "twl4030 gpio" kthread is created but is not started immediatelly. And in fact it may never start, because TWL3040 interrupts may never happen and hence, the 'twl4030_gpio_unmask_irqchip()' function is never run. This makes the softlockup detection code unhappy.

Quoted 6 lines

Fix this by running the "twl4030 gpio" kernel thread in at the end of the 'gpio_twl4030_init()' initialization function. Since the 'gpio_pending_unmask' global variable is 0 at that time, the tread ('twl4030_gpio_unmask_thread()') will effectively do nothing and go sleep. This makes the softlocup detection code happy.

This is good. It fixes also second issue where system load average is always above 1 since task is in uninterruptible state before this first wake-up.

Jarkko

#2 lore raw
Quoted 28 lines · Jarkko Nikula
Quoted 19 lines · On Mon, 18 Aug 2008 18:54:57 +0300 "ext Artem Bityutskiy"…

This patch fixes the following annoying warning:

INFO: task twl4030 gpio:283 blocked for more than 120 seconds.

"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this
message. twl4030 gpio D c027e9dc 0 283 2
[<c027e744>] (schedule+0x0/0x314) from [<c00640f0>] (kthread +0x3c/0x80) [<c00640b4>] (kthread+0x0/0x80) from [<c0052678>] (do_exit +0x0/0x664) r5:00000000 r4:00000000

Which is printed every 120 seconds by the softlockup code (see 'check_hung_task()' function, introduced by on Jan 2008 by commit 82a1fcb90287052aabfa235e7ffc693ea003fe69).

The reason is that the "twl4030 gpio" kthread is created but is not started immediatelly. And in fact it may never start, because TWL3040 interrupts may never happen and hence, the 'twl4030_gpio_unmask_irqchip()' function is never run. This makes the softlockup detection code unhappy.

Quoted 6 lines

Fix this by running the "twl4030 gpio" kernel thread in at the end of the 'gpio_twl4030_init()' initialization function. Since the 'gpio_pending_unmask' global variable is 0 at that time, the tread ('twl4030_gpio_unmask_thread()') will effectively do nothing and go sleep. This makes the softlocup detection code happy.

Quoted 3 lines

This is good. It fixes also second issue where system load average is always above 1 since task is in uninterruptible state before this first wake-up.

Great, thanks Artem, will push your patch today.

Tony