diff options
| author | Mark Brown <[email protected]> | 2020-10-28 21:36:51 +0000 |
|---|---|---|
| committer | Mark Brown <[email protected]> | 2020-10-28 21:36:51 +0000 |
| commit | 3bfd5f422f07a10f485c3f046431783c7c4004f2 (patch) | |
| tree | 7e990a251c825482216a0355177ef80874b3c0cb /drivers/usb/cdns3/ep0.c | |
| parent | 43b6bf406cd0319e522638f97c9086b7beebaeaa (diff) | |
| parent | 3650b228f83adda7e5ee532e2b90429c03f7b9ec (diff) | |
Merge tag 'v5.10-rc1' into spi-5.10
Linux 5.10-rc1
Diffstat (limited to 'drivers/usb/cdns3/ep0.c')
| -rw-r--r-- | drivers/usb/cdns3/ep0.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/usb/cdns3/ep0.c b/drivers/usb/cdns3/ep0.c index d9779abc65b2..4761c852d9c4 100644 --- a/drivers/usb/cdns3/ep0.c +++ b/drivers/usb/cdns3/ep0.c @@ -717,9 +717,17 @@ static int cdns3_gadget_ep0_queue(struct usb_ep *ep, /* send STATUS stage. Should be called only for SET_CONFIGURATION */ if (priv_dev->ep0_stage == CDNS3_STATUS_STAGE) { + u32 val; + cdns3_select_ep(priv_dev, 0x00); cdns3_set_hw_configuration(priv_dev); cdns3_ep0_complete_setup(priv_dev, 0, 1); + /* wait until configuration set */ + ret = readl_poll_timeout_atomic(&priv_dev->regs->usb_sts, val, + val & USB_STS_CFGSTS_MASK, 1, 100); + if (ret == -ETIMEDOUT) + dev_warn(priv_dev->dev, "timeout for waiting configuration set\n"); + request->actual = 0; priv_dev->status_completion_no_call = true; priv_dev->pending_status_request = request; @@ -731,7 +739,7 @@ static int cdns3_gadget_ep0_queue(struct usb_ep *ep, * ep0_queue is back. */ queue_work(system_freezable_wq, &priv_dev->pending_status_wq); - return 0; + return ret; } if (!list_empty(&priv_ep->pending_req_list)) { |