lkml.org 
[lkml]   [2008]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] rfkill-input doesn't work until 5 minutes after boot
    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

    \
     
     \ /
      Last update: 2008-10-04 22:47    [W:0.020 / U:2.488 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site