• Zhang Rui's avatar
    ACPI: button: reinitialize button state upon resume · 13e96214
    Zhang Rui authored
    With commit dfa46c50 ("ACPI / button: Fix an issue in
    button.lid_init_state=ignore mode"), the lid device is considered to be
    not compliant to SW_LID if the Lid state is unchanged when updating it.
    
    This is not wrong, but we overlooked the resume case, where Lid state is
    updated unconditionally in the button driver .resume() callback. And this
    results in warning message "ACPI: button: The lid device is not compliant
    to  SW_LID." after resume, if the machine is suspended with Lid opened and
    then resumed with Lid opened.
    
    Fix this by flushing the cached lid state before updating the Lid device
    in .resume() callback.
    
    Fixes: dfa46c50 ("ACPI / button: Fix an issue in button.lid_init_state=ignore mode")
    Reported-and-tested-by: default avatarZhao Lijian <lijian.zhao@intel.com>
    Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    13e96214
button.c 17.9 KB