* [PATCH 1/2] ACPI: EC: Make the GPE storm threshold a module parameter
@ 2012-09-28 7:22 Feng Tang
2012-09-28 7:22 ` [PATCH 2/2] ACPI: EC: Add a quirk for CLEVO M720T/M730T laptop Feng Tang
0 siblings, 1 reply; 4+ messages in thread
From: Feng Tang @ 2012-09-28 7:22 UTC (permalink / raw)
To: Len Brown, Len Brown, linux-acpi; +Cc: Bob Moore, Francesco, Feng Tang
Different EC hardwares have different behaviors for the GPE storm
detection, some requires the storm threshold to be low to work fine,
and some need a higher value to work ok.
The ACPI_EC_STORM_THRESHOLD was initially 20 when it's created, and
was changed to 8 in commit 06cf7d3c7 "ACPI: EC: lower interrupt storm
threshold" to fix kernel bug 11892 by forcing the laptop in that bug to
work in polling mode. However in bug 45151, it works fine in interrupt
mode if we lift the threshold back to 20.
This patch makes the threshold a module parameter so that user has a
flexible option to chose a number according to their specific EC HW.
It doesn't affect current EC behavior.
This is also a preparation patch to solve kernel bug:
https://bugzilla.kernel.org/show_bug.cgi?id=45151
Signed-off-by: Feng Tang <feng.tang@intel.com>
---
drivers/acpi/ec.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 7edaccc..615264c 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -71,9 +71,6 @@ enum ec_command {
#define ACPI_EC_UDELAY_GLK 1000 /* Wait 1ms max. to get global lock */
#define ACPI_EC_MSI_UDELAY 550 /* Wait 550us for MSI EC */
-#define ACPI_EC_STORM_THRESHOLD 8 /* number of false interrupts
- per one transaction */
-
enum {
EC_FLAGS_QUERY_PENDING, /* Query is pending */
EC_FLAGS_GPE_STORM, /* GPE storm detected */
@@ -87,6 +84,15 @@ static unsigned int ec_delay __read_mostly = ACPI_EC_DELAY;
module_param(ec_delay, uint, 0644);
MODULE_PARM_DESC(ec_delay, "Timeout(ms) waited until an EC command completes");
+/*
+ * If the number of false interrupts per one transaction exceeds
+ * this threshold, will think there is a GPE storm happened and
+ * will disable the GPE for normal transaction.
+ */
+static unsigned int ec_storm_threshold __read_mostly = 8;
+module_param(ec_storm_threshold, uint, 0644);
+MODULE_PARM_DESC(ec_storm_threshold, "Maxim false GPE numbers not considered as GPE storm");
+
/* If we find an EC via the ECDT, we need to keep a ptr to its context */
/* External interfaces use first EC only, so remember */
typedef int (*acpi_ec_query_func) (void *data);
@@ -319,7 +325,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
msleep(1);
/* It is safe to enable the GPE outside of the transaction. */
acpi_enable_gpe(NULL, ec->gpe);
- } else if (t->irq_count > ACPI_EC_STORM_THRESHOLD) {
+ } else if (t->irq_count > ec_storm_threshold) {
pr_info(PREFIX "GPE storm detected, "
"transactions will use polling mode\n");
set_bit(EC_FLAGS_GPE_STORM, &ec->flags);
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/2] ACPI: EC: Add a quirk for CLEVO M720T/M730T laptop
2012-09-28 7:22 [PATCH 1/2] ACPI: EC: Make the GPE storm threshold a module parameter Feng Tang
@ 2012-09-28 7:22 ` Feng Tang
2012-10-01 16:10 ` Peter Stuge
2012-10-06 18:51 ` Len Brown
0 siblings, 2 replies; 4+ messages in thread
From: Feng Tang @ 2012-09-28 7:22 UTC (permalink / raw)
To: Len Brown, Len Brown, linux-acpi; +Cc: Bob Moore, Francesco, Feng Tang
By enlarging the GPE storm threshold back to 20, that laptop's
EC works fine with interrupt mode instead of polling mode.
This solves the bug https://bugzilla.kernel.org/show_bug.cgi?id=45151
Reported-and-Tested-by: Francesco <trentini@dei.unipd.it>
Signed-off-by: Feng Tang <feng.tang@intel.com>
---
drivers/acpi/ec.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 615264c..a51df96 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -930,6 +930,17 @@ static int ec_flag_msi(const struct dmi_system_id *id)
return 0;
}
+/*
+ * Clevo M720 notebook actually works ok with IRQ mode, if we lifted
+ * the GPE storm threshold back to 20
+ */
+static int ec_enlarge_storm_threshold(const struct dmi_system_id *id)
+{
+ pr_debug("Setting the EC GPE storm threshold to 20\n");
+ ec_storm_threshold = 20;
+ return 0;
+}
+
static struct dmi_system_id __initdata ec_dmi_table[] = {
{
ec_skip_dsdt_scan, "Compal JFL92", {
@@ -961,10 +972,13 @@ static struct dmi_system_id __initdata ec_dmi_table[] = {
{
ec_validate_ecdt, "ASUS hardware", {
DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc.") }, NULL},
+ {
+ ec_enlarge_storm_threshold, "CLEVO hardware", {
+ DMI_MATCH(DMI_SYS_VENDOR, "CLEVO Co."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "M720T/M730T"),}, NULL},
{},
};
-
int __init acpi_ec_ecdt_probe(void)
{
acpi_status status;
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 2/2] ACPI: EC: Add a quirk for CLEVO M720T/M730T laptop
2012-09-28 7:22 ` [PATCH 2/2] ACPI: EC: Add a quirk for CLEVO M720T/M730T laptop Feng Tang
@ 2012-10-01 16:10 ` Peter Stuge
2012-10-06 18:51 ` Len Brown
1 sibling, 0 replies; 4+ messages in thread
From: Peter Stuge @ 2012-10-01 16:10 UTC (permalink / raw)
To: Feng Tang; +Cc: Len Brown, Len Brown, linux-acpi, Bob Moore, Francesco
Feng Tang wrote:
> +/*
> + * Clevo M720 notebook actually works ok with IRQ mode, if we lifted
> + * the GPE storm threshold back to 20
> + */
> +static int ec_enlarge_storm_threshold(const struct dmi_system_id *id)
This function name is very generic. Maybe there will be different
thresholds needed in the future. Is it a good idea to name the
function ec_set_storm_threshold_20 instead?
//Peter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] ACPI: EC: Add a quirk for CLEVO M720T/M730T laptop
2012-09-28 7:22 ` [PATCH 2/2] ACPI: EC: Add a quirk for CLEVO M720T/M730T laptop Feng Tang
2012-10-01 16:10 ` Peter Stuge
@ 2012-10-06 18:51 ` Len Brown
1 sibling, 0 replies; 4+ messages in thread
From: Len Brown @ 2012-10-06 18:51 UTC (permalink / raw)
To: Feng Tang; +Cc: Len Brown, linux-acpi, Bob Moore, Francesco
applied this workaround for 3.7.
thanks,
Len Brown, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-10-06 18:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-28 7:22 [PATCH 1/2] ACPI: EC: Make the GPE storm threshold a module parameter Feng Tang
2012-09-28 7:22 ` [PATCH 2/2] ACPI: EC: Add a quirk for CLEVO M720T/M730T laptop Feng Tang
2012-10-01 16:10 ` Peter Stuge
2012-10-06 18:51 ` Len Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).