Re: [PATCH RESEND] usb: phy: mxs: Suggest passing "usbcore.autosuspend=-1" for mx23/mx28

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

 



Hi,

Fabio Estevam <festevam@xxxxxxxxx> writes:
> From: Fabio Estevam <fabio.estevam@xxxxxxx>
>
> On a mx28 board with a USB hub the following error is observed:
>
> hub 1-1:1.0: USB hub found
> hub 1-1:1.0: 2 ports detected
> usb 1-1: USB disconnect, device number 2
> usb usb1-port1: cannot reset (err = -32)
> usb usb1-port1: cannot reset (err = -32)
> usb usb1-port1: cannot reset (err = -32)
> usb usb1-port1: cannot reset (err = -32)
> usb usb1-port1: cannot reset (err = -32)
> usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
>
> ,which is caused by a problem described by the MXS_PHY_ABNORMAL_IN_SUSPEND
> flag.

how about detecting that you're running on mx23/mx28 and returning
-EBUSY on your runtime_idle implementation ? You already have the basics
done for it. Care to test below and tell me whether it helps ?

modified   drivers/usb/phy/phy-mxs-usb.c
@@ -564,8 +564,23 @@ static int mxs_phy_system_resume(struct device *dev)
 }
 #endif /* CONFIG_PM_SLEEP */
 
-static SIMPLE_DEV_PM_OPS(mxs_phy_pm, mxs_phy_system_suspend,
-		mxs_phy_system_resume);
+#ifdef CONFIG_PM
+static int mxs_phy_runtime_idle(struct device *dev)
+{
+	struct mxs_phy *mxs_phy = dev_get_drvdata(dev);
+
+	if (mxs_phy->data->flags & MXS_PHY_ABNORMAL_IN_SUSPEND)
+		return -EBUSY;
+
+	return 0;
+}
+#endif /* CONFIG_PM */
+
+static const struct dev_pm_ops mxs_phy_pm = {
+	SET_SYSTEM_SLEEP_PM_OPS(mxs_phy_system_suspend,
+			mxs_phy_system_resume)
+	SET_RUNTIME_PM_OPS(NULL, NULL, mxs_phy_runtime_idle)
+};
 
 static struct platform_driver mxs_phy_driver = {
 	.probe = mxs_phy_probe,



-- 
balbi

Attachment: signature.asc
Description: PGP signature


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

  Powered by Linux