aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ec.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/ec.c')
-rw-r--r--drivers/acpi/ec.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index a2b82c90a683..2fe15060dcdc 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -120,6 +120,8 @@ static struct acpi_ec {
120 spinlock_t curr_lock; 120 spinlock_t curr_lock;
121} *boot_ec, *first_ec; 121} *boot_ec, *first_ec;
122 122
123static int EC_FLAGS_MSI; /* Out-of-spec MSI controller */
124
123/* -------------------------------------------------------------------------- 125/* --------------------------------------------------------------------------
124 Transaction Management 126 Transaction Management
125 -------------------------------------------------------------------------- */ 127 -------------------------------------------------------------------------- */
@@ -259,6 +261,8 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
259 clear_bit(EC_FLAGS_GPE_MODE, &ec->flags); 261 clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
260 acpi_disable_gpe(NULL, ec->gpe); 262 acpi_disable_gpe(NULL, ec->gpe);
261 } 263 }
264 if (EC_FLAGS_MSI)
265 udelay(ACPI_EC_DELAY);
262 /* start transaction */ 266 /* start transaction */
263 spin_lock_irqsave(&ec->curr_lock, tmp); 267 spin_lock_irqsave(&ec->curr_lock, tmp);
264 /* following two actions should be kept atomic */ 268 /* following two actions should be kept atomic */
@@ -967,6 +971,11 @@ int __init acpi_ec_ecdt_probe(void)
967 /* 971 /*
968 * Generate a boot ec context 972 * Generate a boot ec context
969 */ 973 */
974 if (dmi_name_in_vendors("Micro-Star") ||
975 dmi_name_in_vendors("Notebook")) {
976 pr_info(PREFIX "Enabling special treatment for EC from MSI.\n");
977 EC_FLAGS_MSI = 1;
978 }
970 status = acpi_get_table(ACPI_SIG_ECDT, 1, 979 status = acpi_get_table(ACPI_SIG_ECDT, 1,
971 (struct acpi_table_header **)&ecdt_ptr); 980 (struct acpi_table_header **)&ecdt_ptr);
972 if (ACPI_SUCCESS(status)) { 981 if (ACPI_SUCCESS(status)) {
@@ -982,7 +991,7 @@ int __init acpi_ec_ecdt_probe(void)
982 saved_ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); 991 saved_ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL);
983 if (!saved_ec) 992 if (!saved_ec)
984 return -ENOMEM; 993 return -ENOMEM;
985 memcpy(&saved_ec, boot_ec, sizeof(saved_ec)); 994 memcpy(saved_ec, boot_ec, sizeof(*saved_ec));
986 /* fall through */ 995 /* fall through */
987 } 996 }
988 /* This workaround is needed only on some broken machines, 997 /* This workaround is needed only on some broken machines,