public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rfkill-input doesn't work until 5 minutes after boot
@ 2008-10-04 20:43 Matthew Garrett
  2008-10-04 22:03 ` Sitsofe Wheeler
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Matthew Garrett @ 2008-10-04 20:43 UTC (permalink / raw)
  To: dmitry.torokhov, IvDoorn, hmh; +Cc: sitsofe, linux-kernel

rfkill-input implements debounce as follows:

        if (time_after(jiffies, task->last + msecs_to_jiffies(200))) {

However, task->last is initialised to 0 while jiffies starts at -300*HZ. 
Any input within 5 minutes of kernel start is therefore ignored. Fix by 
initialising task->last correctly.

Signed-off-by: Matthew Garrett <mjg@redhat.com>

---

.27 material?

diff --git a/net/rfkill/rfkill-input.c b/net/rfkill/rfkill-input.c
index e5b6955..de75934 100644
--- a/net/rfkill/rfkill-input.c
+++ b/net/rfkill/rfkill-input.c
@@ -101,6 +101,7 @@ static void rfkill_schedule_toggle(struct rfkill_task *task)
 		.mutex = __MUTEX_INITIALIZER(n.mutex),		\
 		.lock = __SPIN_LOCK_UNLOCKED(n.lock),		\
 		.desired_state = RFKILL_STATE_UNBLOCKED,	\
+		.last = INITIAL_JIFFIES,			\
 	}
 
 static DEFINE_RFKILL_TASK(rfkill_wlan, RFKILL_TYPE_WLAN);

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2008-10-06 16:31 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-04 20:43 [PATCH] rfkill-input doesn't work until 5 minutes after boot Matthew Garrett
2008-10-04 22:03 ` Sitsofe Wheeler
2008-10-04 22:39 ` Andrew Morton
2008-10-04 22:50   ` Matthew Garrett
2008-10-05  0:43 ` [PATCH v2] " Matthew Garrett
2008-10-05  4:43   ` Andrew Morton
2008-10-05 10:58     ` Matthew Garrett
2008-10-05 11:02   ` [PATCH v3] " Matthew Garrett
2008-10-05 13:51     ` Henrique de Moraes Holschuh
2008-10-05 14:31     ` Ivo van Doorn
2008-10-06  2:16       ` Henrique de Moraes Holschuh
2008-10-05 19:04     ` Sitsofe Wheeler
2008-10-05 21:24     ` Dmitry Torokhov
2008-10-05 21:33       ` Matthew Garrett
2008-10-06  5:52         ` Sitsofe Wheeler
2008-10-06 16:31           ` Ivo van Doorn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox