Re: Autosuspend and unbound interfaces

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

 



On May 5, 2010, at 9:00 AM, Alan Stern wrote:

> You will have to do some debugging to find out why your driver isn't
> getting suspended.

I enabled VERBOSE_DEBUG in driver.c and I get the following in the log when I attach my device.

(The messages saying "Skipping management interface", "Using management interface interrupt endpoints", and "Taking interrupt endpoint from management interface" are from a hack I have in usb-serial.c).

May  5 11:33:59 localhost kernel: hub 3-0:1.0: debounce: port 3: total 100ms stable 100ms status 0x101
May  5 11:33:59 localhost kernel: ohci_hcd 0000:00:02.0: GetStatus roothub.portstatus [2] = 0x00100103 PRSC PPS PES CCS
May  5 11:33:59 localhost kernel: usb 3-3: new full speed USB device using ohci_hcd and address 2
May  5 11:33:59 localhost kernel: ohci_hcd 0000:00:02.0: GetStatus roothub.portstatus [2] = 0x00100103 PRSC PPS PES CCS
May  5 11:33:59 localhost kernel: usb 3-3: usb_autoresume_device: cnt 1 -> 1
May  5 11:33:59 localhost kernel: usb 3-3: skipped 1 descriptor after configuration
May  5 11:33:59 localhost kernel: usb 3-3: skipped 4 descriptors after interface
May  5 11:33:59 localhost kernel: usb 3-3: udev 2, busnum 3, minor = 257
May  5 11:33:59 localhost kernel: usb 3-3: New USB device found, idVendor=04e2, idProduct=1410
May  5 11:33:59 localhost kernel: usb 3-3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
May  5 11:33:59 localhost kernel: add_power_attributes
May  5 11:33:59 localhost kernel: add_power_attributes 0 rc=0
May  5 11:33:59 localhost kernel: add_power_attributes 1 rc=0
May  5 11:33:59 localhost kernel: add_power_attributes 2 rc=0
May  5 11:33:59 localhost kernel: add_power_attributes 3 rc=0
May  5 11:33:59 localhost kernel: usb 3-3: usb_probe_device
May  5 11:33:59 localhost kernel: usb 3-3: configuration #1 chosen from 1 choice
May  5 11:33:59 localhost kernel: usb 3-3: usb_autoresume_device: cnt 4 -> 1
May  5 11:33:59 localhost kernel: usb 3-3: adding 3-3:1.0 (config #1, interface 0)
May  5 11:33:59 localhost kernel: usbserial_generic 3-3:1.0: usb_probe_interface
May  5 11:33:59 localhost kernel: usbserial_generic 3-3:1.0: usb_probe_interface - got id
May  5 11:33:59 localhost kernel: usb 3-3: usb_autoresume_device: cnt 5 -> 1
May  5 11:33:59 localhost kernel: usb 3-3: usb_autosuspend_device: cnt 4 -> 0
May  5 11:33:59 localhost kernel: exar 3-3:1.0: usb_probe_interface
May  5 11:33:59 localhost kernel: exar 3-3:1.0: usb_probe_interface - got id
May  5 11:33:59 localhost kernel: usb 3-3: usb_autoresume_device: cnt 5 -> 1
May  5 11:33:59 localhost kernel: exar 3-3:1.0: Skipping management interface
May  5 11:33:59 localhost kernel: usb 3-3: usb_autosuspend_device: cnt 4 -> 0
May  5 11:33:59 localhost kernel: usb 3-3: adding 3-3:1.1 (config #1, interface 1)
May  5 11:33:59 localhost kernel: usbserial_generic 3-3:1.1: usb_probe_interface
May  5 11:33:59 localhost kernel: usbserial_generic 3-3:1.1: usb_probe_interface - got id
May  5 11:33:59 localhost kernel: usb 3-3: usb_autoresume_device: cnt 5 -> 1
May  5 11:33:59 localhost kernel: usb 3-3: usb_autosuspend_device: cnt 4 -> 0
May  5 11:33:59 localhost kernel: exar 3-3:1.1: usb_probe_interface
May  5 11:33:59 localhost kernel: exar 3-3:1.1: usb_probe_interface - got id
May  5 11:33:59 localhost kernel: usb 3-3: usb_autoresume_device: cnt 5 -> 1
May  5 11:33:59 localhost kernel: exar 3-3:1.1: Using management interface interrupt endpoints
May  5 11:33:59 localhost kernel: exar 3-3:1.1: Taking interrupt endpoint from management interface
May  5 11:33:59 localhost kernel: exar 3-3:1.1: Exar serial converter detected
May  5 11:33:59 localhost kernel: usb 3-3: exar_attach: 1410
May  5 11:33:59 localhost kernel: usb 3-3: usb_autosuspend_device: cnt 4 -> 0
May  5 11:33:59 localhost kernel: usb 3-3: Exar serial converter now attached to ttyUSB0
May  5 11:33:59 localhost kernel: usb 3-3: usb_autosuspend_device: cnt 3 -> 0
May  5 11:33:59 localhost kernel: usb 3-3: usb_autosuspend_device: cnt 2 -> 0
May  5 11:33:59 localhost kernel: drivers/usb/core/inode.c: creating file '002'
May  5 11:33:59 localhost kernel: hub 3-0:1.0: usb_autopm_put_interface: cnt 1 -> 0
May  5 11:33:59 localhost kernel: hub 1-0:1.0: state 7 ports 6 chg 0000 evt 0008
May  5 11:33:59 localhost kernel: hub 1-0:1.0: usb_autopm_get_interface: cnt 2 -> 1
May  5 11:33:59 localhost kernel: usb usb3: usb_autoresume_device: cnt 1 -> 1
May  5 11:33:59 localhost kernel: usb usb3: usb_autosuspend_device: cnt 0 -> -16
May  5 11:33:59 localhost kernel: usb usb3: usb_autoresume_device: cnt 1 -> 1
May  5 11:33:59 localhost kernel: usb usb3: usb_autosuspend_device: cnt 0 -> -16
May  5 11:33:59 localhost kernel: usb usb2: usb_autoresume_device: cnt 1 -> 1
May  5 11:33:59 localhost kernel: usb usb2: autosuspend_check do_remote_wakeup=1
May  5 11:33:59 localhost kernel: usb usb2: autosuspend_check time_before
May  5 11:33:59 localhost kernel: usb usb2: usb_autosuspend_device: cnt 0 -> 0
May  5 11:33:59 localhost kernel: usb usb2: usb_autoresume_device: cnt 1 -> 1
May  5 11:33:59 localhost kernel: usb usb2: autosuspend_check do_remote_wakeup=1
May  5 11:33:59 localhost kernel: usb usb2: autosuspend_check time_before
May  5 11:33:59 localhost kernel: usb usb2: usb_autosuspend_device: cnt 0 -> 0
May  5 11:33:59 localhost kernel: usb 1-6: usb_autoresume_device: cnt 2 -> 1
May  5 11:33:59 localhost kernel: usb 1-6: usb_autosuspend_device: cnt 1 -> 0
May  5 11:33:59 localhost kernel: hub 1-0:1.0: usb_autopm_put_interface: cnt 0 -> 0
May  5 11:34:00 localhost kernel: hub 3-0:1.0: state 7 ports 6 chg 0000 evt 0008
May  5 11:34:00 localhost kernel: hub 3-0:1.0: usb_autopm_get_interface: cnt 2 -> 1
May  5 11:34:00 localhost kernel: usb usb1: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:00 localhost kernel: usb usb1: usb_autosuspend_device: cnt 0 -> -16
May  5 11:34:00 localhost kernel: usb 1-6: usb_autoresume_device: cnt 2 -> 1
May  5 11:34:00 localhost kernel: usb 1-6: usb_autosuspend_device: cnt 1 -> 0
May  5 11:34:00 localhost kernel: usb usb1: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:00 localhost kernel: usb usb1: usb_autosuspend_device: cnt 0 -> -16
May  5 11:34:00 localhost kernel: hub 3-0:1.0: usb_autopm_put_interface: cnt 0 -> 0
May  5 11:34:00 localhost kernel: usb usb4: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:00 localhost kernel: usb usb4: autosuspend_check do_remote_wakeup=1
May  5 11:34:00 localhost kernel: usb usb4: autosuspend_check time_before
May  5 11:34:00 localhost kernel: usb usb4: usb_autosuspend_device: cnt 0 -> 0
May  5 11:34:00 localhost kernel: usb usb4: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:00 localhost kernel: usb usb4: autosuspend_check do_remote_wakeup=1
May  5 11:34:00 localhost kernel: usb usb4: autosuspend_check time_before
May  5 11:34:00 localhost kernel: usb usb4: usb_autosuspend_device: cnt 0 -> 0
May  5 11:34:00 localhost kernel: usb 3-3: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:00 localhost kernel: usb 3-3: usb_autosuspend_device: cnt 0 -> -16
May  5 11:34:00 localhost kernel: usb usb3: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:00 localhost kernel: usb usb3: usb_autosuspend_device: cnt 0 -> -16
May  5 11:34:00 localhost kernel: usb 3-3: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:00 localhost kernel: usb 3-3: usb_autosuspend_device: cnt 0 -> -16
May  5 11:34:00 localhost kernel: usb usb3: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:00 localhost kernel: usb usb3: usb_autosuspend_device: cnt 0 -> -16
May  5 11:34:00 localhost kernel: usb usb2: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:00 localhost kernel: usb usb2: autosuspend_check do_remote_wakeup=1
May  5 11:34:00 localhost kernel: usb usb2: autosuspend_check time_before
May  5 11:34:00 localhost kernel: usb usb2: usb_autosuspend_device: cnt 0 -> 0
May  5 11:34:00 localhost kernel: usb usb2: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:00 localhost kernel: usb usb2: autosuspend_check do_remote_wakeup=1
May  5 11:34:00 localhost kernel: usb usb2: autosuspend_check time_before
May  5 11:34:00 localhost kernel: usb usb2: usb_autosuspend_device: cnt 0 -> 0
May  5 11:34:00 localhost kernel: usb 1-6: usb_autoresume_device: cnt 2 -> 1
May  5 11:34:00 localhost kernel: usb 1-6: usb_autosuspend_device: cnt 1 -> 0
May  5 11:34:00 localhost kernel: usb usb1: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:00 localhost kernel: usb usb1: usb_autosuspend_device: cnt 0 -> -16
May  5 11:34:00 localhost kernel: usb 1-6: usb_autoresume_device: cnt 2 -> 1
May  5 11:34:00 localhost kernel: usb 1-6: usb_autosuspend_device: cnt 1 -> 0
May  5 11:34:00 localhost kernel: usb usb1: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:00 localhost kernel: usb usb1: usb_autosuspend_device: cnt 0 -> -16
May  5 11:34:01 localhost kernel: usb usb4: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:01 localhost kernel: usb usb4: autosuspend_check do_remote_wakeup=1
May  5 11:34:01 localhost kernel: usb usb4: autosuspend_check time_before
May  5 11:34:01 localhost kernel: usb usb4: usb_autosuspend_device: cnt 0 -> 0
May  5 11:34:01 localhost kernel: usb usb4: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:01 localhost kernel: usb usb4: autosuspend_check do_remote_wakeup=1
May  5 11:34:01 localhost kernel: usb usb4: autosuspend_check time_before
May  5 11:34:01 localhost kernel: usb usb4: usb_autosuspend_device: cnt 0 -> 0
May  5 11:34:01 localhost kernel: usb 3-3: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:01 localhost kernel: usb 3-3: usb_autosuspend_device: cnt 0 -> -16
May  5 11:34:01 localhost kernel: usb usb3: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:01 localhost kernel: usb usb3: usb_autosuspend_device: cnt 0 -> -16
May  5 11:34:01 localhost kernel: usb 3-3: usb_autoresume_device: cnt 1 -> 1
May  5 11:34:01 localhost kernel: usb 3-3: usb_autosuspend_device: cnt 0 -> -16

And so on.

Here is the usb-serial.c hack I mentioned above.  It's in usb_serial_prove, right after the PL2303 hack.

#if defined(CONFIG_USB_SERIAL_EXAR) || defined(CONFIG_USB_SERIAL_EXAR_MODULE)
        /* BEGIN HORRIBLE HACK FOR EXAR */
        /* The descriptors aren't loony, but this is still a bit
         * nasty, nonetheless.  The device structures its endpoints
         * the same was that CDC-ACM does, and uses an IAD to
         * associate them.  The first (management) interface in the
         * association contains a single interrupt endpoint, and the
         * second one (data) contains a bulk in and a bulk out.
         */
        if (((le16_to_cpu(dev->descriptor.idVendor) == EXAR_VENDOR_ID) &&
             (le16_to_cpu(dev->descriptor.idProduct) == EXAR_PRODUCT_ID_XRV1410))
            || ((le16_to_cpu(dev->descriptor.idVendor) == EXAR_VENDOR_ID) &&
                (le16_to_cpu(dev->descriptor.idProduct) == EXAR_PRODUCT_ID_XRV1412))
            || ((le16_to_cpu(dev->descriptor.idVendor) == EXAR_VENDOR_ID) &&
                (le16_to_cpu(dev->descriptor.idProduct) == EXAR_PRODUCT_ID_XRV1414))
            || ((le16_to_cpu(dev->descriptor.idVendor) == EXAR_VENDOR_ID) &&
                (le16_to_cpu(dev->descriptor.idProduct) == EXAR_PRODUCT_ID_XRB1411))) {
                struct usb_interface_assoc_descriptor *iad;

                iad = interface->intf_assoc;
                if (iad != NULL) {
                        if (interface->cur_altsetting->desc.bInterfaceNumber == iad->bFirstInterface) {
                                unlock_kernel();
                                dev_info(&interface->dev, "Skipping management interface\n");
                                kfree(serial);
                                return -ENODEV;
                        } else {
                                struct usb_interface *mgmt = usb_ifnum_to_if(dev, iad->bFirstInterface);

                                dev_info(&interface->dev, "Using management interface interrupt endpoints\n");
                                iface_desc = mgmt->cur_altsetting;
                                for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
                                        endpoint = &iface_desc->endpoint[i].desc;
                                        if (usb_endpoint_is_int_in(endpoint)) {
                                                dev_info(&interface->dev, "Taking interrupt endpoint from management interface\n");
                                                interrupt_in_endpoint[num_interrupt_in] = endpoint;
                                                ++num_interrupt_in;
                                        }
                                }
                        }
                }
        }
        /* END HORRIBLE HACK FOR EXAR */
#endif

Rob.




The information and any attached documents contained in this message
may be confidential and/or legally privileged.  The message is
intended solely for the addressee(s).  If you are not the intended
recipient, you are hereby notified that any use, dissemination, or
reproduction is strictly prohibited and may be unlawful.  If you are
not the intended recipient, please contact the sender immediately by
return e-mail and destroy all copies of the original message.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux