Alan Stern schrieb:

Darn it. There were two problem pathways in that code and the patch changed the wrong one. Okay, this patch changes both.

Bear in mind that this is just a temporary band-aid. The real problem is that the usblp driver doesn't have any suspend/resume support. That still needs to be fixed.

If you don't feel like using the patch below, you can simply rmmod usblp
before suspending and modprobe usblp after resuming.  That's actually a
safer approach.

Alan Stern



Index: linux-2.6.15-rc3/drivers/usb/core/usb.c
===================================================================
--- linux-2.6.15-rc3.orig/drivers/usb/core/usb.c
+++ linux-2.6.15-rc3/drivers/usb/core/usb.c
@@ -1414,8 +1414,10 @@ static int usb_generic_suspend(struct de
        }
if ((dev->driver == NULL) ||
-           (dev->driver_data == &usb_generic_driver_data))
+           (dev->driver_data == &usb_generic_driver_data)) {
+               dev->power.power_state.event = PM_EVENT_FREEZE;
                return 0;
+       }
intf = to_usb_interface(dev);
        driver = to_usb_driver(dev->driver);
@@ -1433,6 +1435,7 @@ static int usb_generic_suspend(struct de
        } else {
                // FIXME else if there's no suspend method, disconnect...
                dev_warn(dev, "no %s?\n", "suspend");
+               mark_quiesced(intf);
                status = 0;
        }
        return status;

This patch fixes it. dmesg log follows:

drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 2 if 0 alt 0 
proto 2 vid 0x04E8 pid 0x3242
usbcore: registered new driver usblp
drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
[...]
PM: Preparing system for mem sleep
Stopping tasks: =================================================|
usblp 2-2:1.0: no suspend?
ACPI: PCI interrupt for device 0000:02:01.1 disabled
ACPI: PCI interrupt for device 0000:02:01.0 disabled
ACPI: PCI interrupt for device 0000:01:00.0 disabled
ACPI: PCI interrupt for device 0000:00:1f.5 disabled
ACPI: PCI interrupt for device 0000:00:1d.7 disabled
ACPI: PCI interrupt for device 0000:00:1d.2 disabled
ACPI: PCI interrupt for device 0000:00:1d.1 disabled
ACPI: PCI interrupt for device 0000:00:1d.0 disabled
PM: Entering mem sleep
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
Back to C!
PM: Finishing wakeup.
ACPI: PCI Interrupt 0000:00:1d.0[A] -> Link [LNKA] -> GSI 5 (level, low) -> IRQ 
5
PCI: Setting latency timer of device 0000:00:1d.0 to 64
ACPI: PCI Interrupt 0000:00:1d.1[B] -> Link [LNKD] -> GSI 11 (level, low) -> 
IRQ 11
PCI: Setting latency timer of device 0000:00:1d.1 to 64
ACPI: PCI Interrupt 0000:00:1d.2[C] -> Link [LNKC] -> GSI 5 (level, low) -> IRQ 
5
PCI: Setting latency timer of device 0000:00:1d.2 to 64
ACPI: PCI Interrupt 0000:00:1d.7[D] -> Link [LNKH] -> GSI 11 (level, low) -> 
IRQ 11
PCI: Setting latency timer of device 0000:00:1d.7 to 64
PCI: Setting latency timer of device 0000:00:1e.0 to 64
ACPI: PCI Interrupt 0000:00:1f.1[A] -> Link [LNKC] -> GSI 5 (level, low) -> IRQ 
5
ACPI: PCI Interrupt 0000:00:1f.5[B] -> Link [LNKB] -> GSI 5 (level, low) -> IRQ 
5
PCI: Setting latency timer of device 0000:00:1f.5 to 64
PCI: Enabling device 0000:01:00.0 (0000 -> 0003)
ACPI: PCI Interrupt 0000:01:00.0[A] -> Link [LNKA] -> GSI 5 (level, low) -> IRQ 
5
PCI: Setting latency timer of device 0000:01:00.0 to 64
eth0: link down
ACPI: PCI Interrupt 0000:02:01.0[A] -> Link [LNKB] -> GSI 5 (level, low) -> IRQ 
5
ACPI: PCI Interrupt 0000:02:01.1[B] -> Link [LNKA] -> GSI 5 (level, low) -> IRQ 
5
ACPI: PCI Interrupt 0000:02:01.2[C] -> Link [LNKC] -> GSI 5 (level, low) -> IRQ 
5
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
usblp 2-2:1.0: no resume?
Restarting tasks...<6>usb 2-2: USB disconnect, address 2
drivers/usb/class/usblp.c: usblp0: removed
 done
usb 2-2: new full speed USB device using uhci_hcd and address 3
drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 3 if 0 alt 0 
proto 2 vid 0x04E8 pid 0x3242


Please send the patch above for inclusion in 2.6.15.

Thanks for your help!
Carl-Daniel


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to