Skip to contentSkip to conversation

Regression: ACPI AC driver doesn't work on Toshiba Portege R500

PATCH New Rafael J. Wysocki 3 participants 13 messages Nov 22, 2008 – Nov 25, 2008 ACPI

lore
Share & tools
lore
#0 lore raw

Hi,

With current mainline (2.6.28-rc6-git1 as of today) on Toshiba Portege R500 the status of the AC adapter is not updated when the adapter is unplugged and plugged in. Evidently, /sys/class/power_supply/ADP1/online always contains the same value. Interestingly enough, though, if the box is suspended to RAM and resumed, the status of the AC adapter is correctly updated, but the value read at that time remains in /sys/class/power_supply/ADP1/online until the next suspend/resume cycle regardless of what's going on with the AC adapter.

2.6.27.7 works correctly on this box so the recent EC patches don't seem to cause this regression to happen.

Any other ideas?

Rafael

#1 lore raw

Re: Regression: ACPI AC driver doesn't work on Toshiba Portege R500 (bisected)

Quoted 10 lines · Rafael J. Wysocki

Hi,

With current mainline (2.6.28-rc6-git1 as of today) on Toshiba Portege R500 the status of the AC adapter is not updated when the adapter is unplugged and plugged in. Evidently, /sys/class/power_supply/ADP1/online always contains the same value. Interestingly enough, though, if the box is suspended to RAM and resumed, the status of the AC adapter is correctly updated, but the value read at that time remains in /sys/class/power_supply/ADP1/online until the next suspend/resume cycle regardless of what's going on with the AC adapter.

Quoted 4 lines

2.6.27.7 works correctly on this box so the recent EC patches don't seem to cause this regression to happen.

Any other ideas?

The problem was introduced by the following commit:

commit faee816b1502385dc9bc5abf2960d1cc645844d1

Author: Zhang Rui <[email protected]>
Date:   Fri Sep 12 11:12:25 2008 +0800

ACPI: don't enable control method power button as wakeup device when Fixed Power button is used

don't enable control method power button as wakeup device when Fixed Power button is used.

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

Reverting this commit on top of the current mainline makes the kernel behave correctly again.

Thanks,
Rafael

#2 lore raw

Re: Regression: ACPI AC driver doesn't work on Toshiba Portege R500 (bisected)

Quoted 27 lines · Rafael J. Wysocki
Quoted 10 lines · Rafael J. Wysocki

Hi,

With current mainline (2.6.28-rc6-git1 as of today) on Toshiba Portege R500 the status of the AC adapter is not updated when the adapter is unplugged and plugged in. Evidently, /sys/class/power_supply/ADP1/online always contains the same value. Interestingly enough, though, if the box is suspended to RAM and resumed, the status of the AC adapter is correctly updated, but the value read at that time remains in /sys/class/power_supply/ADP1/online until the next suspend/resume cycle regardless of what's going on with the AC adapter.

Quoted 4 lines

2.6.27.7 works correctly on this box so the recent EC patches don't seem to cause this regression to happen.

Any other ideas?

The problem was introduced by the following commit:

commit faee816b1502385dc9bc5abf2960d1cc645844d1

Author: Zhang Rui <[email protected]>
Date:   Fri Sep 12 11:12:25 2008 +0800

ACPI: don't enable control method power button as wakeup device when Fixed Power button is used

don't enable control method power button as wakeup device when Fixed Power button is used.

Quoted 8 lines

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

Reverting this commit on top of the current mainline makes the kernel behave correctly again.

Alas, after reverting the patch the box hangs on resume from suspend to RAM when it is woken up by opening the lid.

I suspect that the GPE which is normally used for signalling the AC adapter events is the same one associated with the fake power button and it is not enabled if that button is not regarded as a wake-up device. However, it causes problems to happen during resume if the fake power button _is_ regarded as a wake-up device.

