> > Anatolij and others: > > Can you explain why the ehci_fsl_mpc512x_drv_suspend() routine goes to > the trouble of turning off the CMD_RUN bit in the EHCI command > register, and why ehci_fsl_mpc512x_drv_resume() turns it back on? > > These routines handle power management for the EHCI controller. At the > time they run, the root hub is guaranteed to be suspended -- that is, > ehci_bus_suspend() has run and ehci_bus_resume() hasn't been called > yet. As a result, the CMD_RUN bit should already be off and it should > remain off. > > Would it be okay for me to remove the code that changes the CMD_RUN > bit? > At fsl driver, the controller suspend/resume routine is not only used at system pm routine, but also for OTG ID switch, it needs to save/restore registers as udc driver will change it. I (I work at ARM platform) guess operation for CMD_RUN is to make sure CMD_RUN is 0 before switch to device mode, set CMD_RUN to 1 before host wants to run. > Also, why does the resume routine call usb_hcd_resume_root_hub()? Is > there a hardware bug that causes the controller not to issue the proper > IRQ when a root-hub wakeup event occurs? > The reason is when CMD_RUN is 1, the usb_hcd_resume_root_hub will not be called at PCD interrupt. The last four lines of code at ehci_fsl_mpc512x_drv_resume may be commented since pcd interrupt will be occurred after vbus is on. tmp = ehci_readl(ehci, &ehci->regs->command); tmp |= CMD_RUN; ehci_writel(ehci, tmp, &ehci->regs->command); usb_hcd_resume_root_hub(hcd); > Alan Stern > > -- > 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 -- 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