Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02e92557 authored by dmitry.torokhov@gmail.com's avatar dmitry.torokhov@gmail.com Committed by Greg Kroah-Hartman
Browse files

ACPI: button: fix handling lid state changes when input device closed



commit 21988a8e51479ceffe7b0568b170effabb708dfe upstream.

The original intent of 84d3f6b7 was to delay evaluating lid state until
all drivers have been loaded, with input device being opened from userspace
serving as a signal for this condition. Let's ensure that state updates
happen even if userspace closed (or in the future inhibited) input device.

Note that if we go through suspend/resume cycle we assume the system has
been fully initialized even if LID input device has not been opened yet.

This has a side-effect of fixing access to input->users outside of
input->mutex protections by the way of eliminating said accesses and using
driver private flag.

Fixes: 84d3f6b7 ("ACPI / button: Delay acpi_lid_initialize_state() until first user space open")
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Cc: 4.15+ <stable@vger.kernel.org> # 4.15+
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dd7992a5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment