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.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 7edaccce6640..a51df9681319 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -71,9 +71,6 @@ enum ec_command {
71#define ACPI_EC_UDELAY_GLK 1000 /* Wait 1ms max. to get global lock */ 71#define ACPI_EC_UDELAY_GLK 1000 /* Wait 1ms max. to get global lock */
72#define ACPI_EC_MSI_UDELAY 550 /* Wait 550us for MSI EC */ 72#define ACPI_EC_MSI_UDELAY 550 /* Wait 550us for MSI EC */
73 73
74#define ACPI_EC_STORM_THRESHOLD 8 /* number of false interrupts
75 per one transaction */
76
77enum { 74enum {
78 EC_FLAGS_QUERY_PENDING, /* Query is pending */ 75 EC_FLAGS_QUERY_PENDING, /* Query is pending */
79 EC_FLAGS_GPE_STORM, /* GPE storm detected */ 76 EC_FLAGS_GPE_STORM, /* GPE storm detected */
@@ -87,6 +84,15 @@ static unsigned int ec_delay __read_mostly = ACPI_EC_DELAY;
87module_param(ec_delay, uint, 0644); 84module_param(ec_delay, uint, 0644);
88MODULE_PARM_DESC(ec_delay, "Timeout(ms) waited until an EC command completes"); 85MODULE_PARM_DESC(ec_delay, "Timeout(ms) waited until an EC command completes");
89 86
87/*
88 * If the number of false interrupts per one transaction exceeds
89 * this threshold, will think there is a GPE storm happened and
90 * will disable the GPE for normal transaction.
91 */
92static unsigned int ec_storm_threshold __read_mostly = 8;
93module_param(ec_storm_threshold, uint, 0644);
94MODULE_PARM_DESC(ec_storm_threshold, "Maxim false GPE numbers not considered as GPE storm");
95
90/* If we find an EC via the ECDT, we need to keep a ptr to its context */ 96/* If we find an EC via the ECDT, we need to keep a ptr to its context */
91/* External interfaces use first EC only, so remember */ 97/* External interfaces use first EC only, so remember */
92typedef int (*acpi_ec_query_func) (void *data); 98typedef int (*acpi_ec_query_func) (void *data);
@@ -319,7 +325,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
319 msleep(1); 325 msleep(1);
320 /* It is safe to enable the GPE outside of the transaction. */ 326 /* It is safe to enable the GPE outside of the transaction. */
321 acpi_enable_gpe(NULL, ec->gpe); 327 acpi_enable_gpe(NULL, ec->gpe);
322 } else if (t->irq_count > ACPI_EC_STORM_THRESHOLD) { 328 } else if (t->irq_count > ec_storm_threshold) {
323 pr_info(PREFIX "GPE storm detected, " 329 pr_info(PREFIX "GPE storm detected, "
324 "transactions will use polling mode\n"); 330 "transactions will use polling mode\n");
325 set_bit(EC_FLAGS_GPE_STORM, &ec->flags); 331 set_bit(EC_FLAGS_GPE_STORM, &ec->flags);
@@ -924,6 +930,17 @@ static int ec_flag_msi(const struct dmi_system_id *id)
924 return 0; 930 return 0;
925} 931}
926 932
933/*
934 * Clevo M720 notebook actually works ok with IRQ mode, if we lifted
935 * the GPE storm threshold back to 20
936 */
937static int ec_enlarge_storm_threshold(const struct dmi_system_id *id)
938{
939 pr_debug("Setting the EC GPE storm threshold to 20\n");
940 ec_storm_threshold = 20;
941 return 0;
942}
943
927static struct dmi_system_id __initdata ec_dmi_table[] = { 944static struct dmi_system_id __initdata ec_dmi_table[] = {
928 { 945 {
929 ec_skip_dsdt_scan, "Compal JFL92", { 946 ec_skip_dsdt_scan, "Compal JFL92", {
@@ -955,10 +972,13 @@ static struct dmi_system_id __initdata ec_dmi_table[] = {
955 { 972 {
956 ec_validate_ecdt, "ASUS hardware", { 973 ec_validate_ecdt, "ASUS hardware", {
957 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc.") }, NULL}, 974 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc.") }, NULL},
975 {
976 ec_enlarge_storm_threshold, "CLEVO hardware", {
977 DMI_MATCH(DMI_SYS_VENDOR, "CLEVO Co."),
978 DMI_MATCH(DMI_PRODUCT_NAME, "M720T/M730T"),}, NULL},
958 {}, 979 {},
959}; 980};
960 981
961
962int __init acpi_ec_ecdt_probe(void) 982int __init acpi_ec_ecdt_probe(void)
963{ 983{
964 acpi_status status; 984 acpi_status status;