Re: [PATCH] ACPI: Add sysfs interface for acpi device wakeup

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Thomas Renninger
Date: Wednesday, March 19, 2008 - 6:06 am

On Fri, 2008-01-11 at 07:55 +0800, Yi Yang wrote:

Any news on this?
I ran into a problem with the current implementation:

If one GPE is tight to several devices you get a message:
echo XYZ >/tmp/acpi/wakeup
ACPI: 'XXX' and 'XYZ' have the same GPE, can't disable/enable one
seperately
ACPI: 'YYY' and 'XYZ' have the same GPE, can't disable/enable one
seperately
and none of the devices are activated to be able to wake the machine up.
Which I expect is wrong, all should be enabled/disabled then IMO, but
it's probably not worth much fixing in /proc/acpi/...

The correct interface to use seem to be:
drivers/base/power/sysfs.c
But this is rather broken?
Here an output of /proc/acpi/wakeup and /sys/...:
for x in `find /sys/ |grep wakeup`;do if [ $(cat $x) ];then echo $x; cat $x;fi;done
/sys/devices/pnp0/00:04/power/wakeup
enabled
/sys/devices/pci0000:00/0000:00:1d.7/usb4/4-5/power/wakeup
enabled
/sys/devices/pci0000:00/0000:00:1d.7/usb4/4-1/power/wakeup
enabled
/sys/devices/pci0000:00/0000:00:1d.7/usb4/power/wakeup
enabled
/sys/devices/pci0000:00/0000:00:1d.7/power/wakeup
enabled
/sys/devices/pci0000:00/0000:00:1d.2/usb3/power/wakeup
enabled
/sys/devices/pci0000:00/0000:00:1d.1/usb2/power/wakeup
enabled
/sys/devices/pci0000:00/0000:00:1d.0/usb1/power/wakeup
enabled
trenn@stravinsky:/extern/trenn/packages/home:trenn> cat /proc/acpi/wakeup 
Device  S-state   Status   Sysfs node
PCI0      S5     disabled  no-bus:pci0000:00

I still think (from comments in drivers/base/power/sysfs.c, not sure
whether it really is that appropriate) it is wakeup sysfs file that
should be used for this.
I wonder why each device has a wakeup file, it should be enough to
create them dynamically if wakeup enable/disable is supported for a
specific device?
Also a second file is missing from which state (S3,S4,S5) the device can
wake the machine up.

If there can be multiple devices for one GPE, this information (the
power directory of multiple devices) could be linked together in sysfs?
E.g.
/sys/devices/pci0000:00/0000:00:1d.7/usb4/power/wakeup
is a link to:
/sys/devices/pci0000:00/0000:00:1d.2/usb3/power/wakeup
If both are using one wake-up GPE.

Also if the ACPI device caught through acpi_get_physical device is a PCI
bridge, it should get evaluated what is behind the bridge and this
device (e.g. a network card) should get the wakeup stuff set up, not the
bridge?

Does someone still look at this?
If not, shall I or is it on some queue?
Should this be discussed a bit more detailed first?

   Thomas

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH linux-acpi] Fix /proc/acpi/alarm set error, Yi Yang, (Wed Dec 26, 11:47 pm)
[PATCH] ACPI: fix processor throttling set error, Yi Yang, (Sun Jan 6, 11:56 pm)
[PATCH] ACPI: fix processor limit set error, Yi Yang, (Mon Jan 7, 8:21 pm)
Re: [PATCH] ACPI: Add sysfs interface for acpi device wakeup, Maxim Levitsky, (Thu Jan 10, 12:43 am)
Re: [PATCH] ACPI: Add sysfs interface for acpi device wakeup, Matthew Garrett, (Thu Jan 10, 3:30 am)
Re: [PATCH] ACPI: Add sysfs interface for acpi device wakeup, Thomas Renninger, (Wed Mar 19, 6:06 am)
Re: [PATCH] ACPI: Add sysfs interface for acpi device wakeup, David Brownell, (Wed Mar 19, 11:52 am)
Re: [PATCH] ACPI: Add sysfs interface for acpi device wakeup, David Brownell, (Wed Mar 19, 11:12 pm)