[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#402447: [patch] Disabling pci_set_power_state() in vortex_ioctl() if the device doesn't support PM



tags 402447 patch
thanks

I believe the problem really is bad logic in pci_set_power_state(),
making it fail if the device doesn't support PM and a driver 
 1) saves power_state, 
 2) wakes up and does something, and 
 3) then reset to the saved state.

I've reported this upstream along with a patch for pci.c

The attached patch works around the problem in the 3c59x.c driver.


Bjørn

--- linux-source-2.6.18/drivers/net/3c59x.c.orig	2006-09-20 05:42:06.000000000 +0200
+++ linux-source-2.6.18/drivers/net/3c59x.c	2007-05-05 00:08:01.000000000 +0200
@@ -2899,7 +2899,7 @@
 	unsigned long flags;
 	int state = 0;
 
-	if(VORTEX_PCI(vp))
+	if(VORTEX_PCI(vp) && pci_find_capability(VORTEX_PCI(vp), PCI_CAP_ID_PM)) 
 		state = VORTEX_PCI(vp)->current_state;
 
 	/* The kernel core really should have pci_get_power_state() */

Reply to: