lkml.org 
[lkml]   [2010]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch 081/123] thinkpad-acpi: fix poll thread auto-start
    2.6.33-stable review patch.  If anyone has any objections, please let me know.

    -----------------

    From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>

    commit b589ea4c44170d3f7a845684e2d1b3b9571663af upstream.

    The driver was not starting the NVRAM polling thread if the input
    device was bound immediately after registration.

    This fixes:
    http://bugzilla.kernel.org/show_bug.cgi?id=15118

    Reported-by: Florian Zumbiehl <florz@florz.de>
    Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    drivers/platform/x86/thinkpad_acpi.c | 15 ++++++---------
    1 file changed, 6 insertions(+), 9 deletions(-)

    --- a/drivers/platform/x86/thinkpad_acpi.c
    +++ b/drivers/platform/x86/thinkpad_acpi.c
    @@ -2607,16 +2607,11 @@ static int hotkey_inputdev_open(struct i
    {
    switch (tpacpi_lifecycle) {
    case TPACPI_LIFE_INIT:
    - /*
    - * hotkey_init will call hotkey_poll_setup_safe
    - * at the appropriate moment
    - */
    - return 0;
    - case TPACPI_LIFE_EXITING:
    - return -EBUSY;
    case TPACPI_LIFE_RUNNING:
    hotkey_poll_setup_safe(false);
    return 0;
    + case TPACPI_LIFE_EXITING:
    + return -EBUSY;
    }

    /* Should only happen if tpacpi_lifecycle is corrupt */
    @@ -2627,7 +2622,7 @@ static int hotkey_inputdev_open(struct i
    static void hotkey_inputdev_close(struct input_dev *dev)
    {
    /* disable hotkey polling when possible */
    - if (tpacpi_lifecycle == TPACPI_LIFE_RUNNING &&
    + if (tpacpi_lifecycle != TPACPI_LIFE_EXITING &&
    !(hotkey_source_mask & hotkey_driver_mask))
    hotkey_poll_setup_safe(false);
    }
    @@ -9051,6 +9046,9 @@ static int __init thinkpad_acpi_module_i
    return ret;
    }
    }
    +
    + tpacpi_lifecycle = TPACPI_LIFE_RUNNING;
    +
    ret = input_register_device(tpacpi_inputdev);
    if (ret < 0) {
    printk(TPACPI_ERR "unable to register input device\n");
    @@ -9060,7 +9058,6 @@ static int __init thinkpad_acpi_module_i
    tp_features.input_device_registered = 1;
    }

    - tpacpi_lifecycle = TPACPI_LIFE_RUNNING;
    return 0;
    }




    \
     
     \ /
      Last update: 2010-03-13 02:21    [W:2.403 / U:0.136 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site