Subject: CVS commit: [jmcneill-pm] src/sys
To: None <source-changes@NetBSD.org>
From: Joerg Sonnenberger <joerg@netbsd.org>
List: source-changes
Date: 11/06/2007 14:27:37
Module Name:	src
Committed By:	joerg
Date:		Tue Nov  6 14:27:37 UTC 2007

Modified Files:
	src/sys/arch/amd64/amd64 [jmcneill-pm]: mainbus.c
	src/sys/arch/i386/acpi [jmcneill-pm]: sony_acpi.c
	src/sys/arch/i386/bios [jmcneill-pm]: vesafb.c
	src/sys/arch/i386/i386 [jmcneill-pm]: mainbus.c
	src/sys/arch/i386/isa [jmcneill-pm]: npx.c
	src/sys/arch/macppc/dev [jmcneill-pm]: if_wi_obio.c
	src/sys/arch/x86/pci [jmcneill-pm]: ichlpcib.c pchb.c pcib.c
	src/sys/arch/x86/x86 [jmcneill-pm]: cpu.c ioapic.c
	src/sys/dev [jmcneill-pm]: audio.c audiovar.h
	src/sys/dev/acpi [jmcneill-pm]: acpi.c acpi_acad.c acpi_bat.c
	    acpi_button.c acpi_ec.c acpi_lid.c acpi_tz.c pckbc_acpi.c
	    pcppi_acpi.c
	src/sys/dev/apm [jmcneill-pm]: apm.c
	src/sys/dev/ata [jmcneill-pm]: ata.c atavar.h wd.c wdvar.h
	src/sys/dev/cardbus [jmcneill-pm]: cardbus.c cardbusvar.h cardslot.c
	    if_ath_cardbus.c if_ral_cardbus.c if_re_cardbus.c if_rtk_cardbus.c
	src/sys/dev/dkwedge [jmcneill-pm]: dk.c
	src/sys/dev/ic [jmcneill-pm]: attimer.c hpet.c pckbc.c pckbcvar.h
	    rt2560.c rt2560var.h rt2661.c rt2661var.h spic.c
	src/sys/dev/isa [jmcneill-pm]: aps.c isa.c isavar.h
	src/sys/dev/isapnp [jmcneill-pm]: isapnp.c
	src/sys/dev/mii [jmcneill-pm]: brgphy.c
	src/sys/dev/pci [jmcneill-pm]: agp.c agp_i810.c agp_intel.c agpvar.h
	    ahcisata_pci.c auacer.c auich.c auixp.c autri.c auvia.c azalia.c
	    cs4280.c cs4281.c ehci_pci.c esa.c esm.c if_an_pci.c if_ath_pci.c
	    if_bge.c if_ipw.c if_iwi.c if_nfe.c if_re_pci.c if_rtk_pci.c
	    if_wi_pci.c if_wm.c if_wpi.c if_wpivar.h neo.c ohci_pci.c pccbb.c
	    pccbbvar.h pci.c pcivar.h piixide.c piixpm.c ppb.c uhci_pci.c
	    vga_pci.c yds.c
	src/sys/dev/pckbport [jmcneill-pm]: pckbd.c pms.c
	src/sys/dev/pcmcia [jmcneill-pm]: if_an_pcmcia.c if_ray.c
	    if_wi_pcmcia.c pcmcia.c pcmciavar.h
	src/sys/dev/scsipi [jmcneill-pm]: scsiconf.c sd.c
	src/sys/dev/sysmon [jmcneill-pm]: sysmon_power.c
	src/sys/dev/usb [jmcneill-pm]: ehci.c ehcivar.h ohci.c ohcivar.h uhci.c
	    uhcivar.h uhub.c umass.c usb.c
	src/sys/dev/wscons [jmcneill-pm]: wsdisplay.c wskbd.c wsmouse.c
	src/sys/kern [jmcneill-pm]: kern_pnp.c kern_subr.c subr_autoconf.c
	src/sys/sys [jmcneill-pm]: device.h pnp.h

Log Message:
Refactor PNP API:
- Make suspend/resume directly a device functionality. It consists of
  three layers (class logic, device logic, bus logic), all of them being
  optional. This replaces D0/D3 transitions.
- device_is_active returns true if the device was not disabled and was
  not suspended (even partially), device_is_enabled returns true if the
  device was enabled.
- Change pnp_global_transition into pnp_system_suspend and
  pnp_system_resume. Before running any suspend/resume handlers, check
  that all currently attached devices support power management and bail
  out otherwise. The latter is not done for the shutdown/panic case.
- Make the former bus-specific generic network handlers a class handler.
- Make PNP message like volume up/down/toogle PNP events. Each device
  can register what events they are interested in and whether the handler
  should be global or not.
