Commit 7ee2566f authored by George Cherian's avatar George Cherian Committed by Felipe Balbi

usb: dwc3: dwc3-omap: get rid of ->prepare()/->complete()

Enabling the core interrupts in complete is too late for
XHCI, and stops it from proper operation. The root of the
problem is due to a disagreement between dwc3-omap and XHCI
about when IRQs should be enabled.

As it turns out, ->resume's documentation states that:

"... generally the driver is expected to start working
again, responding to hardware events and software requests
(the device itself may be left in a low-power state, waiting
for a runtime resume to occur) ..."

From that we infer that IRQs must be unmasked by the end of
->resume().

Due to that, we will remove ->prepare() and ->complete() and
disable/enable interrupts in ->suspend()/->resume().
Acked-by: default avatarRoger Quadros <rogerq@ti.com>
Signed-off-by: default avatarGeorge Cherian <george.cherian@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 1803fe15
...@@ -593,27 +593,12 @@ static const struct of_device_id of_dwc3_match[] = { ...@@ -593,27 +593,12 @@ static const struct of_device_id of_dwc3_match[] = {
MODULE_DEVICE_TABLE(of, of_dwc3_match); MODULE_DEVICE_TABLE(of, of_dwc3_match);
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int dwc3_omap_prepare(struct device *dev)
{
struct dwc3_omap *omap = dev_get_drvdata(dev);
dwc3_omap_disable_irqs(omap);
return 0;
}
static void dwc3_omap_complete(struct device *dev)
{
struct dwc3_omap *omap = dev_get_drvdata(dev);
dwc3_omap_enable_irqs(omap);
}
static int dwc3_omap_suspend(struct device *dev) static int dwc3_omap_suspend(struct device *dev)
{ {
struct dwc3_omap *omap = dev_get_drvdata(dev); struct dwc3_omap *omap = dev_get_drvdata(dev);
omap->utmi_otg_status = dwc3_omap_read_utmi_status(omap); omap->utmi_otg_status = dwc3_omap_read_utmi_status(omap);
dwc3_omap_disable_irqs(omap);
return 0; return 0;
} }
...@@ -623,6 +608,7 @@ static int dwc3_omap_resume(struct device *dev) ...@@ -623,6 +608,7 @@ static int dwc3_omap_resume(struct device *dev)
struct dwc3_omap *omap = dev_get_drvdata(dev); struct dwc3_omap *omap = dev_get_drvdata(dev);
dwc3_omap_write_utmi_status(omap, omap->utmi_otg_status); dwc3_omap_write_utmi_status(omap, omap->utmi_otg_status);
dwc3_omap_enable_irqs(omap);
pm_runtime_disable(dev); pm_runtime_disable(dev);
pm_runtime_set_active(dev); pm_runtime_set_active(dev);
...@@ -632,8 +618,6 @@ static int dwc3_omap_resume(struct device *dev) ...@@ -632,8 +618,6 @@ static int dwc3_omap_resume(struct device *dev)
} }
static const struct dev_pm_ops dwc3_omap_dev_pm_ops = { static const struct dev_pm_ops dwc3_omap_dev_pm_ops = {
.prepare = dwc3_omap_prepare,
.complete = dwc3_omap_complete,
SET_SYSTEM_SLEEP_PM_OPS(dwc3_omap_suspend, dwc3_omap_resume) SET_SYSTEM_SLEEP_PM_OPS(dwc3_omap_suspend, dwc3_omap_resume)
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment