Re: Devices without power management support: dm0 dm1 (LVM / Device Mapper prevents ACPI Sleep State 3)
On Wed, Jan 15, 2020 at 11:42:09AM +0100, Matthias Petermann wrote: > Hello Maya, > > On 15.01.20 07:55, m...@netbsd.org wrote: > > > > > > Since I don't see any of this in the log, I'm not sure at all whether the > > > code is actually executed. Is it generally the case that all device > > > drivers > > > are "detached" before entering ACPI Sleep state 3? Or could this be a > > > special case? > > > > You will need to rebuild the modules, not the kernel. > > > > build.sh modules > > sudo build.sh ... installmodules=/ > > > > Is how I usually do it. > > > > I hadn't thought of that - thanks for the tip. It works now! > > The X230 correctly enters ACPI sleep state 3 with the change you have > proposed and wakes up without any functional restrictions. > > How likely is it that the device mapper was only accidentally not taken into > account in power management, or whether it should deliberately block the > sleep state for technical reasons? > > If nothing speaks against it, how do we get the patch in syssrc? Should I > submit a bug report? > > Best wishes > Matthias > Committed and pulled up to netbsd-9. http://mail-index.netbsd.org/source-changes/2020/01/16/msg112900.html http://mail-index.netbsd.org/source-changes/2020/01/21/msg113133.html Thanks for testing.
Re: Devices without power management support: dm0 dm1 (LVM / Device Mapper prevents ACPI Sleep State 3)
Hello Maya, On 15.01.20 07:55, m...@netbsd.org wrote: Since I don't see any of this in the log, I'm not sure at all whether the code is actually executed. Is it generally the case that all device drivers are "detached" before entering ACPI Sleep state 3? Or could this be a special case? You will need to rebuild the modules, not the kernel. build.sh modules sudo build.sh ... installmodules=/ Is how I usually do it. I hadn't thought of that - thanks for the tip. It works now! The X230 correctly enters ACPI sleep state 3 with the change you have proposed and wakes up without any functional restrictions. How likely is it that the device mapper was only accidentally not taken into account in power management, or whether it should deliberately block the sleep state for technical reasons? If nothing speaks against it, how do we get the patch in syssrc? Should I submit a bug report? Best wishes Matthias smime.p7s Description: S/MIME Cryptographic Signature
Re: Devices without power management support: dm0 dm1 (LVM / Device Mapper prevents ACPI Sleep State 3)
On Wed, Jan 15, 2020 at 07:25:10AM +0100, Matthias Petermann wrote: > Hello Maya, > > many thanks for your response. I used the patch in my NetBSD 9.0 (RC1) > kernel and rebuilt it. However, it does not seem to be the solution to the > problem. If i want to send the system to sleep, the message still appears: > > [92,499360] Devices without power management support: dm0 dm1 > > For security, I have added additional logging - should that actually appear > in the kernel log? > > ... > static void > dm_attach(device_t parent, device_t self, void *aux) > { > aprint_error("dm_attach called\n"); > ... > > static int > dm_detach(device_t self, int flags) > { > dm_dev_t *dmv; > aprint_error("dm_detach called\n"); > ... > > Since I don't see any of this in the log, I'm not sure at all whether the > code is actually executed. Is it generally the case that all device drivers > are "detached" before entering ACPI Sleep state 3? Or could this be a > special case? You will need to rebuild the modules, not the kernel. build.sh modules sudo build.sh ... installmodules=/ Is how I usually do it.
Re: Devices without power management support: dm0 dm1 (LVM / Device Mapper prevents ACPI Sleep State 3)
m...@petermann-it.de (Matthias Petermann) writes: >Hello Maya, >many thanks for your response. I used the patch in my NetBSD 9.0 (RC1)=20 >kernel and rebuilt it. However, it does not seem to be the solution to=20 >the problem. If i want to send the system to sleep, the message still=20 >appears: > [92,499360] Devices without power management support: dm0 dm1 The dm driver is probably loaded as a module. You also need to rebuild and install the modules. -- -- Michael van Elst Internet: mlel...@serpens.de "A potential Snark may lurk in every tree."
Re: Devices without power management support: dm0 dm1 (LVM / Device Mapper prevents ACPI Sleep State 3)
Hello Maya, many thanks for your response. I used the patch in my NetBSD 9.0 (RC1) kernel and rebuilt it. However, it does not seem to be the solution to the problem. If i want to send the system to sleep, the message still appears: [92,499360] Devices without power management support: dm0 dm1 For security, I have added additional logging - should that actually appear in the kernel log? ... static void dm_attach(device_t parent, device_t self, void *aux) { aprint_error("dm_attach called\n"); ... static int dm_detach(device_t self, int flags) { dm_dev_t *dmv; aprint_error("dm_detach called\n"); ... Since I don't see any of this in the log, I'm not sure at all whether the code is actually executed. Is it generally the case that all device drivers are "detached" before entering ACPI Sleep state 3? Or could this be a special case? Best wishes Matthias On 14.01.20 07:13, m...@netbsd.org wrote: The pmf_device_register go appearing in most drivers is what is responsible for whitelisting drivers. So something like this might do. Index: device-mapper.c === RCS file: /cvsroot/src/sys/dev/dm/device-mapper.c,v retrieving revision 1.59 diff -u -r1.59 device-mapper.c --- device-mapper.c 22 Dec 2019 13:16:09 - 1.59 +++ device-mapper.c 14 Jan 2020 06:13:17 - @@ -245,6 +245,8 @@ static void dm_attach(device_t parent, device_t self, void *aux) { + if (!pmf_device_register(self, NULL, NULL)) + aprint_error_dev(self, "couldn't establish power handler\n"); } /* @@ -259,6 +261,8 @@ { dm_dev_t *dmv; + pmf_device_deregister(self); + /* Detach device from global device list */ if ((dmv = dm_dev_detach(self)) == NULL) return ENOENT; smime.p7s Description: S/MIME Cryptographic Signature
Re: Devices without power management support: dm0 dm1 (LVM / Device Mapper prevents ACPI Sleep State 3)
The pmf_device_register go appearing in most drivers is what is responsible for whitelisting drivers. So something like this might do. Index: device-mapper.c === RCS file: /cvsroot/src/sys/dev/dm/device-mapper.c,v retrieving revision 1.59 diff -u -r1.59 device-mapper.c --- device-mapper.c 22 Dec 2019 13:16:09 - 1.59 +++ device-mapper.c 14 Jan 2020 06:13:17 - @@ -245,6 +245,8 @@ static void dm_attach(device_t parent, device_t self, void *aux) { + if (!pmf_device_register(self, NULL, NULL)) + aprint_error_dev(self, "couldn't establish power handler\n"); } /* @@ -259,6 +261,8 @@ { dm_dev_t *dmv; + pmf_device_deregister(self); + /* Detach device from global device list */ if ((dmv = dm_dev_detach(self)) == NULL) return ENOENT;