- Introduce device_active API for devices to mark themselve in use from
  either the system or the device. Use this to implement the idle handling
  for audio and input devices. This is intended to replace most ad-hoc
  watchdogs as well.
- Fix somes situations in which audio resume would lose mixer settings.
- Make USB host controllers better deal with suspend in the light of
  shared interrupts.
- Flush filesystem cache on suspend.
- Flush disk caches on suspend. Put ATA disks into standby on suspend as
  well.
- Adopt drivers to use the new PNP API.
- Fix a critical bug in the generic cardbus layer that made D0->D3
  break.
- Fix ral(4) to set if_stop.
- Convert cbb(4) to the new PNP API.
- Apply the PCI Express SCI fix on resume again.


To generate a diff of this commit:
cvs rdiff -r1.17 -r1.17.8.1 src/sys/arch/amd64/amd64/mainbus.c
cvs rdiff -r1.5.26.5 -r1.5.26.6 src/sys/arch/i386/acpi/sony_acpi.c
cvs rdiff -r1.22.12.2 -r1.22.12.3 src/sys/arch/i386/bios/vesafb.c
cvs rdiff -r1.71.18.1 -r1.71.18.2 src/sys/arch/i386/i386/mainbus.c
cvs rdiff -r1.116.22.2 -r1.116.22.3 src/sys/arch/i386/isa/npx.c
cvs rdiff -r1.13.26.2 -r1.13.26.3 src/sys/arch/macppc/dev/if_wi_obio.c
cvs rdiff -r1.4.6.13 -r1.4.6.14 src/sys/arch/x86/pci/ichlpcib.c
cvs rdiff -r1.1.4.4 -r1.1.4.5 src/sys/arch/x86/pci/pchb.c
cvs rdiff -r1.1.4.2 -r1.1.4.3 src/sys/arch/x86/pci/pcib.c
cvs rdiff -r1.2.6.15 -r1.2.6.16 src/sys/arch/x86/x86/cpu.c
cvs rdiff -r1.19.8.11 -r1.19.8.12 src/sys/arch/x86/x86/ioapic.c
cvs rdiff -r1.222.6.7 -r1.222.6.8 src/sys/dev/audio.c
cvs rdiff -r1.39.16.2 -r1.39.16.3 src/sys/dev/audiovar.h
cvs rdiff -r1.101.16.22 -r1.101.16.23 src/sys/dev/acpi/acpi.c
cvs rdiff -r1.25.6.4 -r1.25.6.5 src/sys/dev/acpi/acpi_acad.c
cvs rdiff -r1.51.6.7 -r1.51.6.8 src/sys/dev/acpi/acpi_bat.c
cvs rdiff -r1.22.22.3 -r1.22.22.4 src/sys/dev/acpi/acpi_button.c
cvs rdiff -r1.41.6.11 -r1.41.6.12 src/sys/dev/acpi/acpi_ec.c
cvs rdiff -r1.21.22.2 -r1.21.22.3 src/sys/dev/acpi/acpi_lid.c
cvs rdiff -r1.23.6.5 -r1.23.6.6 src/sys/dev/acpi/acpi_tz.c
cvs rdiff -r1.20.6.5 -r1.20.6.6 src/sys/dev/acpi/pckbc_acpi.c
cvs rdiff -r1.5.22.3 -r1.5.22.4 src/sys/dev/acpi/pcppi_acpi.c
cvs rdiff -r1.12.6.2 -r1.12.6.3 src/sys/dev/apm/apm.c
cvs rdiff -r1.90.6.2 -r1.90.6.3 src/sys/dev/ata/ata.c
cvs rdiff -r1.74.6.1 -r1.74.6.2 src/sys/dev/ata/atavar.h
cvs rdiff -r1.343.4.4 -r1.343.4.5 src/sys/dev/ata/wd.c
cvs rdiff -r1.32.44.1 -r1.32.44.2 src/sys/dev/ata/wdvar.h
cvs rdiff -r1.75.16.4 -r1.75.16.5 src/sys/dev/cardbus/cardbus.c
cvs rdiff -r1.35.44.2 -r1.35.44.3 src/sys/dev/cardbus/cardbusvar.h
cvs rdiff -r1.35.6.1 -r1.35.6.2 src/sys/dev/cardbus/cardslot.c
cvs rdiff -r1.18.22.4 -r1.18.22.5 src/sys/dev/cardbus/if_ath_cardbus.c
cvs rdiff -r1.8.22.1 -r1.8.22.2 src/sys/dev/cardbus/if_ral_cardbus.c
cvs rdiff -r1.13.8.3 -r1.13.8.4 src/sys/dev/cardbus/if_re_cardbus.c
cvs rdiff -r1.32.8.2 -r1.32.8.3 src/sys/dev/cardbus/if_rtk_cardbus.c
cvs rdiff -r1.28.4.1 -r1.28.4.2 src/sys/dev/dkwedge/dk.c
cvs rdiff -r1.2.44.3 -r1.2.44.4 src/sys/dev/ic/attimer.c
cvs rdiff -r1.1.16.3 -r1.1.16.4 src/sys/dev/ic/hpet.c
cvs rdiff -r1.37.6.2 -r1.37.6.3 src/sys/dev/ic/pckbc.c
cvs rdiff -r1.12.44.1 -r1.12.44.2 src/sys/dev/ic/pckbcvar.h
cvs rdiff -r1.9.6.2 -r1.9.6.3 src/sys/dev/ic/rt2560.c
cvs rdiff -r1.5 -r1.5.14.1 src/sys/dev/ic/rt2560var.h
cvs rdiff -r1.15.6.3 -r1.15.6.4 src/sys/dev/ic/rt2661.c
cvs rdiff -r1.6 -r1.6.14.1 src/sys/dev/ic/rt2661var.h
cvs rdiff -r1.8.6.2 -r1.8.6.3 src/sys/dev/ic/spic.c
cvs rdiff -r1.1.4.4 -r1.1.4.5 src/sys/dev/isa/aps.c
cvs rdiff -r1.128.18.3 -r1.128.18.4 src/sys/dev/isa/isa.c
cvs rdiff -r1.48.44.2 -r1.48.44.3 src/sys/dev/isa/isavar.h
cvs rdiff -r1.52.22.2 -r1.52.22.3 src/sys/dev/isapnp/isapnp.c
cvs rdiff -r1.33.10.1 -r1.33.10.2 src/sys/dev/mii/brgphy.c
cvs rdiff -r1.46.14.8 -r1.46.14.9 src/sys/dev/pci/agp.c
cvs rdiff -r1.41.6.9 -r1.41.6.10 src/sys/dev/pci/agp_i810.c
cvs rdiff -r1.22.8.3 -r1.22.8.4 src/sys/dev/pci/agp_intel.c \
    src/sys/dev/pci/if_an_pci.c
