[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <157972fa5572b0f0c157142ea151b8508e7640b4.1497418749.git.lv.zheng@intel.com>
Date: Wed, 14 Jun 2017 13:59:24 +0800
From: Lv Zheng <lv.zheng@...el.com>
To: "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
"Rafael J . Wysocki" <rjw@...ysocki.net>,
Len Brown <len.brown@...el.com>
Cc: Lv Zheng <lv.zheng@...el.com>, Lv Zheng <zetalog@...il.com>,
linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org
Subject: [PATCH 3/3] ACPI: EC: Change EC noirq tuning to be an optional behavior
According to the bug report, though the busy polling mode can make noirq
stages executed faster, it causes abnormal fan blowing in noirq stages.
This patch prepares an option so that the automatic busy polling mode
switching for noirq stages can be enabled by who wants to tune it, not all
users.
Noticed that the new global option cannot be changed during noirq stages.
There is no need to lock its value changes to sync with polling mode
settings switches.
For reporters and testers in the thread, as there are too many reporters
on the bug link, this patch only picks names from most active commenters.
Sorry for the neglet.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=191181
Reported-by: Tatsuyuki Ishi <ishitatsuyuki@...il.com>
Reported-by: Claudio Sacerdoti Coen <claudio.sacerdoticoen@...bo.it>
Tested-by: Nicolo' <nicolopiazzalunga@...il.com>
Reported-by: Jens Axboe <axboe@...nel.dk>
Tested-by: Gjorgji Jankovski <j.gjorgji@...il.com>
Tested-by: Damjan Georgievski <gdamjan@...il.com>
Tested-by: Fernando Chaves <nanochaves@...il.com>
Signed-off-by: Lv Zheng <lv.zheng@...el.com>
---
drivers/acpi/ec.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index f3ff591..de5dde6 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -151,6 +151,10 @@ static bool ec_freeze_events __read_mostly = true;
module_param(ec_freeze_events, bool, 0644);
MODULE_PARM_DESC(ec_freeze_events, "Disabling event handling during suspend/resume");
+static bool ec_tune_noirq __read_mostly = false;
+module_param(ec_tune_noirq, bool, 0644);
+MODULE_PARM_DESC(ec_tune_noirq, "Automatic enabling busy polling to tune noirq stages faster");
+
struct acpi_ec_query_handler {
struct list_head node;
acpi_ec_query_func func;
@@ -979,9 +983,11 @@ static void acpi_ec_enter_noirq(struct acpi_ec *ec)
unsigned long flags;
spin_lock_irqsave(&ec->lock, flags);
- ec->busy_polling = true;
- ec->polling_guard = 0;
- ec_log_drv("interrupt blocked");
+ if (ec_tune_noirq) {
+ ec->busy_polling = true;
+ ec->polling_guard = 0;
+ ec_log_drv("interrupt blocked");
+ }
spin_unlock_irqrestore(&ec->lock, flags);
}
@@ -990,9 +996,11 @@ static void acpi_ec_leave_noirq(struct acpi_ec *ec)
unsigned long flags;
spin_lock_irqsave(&ec->lock, flags);
- ec->busy_polling = ec_busy_polling;
- ec->polling_guard = ec_polling_guard;
- ec_log_drv("interrupt unblocked");
+ if (ec_tune_noirq) {
+ ec->busy_polling = ec_busy_polling;
+ ec->polling_guard = ec_polling_guard;
+ ec_log_drv("interrupt unblocked");
+ }
spin_unlock_irqrestore(&ec->lock, flags);
}
--
2.7.4
Powered by blists - more mailing lists