The DSDT for the box is at:
http://www.sisk.pl/kernel/debug/ACPI/R500/DSDT.dsl

Thanks,
Rafael

#4 lore raw

Re: Regression: ACPI AC driver doesn't work on Toshiba Portege R500 (bisected)

In reply to Rafael J. Wysocki
Quoted 11 lines · Rafael J. Wysocki
Quoted 10 lines · Rafael J. Wysocki

Hi,

With current mainline (2.6.28-rc6-git1 as of today) on Toshiba Portege R500 the status of the AC adapter is not updated when the adapter is unplugged and plugged in. Evidently, /sys/class/power_supply/ADP1/online always contains the same value. Interestingly enough, though, if the box is suspended to RAM and resumed, the status of the AC adapter is correctly updated, but the value read at that time remains in /sys/class/power_supply/ADP1/online until the next suspend/resume cycle regardless of what's going on with the AC adapter.

Quoted 4 lines
Quoted 4 lines

2.6.27.7 works correctly on this box so the recent EC patches don't seem to cause this regression to happen.

Any other ideas?

Hi, Rafael
Will you please open a new bug at
http://bugzilla.kernel.org/enter_bug.cgi?product=ACPI and attach the output of acpidump, dmesg, lspci -vxxx?
If no ACPI event is reported when AC adapter is unplugged and
plugged, the /sys/class interface can't display the correct AC status. Now Rui is working on this issue and the patch is already finished. But it is not sent to Lenb.

From the problem description it seems that the problem is related
with the AC driver. But from the git-bisect it seems that the problem is related with the button driver(Fix power button device).

Any-way, please attach the output of dmesg, acpidump, lspci -vxxx.

Thanks.

Quoted 27 lines

The problem was introduced by the following commit:

commit faee816b1502385dc9bc5abf2960d1cc645844d1

Author: Zhang Rui <[email protected]>
Date:   Fri Sep 12 11:12:25 2008 +0800

ACPI: don't enable control method power button as wakeup device when Fixed Power button is used

don't enable control method power button as wakeup device when Fixed Power button is used.

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

Reverting this commit on top of the current mainline makes the kernel behave correctly again.

Thanks,
Rafael
--
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

#5 lore raw

Re: Regression: ACPI AC driver doesn't work on Toshiba Portege R500 (bisected)

Quoted 16 lines · Zhao Yakui
Quoted 11 lines · Rafael J. Wysocki
Quoted 10 lines · Rafael J. Wysocki

Hi,

With current mainline (2.6.28-rc6-git1 as of today) on Toshiba Portege R500 the status of the AC adapter is not updated when the adapter is unplugged and plugged in. Evidently, /sys/class/power_supply/ADP1/online always contains the same value. Interestingly enough, though, if the box is suspended to RAM and resumed, the status of the AC adapter is correctly updated, but the value read at that time remains in /sys/class/power_supply/ADP1/online until the next suspend/resume cycle regardless of what's going on with the AC adapter.

Quoted 4 lines
Quoted 4 lines

2.6.27.7 works correctly on this box so the recent EC patches don't seem to cause this regression to happen.

Any other ideas?

Quoted 8 lines

Hi, Rafael
Will you please open a new bug at
http://bugzilla.kernel.org/enter_bug.cgi?product=ACPI and attach the output of acpidump, dmesg, lspci -vxxx?
If no ACPI event is reported when AC adapter is unplugged and
plugged, the /sys/class interface can't display the correct AC status. Now Rui is working on this issue and the patch is already finished. But it is not sent to Lenb.

Can you give me a link to the patch, please?

Quoted 5 lines

From the problem description it seems that the problem is related
with the AC driver. But from the git-bisect it seems that the problem is related with the button driver(Fix power button device).

Any-way, please attach the output of dmesg, acpidump, lspci -vxxx.

Created http://bugzilla.kernel.org/show_bug.cgi?id=12091 with the information attached as requested.

Thanks,
Rafael

#6 lore raw

