提交 9298b4aa 编写于 作者: B Bin Liu 提交者: Felipe Balbi

usb: musb: fix device hotplug behind hub

The commit 889ad3b "usb: musb: try a race-free wakeup" breaks device
hotplug enumeraitonn when the device is connected behind a hub while usb
autosuspend is enabled.

Adding finish_resume_work into runtime resume callback fixes the issue.

Also resume root hub is required to resume the bus from runtime suspend,
so move musb_host_resume_root_hub() back to its original location, where
handles RESUME interrupt.
Signed-off-by: NBin Liu <b-liu@ti.com>
Tested-by: NTony Lindgren <tony@atomide.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 251a17f5
...@@ -567,6 +567,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb, ...@@ -567,6 +567,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
musb->xceiv->otg->state = OTG_STATE_A_HOST; musb->xceiv->otg->state = OTG_STATE_A_HOST;
musb->is_active = 1; musb->is_active = 1;
musb_host_resume_root_hub(musb);
break; break;
case OTG_STATE_B_WAIT_ACON: case OTG_STATE_B_WAIT_ACON:
musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL; musb->xceiv->otg->state = OTG_STATE_B_PERIPHERAL;
...@@ -2500,6 +2501,12 @@ static int musb_runtime_resume(struct device *dev) ...@@ -2500,6 +2501,12 @@ static int musb_runtime_resume(struct device *dev)
musb_restore_context(musb); musb_restore_context(musb);
first = 0; first = 0;
if (musb->need_finish_resume) {
musb->need_finish_resume = 0;
schedule_delayed_work(&musb->finish_resume_work,
msecs_to_jiffies(20));
}
return 0; return 0;
} }
......
...@@ -72,7 +72,6 @@ void musb_host_finish_resume(struct work_struct *work) ...@@ -72,7 +72,6 @@ void musb_host_finish_resume(struct work_struct *work)
musb->xceiv->otg->state = OTG_STATE_A_HOST; musb->xceiv->otg->state = OTG_STATE_A_HOST;
spin_unlock_irqrestore(&musb->lock, flags); spin_unlock_irqrestore(&musb->lock, flags);
musb_host_resume_root_hub(musb);
} }
void musb_port_suspend(struct musb *musb, bool do_suspend) void musb_port_suspend(struct musb *musb, bool do_suspend)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册