]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.0.79/acpi-ec-restart-transaction-even-when-the-ibf-flag-set.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.0.79 / acpi-ec-restart-transaction-even-when-the-ibf-flag-set.patch
CommitLineData
c0e0a2bf
GKH
1From 28fe5c825f8e15744d04c7c1b8df197950923ecd Mon Sep 17 00:00:00 2001
2From: Lan Tianyu <tianyu.lan@intel.com>
3Date: Mon, 6 May 2013 03:23:40 +0000
4Subject: ACPI / EC: Restart transaction even when the IBF flag set
5
6From: Lan Tianyu <tianyu.lan@intel.com>
7
8commit 28fe5c825f8e15744d04c7c1b8df197950923ecd upstream.
9
10The EC driver works abnormally with IBF flag always set.
11IBF means "The host has written a byte of data to the command
12or data port, but the embedded controller has not yet read it".
13If IBF is set in the EC status and not cleared, this will cause
14all subsequent EC requests to fail with a timeout error.
15
16Change the EC driver so that it doesn't refuse to restart a
17transaction if IBF is set in the status. Also increase the
18number of transaction restarts to 5, as it turns out that 2
19is not sufficient in some cases.
20
21This bug happens on several different machines (Asus V1S,
22Dell Latitude E6530, Samsung R719, Acer Aspire 5930G,
23Sony Vaio SR19VN and others).
24
25[rjw: Changelog]
26References: https://bugzilla.kernel.org/show_bug.cgi?id=14733
27References: https://bugzilla.kernel.org/show_bug.cgi?id=15560
28References: https://bugzilla.kernel.org/show_bug.cgi?id=15946
29References: https://bugzilla.kernel.org/show_bug.cgi?id=42945
30References: https://bugzilla.kernel.org/show_bug.cgi?id=48221
31Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
32Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
33Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
34
35---
36 drivers/acpi/ec.c | 4 +---
37 1 file changed, 1 insertion(+), 3 deletions(-)
38
39--- a/drivers/acpi/ec.c
40+++ b/drivers/acpi/ec.c
41@@ -217,7 +217,7 @@ static int ec_check_sci_sync(struct acpi
42 static int ec_poll(struct acpi_ec *ec)
43 {
44 unsigned long flags;
45- int repeat = 2; /* number of command restarts */
46+ int repeat = 5; /* number of command restarts */
47 while (repeat--) {
48 unsigned long delay = jiffies +
49 msecs_to_jiffies(ec_delay);
50@@ -235,8 +235,6 @@ static int ec_poll(struct acpi_ec *ec)
51 }
52 advance_transaction(ec, acpi_ec_read_status(ec));
53 } while (time_before(jiffies, delay));
54- if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF)
55- break;
56 pr_debug(PREFIX "controller reset, restart transaction\n");
57 spin_lock_irqsave(&ec->curr_lock, flags);
58 start_transaction(ec);