Re: Regression: ACPI AC driver doesn't work on Toshiba Portege R500 (bisected)

Quoted 26 lines · Rafael J. Wysocki
Quoted 16 lines · Zhao Yakui
Quoted 11 lines · Rafael J. Wysocki
Quoted 10 lines · Rafael J. Wysocki

Hi,

With current mainline (2.6.28-rc6-git1 as of today) on Toshiba Portege R500 the status of the AC adapter is not updated when the adapter is unplugged and plugged in. Evidently, /sys/class/power_supply/ADP1/online always contains the same value. Interestingly enough, though, if the box is suspended to RAM and resumed, the status of the AC adapter is correctly updated, but the value read at that time remains in /sys/class/power_supply/ADP1/online until the next suspend/resume cycle regardless of what's going on with the AC adapter.

Quoted 4 lines
Quoted 4 lines

2.6.27.7 works correctly on this box so the recent EC patches don't seem to cause this regression to happen.

Any other ideas?

Quoted 8 lines

Hi, Rafael
Will you please open a new bug at
http://bugzilla.kernel.org/enter_bug.cgi?product=ACPI and attach the output of acpidump, dmesg, lspci -vxxx?
If no ACPI event is reported when AC adapter is unplugged and
plugged, the /sys/class interface can't display the correct AC status. Now Rui is working on this issue and the patch is already finished. But it is not sent to Lenb.

Quoted 1 line

Can you give me a link to the patch, please?

From: Zhang Rui <[email protected]>
Subject: power_supply: update ac status before acquiring it.

Update AC status in sysfs I/F.
http://bugzilla.kernel.org/show_bug.cgi?id=12035

---
 drivers/acpi/ac.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/acpi/ac.c +5 -1
Index: linux-2.6/drivers/acpi/ac.c
===================================================================
@@ -87,6 +87,7 @@ struct acpi_ac {
 	unsigned long long state;
 };
 
+static int acpi_ac_get_state(struct acpi_ac *ac);
 #define to_acpi_ac(x) container_of(x, struct acpi_ac, charger);
 
 #ifdef CONFIG_ACPI_PROCFS_POWER
