Re: Root hub autosusend delay

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

 



On Wed, Jan 23, 2013 at 04:44:54PM +0800, Ming Lei wrote:
> Hi Peter,
> 
> On Wed, Jan 23, 2013 at 2:15 PM, Peter Chen <peter.chen@xxxxxxxxxxxxx> wrote:
> > Hi Ming, I also find this problem at my platform.
> > (At chipidea controller, the resume signal will be ended about 21ms
> >  automatically)
> >
> > Neither delay 30ms at hub_events, nor revert your patch
> > (596d789a211d134dc5f94d1e5957248c204ef850) can work.
> 
> Good point, looks I can reproduce the problem on Pandaboard too,
> and same result with you, but root cause of the problem is what Alan
> mentioned, the port change can't be retrieved during root hub ports
> resuming.
> 
> Looks a little change on my previous patch might fix the problem, could
> you test the below patch to see if it can fix that on your board?
Hi Ming,

As I can't apply your patch directly, I just try below code.
It works, no "hub 1-0:1.0: hub_suspend" is called.

>   init2:
> +	if (type == HUB_RESUME) {
> +		/* root hub is sending resume signal, so wait for its completion */
> +		if (!hdev->parent && usb_hcd_get_rh_ports_resuming(hdev)) {
> +			dev_dbg(&hdev->dev, "wait for ports resuming over\n");
> +			msleep(30);
> +			usb_hcd_set_rh_ports_resuming(hdev, 0);
> +			dev_dbg(&hdev->dev, "ports resuming over\n");
> +		}
> +	}
> 

Do you know the reason why hub_suspend is called if there is a
30ms delay at hub_resume? Below is the log with and without 30ms
at your patch, the "process" just means kick_khubd is called from
process context.

---------------------------------------log 1---------------------------------
usb usb1: usb wakeup-resume
usb usb1: usb auto-resume
ci_hdrc ci_hdrc.0: resume root hub
hub 1-0:1.0: hub_resume
usb usb1: wait for ports resuming over
hub 1-0:1.0: port 1: status 0107 change 0000
process
hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0000
hub 1-0:1.0: hub_suspend
usb usb1: bus auto-suspend, wakeup 1
ci_hdrc ci_hdrc.0: suspend root hub
ci_hdrc ci_hdrc.0: suspend failed because a port is resuming
usb usb1: bus suspend fail, err -16
hub 1-0:1.0: hub_resume
usb usb1: wait for ports resuming over
ci_hdrc ci_hdrc.0: GetStatus port:1 status 10001805 8  ACK POWER sig=j PE CONNECT
hub 1-0:1.0: port 1: status 0103 change 0004
process
hub 1-0:1.0: state 7 ports 1 chg 0002 evt 0000
ci_hdrc ci_hdrc.0: GetStatus port:1 status 10001805 8  ACK POWER sig=j PE CONNECT
usb 1-1: usb wakeup-resume
usb 1-1: finish resume
hub 1-1:1.0: hub_resume

--------------------------------------log 2-----------------------------------------
usb usb1: usb wakeup-resume
usb usb1: usb auto-resume
ci_hdrc ci_hdrc.0: resume root hub
hub 1-0:1.0: hub_resume
usb usb1: wait for ports resuming over
ci_hdrc ci_hdrc.0: GetStatus port:1 status 10001805 8  ACK POWER sig=j PE CONNECT
hub 1-0:1.0: port 1: status 0103 change 0004
process
hub 1-0:1.0: state 7 ports 1 chg 0002 evt 0000
ci_hdrc ci_hdrc.0: GetStatus port:1 status 10001805 8  ACK POWER sig=j PE CONNECT
usb 1-1: usb wakeup-resume
usb 1-1: finish resume
hub 1-1:1.0: hub_resume

Thanks.
-- 

Best Regards,
Peter Chen

--
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


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

  Powered by Linux