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 Tue, 23 Feb 2016, Daniel Fraga wrote:

> On Tue, 23 Feb 2016 11:48:51 -0500 (EST)
> Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> 
> > I don't see any crash in that photo.
> 
> 	Sorry. By "crash" I mean "unable to use the keyboard". Maybe I
> used the wrong term.
> 
> > Also, it looks like the log results in this run were different from 
> > what you posted before.  Earlier you had "usbhid 3-1.6:1.0: post reset
> > hid_start_in -> -22" but the photo shows "usbhid 3-1.3:1.1: post reset
> > hid_start_in -> 0" (I think -- the photo is hard to read).
> > 
> > So either the mouse is plugged into a different port and is behaving 
> > differently, or else the photo shows the results for a different 
> > device, which isn't very useful.
> 
> 	Maybe is the mobile phone I left plugged for transferring
> photos. I'll remove it completely when doing the tests.
> 
> > Let's forget about trying to trace into the USB core and instead trace
> > just the usbhid driver.
> 
> 	Ok, another Call Trace. These are the best pictures I took (just
> the second is not so good) and this is the maximum I can go back in
> the scroll buffer. I hope it's clear enough. You can click on the
> thumbnail to expand the picture.

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.

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);
@@ -1139,7 +1142,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);
@@ -1457,7 +1460,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 +1502,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