Skip to contentSkip to conversation

ACPI: EC: revert msleep patch

PATCH In review Alexey Starikovskiy 3 participants 3 messages Oct 27, 2008 – Oct 28, 2008 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: EC: revert msleep patch

With the better solution for EC interrupt storm issue, there is no need to use msleep over udelay.

References:

	http://bugzilla.kernel.org/show_bug.cgi?id=11810
	http://bugzilla.kernel.org/show_bug.cgi?id=10724

---

 drivers/acpi/ec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/ec.c +2 -2
index ef42316..3ef5b79 100644
@@ -239,10 +239,10 @@ static int ec_check_sci(struct acpi_ec *ec, u8 state)
 static int ec_poll(struct acpi_ec *ec)
 {
 	unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY);
-	msleep(1);
+	udelay(ACPI_EC_UDELAY);
 	while (time_before(jiffies, delay)) {
 		gpe_transaction(ec, acpi_ec_read_status(ec));
-		msleep(1);
+		udelay(ACPI_EC_UDELAY);
 		if (ec_transaction_done(ec))
 			return 0;
 	}
#1 lore raw
Quoted 3 lines · Alexey Starikovskiy

With the better solution for EC interrupt storm issue, there is no need to use msleep over udelay.

Why is msleep replaced by udelay again? When udelay is used, CPU will execute the loop while doing EC transaction.Although this only affects some laptops, this still is not very reasonable.

	For example: EC GPE interrupt storms; 
	there is no EC interrupt while doing some EC transaction;
	force_poll is 1.

IMO it is necessary to get the root cause of bug. We had better not revert something for some bugs and when another bug appears, we revert it again.

Thanks.

Quoted 34 lines

References:

	http://bugzilla.kernel.org/show_bug.cgi?id=11810
	http://bugzilla.kernel.org/show_bug.cgi?id=10724

---

 drivers/acpi/ec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/ec.c +2 -3
index ef42316..3ef5b79 100644
@@ -239,10 +239,10 @@ static int ec_check_sci(struct acpi_ec *ec, u8 state)
 static int ec_poll(struct acpi_ec *ec)
 {
 	unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY);
-	msleep(1);
+	udelay(ACPI_EC_UDELAY);
 	while (time_before(jiffies, delay)) {
 		gpe_transaction(ec, acpi_ec_read_status(ec));
-		msleep(1);
+		udelay(ACPI_EC_UDELAY);
 		if (ec_transaction_done(ec))
 			return 0;
 	}
 
--

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

reviewer
#2 lore raw
In reply to Alexey Starikovskiy

applied to acpi-test

Quoted 33 lines · Alexey Starikovskiy

With the better solution for EC interrupt storm issue, there is no need to use msleep over udelay.

References:

	http://bugzilla.kernel.org/show_bug.cgi?id=11810
	http://bugzilla.kernel.org/show_bug.cgi?id=10724

---

 drivers/acpi/ec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/acpi/ec.c +2 -2
index ef42316..3ef5b79 100644
@@ -239,10 +239,10 @@ static int ec_check_sci(struct acpi_ec *ec, u8 state)
 static int ec_poll(struct acpi_ec *ec)
 {
 	unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY);
-	msleep(1);
+	udelay(ACPI_EC_UDELAY);
 	while (time_before(jiffies, delay)) {
 		gpe_transaction(ec, acpi_ec_read_status(ec));
-		msleep(1);
+		udelay(ACPI_EC_UDELAY);
 		if (ec_transaction_done(ec))
 			return 0;
 	}