@@ -103,15 +104,18 @@ static int get_ac_property(struct power_
 			   enum power_supply_property psp,
 			   union power_supply_propval *val)
 {
+	int result;
 	struct acpi_ac *ac = to_acpi_ac(psy);
+
 	switch (psp) {
 	case POWER_SUPPLY_PROP_ONLINE:
+		result = acpi_ac_get_state(ac);
 		val->intval = ac->state;
 		break;
 	default:
 		return -EINVAL;
 	}
-	return 0;
+	return result;
 }
 
 static enum power_supply_property ac_props[] = {
Quoted 10 lines
Quoted 6 lines

From the problem description it seems that the problem is related
with the AC driver. But from the git-bisect it seems that the problem is related with the button driver(Fix power button device).

Any-way, please attach the output of dmesg, acpidump, lspci -vxxx.

Created http://bugzilla.kernel.org/show_bug.cgi?id=12091 with the information attached as requested.

I'll take this bug. :)

thanks,
rui

Update AC status in sysfs I/F.
http://bugzilla.kernel.org/show_bug.cgi?id=12035

---
 drivers/acpi/ac.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/acpi/ac.c +5 -1
Index: linux-2.6/drivers/acpi/ac.c
===================================================================
@@ -87,6 +87,7 @@ struct acpi_ac {
 	unsigned long long state;
 };
 
+static int acpi_ac_get_state(struct acpi_ac *ac);
 #define to_acpi_ac(x) container_of(x, struct acpi_ac, charger);
 
 #ifdef CONFIG_ACPI_PROCFS_POWER
@@ -103,15 +104,18 @@ static int get_ac_property(struct power_
 			   enum power_supply_property psp,
 			   union power_supply_propval *val)
 {
+	int result;
 	struct acpi_ac *ac = to_acpi_ac(psy);
+
 	switch (psp) {
 	case POWER_SUPPLY_PROP_ONLINE:
+		result = acpi_ac_get_state(ac);
 		val->intval = ac->state;
 		break;
 	default:
 		return -EINVAL;
 	}
-	return 0;
+	return result;
 }
 
 static enum power_supply_property ac_props[] = {
#3 lore raw

Re: Regression: ACPI AC driver doesn't work on Toshiba Portege R500 (bisected)

In reply to Rafael J. Wysocki
Quoted 34 lines · Rafael J. Wysocki
Quoted 33 lines · Rafael J. Wysocki
Quoted 10 lines · Rafael J. Wysocki

Hi,

With current mainline (2.6.28-rc6-git1 as of today) on Toshiba Portege R500 the status of the AC adapter is not updated when the adapter is unplugged and plugged in. Evidently, /sys/class/power_supply/ADP1/online always contains the same value. Interestingly enough, though, if the box is suspended to RAM and resumed, the status of the AC adapter is correctly updated, but the value read at that time remains in /sys/class/power_supply/ADP1/online until the next suspend/resume cycle regardless of what's going on with the AC adapter.

Quoted 4 lines

2.6.27.7 works correctly on this box so the recent EC patches don't seem to cause this regression to happen.

Any other ideas?

The problem was introduced by the following commit:

commit faee816b1502385dc9bc5abf2960d1cc645844d1

Author: Zhang Rui <[email protected]>
Date:   Fri Sep 12 11:12:25 2008 +0800

ACPI: don't enable control method power button as wakeup device when Fixed Power button is used

don't enable control method power button as wakeup device when Fixed Power button is used.

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

Quoted 5 lines
Quoted 2 lines

Reverting this commit on top of the current mainline makes the kernel behave correctly again.

Alas, after reverting the patch the box hangs on resume from suspend to RAM when it is woken up by opening the lid.

This was actually wrong. There is a separate resume regression on this box, caused most probably by DRM, so in fact the reverting of the commit above is fine.

Thanks,
Rafael

#7 lore raw

Re: Regression: ACPI AC driver doesn't work on Toshiba Portege R500 (bisected)

In reply to Zhang Rui
Quoted 27 lines · Zhang Rui
Quoted 26 lines · Rafael J. Wysocki
Quoted 24 lines · Zhao Yakui
Quoted 11 lines · Rafael J. Wysocki
Quoted 10 lines · Rafael J. Wysocki

Hi,

With current mainline (2.6.28-rc6-git1 as of today) on Toshiba Portege R500 the status of the AC adapter is not updated when the adapter is unplugged and plugged in. Evidently, /sys/class/power_supply/ADP1/online always contains the same value. Interestingly enough, though, if the box is suspended to RAM and resumed, the status of the AC adapter is correctly updated, but the value read at that time remains in /sys/class/power_supply/ADP1/online until the next suspend/resume cycle regardless of what's going on with the AC adapter.

Quoted 4 lines
Quoted 4 lines

2.6.27.7 works correctly on this box so the recent EC patches don't seem to cause this regression to happen.

Any other ideas?

Hi, Rafael
Will you please open a new bug at
http://bugzilla.kernel.org/enter_bug.cgi?product=ACPI and attach the output of acpidump, dmesg, lspci -vxxx?
If no ACPI event is reported when AC adapter is unplugged and
plugged, the /sys/class interface can't display the correct AC status. Now Rui is working on this issue and the patch is already finished. But it is not sent to Lenb.

Quoted 1 line
Quoted 1 line

Can you give me a link to the patch, please?

Thanks.

Still, it doesn't seem to be related to the problem at hand.

Quoted 49 lines

From: Zhang Rui <[email protected]>
Subject: power_supply: update ac status before acquiring it.

Update AC status in sysfs I/F.
http://bugzilla.kernel.org/show_bug.cgi?id=12035

---
 drivers/acpi/ac.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/acpi/ac.c
===================================================================

drivers/acpi/ac.c +5 -1
@@ -87,6 +87,7 @@ struct acpi_ac {
 	unsigned long long state;
 };
 
+static int acpi_ac_get_state(struct acpi_ac *ac);
 #define to_acpi_ac(x) container_of(x, struct acpi_ac, charger);
 
 #ifdef CONFIG_ACPI_PROCFS_POWER
@@ -103,15 +104,18 @@ static int get_ac_property(struct power_
 			   enum power_supply_property psp,
 			   union power_supply_propval *val)
 {
+	int result;
 	struct acpi_ac *ac = to_acpi_ac(psy);
+
 	switch (psp) {
 	case POWER_SUPPLY_PROP_ONLINE:
+		result = acpi_ac_get_state(ac);
 		val->intval = ac->state;
 		break;
 	default:
 		return -EINVAL;
 	}
-	return 0;
+	return result;
 }
 
 static enum power_supply_property ac_props[] = {
Quoted 6 lines
Quoted 6 lines

From the problem description it seems that the problem is related
with the AC driver. But from the git-bisect it seems that the problem is related with the button driver(Fix power button device).

Quoted 6 lines
Quoted 5 lines
Quoted 1 line

Any-way, please attach the output of dmesg, acpidump, lspci -vxxx.

Created http://bugzilla.kernel.org/show_bug.cgi?id=12091 with the information attached as requested.

I'll take this bug. :)

Thanks again.

Do I understand correctly that you intend to revert commit faee816b1502385dc9bc5abf2960d1cc645844d1 and provide an alternative patch for walken?

Rafael

#8 lore raw

Re: Regression: ACPI AC driver doesn't work on Toshiba Portege R500 (bisected)

Quoted 28 lines · Rafael J. Wysocki
Quoted 27 lines · Zhang Rui
Quoted 26 lines · Rafael J. Wysocki
Quoted 24 lines · Zhao Yakui
Quoted 11 lines · Rafael J. Wysocki
Quoted 10 lines · Rafael J. Wysocki

Hi,

With current mainline (2.6.28-rc6-git1 as of today) on Toshiba Portege R500 the status of the AC adapter is not updated when the adapter is unplugged and plugged in. Evidently, /sys/class/power_supply/ADP1/online always contains the same value. Interestingly enough, though, if the box is suspended to RAM and resumed, the status of the AC adapter is correctly updated, but the value read at that time remains in /sys/class/power_supply/ADP1/online until the next suspend/resume cycle regardless of what's going on with the AC adapter.

Quoted 4 lines
Quoted 4 lines

2.6.27.7 works correctly on this box so the recent EC patches don't seem to cause this regression to happen.

Any other ideas?

Hi, Rafael
Will you please open a new bug at
http://bugzilla.kernel.org/enter_bug.cgi?product=ACPI and attach the output of acpidump, dmesg, lspci -vxxx?
If no ACPI event is reported when AC adapter is unplugged and
plugged, the /sys/class interface can't display the correct AC status. Now Rui is working on this issue and the patch is already finished. But it is not sent to Lenb.

Quoted 5 lines
Quoted 1 line
Quoted 1 line

Can you give me a link to the patch, please?

Thanks.

Still, it doesn't seem to be related to the problem at hand.

On the R500 box there exist two issues related with AC driver
a. no ACPI event is reported by AC adapter. The root cause is that
the GPE is shared by several devices(Fake Power button, LID device,HS86, HS87, ADP1). If the GPE is registered as run_wake type by the fake power button, the AC adapter can be reported correctly. If the GPE is registered as wake type, the AC adapter can't be reported correctly.
In the commit the GPE obtained from the _PRW packge of Power button
device won't be registered as the Fix power button is used instead of generic power button.
b. the /sys/class/power_supply/ADP1/online can't report the correct
status of AC adapter.But the /proc/acpi/ interface can report the correct status even when there is no ACPI event. This can be fixed by the patch from Rui.

Thanks.

Quoted 64 lines
Quoted 50 lines

From: Zhang Rui <[email protected]>
Subject: power_supply: update ac status before acquiring it.

Update AC status in sysfs I/F.
http://bugzilla.kernel.org/show_bug.cgi?id=12035

---
 drivers/acpi/ac.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/acpi/ac.c
===================================================================

drivers/acpi/ac.c +5 -1
@@ -87,6 +87,7 @@ struct acpi_ac {
 	unsigned long long state;
 };
 
+static int acpi_ac_get_state(struct acpi_ac *ac);
 #define to_acpi_ac(x) container_of(x, struct acpi_ac, charger);
 
 #ifdef CONFIG_ACPI_PROCFS_POWER
@@ -103,15 +104,18 @@ static int get_ac_property(struct power_
 			   enum power_supply_property psp,
 			   union power_supply_propval *val)
 {
+	int result;
 	struct acpi_ac *ac = to_acpi_ac(psy);
+
 	switch (psp) {
 	case POWER_SUPPLY_PROP_ONLINE:
+		result = acpi_ac_get_state(ac);
 		val->intval = ac->state;
 		break;
 	default:
 		return -EINVAL;
 	}
-	return 0;
+	return result;
 }
 
 static enum power_supply_property ac_props[] = {
Quoted 6 lines
Quoted 6 lines

From the problem description it seems that the problem is related
with the AC driver. But from the git-bisect it seems that the problem is related with the button driver(Fix power button device).

Quoted 6 lines
Quoted 5 lines
Quoted 1 line

Any-way, please attach the output of dmesg, acpidump, lspci -vxxx.

Created http://bugzilla.kernel.org/show_bug.cgi?id=12091 with the information attached as requested.

I'll take this bug. :)

Thanks again.

Do I understand correctly that you intend to revert commit faee816b1502385dc9bc5abf2960d1cc645844d1 and provide an alternative patch for walken?

Rafael

#10 lore raw

Re: Regression: ACPI AC driver doesn't work on Toshiba Portege R500 (bisected)

In reply to Rafael J. Wysocki
Quoted 28 lines · Rafael J. Wysocki
Quoted 27 lines · Zhang Rui
Quoted 26 lines · Rafael J. Wysocki
Quoted 24 lines · Zhao Yakui
Quoted 11 lines · Rafael J. Wysocki
Quoted 10 lines · Rafael J. Wysocki

Hi,

With current mainline (2.6.28-rc6-git1 as of today) on Toshiba Portege R500 the status of the AC adapter is not updated when the adapter is unplugged and plugged in. Evidently, /sys/class/power_supply/ADP1/online always contains the same value. Interestingly enough, though, if the box is suspended to RAM and resumed, the status of the AC adapter is correctly updated, but the value read at that time remains in /sys/class/power_supply/ADP1/online until the next suspend/resume cycle regardless of what's going on with the AC adapter.

Quoted 4 lines
Quoted 4 lines

2.6.27.7 works correctly on this box so the recent EC patches don't seem to cause this regression to happen.

Any other ideas?

Hi, Rafael
Will you please open a new bug at
http://bugzilla.kernel.org/enter_bug.cgi?product=ACPI and attach the output of acpidump, dmesg, lspci -vxxx?
If no ACPI event is reported when AC adapter is unplugged and
plugged, the /sys/class interface can't display the correct AC status. Now Rui is working on this issue and the patch is already finished. But it is not sent to Lenb.

Quoted 6 lines
Quoted 1 line
Quoted 1 line

Can you give me a link to the patch, please?

Thanks.

Still, it doesn't seem to be related to the problem at hand.

right, it's another problem.

Quoted 54 lines
Quoted 54 lines

From: Zhang Rui <[email protected]>
Subject: power_supply: update ac status before acquiring it.

Update AC status in sysfs I/F.
http://bugzilla.kernel.org/show_bug.cgi?id=12035

---
 drivers/acpi/ac.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/acpi/ac.c
===================================================================

drivers/acpi/ac.c +5 -1
@@ -87,6 +87,7 @@ struct acpi_ac {
 	unsigned long long state;
 };
 
+static int acpi_ac_get_state(struct acpi_ac *ac);
 #define to_acpi_ac(x) container_of(x, struct acpi_ac, charger);
 
 #ifdef CONFIG_ACPI_PROCFS_POWER
@@ -103,15 +104,18 @@ static int get_ac_property(struct power_
 			   enum power_supply_property psp,
 			   union power_supply_propval *val)
 {
+	int result;
 	struct acpi_ac *ac = to_acpi_ac(psy);
+
 	switch (psp) {
 	case POWER_SUPPLY_PROP_ONLINE:
+		result = acpi_ac_get_state(ac);
 		val->intval = ac->state;
 		break;
 	default:
 		return -EINVAL;
 	}
-	return 0;
+	return result;
 }
 
 static enum power_supply_property ac_props[] = {
Quoted 11 lines
Quoted 7 lines

From the problem description it seems that the problem is related
with the AC driver. But from the git-bisect it seems that the problem is related with the button driver(Fix power button device).

Any-way, please attach the output of dmesg, acpidump, lspci -vxxx.

Created http://bugzilla.kernel.org/show_bug.cgi?id=12091 with the information attached as requested.

Quoted 8 lines
Quoted 1 line

I'll take this bug. :)

Thanks again.

Do I understand correctly that you intend to revert commit faee816b1502385dc9bc5abf2960d1cc645844d1 and provide an alternative patch for walken?

First, I think it's safe to revert
commit faee816b1502385dc9bc5abf2960d1cc645844d1
because bug #10503 can not be reproduced in the upstream kernel as a result of another commit 49db139955d3392c6c4facf987905d0a9afed581

Second, if we can make sure all the pci devices won't issue any PMEs when the /sys/devices/.../power/wakeup files are "disabled", then I'd glad to generate another patch which always enables the PCI root bridge (PNP0A03) GPE, both at runtime and sleep state, just like what we do for the buttons.

thanks,
rui

--
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

#11 lore raw

Re: Regression: ACPI AC driver doesn't work on Toshiba Portege R500 (bisected)

Quoted 2 lines · Zhang Rui
Quoted 1 line · Rafael J. Wysocki

On Monday, 24 of November 2008, Zhang Rui wrote:

[--snip--]

Quoted 9 lines
Quoted 5 lines

Do I understand correctly that you intend to revert commit faee816b1502385dc9bc5abf2960d1cc645844d1 and provide an alternative patch for walken?

First, I think it's safe to revert
commit faee816b1502385dc9bc5abf2960d1cc645844d1
because bug #10503 can not be reproduced in the upstream kernel as a result of another commit 49db139955d3392c6c4facf987905d0a9afed581

OK, I'll send the revert of faee816b1502385dc9bc5abf2960d1cc645844d1 to Len later today.

Quoted 2 lines

Second, if we can make sure all the pci devices won't issue any PMEs when the /sys/devices/.../power/wakeup files are "disabled",

It is supposed to work like this. If it doesn't, then there is a bug that has to be fixed.

Quoted 3 lines

then I'd glad to generate another patch which always enables the PCI root bridge (PNP0A03) GPE, both at runtime and sleep state, just like what we do for the buttons.

Please go for it.

Thanks,
Rafael
--
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

#9 lore raw

Re: Regression: ACPI AC driver doesn't work on Toshiba Portege R500 (bisected)

In reply to Zhao Yakui
Quoted 34 lines · Zhao Yakui
Quoted 28 lines · Rafael J. Wysocki
Quoted 27 lines · Zhang Rui
Quoted 26 lines · Rafael J. Wysocki
Quoted 24 lines · Zhao Yakui
Quoted 11 lines · Rafael J. Wysocki
Quoted 10 lines · Rafael J. Wysocki

Hi,

With current mainline (2.6.28-rc6-git1 as of today) on Toshiba Portege R500 the status of the AC adapter is not updated when the adapter is unplugged and plugged in. Evidently, /sys/class/power_supply/ADP1/online always contains the same value. Interestingly enough, though, if the box is suspended to RAM and resumed, the status of the AC adapter is correctly updated, but the value read at that time remains in /sys/class/power_supply/ADP1/online until the next suspend/resume cycle regardless of what's going on with the AC adapter.

Quoted 4 lines
Quoted 4 lines

2.6.27.7 works correctly on this box so the recent EC patches don't seem to cause this regression to happen.

Any other ideas?

Hi, Rafael
Will you please open a new bug at
http://bugzilla.kernel.org/enter_bug.cgi?product=ACPI and attach the output of acpidump, dmesg, lspci -vxxx?
If no ACPI event is reported when AC adapter is unplugged and
plugged, the /sys/class interface can't display the correct AC status. Now Rui is working on this issue and the patch is already finished. But it is not sent to Lenb.

Quoted 5 lines
Quoted 1 line
Quoted 1 line

Can you give me a link to the patch, please?

Thanks.

Still, it doesn't seem to be related to the problem at hand.

Quoted 13 lines

On the R500 box there exist two issues related with AC driver
a. no ACPI event is reported by AC adapter. The root cause is that
the GPE is shared by several devices(Fake Power button, LID device,HS86, HS87, ADP1). If the GPE is registered as run_wake type by the fake power button, the AC adapter can be reported correctly. If the GPE is registered as wake type, the AC adapter can't be reported correctly.
In the commit the GPE obtained from the _PRW packge of Power button
device won't be registered as the Fix power button is used instead of generic power button.
b. the /sys/class/power_supply/ADP1/online can't report the correct
status of AC adapter.But the /proc/acpi/ interface can report the correct status even when there is no ACPI event. This can be fixed by the patch from Rui.

I see, thanks for the explanation.

The /proc/acpi interface is not compiled in here, so obviously I didn't notice the issue with it.

Thanks,
Rafael

#12 lore raw

PATCH 1/1 ACPI: Revert commit faee816b150238 due to regression

In reply to Zhang Rui

From: Rafael J. Wysocki <[email protected]>
Subject: ACPI: Revert commit faee816b150238 due to regression

Commit faee816b1502385dc9bc5abf2960d1cc645844d1
"ACPI: don't enable control method power button as wakeup device when Fixed Power button is used" caused the regression tracked as http://bugzilla.kernel.org/show_bug.cgi?id=12091 (there are no AC adapter events on Toshiba Portege R500) and the problem this commit was intended to fix can be fixed differently.

For this reason, the author of the commit, Zhang Rui, has requested that it be reverted.

---
 drivers/acpi/scan.c |   10 ----------
 1 file changed, 10 deletions(-)
drivers/acpi/scan.c +0 -10
Index: linux-2.6/drivers/acpi/scan.c
===================================================================
@@ -751,16 +751,6 @@ static int acpi_bus_get_wakeup_device_fl
 	if (!acpi_match_device_ids(device, button_device_ids))
 		device->wakeup.flags.run_wake = 1;
 
-	/*
-	 * Don't set Power button GPE as run_wake
-	 * if Fixed Power button is used
-	 */
-	if (!strcmp(device->pnp.hardware_id, "PNP0C0C") &&
-		!(acpi_gbl_FADT.flags & ACPI_FADT_POWER_BUTTON)) {
-		device->wakeup.flags.run_wake = 0;
-		device->wakeup.flags.valid = 0;
-	}
-
       end:
 	if (ACPI_FAILURE(status))
 		device->flags.wake_capable = 0;