Writing Device Drivers

Hardware State

Devices that export a reg property are considered to have hardware state that must be saved prior to shutting down the system. If a device does not have a reg property, then it is considered to be stateless. However, this consideration can be overridden by the device driver.

A device that has hardware state but no reg property (such as a SCSI target driver, which has hardware at the other end of the SCSI bus), is called to save and restore its state if it exports a pm-hardware-state property with the value needs-suspend-resume. Otherwise, the lack of a reg property is taken to mean that the device has no hardware state. For information on device properties, see "Device Attribute Representations".

A device that has a reg property but no hardware state may export a pm-hardware-state property with the value no-suspend-resume to keep the framework from calling into the driver to save and restore that state. For more information on Power Management properties, see the pm_props(9E) man page.