From: David Brownell <david-b@pacbell.net>
To: linux-pm@lists.linux-foundation.org, linux-acpi@vger.kernel.org
Subject: [patch 2.6.21-rc5-git 0/3] x86_pc and ACPI support /sys/devices/.../wakeup
Date: Thu, 5 Apr 2007 12:48:40 -0700 [thread overview]
Message-ID: <200704051248.40745.david-b@pacbell.net> (raw)
Following are three patches for basic driver model wakeup flag support on
PCs. I think the first two are nearly mergable. The third previously broke
powerpc, so it's likely not yet mergeable ... the issue was arch-specific
differences in PCI initialization, someone else will need to solve them.
The patches are:
- Define a platform_enable_wakeup() PM hook and use it with PCI. (This
might help OLPC with its non-RTC events...)
- Make ACPI init and use driver model wakeup flags for the (motherboard)
devices in its table ... and implement that new platform hook. Now
/proc/acpi/wakeup is almost purely informative.
- Update PCI to set those flags on devices that can issue PME#/WAKE#;
this gets overridden by ACPI, except for add-on cards.
Now, I've not yet made time to test whether the results _work_ but they
do look like they do the right thing. (So far I've had lousy luck seeing
ACPI recover from wake events...) The script I append (which I've posted
before) gave the following on one system:
input on acpi_system:00/device:00/PNP0C0E:00
on pci0000:00/0000:00:09.0
lan on pci0000:00/0000:00:04.0
hub on pci0000:00/0000:00:03.3/usb1
usb_host on pci0000:00/0000:00:03.3
hub on pci0000:00/0000:00:03.1/usb3
usb_host on pci0000:00/0000:00:03.1
input on pci0000:00/0000:00:03.0/usb2/2-1/2-1.1
hub on pci0000:00/0000:00:03.0/usb2/2-1
hub on pci0000:00/0000:00:03.0/usb2
usb_host on pci0000:00/0000:00:03.0
modem on pci0000:00/0000:00:02.7
on pci0000:00
tty on pnp0/00:08
on pnp0/00:06
on pnp0/00:05
rtc on pnp0/00:02
Notice the external USB hub and keyboard. The i8042 drivers don't
seem to list themselvs as input drivers in the usual way, or those
PS2 kbd/aux nodes would also say "input". PCI 00:09.0 is an add-in
card, invisible without the third patch; it'd be a USB host if it
had a Linux driver.
- Dave
#!/bin/bash
# pm-wake
# classfilename *:* ==> $type
class_label ()
{
case $1 in
# recognize common types of wakeup-capable devices
i2c-dev:*) type="smbus "; return 0;;
input:*) type="input "; return 0;;
mmc_host:*) type="mmc_host "; return 0;;
net:eth*) type="lan "; return 0;;
net:*) type="net "; return 0;;
pcmcia_socket:*)type="pcmcia "; return 0;;
rtc:*) type="rtc "; return 0;;
sound:*) type="modem "; return 0;;
tty:*) type="tty "; return 0;;
usb_host:*) type="usb_host "; return 0;;
esac
return 1
}
# interface_label $PATH ==> $type
interface_label ()
{
for F in $(cd $1 >/dev/null 2>&1 ; echo *:*)
do
class_label $F && return
done
}
# devtype $PATH ==> $type
devtype ()
{
local F T
# fixed length, currently ten spaces
type=""
for F in $(cd $1 >/dev/null 2>&1 ; echo *:*)
do
if [ ! -d "$1/$F" ]
then
break;
fi
# is this a usb interface?
if [ -f $1/$F/bInterfaceClass ]
then
interface_label $1/$F && return
fi
case $F in
# use interface's label if possible, else generic
usb_device:*)
read T < $1/maxchild
if [ 0 -lt $T ]
then
type="hub "
return
fi
type="(usb) "
continue;;
*:*) class_label $F && return ;;
esac
done
if [ "$type" = "" ]
then
for T in $(cd $1 >/dev/null 2>&1 ; echo fw-host*/ieee1394_host:*)
do
if [ ! -L "$1/$T" ]
then
break;
fi
type="firewire "
return
done
fi
if [ "$type" = "" ]
then
type=" "
fi
}
cd /sys/devices
for F in $(find * -name 'wakeup')
do
# F=.../power/wakeup
read value < $F
if [ "$value" = "" ]
then
continue
fi
# F=...
F=$(dirname $(dirname $F))
devtype $F
# for each entry that actually supports wakeup, one line with:
# - device type (if recognized)
# - wake on/OFF
# - /sys/devices/... path
case "$value" in
"disabled") echo "$type OFF $F" ;;
"enabled") echo "$type on $F" ;;
esac
done
next reply other threads:[~2007-04-05 20:07 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-05 19:48 David Brownell [this message]
2007-04-05 23:20 ` [patch 2.6.21-rc5-git 0/3] x86_pc and ACPI support /sys/devices/.../wakeup David Brownell
2007-04-05 23:30 ` Matthew Garrett
2007-04-05 23:48 ` David Brownell
2007-04-05 23:54 ` Matthew Garrett
2007-04-06 0:05 ` Rafael J. Wysocki
2007-04-05 23:48 ` David Brownell
2007-04-05 23:20 ` David Brownell
2007-04-08 16:56 ` Jordan Crouse
2007-04-08 16:56 ` Jordan Crouse
2007-04-17 20:15 ` [patch 2.6.21-rc5-git 0/3] " David Brownell
2007-04-17 20:15 ` David Brownell
2007-04-18 9:51 ` Zhang Rui
2007-04-18 9:51 ` Zhang Rui
2007-04-18 16:33 ` David Brownell
2007-04-19 9:48 ` Zhang Rui
2007-04-19 19:24 ` David Brownell
2007-04-19 19:24 ` David Brownell
2007-04-19 9:48 ` Zhang Rui
2007-04-18 16:33 ` David Brownell
-- strict thread matches above, loose matches on Subject: below --
2007-04-05 19:48 David Brownell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200704051248.40745.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.