lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 6 Sep 2007 09:50:30 +0200 (CEST)
From:	Stefan Richter <stefanr@...6.in-berlin.de>
To:	Andrew Morton <akpm@...ux-foundation.org>
cc:	rael@...e.ping.de, michal.k.k.piotrowski@...il.com,
	rbrito@...il.com, linux-kernel@...r.kernel.org,
	linuxppc-dev@...abs.org, debian-powerpc@...ts.debian.org,
	rjw@...k.pl, linux-pm@...ts.linux-foundation.org, krh@...hat.com
Subject: [PATCH update] Re: Sleep problems with kernels >= 2.6.21 on powerpc

On  5 Sep, Stefan Richter wrote:
> On  5 Sep, Andrew Morton wrote:
>>> >>> Trying to free already-free IRQ 40
>>> >>> pci_set_power_state(): 0002:20:0e.0: state=3, current state=5
>>> >>> firewire_ohci: pci_set_power_state failed with -22<3>pci_device_suspend(): pci_suspend+0x0/0x9c [firewire_ohci]() returns -22
...
>> It's not clear _why_ pci_set_power_state() is failing.
> 
> The only -22 error path in pci_set_power_state is this:
> 
> 	/* Validate current state:
> 	 * Can enter D0 from any state, but if we can only go deeper 
> 	 * to sleep if we're already in a low power state
> 	 */
> 	if (state != PCI_D0 && dev->current_state > state) {
> 		printk(KERN_ERR "%s(): %s: state=%d, current state=%d\n",
> 			__FUNCTION__, pci_name(dev), state, dev->current_state);
> 		return -EINVAL;
> 	} [...else...]


From: Stefan Richter <stefanr@...6.in-berlin.de>
Subject: firewire: fw-ohci: ignore failure of pci_set_power_state (fix suspend regression)

Fixes (papers over) "Sleep problems with kernels >= 2.6.21 on powerpc",
http://lkml.org/lkml/2007/8/25/155.  The issue is that the FireWire
controller's pci_dev.current_state of iBook G3 and presumably older
PowerBooks is still in PCI_UNKNOWN instead of PCI_D0 when the firewire
driver's .suspend method is called.

Like it was suggested earlier in http://lkml.org/lkml/2006/10/24/13, we
do not fail .suspend anymore if pci_set_power_state failed.

Signed-off-by: Stefan Richter <stefanr@...6.in-berlin.de>
---

Update:
  - omit comment which will become outdated if the underlying problem is fixed
  - log the error return value
  - document the actual bug in the patch description

IMO the actual bug here (operating the controller while it is in
PCI_UNKNOWN state, which is surely a fault in the PPC platform code) is
something to be fixed post 2.6.23 release.

 drivers/firewire/fw-ohci.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Index: linux/drivers/firewire/fw-ohci.c
===================================================================
--- linux.orig/drivers/firewire/fw-ohci.c
+++ linux/drivers/firewire/fw-ohci.c
@@ -1973,10 +1973,8 @@ static int pci_suspend(struct pci_dev *p
 		return err;
 	}
 	err = pci_set_power_state(pdev, pci_choose_state(pdev, state));
-	if (err) {
-		fw_error("pci_set_power_state failed\n");
-		return err;
-	}
+	if (err)
+		fw_error("pci_set_power_state failed with %d\n", err);
 
 	return 0;
 }


-- 
Stefan Richter
-=====-=-=== =--= --==-
http://arcgraph.de/sr/


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