[RFC] [Patch 2/3] ACPI :Add the 2us delay before loop check EC status while in polling mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add the 2us delay before loop check EC status while in polling mode

According to the ACPI spec when the host writes data to the command or data
register of the embedded controller, the input buffer flag (IBF) in the 
status register is set within 1 microsecond. 
Maybe the incorrect status is returned by EC if host checks the EC status 
immediately after the data is written to EC I/O port. On most laptosp it
is unnecessary to add the delay as EC device is connected with the slow
peripherial bus. 
But it is safe to add the delay of 2 microseconds before starting loop 
check the EC status while EC is in polling mode.

Signed-off-by: Zhao Yakui <yakui.zhao@xxxxxxxxx>
---
 drivers/acpi/ec.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6/drivers/acpi/ec.c
===================================================================
--- linux-2.6.orig/drivers/acpi/ec.c
+++ linux-2.6/drivers/acpi/ec.c
@@ -259,6 +259,7 @@ static int acpi_ec_wait(struct acpi_ec *
 	} else {
 		unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY);
 		clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
+		udelay(2);
 		while (time_before(jiffies, delay)) {
 			if (acpi_ec_check_status(ec, event))
 				return 0;


--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux