Fix swsusp with PNP BIOS
PATCH RESEND 1/1 Fix swsusp with PNP BIOS
Hello,
swsusp is unable to suspend my machine (DTK FortisPro TOP-5A notebook) with kernel 2.6.17.5 because it's unable to suspend PNP device 00:16 (mouse).
The problem is in PNP BIOS. pnp_bus_suspend() calls pnp_stop_dev() for the device if the device can be disabled according to pnp_can_disable(). The problem is that pnpbios_disable_resources() returns -EPERM if the device is not dynamic (!pnpbios_is_dynamic()) but insert_device() happily sets PNP_DISABLE capability/flag even if the device is not dynamic. So we try to disable non-dynamic devices which will fail.
This patch prevents insert_device() from setting PNP_DISABLE if the device is not dynamic and fixes suspend on my system.
drivers/pnp/pnpbios/core.c +1 -1
@@ -346,7 +346,7 @@ dev->flags = node->flags;if (!(dev->flags &PNPBIOS_NO_CONFIG )) dev->capabilities |=PNP_CONFIGURABLE ; -if (!(dev->flags &PNPBIOS_NO_DISABLE )) +if (!(dev->flags &PNPBIOS_NO_DISABLE ) &&pnpbios_is_dynamic (dev)) dev->capabilities |=PNP_DISABLE ; dev->capabilities |=PNP_READ ;if (pnpbios_is_dynamic (dev))
Signature · 1 line
Ondrej Zary
Hi,
Quoted 4 lines · Ondrej Zary
Hello,
swsusp is unable to suspend my machine (DTK FortisPro TOP-5A notebook) with kernel 2.6.17.5 because it's unable to suspend PNP device 00:16 (mouse).
Quoted 8 lines
The problem is in PNP BIOS.
pnp_bus_suspend()callspnp_stop_dev()for the device if the device can be disabled according topnp_can_disable(). The problem is thatpnpbios_disable_resources()returns-EPERMif the device is not dynamic (!pnpbios_is_dynamic()) butinsert_device()happily setsPNP_DISABLEcapability/flag even if the device is not dynamic. So we try to disable non-dynamic devices which will fail.
This patch preventsinsert_device()from settingPNP_DISABLEif the device is not dynamic and fixes suspend on my system.
Thanks for the patch.
Pavel, what do you think?
Quoted 14 lines
Signed-off-by Ondrej Zary <[email protected]>drivers/pnp/pnpbios/core.c +1
-1@@ -346,7 +346,7 @@ dev->flags = node->flags;if (!(dev->flags &PNPBIOS_NO_CONFIG )) dev->capabilities |=PNP_CONFIGURABLE ; -if (!(dev->flags &PNPBIOS_NO_DISABLE )) +if (!(dev->flags &PNPBIOS_NO_DISABLE ) &&pnpbios_is_dynamic (dev)) dev->capabilities |=PNP_DISABLE ; dev->capabilities |=PNP_READ ;if (pnpbios_is_dynamic (dev))
Quoted 16 lines · Rafael J. Wysocki
Hi,
Quoted 4 lines · Ondrej Zary
Hello,
swsusp is unable to suspend my machine (DTK FortisPro TOP-5A notebook) with kernel 2.6.17.5 because it's unable to suspend PNP device 00:16 (mouse).Quoted 8 lines
The problem is in PNP BIOS.
pnp_bus_suspend()callspnp_stop_dev()for the device if the device can be disabled according topnp_can_disable(). The problem is thatpnpbios_disable_resources()returns-EPERMif the device is not dynamic (!pnpbios_is_dynamic()) butinsert_device()happily setsPNP_DISABLEcapability/flag even if the device is not dynamic. So we try to disable non-dynamic devices which will fail.
This patch preventsinsert_device()from settingPNP_DISABLEif the device is not dynamic and fixes suspend on my system.
Quoted 3 lines
Thanks for the patch.
Pavel, what do you think?
Knowing nothing about pnpbios it looks okay to me.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Hi.
Quoted 17 lines · Rafael J. Wysocki
Hi,
Quoted 5 lines · Ondrej Zary
Hello,
swsusp is unable to suspend my machine (DTK FortisPro TOP-5A notebook) with kernel 2.6.17.5 because it's unable to suspend PNP device 00:16 (mouse).Quoted 8 lines
The problem is in PNP BIOS.
pnp_bus_suspend()callspnp_stop_dev()for the device if the device can be disabled according topnp_can_disable(). The problem is thatpnpbios_disable_resources()returns-EPERMif the device is not dynamic (!pnpbios_is_dynamic()) butinsert_device()happily setsPNP_DISABLEcapability/flag even if the device is not dynamic. So we try to disable non-dynamic devices which will fail.
This patch preventsinsert_device()from settingPNP_DISABLEif the device is not dynamic and fixes suspend on my system.
Quoted 3 lines
Thanks for the patch.
Pavel, what do you think?
Adam is probably a better person to ask. (Added to cc).
Regards,
Nigel
Quoted 20 lines · Nigel Cunningham
Hi.
Quoted 17 lines · Rafael J. Wysocki
Hi,
Quoted 13 lines · Ondrej Zary
Hello,
swsusp is unable to suspend my machine (DTK FortisPro TOP-5A notebook) with kernel 2.6.17.5 because it's unable to suspend PNP device 00:16 (mouse).The problem is in PNP BIOS.
pnp_bus_suspend()callspnp_stop_dev()for the device if the device can be disabled according topnp_can_disable(). The problem is thatpnpbios_disable_resources()returns-EPERMif the device is not dynamic (!pnpbios_is_dynamic()) butinsert_device()happily setsPNP_DISABLEcapability/flag even if the device is not dynamic. So we try to disable non-dynamic devices which will fail.
This patch preventsinsert_device()from settingPNP_DISABLEif the device is not dynamic and fixes suspend on my system.
Quoted 5 lines
Quoted 3 lines
Thanks for the patch.
Pavel, what do you think?
Adam is probably a better person to ask. (Added to cc).
I appreciate it.
Quoted 4 lines
Regards,
Nigel
The patch looks good. Maybe we should even do this check for PNP_CONFIGURABLE.
Thanks,
Adam
Quoted 27 lines · Adam Belay
Quoted 20 lines · Nigel Cunningham
Hi.
Quoted 17 lines · Rafael J. Wysocki
Hi,
Quoted 13 lines · Ondrej Zary
Hello,
swsusp is unable to suspend my machine (DTK FortisPro TOP-5A notebook) with kernel 2.6.17.5 because it's unable to suspend PNP device 00:16 (mouse).The problem is in PNP BIOS.
pnp_bus_suspend()callspnp_stop_dev()for the device if the device can be disabled according topnp_can_disable(). The problem is thatpnpbios_disable_resources()returns-EPERMif the device is not dynamic (!pnpbios_is_dynamic()) butinsert_device()happily setsPNP_DISABLEcapability/flag even if the device is not dynamic. So we try to disable non-dynamic devices which will fail.
This patch preventsinsert_device()from settingPNP_DISABLEif the device is not dynamic and fixes suspend on my system.Quoted 5 lines
Quoted 3 lines
Thanks for the patch.
Pavel, what do you think?
Adam is probably a better person to ask. (Added to cc).
Quoted 8 lines
I appreciate it.
Quoted 4 lines
Regards,
Nigel
The patch looks good.
I'll send it to Andrew then. I assume I can place your ACK on it?
Rafael