Skip to content

Commit 767191d

Browse files
jwrdegoederafaeljw
authored andcommitted
platform/x86: intel_int0002_vgpio: Use acpi_register_wakeup_handler()
The Power Management Events (PMEs) the INT0002 driver listens for get signalled by the Power Management Controller (PMC) using the same IRQ as used for the ACPI SCI. Since commit fdde0ff ("ACPI: PM: s2idle: Prevent spurious SCIs from waking up the system") the SCI triggering, without there being a wakeup cause recognized by the ACPI sleep code, will no longer wakeup the system. This breaks PMEs / wakeups signalled to the INT0002 driver, the system never leaves the s2idle_loop() now. Use acpi_register_wakeup_handler() to register a function which checks the GPE0a_STS register for a PME and trigger a wakeup when a PME has been signalled. Fixes: fdde0ff ("ACPI: PM: s2idle: Prevent spurious SCIs from waking up the system") Cc: 5.4+ <[email protected]> # 5.4+ Signed-off-by: Hans de Goede <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent ddfd9dc commit 767191d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/platform/x86/intel_int0002_vgpio.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ static irqreturn_t int0002_irq(int irq, void *data)
127127
return IRQ_HANDLED;
128128
}
129129

130+
static bool int0002_check_wake(void *data)
131+
{
132+
u32 gpe_sts_reg;
133+
134+
gpe_sts_reg = inl(GPE0A_STS_PORT);
135+
return (gpe_sts_reg & GPE0A_PME_B0_STS_BIT);
136+
}
137+
130138
static struct irq_chip int0002_byt_irqchip = {
131139
.name = DRV_NAME,
132140
.irq_ack = int0002_irq_ack,
@@ -220,13 +228,15 @@ static int int0002_probe(struct platform_device *pdev)
220228
return ret;
221229
}
222230

231+
acpi_register_wakeup_handler(irq, int0002_check_wake, NULL);
223232
device_init_wakeup(dev, true);
224233
return 0;
225234
}
226235

227236
static int int0002_remove(struct platform_device *pdev)
228237
{
229238
device_init_wakeup(&pdev->dev, false);
239+
acpi_unregister_wakeup_handler(int0002_check_wake, NULL);
230240
return 0;
231241
}
232242

0 commit comments

Comments
 (0)