Skip to contentSkip to conversation

Fix swsusp with PNP BIOS

PATCH RESEND In review Ondrej Zary 5 participants 6 messages Jul 24, 2006 – Jul 25, 2006 Pnp support

lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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() 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.

Thanks for the patch.

Pavel, what do you think?

Quoted 14 lines
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))
#2 lore raw
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() 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.

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
#3 lore raw
In reply to Rafael J. Wysocki

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() 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.

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

#4 lore raw
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() 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.

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

#5 lore raw
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() 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.

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