[24/50] firewire: fw-ohci: ignore failure of pci_set_power_state (fix suspend regression)

Greg KH
2007-09-24T16:33:34Z

[-- Attachment #1: firewire-fw-ohci-ignore-failure-of-pci_set_power_state.patch --]
[-- Type: text/plain, Size: 1908 bytes --]

From: Stefan Richter <stefanr@s5r6.in-berlin.de>

Minor regression since 2.6.22-rc1: If the experimental firewire-ohci
driver instead of ohci1394 was loaded, iBook G3 and older PowerBooks
refused to suspend.

Same as commit 5511142870046a7bed947d51ec9b320856ee120a plus format
string touch-ups from 8a8cea2734808522f02941ea16125810ee42c9c7,
"firewire: missing newline in printk". Original patch description:

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@s5r6.in-berlin.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

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

--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1934,14 +1934,12 @@ static int pci_suspend(struct pci_dev *p
free_irq(pdev->irq, ohci);
err = pci_save_state(pdev);
if (err) {
- fw_error("pci_save_state failed with %d", err);
+ fw_error("pci_save_state failed with %d\n", err);
return err;
}
err = pci_set_power_state(pdev, pci_choose_state(pdev, state));
- if (err) {
- fw_error("pci_set_power_state failed with %d", err);
- return err;
- }
+ if (err)
+ fw_error("pci_set_power_state failed with %d\n", err);

return 0;
}
@@ -1955,7 +1953,7 @@ static int pci_resume(struct pci_dev *pd
pci_restore_state(pdev);
err = pci_enable_device(pdev);
if (err) {
- fw_error("pci_enable_device failed with %d", err);
+ fw_error("pci_enable_device failed with %d\n", err);
return err;
}

--