From 06318eea077ea6b2b6e6a3f5f5836f3d57563738 Mon Sep 17 00:00:00 2001 From: Bart Van Der Meerssche Date: Mon, 30 Aug 2010 10:24:09 +0200 Subject: [PATCH] fix hotplug button timer bug in 2.6.30.10 --- .../120.hotplug_button_jiffies_calc.patch | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 mote/v2/openwrt/patches/120.hotplug_button_jiffies_calc.patch diff --git a/mote/v2/openwrt/patches/120.hotplug_button_jiffies_calc.patch b/mote/v2/openwrt/patches/120.hotplug_button_jiffies_calc.patch new file mode 100644 index 0000000..65a96da --- /dev/null +++ b/mote/v2/openwrt/patches/120.hotplug_button_jiffies_calc.patch @@ -0,0 +1,27 @@ +--- /tmp/build_dir/linux-atheros/linux-2.6.30.10/arch/mips/ar231x/reset.c 2010-08-29 22:43:02.508208080 +0200 ++++ build_dir/linux-atheros/linux-2.6.30.10/arch/mips/ar231x/reset.c 2010-08-30 10:02:11.682269327 +0200 +@@ -19,6 +19,7 @@ + struct work_struct wq; + int set; + unsigned long jiffies; ++ unsigned long jiffies_prev; + }; + + static struct timer_list rst_button_timer; +@@ -68,7 +69,7 @@ + add_msg(skb, "SUBSYSTEM=button"); + add_msg(skb, "BUTTON=reset"); + add_msg(skb, (event->set ? "ACTION=pressed" : "ACTION=released")); +- sprintf(buf, "SEEN=%ld", (event->jiffies - seen)/HZ); ++ sprintf(buf, "SEEN=%lu", (event->jiffies - event->jiffies_prev)/HZ); + add_msg(skb, buf); + snprintf(buf, 128, "SEQNUM=%llu", uevent_next_seqnum()); + add_msg(skb, buf); +@@ -127,6 +128,7 @@ + no_release_workaround = 0; + + event->jiffies = jiffies; ++ event->jiffies_prev = seen; + + INIT_WORK(&event->wq, hotplug_button); + schedule_work(&event->wq);