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

2008-01-14 Thread Pavel Machek

> [EMAIL PROTECTED] ~]$ cat /proc/acpi/wakeup 
> Device  S-state   Status   Sysfs node   PCI ID
> SLPB  S4*enabled   
> P32   S4 disabled  pci::00:1e.0 0x244e
> UAR1  S4 disabled  pnp:00:090x

This should tell you how bad is placing PCI ID into generic file.

NAK.
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2008-01-14 Thread Pavel Machek

 [EMAIL PROTECTED] ~]$ cat /proc/acpi/wakeup 
 Device  S-state   Status   Sysfs node   PCI ID
 SLPB  S4*enabled   
 P32   S4 disabled  pci::00:1e.0 0x244e
 UAR1  S4 disabled  pnp:00:090x

This should tell you how bad is placing PCI ID into generic file.

NAK.
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2008-01-11 Thread Yi Yang
> > I think that it would be much much better to place wake-up attributes under
> > corresponding PCI and PNP devices.
> > Probably it is even better to link this code to PCI code, so PCI drivers 
> > will be aware of ACPI.
> I like this idea, maxim. :)
> And that's what we actually did about half a year ago.
> 
> Yi,
> Please refer to http://bugzilla.kernel.org/show_bug.cgi?id=6892
> and David's patch set here:
> http://marc.info/?l=linux-mm-commits=117701595209299=2
> http://marc.info/?l=linux-mm-commits=117701866524935=2
> You can have a look at this thread as well:
> http://marc.info/?l=linux-acpi=119982937409968=2
> 
I checked those patches you mentioned, they did bind two wakeup flag to
some extent, but they can't be exchanged to use and they are just partly
in current linus tree, two flags bind isn't in linus tree.

According to my test on the latest linus tree, wakeup flag of
acpi_device hasn't any association with device's, i don't know if they
are the same thing. if we enbale or disable it manually, what will
happen? From source code, it is just a flag, it doesn't trigger any
event or hardware operation.