cvs rdiff -r1.14.14.3 -r1.14.14.4 src/sys/dev/pci/agpvar.h
cvs rdiff -r1.1.12.2 -r1.1.12.3 src/sys/dev/pci/ahcisata_pci.c
cvs rdiff -r1.16.14.2 -r1.16.14.3 src/sys/dev/pci/auacer.c
cvs rdiff -r1.117.14.4 -r1.117.14.5 src/sys/dev/pci/auich.c
cvs rdiff -r1.23.6.3 -r1.23.6.4 src/sys/dev/pci/auixp.c
cvs rdiff -r1.34.22.2 -r1.34.22.3 src/sys/dev/pci/autri.c
cvs rdiff -r1.60.14.1 -r1.60.14.2 src/sys/dev/pci/auvia.c
cvs rdiff -r1.50.6.3 -r1.50.6.4 src/sys/dev/pci/azalia.c
cvs rdiff -r1.46.6.2 -r1.46.6.3 src/sys/dev/pci/cs4280.c
cvs rdiff -r1.34.6.2 -r1.34.6.3 src/sys/dev/pci/cs4281.c
cvs rdiff -r1.29.2.5 -r1.29.2.6 src/sys/dev/pci/ehci_pci.c
cvs rdiff -r1.41.14.2 -r1.41.14.3 src/sys/dev/pci/esa.c
cvs rdiff -r1.42.14.2 -r1.42.14.3 src/sys/dev/pci/esm.c
cvs rdiff -r1.21.6.2 -r1.21.6.3 src/sys/dev/pci/if_ath_pci.c
cvs rdiff -r1.132.6.7 -r1.132.6.8 src/sys/dev/pci/if_bge.c
cvs rdiff -r1.32.14.3 -r1.32.14.4 src/sys/dev/pci/if_ipw.c
cvs rdiff -r1.62.14.5 -r1.62.14.6 src/sys/dev/pci/if_iwi.c
cvs rdiff -r1.16.6.4 -r1.16.6.5 src/sys/dev/pci/if_nfe.c
cvs rdiff -r1.28.4.3 -r1.28.4.4 src/sys/dev/pci/if_re_pci.c
cvs rdiff -r1.32.8.3 -r1.32.8.4 src/sys/dev/pci/if_rtk_pci.c \
    src/sys/dev/pci/vga_pci.c
