]>
Commit | Line | Data |
---|---|---|
c0e0a2bf GKH |
1 | From 28fe5c825f8e15744d04c7c1b8df197950923ecd Mon Sep 17 00:00:00 2001 |
2 | From: Lan Tianyu <tianyu.lan@intel.com> | |
3 | Date: Mon, 6 May 2013 03:23:40 +0000 | |
4 | Subject: ACPI / EC: Restart transaction even when the IBF flag set | |
5 | ||
6 | From: Lan Tianyu <tianyu.lan@intel.com> | |
7 | ||
8 | commit 28fe5c825f8e15744d04c7c1b8df197950923ecd upstream. | |
9 | ||
10 | The EC driver works abnormally with IBF flag always set. | |
11 | IBF means "The host has written a byte of data to the command | |
12 | or data port, but the embedded controller has not yet read it". | |
13 | If IBF is set in the EC status and not cleared, this will cause | |
14 | all subsequent EC requests to fail with a timeout error. | |
15 | ||
16 | Change the EC driver so that it doesn't refuse to restart a | |
17 | transaction if IBF is set in the status. Also increase the | |
18 | number of transaction restarts to 5, as it turns out that 2 | |
19 | is not sufficient in some cases. | |
20 | ||
21 | This bug happens on several different machines (Asus V1S, | |
22 | Dell Latitude E6530, Samsung R719, Acer Aspire 5930G, | |
23 | Sony Vaio SR19VN and others). | |
24 | ||
25 | [rjw: Changelog] | |
26 | References: https://bugzilla.kernel.org/show_bug.cgi?id=14733 | |
27 | References: https://bugzilla.kernel.org/show_bug.cgi?id=15560 | |
28 | References: https://bugzilla.kernel.org/show_bug.cgi?id=15946 | |
29 | References: https://bugzilla.kernel.org/show_bug.cgi?id=42945 | |
30 | References: https://bugzilla.kernel.org/show_bug.cgi?id=48221 | |
31 | Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> | |
32 | Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | |
33 | Signed-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); |