Skip to content

Commit 28fe5c8

Browse files
Lan Tianyurafaeljw
authored andcommitted
ACPI / EC: Restart transaction even when the IBF flag set
The EC driver works abnormally with IBF flag always set. IBF means "The host has written a byte of data to the command or data port, but the embedded controller has not yet read it". If IBF is set in the EC status and not cleared, this will cause all subsequent EC requests to fail with a timeout error. Change the EC driver so that it doesn't refuse to restart a transaction if IBF is set in the status. Also increase the number of transaction restarts to 5, as it turns out that 2 is not sufficient in some cases. This bug happens on several different machines (Asus V1S, Dell Latitude E6530, Samsung R719, Acer Aspire 5930G, Sony Vaio SR19VN and others). [rjw: Changelog] References: https://bugzilla.kernel.org/show_bug.cgi?id=14733 References: https://bugzilla.kernel.org/show_bug.cgi?id=15560 References: https://bugzilla.kernel.org/show_bug.cgi?id=15946 References: https://bugzilla.kernel.org/show_bug.cgi?id=42945 References: https://bugzilla.kernel.org/show_bug.cgi?id=48221 Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Cc: All <stable@vger.kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 4ef366c commit 28fe5c8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/acpi/ec.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ static int ec_check_sci_sync(struct acpi_ec *ec, u8 state)
223223
static int ec_poll(struct acpi_ec *ec)
224224
{
225225
unsigned long flags;
226-
int repeat = 2; /* number of command restarts */
226+
int repeat = 5; /* number of command restarts */
227227
while (repeat--) {
228228
unsigned long delay = jiffies +
229229
msecs_to_jiffies(ec_delay);
@@ -241,8 +241,6 @@ static int ec_poll(struct acpi_ec *ec)
241241
}
242242
advance_transaction(ec, acpi_ec_read_status(ec));
243243
} while (time_before(jiffies, delay));
244-
if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF)
245-
break;
246244
pr_debug(PREFIX "controller reset, restart transaction\n");
247245
spin_lock_irqsave(&ec->lock, flags);
248246
start_transaction(ec);

0 commit comments

Comments
 (0)