cvs rdiff -r1.41.22.3 -r1.41.22.4 src/sys/dev/pci/if_wi_pci.c
cvs rdiff -r1.142.6.9 -r1.142.6.10 src/sys/dev/pci/if_wm.c
cvs rdiff -r1.17.4.8 -r1.17.4.9 src/sys/dev/pci/if_wpi.c
cvs rdiff -r1.6.6.5 -r1.6.6.6 src/sys/dev/pci/if_wpivar.h
cvs rdiff -r1.35.22.2 -r1.35.22.3 src/sys/dev/pci/neo.c
cvs rdiff -r1.31.24.3 -r1.31.24.4 src/sys/dev/pci/ohci_pci.c
cvs rdiff -r1.145.6.3 -r1.145.6.4 src/sys/dev/pci/pccbb.c
cvs rdiff -r1.28.18.1 -r1.28.18.2 src/sys/dev/pci/pccbbvar.h
cvs rdiff -r1.103.22.7 -r1.103.22.8 src/sys/dev/pci/pci.c
cvs rdiff -r1.74.14.4 -r1.74.14.5 src/sys/dev/pci/pcivar.h
cvs rdiff -r1.37.14.4 -r1.37.14.5 src/sys/dev/pci/piixide.c
cvs rdiff -r1.13.14.4 -r1.13.14.5 src/sys/dev/pci/piixpm.c
cvs rdiff -r1.34.22.8 -r1.34.22.9 src/sys/dev/pci/ppb.c
cvs rdiff -r1.36.2.3 -r1.36.2.4 src/sys/dev/pci/uhci_pci.c
cvs rdiff -r1.37.22.2 -r1.37.22.3 src/sys/dev/pci/yds.c
cvs rdiff -r1.15.14.2 -r1.15.14.3 src/sys/dev/pckbport/pckbd.c
cvs rdiff -r1.19.4.3 -r1.19.4.4 src/sys/dev/pckbport/pms.c
cvs rdiff -r1.31.22.2 -r1.31.22.3 src/sys/dev/pcmcia/if_an_pcmcia.c
cvs rdiff -r1.65.6.3 -r1.65.6.4 src/sys/dev/pcmcia/if_ray.c
cvs rdiff -r1.75.18.2 -r1.75.18.3 src/sys/dev/pcmcia/if_wi_pcmcia.c
cvs rdiff -r1.82.22.1 -r1.82.22.2 src/sys/dev/pcmcia/pcmcia.c
cvs rdiff -r1.32.38.1 -r1.32.38.2 src/sys/dev/pcmcia/pcmciavar.h
cvs rdiff -r1.243 -r1.243.14.1 src/sys/dev/scsipi/scsiconf.c
cvs rdiff -r1.265.2.2 -r1.265.2.3 src/sys/dev/scsipi/sd.c
cvs rdiff -r1.20.6.6 -r1.20.6.7 src/sys/dev/sysmon/sysmon_power.c
cvs rdiff -r1.123.18.5 -r1.123.18.6 src/sys/dev/usb/ehci.c
cvs rdiff -r1.24.20.2 -r1.24.20.3 src/sys/dev/usb/ehcivar.h
cvs rdiff -r1.182.18.4 -r1.182.18.5 src/sys/dev/usb/ohci.c
cvs rdiff -r1.39.46.2 -r1.39.46.3 src/sys/dev/usb/ohcivar.h
cvs rdiff -r1.209.2.4 -r1.209.2.5 src/sys/dev/usb/uhci.c
cvs rdiff -r1.40.46.2 -r1.40.46.3 src/sys/dev/usb/uhcivar.h
cvs rdiff -r1.89.8.4 -r1.89.8.5 src/sys/dev/usb/uhub.c
cvs rdiff -r1.124 -r1.124.10.1 src/sys/dev/usb/umass.c
cvs rdiff -r1.98.6.3 -r1.98.6.4 src/sys/dev/usb/usb.c
cvs rdiff -r1.108.14.2 -r1.108.14.3 src/sys/dev/wscons/wsdisplay.c
cvs rdiff -r1.104.6.4 -r1.104.6.5 src/sys/dev/wscons/wskbd.c
cvs rdiff -r1.52.6.2 -r1.52.6.3 src/sys/dev/wscons/wsmouse.c
cvs rdiff -r1.1.2.12 -r1.1.2.13 src/sys/kern/kern_pnp.c
cvs rdiff -r1.163.2.5 -r1.163.2.6 src/sys/kern/kern_subr.c
cvs rdiff -r1.119.4.3 -r1.119.4.4 src/sys/kern/subr_autoconf.c
cvs rdiff -r1.96.6.4 -r1.96.6.5 src/sys/sys/device.h
cvs rdiff -r1.1.2.5 -r1.1.2.6 src/sys/sys/pnp.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.