Commit e8aa6c39 authored by Felipe Balbi's avatar Felipe Balbi Committed by Greg Kroah-Hartman

usb: musb: dsps: kill OTG timer on suspend

commit 468bcc2a upstream.

if we don't make sure to kill the timer, it could
expire after we have already gated our clocks.

That will trigger a Data Abort exception because
we would try to access register while clock is gated.

Fix that bug.

Fixes 869c5978 (usb: musb: dsps: add support for suspend and resume)
Tested-by: default avatarDave Gerlach <d-gerlach@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e5c8fe8e
...@@ -780,6 +780,7 @@ static int dsps_suspend(struct device *dev) ...@@ -780,6 +780,7 @@ static int dsps_suspend(struct device *dev)
struct musb *musb = platform_get_drvdata(glue->musb); struct musb *musb = platform_get_drvdata(glue->musb);
void __iomem *mbase = musb->ctrl_base; void __iomem *mbase = musb->ctrl_base;
del_timer_sync(&glue->timer);
glue->context.control = dsps_readl(mbase, wrp->control); glue->context.control = dsps_readl(mbase, wrp->control);
glue->context.epintr = dsps_readl(mbase, wrp->epintr_set); glue->context.epintr = dsps_readl(mbase, wrp->epintr_set);
glue->context.coreintr = dsps_readl(mbase, wrp->coreintr_set); glue->context.coreintr = dsps_readl(mbase, wrp->coreintr_set);
...@@ -805,6 +806,7 @@ static int dsps_resume(struct device *dev) ...@@ -805,6 +806,7 @@ static int dsps_resume(struct device *dev)
dsps_writel(mbase, wrp->mode, glue->context.mode); dsps_writel(mbase, wrp->mode, glue->context.mode);
dsps_writel(mbase, wrp->tx_mode, glue->context.tx_mode); dsps_writel(mbase, wrp->tx_mode, glue->context.tx_mode);
dsps_writel(mbase, wrp->rx_mode, glue->context.rx_mode); dsps_writel(mbase, wrp->rx_mode, glue->context.rx_mode);
setup_timer(&glue->timer, otg_timer, (unsigned long) musb);
return 0; return 0;
} }
......
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