diff options
author | Li Jun <jun.li@freescale.com> | 2014-11-25 12:08:48 +0800 |
---|---|---|
committer | Li Jun <jun.li@freescale.com> | 2015-06-23 17:50:55 +0800 |
commit | 9c18e5893b59710187de19a7042b404070bf0486 (patch) | |
tree | e54a27fe8076cb1b59b434065220aed04d2dd8fd | |
parent | 4d7c12ee0d1d5f542bc0027eb8d3a5be89e5b604 (diff) |
MLK-9897-2 usb: otg-fsm: check B-device state before sending polling request
While system resume, the connected udev as B-device may not has been resumed,
if HNP polling request is sent to it, HNP polling may fail, this patch adds
check of the udev state to make sure it finished resume and to be configured
state before sending host request message, otherwise try next HNP polling
request.
Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
(cherry picked from commit 2cff5eb7bd4feb70cd28ac4655e7433e57a17938)
-rw-r--r-- | drivers/usb/common/usb-otg-fsm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c index 0cc68b574336..b1894cb6a973 100644 --- a/drivers/usb/common/usb-otg-fsm.c +++ b/drivers/usb/common/usb-otg-fsm.c @@ -428,6 +428,12 @@ int otg_hnp_polling(struct otg_fsm *fsm) return -ENODEV; } + if (udev->state != USB_STATE_CONFIGURED) { + dev_dbg(&udev->dev, "the B dev is not resumed!\n"); + otg_add_timer(fsm, HNP_POLLING); + return -EPERM; + } + /* Get host request flag from connected USB device */ retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), |