> thanks,
> Rui
> > For example it will fix the 'EHCI instantly wakes up the system from S4' on 
> > my system, since here USB doesn't wake
> > up anything from S4, and ACPI tables correctly show that.
> > 
> > If ehci driver was aware of that it could disable #PME on entrance to S4.
> > And we even can reuse its 'wakeup' attribute, thus enabling wakeup 
> > automatically.
> > 
> > Going ever further, I think that it will be great to get rid of ACPI device 
> > tree, since
> > most acpi devices are ether PCI of PNP ones.
> > 
> > Or, even better have a small ACPI tree, that will contain 'true' ACPI 
> > devices, like cpus
> > thermal sensors, buttons, etc. 
> > 
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2008-01-11 Thread Zhang Rui
On Thu, 2008-01-10 at 09:43 +0200, Maxim Levitsky wrote:
> On Thursday, 10 January 2008 00:21:46 Yi Yang wrote:
> > Subject: ACPI: convert procfs to sysfs for /proc/acpi/wakeup
> > From: Yi Yang <[EMAIL PROTECTED]>
> > 
> > /proc/acpi/wakeup is deprecated but it has to exist because
> > we haven't a sysfs interface to replace it yet, this patch
> > converts /proc/acpi/wakeup to sysfs interface, under every
> > acpi device sysfs node, a user can see a directory "wakeup"
> > if the acpi device can support wakeup, there are six files
> > under this directory:
> > 
> > acpi_bus_id  bus_id  pci_id  run_wakeup  sleep_state  status
> > 
> > All the files are read-only exclude "status" which is used
> > to enable or disable wakeup of the acpi device.
> > 
> > "acpi_bus_id" is acpi bus ID of the acpi device.
> > 
> > "bus_id" is pci bus id of the device associated to the acpi
> > device, it will be empty if there isn't any device associated
> > to it.
> > 
> > "pci_id" is PCI ID of the pci device associated to the acpi
> > device, it will be empty if there isn't any device associated
> > to it.
> > 
> > "run_wake" is a flag indicating if a wakeup process is being
> > handled.
> > 
> > "sleep_state" is sleep state of the acpi device such as "S0".
> > 
> > "status" is wakeup status of the acpi device, it is enabled
> > or disabled, a user can change it be echoing "0", "1",
> > "disabled" or "enabled" to /sys/devices/.../wakeup/status. 
> > 
> > Here is the test result:
> > 
> > [EMAIL PROTECTED] ~]# cat /proc/acpi/wakeup
> > Device  S-state   Status   Sysfs node   PCI ID
> > C093  S5 disabled  pci::00:1e.0 0x2448
> > C0E8  S3 disabled  pci::00:1d.0 0x27c8
> > C0EF  S3 disabled  pci::00:1d.1 0x27c9
> > C0F0  S3 disabled  pci::00:1d.2 0x27ca
> > C0F1  S3 disabled  pci::00:1d.3 0x27cb
> > C0F2  S3 disabled  pci::00:1d.7 0x27cc
> > C0F9  S0 disabled  pci::00:1c.0 0x27d0
> > C21D  S0 disabled  pci::08:00.0 0x16fd
> > C109  S5 disabled  pci::00:1c.1 0x27d2
> > C228  S5 disabled  pci::10:00.0 0x4222
> > C10F  S5 disabled  pci::00:1c.3 0x27d6
> > C229  S5 disabled
> > [EMAIL PROTECTED] ~]# find /sys -name "*" | grep sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:05/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:0d/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:11/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:15/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:1d/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2b/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2b/device:2c/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2d/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2d/device:2e/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/sleep_state
> > [EMAIL PROTECTED] ~]# ls 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup
> > acpi_bus_id  bus_id  pci_id  run_wakeup  sleep_state  status
> > [EMAIL PROTECTED] ~]# cat 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/acpi_bus_id
> > cat: 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/acpi_bus_id:
> >  No such file or directory
> > [EMAIL PROTECTED] ~]# cat 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/acpi_bus_id
> > C229
> > [EMAIL PROTECTED] ~]# cat 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/sleep_state
> > S5
> > [EMAIL PROTECTED] ~]# cat 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
> > disabled
> > [EMAIL PROTECTED] ~]# cat 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/bus_id
> > 
> > [EMAIL PROTECTED] ~]# cat 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/pci_id
> > 
> > [EMAIL PROTECTED] ~]# echo 1 > 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
> > [EMAIL PROTECTED] ~]# cat 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
> > enabled
> > [EMAIL PROTECTED] ~]# cat /proc/acpi/wakeup
> > Device  S-state   Status   Sysfs node   PCI ID
> > C093  S5 disabled  pci::00:1e.0 0x2448
> > C0E8  S3 disabled  pci::00:1d.0 0x27c8
> > C0EF  S3 disabled  pci::00:1d.1 0x27c9
> > C0F0  S3 disabled  pci::00:1d.2 0x27ca
> > C0F1  S3 disabled  pci::00:1d.3 0x27cb

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

