Skip to content

Commit

Permalink
Merge tag 'usb-v5.13-rc3' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/peter.chen/usb into usb-linus

Peter writes:

Some small bug fixes for both chipidea and cdns USB

* tag 'usb-v5.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb:
  usb: chipidea: udc: assign interrupt number to USB gadget structure
  usb: cdnsp: Fix lack of removing request from pending list.
  usb: cdns3: Fix runtime PM imbalance on error
  • Loading branch information
Greg Kroah-Hartman committed May 22, 2021
2 parents 746e4ac + 9e3927f commit 2cbd838
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion drivers/usb/cdns3/cdns3-gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -3268,8 +3268,10 @@ static int __cdns3_gadget_init(struct cdns *cdns)
pm_runtime_get_sync(cdns->dev);

ret = cdns3_gadget_start(cdns);
if (ret)
if (ret) {
pm_runtime_put_sync(cdns->dev);
return ret;
}

/*
* Because interrupt line can be shared with other components in
Expand Down
14 changes: 7 additions & 7 deletions drivers/usb/cdns3/cdnsp-gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,17 +422,17 @@ int cdnsp_ep_enqueue(struct cdnsp_ep *pep, struct cdnsp_request *preq)
int cdnsp_ep_dequeue(struct cdnsp_ep *pep, struct cdnsp_request *preq)
{
struct cdnsp_device *pdev = pep->pdev;
int ret;
int ret_stop = 0;
int ret_rem;

trace_cdnsp_request_dequeue(preq);

if (GET_EP_CTX_STATE(pep->out_ctx) == EP_STATE_RUNNING) {
ret = cdnsp_cmd_stop_ep(pdev, pep);
if (ret)
return ret;
}
if (GET_EP_CTX_STATE(pep->out_ctx) == EP_STATE_RUNNING)
ret_stop = cdnsp_cmd_stop_ep(pdev, pep);

ret_rem = cdnsp_remove_request(pdev, preq, pep);

return cdnsp_remove_request(pdev, preq, pep);
return ret_rem ? ret_rem : ret_stop;
}

static void cdnsp_zero_in_ctx(struct cdnsp_device *pdev)
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/chipidea/udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2061,6 +2061,7 @@ static int udc_start(struct ci_hdrc *ci)
ci->gadget.name = ci->platdata->name;
ci->gadget.otg_caps = otg_caps;
ci->gadget.sg_supported = 1;
ci->gadget.irq = ci->irq;

if (ci->platdata->flags & CI_HDRC_REQUIRES_ALIGNED_DMA)
ci->gadget.quirk_avoids_skb_reserve = 1;
Expand Down

0 comments on commit 2cbd838

Please sign in to comment.