Re: problem with resume after s2ram

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

 



On Tue, 22 Apr 2014, Peter Münster wrote:

> On Mon, Apr 21 2014, Alan Stern wrote:
> 
> > Here's a new diagnostic patch (diag4) to try, on the same kernel, along 
> > with diag1 and nothing else.  This patch does almost the same thing as 
> > turning off CONFIG_USB_SUSPEND used to do in earlier versions of the 
> > kernel.  If the behavior is consistent, this should work with both the 
> > keyboard and mouse attached to the rear ports.
> 
> Hi Alan,
> 
> Yes it works. I need to press the power button to wake up the system,
> but that's not a problem.
> 
> Please find attached the log.

Okay, that's good.  Now we just have to remove pieces from diag4 until 
we find the part responsible for the problem.

Here's diag5; it's essentially a subset of diag4.  Test it in the same
way.

(Not being able to wake up the system from the keyboard is expected
for diag4.  With diag5, you may or may not be able to use the keyboard
for wakeup -- try it and see.  It's even possible that the system will 
crash if you use the keyboard but not if you use the power button!)

Alan Stern



Index: peter/drivers/usb/core/hub.c
===================================================================
--- peter.orig/drivers/usb/core/hub.c
+++ peter/drivers/usb/core/hub.c
@@ -2981,7 +2981,7 @@ int usb_port_suspend(struct usb_device *
 	 * Therefore we will turn on the suspend feature if udev or any of its
 	 * descendants is enabled for remote wakeup.
 	 */
-	else if (PMSG_IS_AUTO(msg) || wakeup_enabled_descendants(udev) > 0)
+	else if (0)
 		status = set_port_feature(hub->hdev, port1,
 				USB_PORT_FEAT_SUSPEND);
 	else {
@@ -3062,7 +3062,6 @@ int usb_port_suspend(struct usb_device *
 static int finish_port_resume(struct usb_device *udev)
 {
 	int	status = 0;
-	u16	devstatus = 0;
 
 	/* caller owns the udev device lock */
 	dev_dbg(&udev->dev, "%s\n",
@@ -3091,10 +3090,6 @@ static int finish_port_resume(struct usb
 	 * and device drivers will know about any resume quirks.
 	 */
 	if (status == 0) {
-		devstatus = 0;
-		status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus);
-		if (status >= 0)
-			status = (status > 0 ? 0 : -ENODEV);
 
 		/* If a normal resume failed, try doing a reset-resume */
 		if (status && !udev->reset_resume && udev->persist_enabled) {
@@ -3107,38 +3102,6 @@ static int finish_port_resume(struct usb
 	if (status) {
 		dev_dbg(&udev->dev, "gone after usb resume? status %d\n",
 				status);
-	/*
-	 * There are a few quirky devices which violate the standard
-	 * by claiming to have remote wakeup enabled after a reset,
-	 * which crash if the feature is cleared, hence check for
-	 * udev->reset_resume
-	 */
-	} else if (udev->actconfig && !udev->reset_resume) {
-		if (!hub_is_superspeed(udev->parent)) {
-			le16_to_cpus(&devstatus);
-			if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP))
-				status = usb_control_msg(udev,
-						usb_sndctrlpipe(udev, 0),
-						USB_REQ_CLEAR_FEATURE,
-						USB_RECIP_DEVICE,
-						USB_DEVICE_REMOTE_WAKEUP, 0,
-						NULL, 0,
-						USB_CTRL_SET_TIMEOUT);
-		} else {
-			status = usb_get_status(udev, USB_RECIP_INTERFACE, 0,
-					&devstatus);
-			le16_to_cpus(&devstatus);
-			if (!status && devstatus & (USB_INTRF_STAT_FUNC_RW_CAP
-					| USB_INTRF_STAT_FUNC_RW))
-				status =
-					usb_disable_function_remotewakeup(udev);
-		}
-
-		if (status)
-			dev_dbg(&udev->dev,
-				"disable remote wakeup, status %d\n",
-				status);
-		status = 0;
 	}
 	return status;
 }

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