2008-01-11 Thread Zhang Rui
On Thu, 2008-01-10 at 09:43 +0200, Maxim Levitsky wrote:
 On Thursday, 10 January 2008 00:21:46 Yi Yang wrote:
  Subject: ACPI: convert procfs to sysfs for /proc/acpi/wakeup
  From: Yi Yang [EMAIL PROTECTED]
  
  /proc/acpi/wakeup is deprecated but it has to exist because
  we haven't a sysfs interface to replace it yet, this patch
  converts /proc/acpi/wakeup to sysfs interface, under every
  acpi device sysfs node, a user can see a directory wakeup
  if the acpi device can support wakeup, there are six files
  under this directory:
  
  acpi_bus_id  bus_id  pci_id  run_wakeup  sleep_state  status
  
  All the files are read-only exclude status which is used
  to enable or disable wakeup of the acpi device.
  
  acpi_bus_id is acpi bus ID of the acpi device.
  
  bus_id is pci bus id of the device associated to the acpi
  device, it will be empty if there isn't any device associated
  to it.
  
  pci_id is PCI ID of the pci device associated to the acpi
  device, it will be empty if there isn't any device associated
  to it.
  
  run_wake is a flag indicating if a wakeup process is being
  handled.
  
  sleep_state is sleep state of the acpi device such as S0.
  
  status is wakeup status of the acpi device, it is enabled
  or disabled, a user can change it be echoing 0, 1,
  disabled or enabled to /sys/devices/.../wakeup/status. 
  
  Here is the test result:
  
  [EMAIL PROTECTED] ~]# cat /proc/acpi/wakeup
  Device  S-state   Status   Sysfs node   PCI ID
  C093  S5 disabled  pci::00:1e.0 0x2448
  C0E8  S3 disabled  pci::00:1d.0 0x27c8
  C0EF  S3 disabled  pci::00:1d.1 0x27c9
  C0F0  S3 disabled  pci::00:1d.2 0x27ca
  C0F1  S3 disabled  pci::00:1d.3 0x27cb
  C0F2  S3 disabled  pci::00:1d.7 0x27cc
  C0F9  S0 disabled  pci::00:1c.0 0x27d0
  C21D  S0 disabled  pci::08:00.0 0x16fd
  C109  S5 disabled  pci::00:1c.1 0x27d2
  C228  S5 disabled  pci::10:00.0 0x4222
  C10F  S5 disabled  pci::00:1c.3 0x27d6
  C229  S5 disabled
  [EMAIL PROTECTED] ~]# find /sys -name * | grep sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:05/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:0d/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:11/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:15/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:1d/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2b/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2b/device:2c/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2d/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2d/device:2e/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/sleep_state
  [EMAIL PROTECTED] ~]# ls 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup
  acpi_bus_id  bus_id  pci_id  run_wakeup  sleep_state  status
  [EMAIL PROTECTED] ~]# cat 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/acpi_bus_id
  cat: 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/acpi_bus_id:
   No such file or directory
  [EMAIL PROTECTED] ~]# cat 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/acpi_bus_id
  C229
  [EMAIL PROTECTED] ~]# cat 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/sleep_state
  S5
  [EMAIL PROTECTED] ~]# cat 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
  disabled
  [EMAIL PROTECTED] ~]# cat 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/bus_id
  
  [EMAIL PROTECTED] ~]# cat 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/pci_id
  
  [EMAIL PROTECTED] ~]# echo 1  
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
  [EMAIL PROTECTED] ~]# cat 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
  enabled
  [EMAIL PROTECTED] ~]# cat /proc/acpi/wakeup
  Device  S-state   Status   Sysfs node   PCI ID
  C093  S5 disabled  pci::00:1e.0 0x2448
  C0E8  S3 disabled  pci::00:1d.0 0x27c8
  C0EF  S3 disabled  pci::00:1d.1 0x27c9
  C0F0  S3 disabled  pci::00:1d.2 0x27ca
  C0F1  S3 disabled  pci::00:1d.3 0x27cb
  C0F2  S3 disabled  pci::00:1d.7 0x27cc
  C0F9  S0 enabled   pci::00:1c.0 0x27d0
  C21D  S0 enabled   pci::08:00.0 0x16fd
  C109  S5 enabled   pci::00:1c.1 0x27d2

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

2008-01-11 Thread Yi Yang
  I think that it would be much much better to place wake-up attributes under
  corresponding PCI and PNP devices.
  Probably it is even better to link this code to PCI code, so PCI drivers 
  will be aware of ACPI.
 I like this idea, maxim. :)
 And that's what we actually did about half a year ago.
 
 Yi,
 Please refer to http://bugzilla.kernel.org/show_bug.cgi?id=6892
 and David's patch set here:
 http://marc.info/?l=linux-mm-commitsm=117701595209299w=2
 http://marc.info/?l=linux-mm-commitsm=117701866524935w=2
 You can have a look at this thread as well:
 http://marc.info/?l=linux-acpim=119982937409968w=2
 
I checked those patches you mentioned, they did bind two wakeup flag to
some extent, but they can't be exchanged to use and they are just partly
in current linus tree, two flags bind isn't in linus tree.

