Skip to content

Commit 4c23737

Browse files
Lv Zhengrafaeljw
authored andcommitted
ACPI / EC: Remove old CLEAR_ON_RESUME quirk
IRQ polling logic has been implemented to drain the post-boot/resume EC events: 1. Triggered by the following code, invoked from acpi_ec_enable_event(): if (!test_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) advance_transaction(ec); 2. Drained by the following code, invoked after acpi_ec_complete_query(): if (status & ACPI_EC_FLAG_SCI) acpi_ec_submit_query(ec); This facility is safer than the old CLEAR_ON_RESUME quirk as the CLEAR_ON_RESUME quirk sends EC query commands unconditionally. The behavior is apparently not suitable for firmware that requires QUERY_HANDSHAKE quirk. Though the QUERY_HANDSHAKE quirk isn't used now because of the improvement done in the EC transaction state machine (ec_event_clearing=QUERY), it is the proof that we cannot send EC query command unconditionally. So it's time to delete the out-dated CLEAR_ON_RESUME quirk to let the users to try the newer approach. Link: https://bugzilla.kernel.org/show_bug.cgi?id=191211 Signed-off-by: Lv Zheng <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 566cf87 commit 4c23737

File tree

1 file changed

+0
-53
lines changed

1 file changed

+0
-53
lines changed

drivers/acpi/ec.c

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ EXPORT_SYMBOL(first_ec);
188188
static bool boot_ec_is_ecdt = false;
189189
static struct workqueue_struct *ec_query_wq;
190190

191-
static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */
192191
static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */
193192
static int EC_FLAGS_CORRECT_ECDT; /* Needs ECDT port address correction */
194193

@@ -492,26 +491,6 @@ static inline void __acpi_ec_disable_event(struct acpi_ec *ec)
492491
ec_log_drv("event blocked");
493492
}
494493

495-
/*
496-
* Process _Q events that might have accumulated in the EC.
497-
* Run with locked ec mutex.
498-
*/
499-
static void acpi_ec_clear(struct acpi_ec *ec)
500-
{
501-
int i, status;
502-
u8 value = 0;
503-
504-
for (i = 0; i < ACPI_EC_CLEAR_MAX; i++) {
505-
status = acpi_ec_query(ec, &value);
506-
if (status || !value)
507-
break;
508-
}
509-
if (unlikely(i == ACPI_EC_CLEAR_MAX))
510-
pr_warn("Warning: Maximum of %d stale EC events cleared\n", i);
511-
else
512-
pr_info("%d stale EC events cleared\n", i);
513-
}
514-
515494
static void acpi_ec_enable_event(struct acpi_ec *ec)
516495
{
517496
unsigned long flags;
@@ -520,10 +499,6 @@ static void acpi_ec_enable_event(struct acpi_ec *ec)
520499
if (acpi_ec_started(ec))
521500
__acpi_ec_enable_event(ec);
522501
spin_unlock_irqrestore(&ec->lock, flags);
523-
524-
/* Drain additional events if hardware requires that */
525-
if (EC_FLAGS_CLEAR_ON_RESUME)
526-
acpi_ec_clear(ec);
527502
}
528503

529504
#ifdef CONFIG_PM_SLEEP
@@ -1740,31 +1715,6 @@ static int ec_flag_query_handshake(const struct dmi_system_id *id)
17401715
}
17411716
#endif
17421717

1743-
/*
1744-
* On some hardware it is necessary to clear events accumulated by the EC during
1745-
* sleep. These ECs stop reporting GPEs until they are manually polled, if too
1746-
* many events are accumulated. (e.g. Samsung Series 5/9 notebooks)
1747-
*
1748-
* https://bugzilla.kernel.org/show_bug.cgi?id=44161
1749-
*
1750-
* Ideally, the EC should also be instructed NOT to accumulate events during
1751-
* sleep (which Windows seems to do somehow), but the interface to control this
1752-
* behaviour is not known at this time.
1753-
*
1754-
* Models known to be affected are Samsung 530Uxx/535Uxx/540Uxx/550Pxx/900Xxx,
1755-
* however it is very likely that other Samsung models are affected.
1756-
*
1757-
* On systems which don't accumulate _Q events during sleep, this extra check
1758-
* should be harmless.
1759-
*/
1760-
static int ec_clear_on_resume(const struct dmi_system_id *id)
1761-
{
1762-
pr_debug("Detected system needing EC poll on resume.\n");
1763-
EC_FLAGS_CLEAR_ON_RESUME = 1;
1764-
ec_event_clearing = ACPI_EC_EVT_TIMING_STATUS;
1765-
return 0;
1766-
}
1767-
17681718
/*
17691719
* Some ECDTs contain wrong register addresses.
17701720
* MSI MS-171F
@@ -1782,9 +1732,6 @@ static struct dmi_system_id ec_dmi_table[] __initdata = {
17821732
ec_correct_ecdt, "MSI MS-171F", {
17831733
DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star"),
17841734
DMI_MATCH(DMI_PRODUCT_NAME, "MS-171F"),}, NULL},
1785-
{
1786-
ec_clear_on_resume, "Samsung hardware", {
1787-
DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD.")}, NULL},
17881735
{},
17891736
};
17901737

0 commit comments

Comments
 (0)