On Fri, 19 Aug 2022, Emmanuel Dreyfus wrote:

Hello

When a devices fails initialization, the xxx_attach() function may exit
early, before calling pmf_device_register().

The consequence is that any attempt to put the system to sleep fail with
a "Devices without power management support: ..." message.

Weird things happens, and I experienced situation where some devices
randomly or always fail initialization. This breaks sleeping mode.

I have patches to move the pmf_device_register() earlier in xxx_attach()
to workaround the problem in iwm(4) and ihidev(4) where I encounter the
problem, but perhaps the problem could be worked around globaly, by not
failing sleep mode if a driver did not call pmf_device_register()?

Don't forget to deregister the device if the xxx_attach() later exits...

Of course the lack of a registered suspend handler may miss the expectation
of a system sleeping with reduced power, but on the other hand, being
unable to sleep at all means even less power reduction.

--
Emmanuel Dreyfus
m...@netbsd.org

!DSPAM:62fee614256621427699200!



+--------------------+--------------------------+----------------------+
| Paul Goyette       | PGP Key fingerprint:     | E-mail addresses:    |
| (Retired)          | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com    |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org  |
| & Network Engineer |                          | pgoyett...@gmail.com |
+--------------------+--------------------------+----------------------+

Reply via email to