Subject: Re: Device power management patch
To: None <tech-kern@NetBSD.org>
From: Pavel Cahyna <pavel@NetBSD.org>
List: tech-kern
Date: 07/18/2007 10:50:44
On Tue, Jul 17, 2007 at 07:29:56PM -0400, Jared D. McNeill wrote:
> Heyas folks --
> 
> First cut of my new device power management code is ready for review. Feedback 
> would be great.
> 
>   http://www.invisible.ca/~jmcneill/netbsd/jmcneill-devpm-22.patch

Excellent!

Looking at your piixide_power(), it seems that the only piixide-specific
thing are those several lines:

+			sc->sc_idetim = pci_conf_read(sc->sc_pc, sc->sc_tag,
+			    PIIX_IDETIM);
+			sc->sc_udmatim = pci_conf_read(sc->sc_pc, sc->sc_tag,
+			    PIIX_UDMATIM);

 		pci_conf_write(sc->sc_pc, sc->sc_tag, PIIX_IDETIM,
 		    sc->sc_idetim);
 		pci_conf_write(sc->sc_pc, sc->sc_tag, PIIX_UDMATIM,
 		    sc->sc_udmatim);

and in agp_i810_power() the only device-specific thing is agp_flush_cache();
(maybe it is even common to all AGP drivers).

Isn't it feasible to make a common PCI power handler and have only those
several lines specific to each device in their power handlers?

Also, is it correct that vesafb_power does no saving/restoring of
registers in the underlying (typically PCI) device?

Pavel