On Fri, 19 Feb 2016, Alan Stern wrote:
> On Fri, 19 Feb 2016, Daniel Fraga wrote:
>
> > On Fri, 19 Feb 2016 14:13:25 -0500 (EST)
> > Alan Stern <[email protected]> wrote:
> >
> > > -22 is -EINVAL, so we need to figure out which of the many possible
> > > EINVAL errors you're getting. Try the patch below.
> >
> > I applied your patch, but when it wakes up from S3, the system
> > is stalled: nothing works. No keyboard, no mouse...
> >
> > And nothing in the log.
>
> Probably something about the patch causes a runtime error and that
> causes the resume to fail. I'll try some testing on my machine and get
> back to you next week...
Well, I'm still puzzled. I tried running that patch on my system
(under 4.5-rc2) and it worked perfectly.
So let's try for a little more detail. Please apply this patch instead
of the earlier one. Also, add no_console_suspend to the boot command
line, do
echo 7 >/proc/sys/kernel/printk
and start the suspend from a VT console rather than a GUI.
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
@@ -1427,6 +1427,7 @@ static int hid_post_reset(struct usb_int
struct usb_host_interface *interface = intf->cur_altsetting;
int status;
char *rdesc;
+ extern int alantest;
/* Fetch and examine the HID report descriptor. If this
* has changed, then rebind. Since usbcore's check of the
@@ -1457,7 +1458,10 @@ 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);
+ alantest = 1;
status = hid_start_in(hid);
+ alantest = 0;
+ dev_info(&intf->dev, "post reset hid_start_in -> %d\n", status);
if (status < 0)
hid_io_error(hid);
usbhid_restart_queues(usbhid);
Index: usb-4.4/drivers/usb/core/urb.c
===================================================================
--- usb-4.4.orig/drivers/usb/core/urb.c
+++ usb-4.4/drivers/usb/core/urb.c
@@ -184,6 +184,9 @@ EXPORT_SYMBOL_GPL(usb_unanchor_urb);
/*-------------------------------------------------------------------*/
+int alantest;
+EXPORT_SYMBOL(alantest);
+
/**
* usb_submit_urb - issue an asynchronous transfer request for an endpoint
* @urb: pointer to the urb describing the request
@@ -332,8 +335,14 @@ int usb_submit_urb(struct urb *urb, gfp_
int is_out;
unsigned int allowed;
+ if (alantest) {
+ pr_info("alantest: urb %p\n", urb);
+ pr_info("alantest: udev %p\n", urb->dev);
+ }
+ if (alantest) dev_info(&urb->dev->dev, "submit A\n");
if (!urb || !urb->complete)
return -EINVAL;
+ if (alantest) dev_info(&urb->dev->dev, "submit B\n");
if (urb->hcpriv) {
WARN_ONCE(1, "URB %p submitted while active\n", urb);
return -EBUSY;
@@ -395,6 +404,7 @@ int usb_submit_urb(struct urb *urb, gfp_
* but drivers only control those sizes for ISO.
* while we're checking, initialize return status.
*/
+ if (alantest) dev_info(&urb->dev->dev, "submit C\n");
if (xfertype == USB_ENDPOINT_XFER_ISOC) {
int n, len;
@@ -433,6 +443,7 @@ int usb_submit_urb(struct urb *urb, gfp_
if (sg->length % max)
return -EINVAL;
}
+ if (alantest) dev_info(&urb->dev->dev, "submit D\n");
/* the I/O buffer must be mapped/unmapped, except when length=0 */
if (urb->transfer_buffer_length > INT_MAX)
@@ -487,6 +498,7 @@ int usb_submit_urb(struct urb *urb, gfp_
case USB_ENDPOINT_XFER_ISOC:
case USB_ENDPOINT_XFER_INT:
/* too small? */
+ if (alantest) dev_info(&urb->dev->dev, "submit E\n");
switch (dev->speed) {
case USB_SPEED_WIRELESS:
if ((urb->interval < 6)
@@ -497,6 +509,7 @@ int usb_submit_urb(struct urb *urb, gfp_
return -EINVAL;
break;
}
+ if (alantest) dev_info(&urb->dev->dev, "submit F\n");
/* too big? */
switch (dev->speed) {
case USB_SPEED_SUPER: /* units are 125us */
@@ -532,6 +545,7 @@ int usb_submit_urb(struct urb *urb, gfp_
default:
return -EINVAL;
}
+ if (alantest) dev_info(&urb->dev->dev, "submit G\n");
if (dev->speed != USB_SPEED_WIRELESS) {
/* Round down to a power of 2, no more than max */
urb->interval = min(max, 1 << ilog2(urb->interval));
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html