Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: src
Module Name: src
Committed By: dyoung
Date: Wed Sep 16 16:34:56 UTC 2009
Modified Files:
src/distrib/sets/lists/comp: mi
src/sys/dev: audio.c
src/sys/dev/acpi: acpi.c
src/sys/dev/apm: apm.c
src/sys/dev/cardbus: if_ath_cardbus.c if_atw_cardbus.c if_rtw_cardbus.c
src/sys/dev/ic: ath.c athvar.h atw.c atwvar.h rtw.c rtwvar.h
src/sys/dev/pci: if_ath_pci.c if_atw_pci.c if_rtw_pci.c if_sip.c
src/sys/kern: kern_drvctl.c kern_pmf.c subr_autoconf.c
src/sys/sys: Makefile device.h pmf.h
Added Files:
src/sys/sys: device_if.h
Log Message:
In pmf(9), improve the implementation of device self-suspension
and make suspension by self, by drvctl(8), and by ACPI system sleep
play nice together. Start solidifying some temporary API changes.
1. Extract a new header file, <sys/device_if.h>, from <sys/device.h> and
#include it from <sys/pmf.h> instead of <sys/device.h> to break the
circular dependency between <sys/device.h> and <sys/pmf.h>.
2. Introduce pmf_qual_t, an aggregate of qualifications on a PMF
suspend/resume call. Start to replace instances of PMF_FN_PROTO,
PMF_FN_ARGS, et cetera, with a pmf_qual_t.
3. Introduce the notion of a "suspensor," an entity that holds a
device in suspension. More than one suspensor may hold a device
at once. A device stays suspended as long as at least one
suspensor holds it. A device resumes when the last suspensor
releases it.
Currently, the kernel defines three suspensors,
3a the system-suspensor: for system suspension, initiated
by 'sysctl -w machdep.sleep_state=3', by lid closure, by
power-button press, et cetera,
3b the drvctl-suspensor: for device suspension by /dev/drvctl
ioctl, e.g., drvctl -S sip0.
3c the system self-suspensor: for device drivers that suspend
themselves and their children. Several drivers for network
interfaces put the network device to sleep while it is not
administratively up, that is, after the kernel calls if_stop(,
1). The self-suspensor should not be used directly. See
the description of suspensor delegates, below.
A suspensor can have one or more "delegates". A suspensor can
release devices that its delegates hold suspended. Right now,
only the system self-suspensor has delegates. For each device
that a self-suspending driver attaches, it creates the device's
self-suspensor, a delegate of the system self-suspensor.
Suspensors stop a system-wide suspend/resume cycle from waking
devices that the operator put to sleep with drvctl before the cycle.
They also help self-suspension to work more simply, safely, and in
accord with expectations.
4. Add the notion of device activation level, devact_level_t,
and a routine for checking the current activation level,
device_activation(). Current activation levels are DEVACT_LEVEL_BUS,
DEVACT_LEVEL_DRIVER, and DEVACT_LEVEL_CLASS, which respectively
indicate that the device's bus is active, that the bus and device are
active, and that the bus, device, and the functions of the device's
class (network, audio) are active.
Suspend/resume calls can be qualified with a devact_level_t.
The power-management framework treats a devact_level_t that
qualifies a device suspension as the device's current activation
level; it only runs hooks to reduce the activation level from
the presumed current level to the fully suspended state. The
framework treats a devact_level_t qualifying device resumption
as the target activation level; it only runs hooks to raise the
activation level to the target.
5. Use pmf_qual_t, devact_level_t, and self-suspensors in several
drivers.
6. Temporarily add an unused power-management workqueue that I will
remove or replace, soon.
To generate a diff of this commit:
cvs rdiff -u -r1.1308 -r1.1309 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.244 -r1.245 src/sys/dev/audio.c
cvs rdiff -u -r1.132 -r1.133 src/sys/dev/acpi/acpi.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/apm/apm.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/cardbus/if_ath_cardbus.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/cardbus/if_atw_cardbus.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/cardbus/if_rtw_cardbus.c
cvs rdiff -u -r1.106 -r1.107 src/sys/dev/ic/ath.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/ic/athvar.h
cvs rdiff -u -r1.145 -r1.146 src/sys/dev/ic/atw.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/ic/atwvar.h
cvs rdiff -u -r1.108 -r1.109 src/sys/dev/ic/rtw.c
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/ic/rtwvar.h
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/if_ath_pci.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/if_atw_pci.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/if_rtw_pci.c
cvs rdiff -u -r1.141 -r1.142 src/sys/dev/pci/if_sip.c
cvs rdiff -u -r1.28 -r1.29 src/sys/kern/kern_drvctl.c src/sys/kern/kern_pmf.c
cvs rdiff -u -r1.182 -r1.183 src/sys/kern/subr_autoconf.c
cvs rdiff -u -r1.122 -r1.123 src/sys/sys/Makefile
cvs rdiff -u -r1.121 -r1.122 src/sys/sys/device.h
cvs rdiff -u -r0 -r1.1 src/sys/sys/device_if.h
cvs rdiff -u -r1.15 -r1.16 src/sys/sys/pmf.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Home |
Main Index |
Thread Index |
Old Index