View | Details | Raw Unified | Return to bug 44161 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-1 / +44 lines)
Line  Link Here
0
-- a/drivers/acpi/ec.c
0
++ b/drivers/acpi/ec.c
Lines 116-121 EXPORT_SYMBOL(first_ec); Link Here
116
static int EC_FLAGS_MSI; /* Out-of-spec MSI controller */
116
static int EC_FLAGS_MSI; /* Out-of-spec MSI controller */
117
static int EC_FLAGS_VALIDATE_ECDT; /* ASUStec ECDTs need to be validated */
117
static int EC_FLAGS_VALIDATE_ECDT; /* ASUStec ECDTs need to be validated */
118
static int EC_FLAGS_SKIP_DSDT_SCAN; /* Not all BIOS survive early DSDT scan */
118
static int EC_FLAGS_SKIP_DSDT_SCAN; /* Not all BIOS survive early DSDT scan */
119
static int EC_FLAGS_CLEAR_ON_RESUME; /* EC should be polled on boot/resume */
119
120
120
/* --------------------------------------------------------------------------
121
/* --------------------------------------------------------------------------
121
                             Transaction Management
122
                             Transaction Management
Lines 339-344 unlock: Link Here
339
	return status;
340
	return status;
340
}
341
}
341
342
343
static int acpi_ec_clear(struct acpi_ec *ec)
344
{
345
	int status, i;
346
	u8 value = 0;
347
	/*
348
	 * Run if EC_FLAGS_CLEAR_ON_RESUME is set, with mutex locked.
349
	 * 20 queries are enough to handle affected Samsung hardware
350
	 */
351
	for (i = 0; i < 20; i++) {
352
		status = acpi_ec_query_unlocked(ec, &value);
353
		if (status || !value)
354
			break;
355
	}
356
}
357
342
static int acpi_ec_burst_enable(struct acpi_ec *ec)
358
static int acpi_ec_burst_enable(struct acpi_ec *ec)
343
{
359
{
344
	u8 d;
360
	u8 d;
Lines 463-468 void acpi_ec_unblock_transactions(void) Link Here
463
	mutex_lock(&ec->mutex);
479
	mutex_lock(&ec->mutex);
464
	/* Allow transactions to be carried out again */
480
	/* Allow transactions to be carried out again */
465
	clear_bit(EC_FLAGS_BLOCKED, &ec->flags);
481
	clear_bit(EC_FLAGS_BLOCKED, &ec->flags);
482
483
	if (EC_FLAGS_CLEAR_ON_RESUME)
484
		acpi_ec_clear(ec);
485
466
	mutex_unlock(&ec->mutex);
486
	mutex_unlock(&ec->mutex);
467
}
487
}
468
488
Lines 821-826 static int acpi_ec_add(struct acpi_device *device) Link Here
821
841
822
	/* EC is fully operational, allow queries */
842
	/* EC is fully operational, allow queries */
823
	clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
843
	clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
844
845
	/* Some hardware may need the EC to be cleared before use */
846
	if (EC_FLAGS_CLEAR_ON_RESUME) {
847
		pr_info("Clearing stale EC events");
848
		mutex_lock(&ec->mutex);
849
		acpi_ec_clear(ec);
850
		mutex_unlock(&ec->mutex);
851
	}
824
	return ret;
852
	return ret;
825
}
853
}
826
854
Lines 922-927 static int ec_enlarge_storm_threshold(const struct dmi_system_id *id) Link Here
922
	return 0;
950
	return 0;
923
}
951
}
924
952
953
/*
954
 * On some hardware it is necessary to clear events accumulated during
955
 * sleep by the EC. These ECs stop reporting GPE events until they are
956
 * polled, if too many events are accumulated. (e.g. Samsung Series 5/9)
957
 */
958
static int ec_clear_on_resume(const struct dmi_system_id *id)
959
{
960
	pr_debug("Detected system needing EC poll on resume.\n");
961
	EC_FLAGS_CLEAR_ON_RESUME = 1;
962
	return 0;
963
}
964
925
static struct dmi_system_id ec_dmi_table[] __initdata = {
965
static struct dmi_system_id ec_dmi_table[] __initdata = {
926
	{
966
	{
927
	ec_skip_dsdt_scan, "Compal JFL92", {
967
	ec_skip_dsdt_scan, "Compal JFL92", {
Lines 965-970 static struct dmi_system_id ec_dmi_table[] __initdata = { Link Here
965
	ec_validate_ecdt, "ASUS hardware", {
1005
	ec_validate_ecdt, "ASUS hardware", {
966
	DMI_MATCH(DMI_SYS_VENDOR, "ASUSTek Computer Inc."),
1006
	DMI_MATCH(DMI_SYS_VENDOR, "ASUSTek Computer Inc."),
967
	DMI_MATCH(DMI_PRODUCT_NAME, "L4R"),}, NULL},
1007
	DMI_MATCH(DMI_PRODUCT_NAME, "L4R"),}, NULL},
1008
	{
1009
	ec_clear_on_resume, "Samsung hardware", {
1010
	DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD.")}, NULL},
968
	{},
1011
	{},
969
};
1012
};
970
1013

Return to bug 44161