According to my test on the latest linus tree, wakeup flag of
acpi_device hasn't any association with device's, i don't know if they
are the same thing. if we enbale or disable it manually, what will
happen? From source code, it is just a flag, it doesn't trigger any
event or hardware operation.

 thanks,
 Rui
  For example it will fix the 'EHCI instantly wakes up the system from S4' on 
  my system, since here USB doesn't wake
  up anything from S4, and ACPI tables correctly show that.
  
  If ehci driver was aware of that it could disable #PME on entrance to S4.
  And we even can reuse its 'wakeup' attribute, thus enabling wakeup 
  automatically.
  
  Going ever further, I think that it will be great to get rid of ACPI device 
  tree, since
  most acpi devices are ether PCI of PNP ones.
  
  Or, even better have a small ACPI tree, that will contain 'true' ACPI 
  devices, like cpus
  thermal sensors, buttons, etc. 
  
 
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2008-01-10 Thread Matthew Garrett
On Thu, Jan 10, 2008 at 07:59:36AM +0800, Yi Yang wrote:

> Maybe this is a good idea, but i don't know the relationships between
> acpi devices, devices, pci devices and pnp devices. If we can merge all
> these things together, that will be a great job.

Let's not merge this yet, then, otherwise we'll be forced to carry 
around a sysfs API that's of no real use.

-- 
Matthew Garrett | [EMAIL PROTECTED]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2008-01-10 Thread Yi Yang
On Thu, 2008-01-10 at 09:43 +0200, Maxim Levitsky wrote:
> On Thursday, 10 January 2008 00:21:46 Yi Yang wrote:
> > Subject: ACPI: convert procfs to sysfs for /proc/acpi/wakeup
> > From: Yi Yang <[EMAIL PROTECTED]>
> > 
> > /proc/acpi/wakeup is deprecated but it has to exist because
> > we haven't a sysfs interface to replace it yet, this patch
> > converts /proc/acpi/wakeup to sysfs interface, under every
> > acpi device sysfs node, a user can see a directory "wakeup"
> > if the acpi device can support wakeup, there are six files
> > under this directory:
> > 
> > acpi_bus_id  bus_id  pci_id  run_wakeup  sleep_state  status
> > 
> > All the files are read-only exclude "status" which is used
> > to enable or disable wakeup of the acpi device.
> > 
> > "acpi_bus_id" is acpi bus ID of the acpi device.
> > 
> > "bus_id" is pci bus id of the device associated to the acpi
> > device, it will be empty if there isn't any device associated
> > to it.
> > 
> > "pci_id" is PCI ID of the pci device associated to the acpi
> > device, it will be empty if there isn't any device associated
> > to it.
> > 
> > "run_wake" is a flag indicating if a wakeup process is being
> > handled.
> > 
> > "sleep_state" is sleep state of the acpi device such as "S0".
> > 
> > "status" is wakeup status of the acpi device, it is enabled
> > or disabled, a user can change it be echoing "0", "1",
> > "disabled" or "enabled" to /sys/devices/.../wakeup/status. 
> > 
> > Here is the test result:
> > 
> > [EMAIL PROTECTED] ~]# cat /proc/acpi/wakeup
> > Device  S-state   Status   Sysfs node   PCI ID
> > C093  S5 disabled  pci::00:1e.0 0x2448
> > C0E8  S3 disabled  pci::00:1d.0 0x27c8
> > C0EF  S3 disabled  pci::00:1d.1 0x27c9
> > C0F0  S3 disabled  pci::00:1d.2 0x27ca
> > C0F1  S3 disabled  pci::00:1d.3 0x27cb
> > C0F2  S3 disabled  pci::00:1d.7 0x27cc
> > C0F9  S0 disabled  pci::00:1c.0 0x27d0
> > C21D  S0 disabled  pci::08:00.0 0x16fd
> > C109  S5 disabled  pci::00:1c.1 0x27d2
> > C228  S5 disabled  pci::10:00.0 0x4222
> > C10F  S5 disabled  pci::00:1c.3 0x27d6
> > C229  S5 disabled
> > [EMAIL PROTECTED] ~]# find /sys -name "*" | grep sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:05/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:0d/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:11/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:15/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:1d/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2b/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2b/device:2c/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2d/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2d/device:2e/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/wakeup/sleep_state
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/sleep_state
> > [EMAIL PROTECTED] ~]# ls 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup
> > acpi_bus_id  bus_id  pci_id  run_wakeup  sleep_state  status
> > [EMAIL PROTECTED] ~]# cat 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/acpi_bus_id
> > cat: 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/acpi_bus_id:
> >  No such file or directory
> > [EMAIL PROTECTED] ~]# cat 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/acpi_bus_id
> > C229
> > [EMAIL PROTECTED] ~]# cat 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/sleep_state
> > S5
> > [EMAIL PROTECTED] ~]# cat 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
> > disabled
> > [EMAIL PROTECTED] ~]# cat 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/bus_id
> > 
> > [EMAIL PROTECTED] ~]# cat 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/pci_id
> > 
> > [EMAIL PROTECTED] ~]# echo 1 > 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
> > [EMAIL PROTECTED] ~]# cat 
> > /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
> > enabled
> > [EMAIL PROTECTED] ~]# cat /proc/acpi/wakeup
> > Device  S-state   Status   Sysfs node   PCI ID
> > C093  S5 disabled  pci::00:1e.0 0x2448
> > C0E8  S3 disabled  pci::00:1d.0 0x27c8
> > C0EF  S3 disabled  pci::00:1d.1 0x27c9
> > C0F0  S3 disabled  pci::00:1d.2 0x27ca
> > C0F1  S3 disabled  pci::00:1d.3 0x27cb

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

