Skip to content

Commit 8f02139

Browse files
spandruvadaJiri Kosina
authored andcommitted
HID: intel-ish-hid: ipc: Disable and reenable ACPI GPE bit
The EHL (Elkhart Lake) based platforms provide a OOB (Out of band) service, which allows to wakup device when the system is in S5 (Soft-Off state). This OOB service can be enabled/disabled from BIOS settings. When enabled, the ISH device gets PME wake capability. To enable PME wakeup, driver also needs to enable ACPI GPE bit. On resume, BIOS will clear the wakeup bit. So driver need to re-enable it in resume function to keep the next wakeup capability. But this BIOS clearing of wakeup bit doesn't decrement internal OS GPE reference count, so this reenabling on every resume will cause reference count to overflow. So first disable and reenable ACPI GPE bit using acpi_disable_gpe(). Fixes: 2e23a70 ("HID: intel-ish-hid: ipc: finish power flow for EHL OOB") Reported-by: Kai-Heng Feng <[email protected]> Closes: https://lore.kernel.org/lkml/CAAd53p4=oLYiH2YbVSmrPNj1zpMcfp=Wxbasb5vhMXOWCArLCg@mail.gmail.com/T/ Tested-by: Kai-Heng Feng <[email protected]> Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent b328dd0 commit 8f02139

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/hid/intel-ish-hid/ipc/pci-ish.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ static int enable_gpe(struct device *dev)
133133
}
134134
wakeup = &adev->wakeup;
135135

136+
/*
137+
* Call acpi_disable_gpe(), so that reference count
138+
* gpe_event_info->runtime_count doesn't overflow.
139+
* When gpe_event_info->runtime_count = 0, the call
140+
* to acpi_disable_gpe() simply return.
141+
*/
142+
acpi_disable_gpe(wakeup->gpe_device, wakeup->gpe_number);
143+
136144
acpi_sts = acpi_enable_gpe(wakeup->gpe_device, wakeup->gpe_number);
137145
if (ACPI_FAILURE(acpi_sts)) {
138146
dev_err(dev, "enable ose_gpe failed\n");

0 commit comments

Comments
 (0)