Re: "reset full-speed USB device number 6 using ehci-pci" with Dell Inspiron 15R 5537

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

 



On Wed, 24 Feb 2016, Daniel Fraga wrote:

> On Wed, 24 Feb 2016 14:24:44 -0500 (EST)
> Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> 
> > I intended the patch not to cause any call traces, but it did anyway.  
> > So let's drop the questionable code and try something that will be
> > completely safe.
> 
> 	Ok, here's what I got:
> 
> Feb 24 19:16:41 tux kernel: [  717.316048] usb 3-1.6: reset full-speed USB device number 6 using ehci-pci
> Feb 24 19:16:41 tux kernel: [  717.406163] hid_start_in: urbin           (null)

Okay, that's what I had guessed.  Somehow usbhid->urbin is getting set 
to NULL.  Maybe the patch below will indicate why.  When you post the 
log, include everything that mentions the 3-1.6 device -- even if they 
precede the suspend test.

Alan Stern



Index: usb-4.4/drivers/hid/usbhid/hid-core.c
===================================================================
--- usb-4.4.orig/drivers/hid/usbhid/hid-core.c
+++ usb-4.4/drivers/hid/usbhid/hid-core.c
@@ -75,7 +75,7 @@ static int hid_submit_ctrl(struct hid_de
 static void hid_cancel_delayed_stuff(struct usbhid_device *usbhid);
 
 /* Start up the input URB */
-static int hid_start_in(struct hid_device *hid)
+static int hid_start_in(struct hid_device *hid, int alantest)
 {
 	unsigned long flags;
 	int rc = 0;
@@ -86,6 +86,9 @@ static int hid_start_in(struct hid_devic
 			!test_bit(HID_DISCONNECTED, &usbhid->iofl) &&
 			!test_bit(HID_SUSPENDED, &usbhid->iofl) &&
 			!test_and_set_bit(HID_IN_RUNNING, &usbhid->iofl)) {
+		if (alantest) {
+			pr_info("hid_start_in: urbin %p\n", usbhid->urbin);
+		}
 		rc = usb_submit_urb(usbhid->urbin, GFP_ATOMIC);
 		if (rc != 0) {
 			clear_bit(HID_IN_RUNNING, &usbhid->iofl);
@@ -106,7 +109,7 @@ static void hid_retry_timeout(unsigned l
 	struct usbhid_device *usbhid = hid->driver_data;
 
 	dev_dbg(&usbhid->intf->dev, "retrying intr urb\n");
-	if (hid_start_in(hid))
+	if (hid_start_in(hid, 0))
 		hid_io_error(hid);
 }
 
@@ -123,7 +126,7 @@ static void hid_reset(struct work_struct
 		rc = usb_clear_halt(hid_to_usb_dev(hid), usbhid->urbin->pipe);
 		clear_bit(HID_CLEAR_HALT, &usbhid->iofl);
 		if (rc == 0) {
-			hid_start_in(hid);
+			hid_start_in(hid, 0);
 		} else {
 			dev_dbg(&usbhid->intf->dev,
 					"clear-halt failed: %d\n", rc);
@@ -690,7 +693,7 @@ int usbhid_open(struct hid_device *hid)
 		}
 		usbhid->intf->needs_remote_wakeup = 1;
 		set_bit(HID_RESUME_RUNNING, &usbhid->iofl);
-		res = hid_start_in(hid);
+		res = hid_start_in(hid, 0);
 		if (res) {
 			if (res != -ENOSPC) {
 				hid_io_error(hid);
@@ -1100,6 +1103,7 @@ static int usbhid_start(struct hid_devic
 				continue;
 			if (!(usbhid->urbin = usb_alloc_urb(0, GFP_KERNEL)))
 				goto fail;
+			dev_info(&intf->dev, "usbhid_start urb %p\n", usbhid->urbin);
 			pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
 			usb_fill_int_urb(usbhid->urbin, dev, pipe, usbhid->inbuf, insize,
 					 hid_irq_in, hid, interval);
@@ -1139,7 +1143,7 @@ static int usbhid_start(struct hid_devic
 		if (ret)
 			goto fail;
 		usbhid->intf->needs_remote_wakeup = 1;
-		ret = hid_start_in(hid);
+		ret = hid_start_in(hid, 0);
 		if (ret) {
 			dev_err(&hid->dev,
 				"failed to start in urb: %d\n", ret);
@@ -1162,6 +1166,7 @@ static int usbhid_start(struct hid_devic
 	return 0;
 
 fail:
+	dev_info(&intf->dev, "usbhid_start fail urb %p\n", usbhid->urbin);
 	usb_free_urb(usbhid->urbin);
 	usb_free_urb(usbhid->urbout);
 	usb_free_urb(usbhid->urbctrl);
@@ -1194,6 +1199,7 @@ static void usbhid_stop(struct hid_devic
 
 	hid->claimed = 0;
 
+	dev_info(&usbhid->intf->dev, "usbhid_stop urb %p\n", usbhid->urbin);
 	usb_free_urb(usbhid->urbin);
 	usb_free_urb(usbhid->urbctrl);
 	usb_free_urb(usbhid->urbout);
@@ -1399,6 +1405,7 @@ static void hid_cancel_delayed_stuff(str
 static void hid_cease_io(struct usbhid_device *usbhid)
 {
 	del_timer_sync(&usbhid->io_retry);
+	dev_info(&usbhid->intf->dev, "hid_cease_io urb %p\n", usbhid->urbin);
 	usb_kill_urb(usbhid->urbin);
 	usb_kill_urb(usbhid->urbctrl);
 	usb_kill_urb(usbhid->urbout);
@@ -1457,7 +1464,8 @@ static int hid_post_reset(struct usb_int
 	clear_bit(HID_RESET_PENDING, &usbhid->iofl);
 	spin_unlock_irq(&usbhid->lock);
 	hid_set_idle(dev, intf->cur_altsetting->desc.bInterfaceNumber, 0, 0);
-	status = hid_start_in(hid);
+	status = hid_start_in(hid, 1);
+	dev_info(&intf->dev, "post reset hid_start_in -> %d\n", status);
 	if (status < 0)
 		hid_io_error(hid);
 	usbhid_restart_queues(usbhid);
@@ -1498,7 +1506,7 @@ static int hid_resume_common(struct hid_
 	usbhid_restart_queues(usbhid);
 	spin_unlock_irq(&usbhid->lock);
 
-	status = hid_start_in(hid);
+	status = hid_start_in(hid, 0);
 	if (status < 0)
 		hid_io_error(hid);
 

--
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