2008-01-10 Thread Yi Yang
On Thu, 2008-01-10 at 09:43 +0200, Maxim Levitsky wrote:
 On Thursday, 10 January 2008 00:21:46 Yi Yang wrote:
  Subject: ACPI: convert procfs to sysfs for /proc/acpi/wakeup
  From: Yi Yang [EMAIL PROTECTED]
  
  /proc/acpi/wakeup is deprecated but it has to exist because
  we haven't a sysfs interface to replace it yet, this patch
  converts /proc/acpi/wakeup to sysfs interface, under every
  acpi device sysfs node, a user can see a directory wakeup
  if the acpi device can support wakeup, there are six files
  under this directory:
  
  acpi_bus_id  bus_id  pci_id  run_wakeup  sleep_state  status
  
  All the files are read-only exclude status which is used
  to enable or disable wakeup of the acpi device.
  
  acpi_bus_id is acpi bus ID of the acpi device.
  
  bus_id is pci bus id of the device associated to the acpi
  device, it will be empty if there isn't any device associated
  to it.
  
  pci_id is PCI ID of the pci device associated to the acpi
  device, it will be empty if there isn't any device associated
  to it.
  
  run_wake is a flag indicating if a wakeup process is being
  handled.
  
  sleep_state is sleep state of the acpi device such as S0.
  
  status is wakeup status of the acpi device, it is enabled
  or disabled, a user can change it be echoing 0, 1,
  disabled or enabled to /sys/devices/.../wakeup/status. 
  
  Here is the test result:
  
  [EMAIL PROTECTED] ~]# cat /proc/acpi/wakeup
  Device  S-state   Status   Sysfs node   PCI ID
  C093  S5 disabled  pci::00:1e.0 0x2448
  C0E8  S3 disabled  pci::00:1d.0 0x27c8
  C0EF  S3 disabled  pci::00:1d.1 0x27c9
  C0F0  S3 disabled  pci::00:1d.2 0x27ca
  C0F1  S3 disabled  pci::00:1d.3 0x27cb
  C0F2  S3 disabled  pci::00:1d.7 0x27cc
  C0F9  S0 disabled  pci::00:1c.0 0x27d0
  C21D  S0 disabled  pci::08:00.0 0x16fd
  C109  S5 disabled  pci::00:1c.1 0x27d2
  C228  S5 disabled  pci::10:00.0 0x4222
  C10F  S5 disabled  pci::00:1c.3 0x27d6
  C229  S5 disabled
  [EMAIL PROTECTED] ~]# find /sys -name * | grep sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:05/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:0d/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:11/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:15/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:1d/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2b/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2b/device:2c/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2d/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2d/device:2e/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/wakeup/sleep_state
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/sleep_state
  [EMAIL PROTECTED] ~]# ls 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup
  acpi_bus_id  bus_id  pci_id  run_wakeup  sleep_state  status
  [EMAIL PROTECTED] ~]# cat 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/acpi_bus_id
  cat: 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/acpi_bus_id:
   No such file or directory
  [EMAIL PROTECTED] ~]# cat 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/acpi_bus_id
  C229
  [EMAIL PROTECTED] ~]# cat 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/sleep_state
  S5
  [EMAIL PROTECTED] ~]# cat 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
  disabled
  [EMAIL PROTECTED] ~]# cat 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/bus_id
  
  [EMAIL PROTECTED] ~]# cat 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/pci_id
  
  [EMAIL PROTECTED] ~]# echo 1  
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
  [EMAIL PROTECTED] ~]# cat 
  /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
  enabled
  [EMAIL PROTECTED] ~]# cat /proc/acpi/wakeup
  Device  S-state   Status   Sysfs node   PCI ID
  C093  S5 disabled  pci::00:1e.0 0x2448
  C0E8  S3 disabled  pci::00:1d.0 0x27c8
  C0EF  S3 disabled  pci::00:1d.1 0x27c9
  C0F0  S3 disabled  pci::00:1d.2 0x27ca
  C0F1  S3 disabled  pci::00:1d.3 0x27cb
  C0F2  S3 disabled  pci::00:1d.7 0x27cc
  C0F9  S0 enabled   pci::00:1c.0 0x27d0
  C21D  S0 enabled   pci::08:00.0 0x16fd
  C109  S5 enabled   pci::00:1c.1 0x27d2

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

