Re: additional debug output for autosuspend in cdc-ether

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

 



Am Dienstag, 10. November 2009 11:36:40 schrieb Rickard Bellini:
> Hi,
> 
> I have tested 24+ hours with cdc-wdm unloaded and I could not recreate the
>  XactErr, I however ran into the seperate issue where it seems a remote
>  wakeup is lost somewhere. I would probably need to get a USB Hardware
>  Analyzer to hook up to our device. Unless there is a 100% proof way of
>  capturing USB traces in the linux kernel?

This is an issue wider advice is needed to answer.
I am putting the list into CC.

> As soon as I loaded cdc-wdm it only took a hour of testing before I
>  captured the XactError again. Attached is the log and a wireshark usb
>  capture. I'm not using cdc-wdm at all, it is just loaded.

I am puzzeled. By the log that is. Given the debug patch I don't see how
it can fail to trigger if an URB is sent to the device too late.

People, any ideas?

	Regards
		Oliver

PS: I am attaching the debugging patch



commit 2ded0cc03864e0f538420f4a1c18b5b8cf423f2b
Author: Oliver Neukum <oliver@xxxxxxxxxx>
Date:   Wed Oct 14 14:57:15 2009 +0200

    additional debug output for cdc-ether

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index dd0a394..f47dce2 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -348,6 +348,7 @@ static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
 
 	usb_fill_bulk_urb (urb, dev->udev, dev->in,
 		skb->data, size, rx_complete, skb);
+	devdbg(dev, "input urb at %p", urb);
 
 	spin_lock_irqsave (&dev->rxq.lock, lockflags);
 
@@ -1051,6 +1052,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
 	length = skb->len;
 
 	if (!(urb = usb_alloc_urb (0, GFP_ATOMIC))) {
+		devdbg (dev, "output urb at %p", urb);
 		if (netif_msg_tx_err (dev))
 			devdbg (dev, "no urb");
 		goto drop;
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 34de475..fcea886 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1502,6 +1502,12 @@ void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb, int status)
 	usbmon_urb_complete(&hcd->self, urb, status);
 	usb_unanchor_urb(urb);
 
+	if((!urb->unlinked) && urb->dev->state == USB_STATE_SUSPENDED) {
+		dev_dbg(&urb->dev->dev,
+			"URB %p finishes on suspended device\n", urb);
+		WARN_ON(1);
+	}
+
 	/* pass ownership to the completion handler */
 	urb->status = status;
 	urb->complete (urb);

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

  Powered by Linux