2008-01-10 Thread Matthew Garrett
On Thu, Jan 10, 2008 at 07:59:36AM +0800, Yi Yang wrote:

 Maybe this is a good idea, but i don't know the relationships between
 acpi devices, devices, pci devices and pnp devices. If we can merge all
 these things together, that will be a great job.

Let's not merge this yet, then, otherwise we'll be forced to carry 
around a sysfs API that's of no real use.

-- 
Matthew Garrett | [EMAIL PROTECTED]
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2008-01-09 Thread Maxim Levitsky
On Thursday, 10 January 2008 00:21:46 Yi Yang wrote:
> Subject: ACPI: convert procfs to sysfs for /proc/acpi/wakeup
> From: Yi Yang <[EMAIL PROTECTED]>
> 
> /proc/acpi/wakeup is deprecated but it has to exist because
> we haven't a sysfs interface to replace it yet, this patch
> converts /proc/acpi/wakeup to sysfs interface, under every
> acpi device sysfs node, a user can see a directory "wakeup"
> if the acpi device can support wakeup, there are six files
> under this directory:
> 
> acpi_bus_id  bus_id  pci_id  run_wakeup  sleep_state  status
> 
> All the files are read-only exclude "status" which is used
> to enable or disable wakeup of the acpi device.
> 
> "acpi_bus_id" is acpi bus ID of the acpi device.
> 
> "bus_id" is pci bus id of the device associated to the acpi
> device, it will be empty if there isn't any device associated
> to it.
> 
> "pci_id" is PCI ID of the pci device associated to the acpi
> device, it will be empty if there isn't any device associated
> to it.
> 
> "run_wake" is a flag indicating if a wakeup process is being
> handled.
> 
> "sleep_state" is sleep state of the acpi device such as "S0".
> 
> "status" is wakeup status of the acpi device, it is enabled
> or disabled, a user can change it be echoing "0", "1",
> "disabled" or "enabled" to /sys/devices/.../wakeup/status. 
> 
> Here is the test result:
> 
> [EMAIL PROTECTED] ~]# cat /proc/acpi/wakeup
> Device  S-state   Status   Sysfs node   PCI ID
> C093  S5 disabled  pci::00:1e.0 0x2448
> C0E8  S3 disabled  pci::00:1d.0 0x27c8
> C0EF  S3 disabled  pci::00:1d.1 0x27c9
> C0F0  S3 disabled  pci::00:1d.2 0x27ca
> C0F1  S3 disabled  pci::00:1d.3 0x27cb
> C0F2  S3 disabled  pci::00:1d.7 0x27cc
> C0F9  S0 disabled  pci::00:1c.0 0x27d0
> C21D  S0 disabled  pci::08:00.0 0x16fd
> C109  S5 disabled  pci::00:1c.1 0x27d2
> C228  S5 disabled  pci::10:00.0 0x4222
> C10F  S5 disabled  pci::00:1c.3 0x27d6
> C229  S5 disabled
> [EMAIL PROTECTED] ~]# find /sys -name "*" | grep sleep_state
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:05/wakeup/sleep_state
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:0d/wakeup/sleep_state
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:11/wakeup/sleep_state
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:15/wakeup/sleep_state
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/wakeup/sleep_state
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:1d/wakeup/sleep_state
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2b/wakeup/sleep_state
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2b/device:2c/wakeup/sleep_state
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2d/wakeup/sleep_state
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2d/device:2e/wakeup/sleep_state
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/wakeup/sleep_state
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/sleep_state
> [EMAIL PROTECTED] ~]# ls 
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup
> acpi_bus_id  bus_id  pci_id  run_wakeup  sleep_state  status
> [EMAIL PROTECTED] ~]# cat 
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/acpi_bus_id
> cat: 
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/acpi_bus_id:
>  No such file or directory
> [EMAIL PROTECTED] ~]# cat 
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/acpi_bus_id
> C229
> [EMAIL PROTECTED] ~]# cat 
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/sleep_state
> S5
> [EMAIL PROTECTED] ~]# cat 
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
> disabled
> [EMAIL PROTECTED] ~]# cat 
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/bus_id
> 
> [EMAIL PROTECTED] ~]# cat 
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/pci_id
> 
> [EMAIL PROTECTED] ~]# echo 1 > 
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
> [EMAIL PROTECTED] ~]# cat 
> /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
> enabled
> [EMAIL PROTECTED] ~]# cat /proc/acpi/wakeup
> Device  S-state   Status   Sysfs node   PCI ID
> C093  S5 disabled  pci::00:1e.0 0x2448
> C0E8  S3 disabled  pci::00:1d.0 0x27c8
> C0EF  S3 disabled  pci::00:1d.1 0x27c9
> C0F0  S3 disabled  pci::00:1d.2 0x27ca
> C0F1  S3 disabled  pci::00:1d.3 0x27cb
> C0F2  S3 disabled  pci::00:1d.7 0x27cc
> C0F9  S0 enabled   pci::00:1c.0 0x27d0
> C21D  S0 enabled   pci::08:00.0 0x16fd
> C109  S5 enabled   pci::00:1c.1 0x27d2
> C228  S5 enabled 

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

2008-01-09 Thread Maxim Levitsky
On Thursday, 10 January 2008 00:21:46 Yi Yang wrote:
 Subject: ACPI: convert procfs to sysfs for /proc/acpi/wakeup
 From: Yi Yang [EMAIL PROTECTED]
 
 /proc/acpi/wakeup is deprecated but it has to exist because
 we haven't a sysfs interface to replace it yet, this patch
 converts /proc/acpi/wakeup to sysfs interface, under every
 acpi device sysfs node, a user can see a directory wakeup
 if the acpi device can support wakeup, there are six files
 under this directory:
 
 acpi_bus_id  bus_id  pci_id  run_wakeup  sleep_state  status
 
 All the files are read-only exclude status which is used
 to enable or disable wakeup of the acpi device.
 
 acpi_bus_id is acpi bus ID of the acpi device.
 
 bus_id is pci bus id of the device associated to the acpi
 device, it will be empty if there isn't any device associated
 to it.
 
 pci_id is PCI ID of the pci device associated to the acpi
 device, it will be empty if there isn't any device associated
 to it.
 
 run_wake is a flag indicating if a wakeup process is being
 handled.
 
 sleep_state is sleep state of the acpi device such as S0.
 
 status is wakeup status of the acpi device, it is enabled
 or disabled, a user can change it be echoing 0, 1,
 disabled or enabled to /sys/devices/.../wakeup/status. 
 
 Here is the test result:
 
 [EMAIL PROTECTED] ~]# cat /proc/acpi/wakeup
 Device  S-state   Status   Sysfs node   PCI ID
 C093  S5 disabled  pci::00:1e.0 0x2448
 C0E8  S3 disabled  pci::00:1d.0 0x27c8
 C0EF  S3 disabled  pci::00:1d.1 0x27c9
 C0F0  S3 disabled  pci::00:1d.2 0x27ca
 C0F1  S3 disabled  pci::00:1d.3 0x27cb
 C0F2  S3 disabled  pci::00:1d.7 0x27cc
 C0F9  S0 disabled  pci::00:1c.0 0x27d0
 C21D  S0 disabled  pci::08:00.0 0x16fd
 C109  S5 disabled  pci::00:1c.1 0x27d2
 C228  S5 disabled  pci::10:00.0 0x4222
 C10F  S5 disabled  pci::00:1c.3 0x27d6
 C229  S5 disabled
 [EMAIL PROTECTED] ~]# find /sys -name * | grep sleep_state
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:05/wakeup/sleep_state
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:0d/wakeup/sleep_state
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:11/wakeup/sleep_state
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:15/wakeup/sleep_state
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:19/wakeup/sleep_state
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:1d/wakeup/sleep_state
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2b/wakeup/sleep_state
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2b/device:2c/wakeup/sleep_state
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2d/wakeup/sleep_state
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2d/device:2e/wakeup/sleep_state
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/wakeup/sleep_state
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/sleep_state
 [EMAIL PROTECTED] ~]# ls 
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup
 acpi_bus_id  bus_id  pci_id  run_wakeup  sleep_state  status
 [EMAIL PROTECTED] ~]# cat 
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/acpi_bus_id
 cat: 
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/acpi_bus_id:
  No such file or directory
 [EMAIL PROTECTED] ~]# cat 
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/acpi_bus_id
 C229
 [EMAIL PROTECTED] ~]# cat 
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/sleep_state
 S5
 [EMAIL PROTECTED] ~]# cat 
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
 disabled
 [EMAIL PROTECTED] ~]# cat 
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/bus_id
 
 [EMAIL PROTECTED] ~]# cat 
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/pci_id
 
 [EMAIL PROTECTED] ~]# echo 1  
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
 [EMAIL PROTECTED] ~]# cat 
 /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:2f/device:30/wakeup/status
 enabled
 [EMAIL PROTECTED] ~]# cat /proc/acpi/wakeup
 Device  S-state   Status   Sysfs node   PCI ID
 C093  S5 disabled  pci::00:1e.0 0x2448
 C0E8  S3 disabled  pci::00:1d.0 0x27c8
 C0EF  S3 disabled  pci::00:1d.1 0x27c9
 C0F0  S3 disabled  pci::00:1d.2 0x27ca
 C0F1  S3 disabled  pci::00:1d.3 0x27cb
 C0F2  S3 disabled  pci::00:1d.7 0x27cc
 C0F9  S0 enabled   pci::00:1c.0 0x27d0
 C21D  S0 enabled   pci::08:00.0 0x16fd
 C109  S5 enabled   pci::00:1c.1 0x27d2
 C228  S5 enabled   pci::10:00.0 0x4222
 C10F  S5 enabled   pci::00:1c.3 0x27d6
 C229  S5 enabled
 [EMAIL PROTECTED]