Skip to content

Commit

Permalink
Merge tag 'usb-v5.13-rc6' 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:

Two bug fixes for cdns3 and cdnsp

* tag 'usb-v5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb:
  usb: cdnsp: Fix deadlock issue in cdnsp_thread_irq_handler
  usb: cdns3: Enable TDL_CHK only for OUT ep
  • Loading branch information
Greg Kroah-Hartman committed Jun 9, 2021
2 parents 1ca01c0 + a9aecef commit a39b7ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 3 additions & 5 deletions drivers/usb/cdns3/cdns3-gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,7 @@ static void cdns3_configure_dmult(struct cdns3_device *priv_dev,
else
mask = BIT(priv_ep->num);

if (priv_ep->type != USB_ENDPOINT_XFER_ISOC) {
if (priv_ep->type != USB_ENDPOINT_XFER_ISOC && !priv_ep->dir) {
cdns3_set_register_bit(&regs->tdl_from_trb, mask);
cdns3_set_register_bit(&regs->tdl_beh, mask);
cdns3_set_register_bit(&regs->tdl_beh2, mask);
Expand Down Expand Up @@ -2046,15 +2046,13 @@ int cdns3_ep_config(struct cdns3_endpoint *priv_ep, bool enable)
case USB_ENDPOINT_XFER_INT:
ep_cfg = EP_CFG_EPTYPE(USB_ENDPOINT_XFER_INT);

if ((priv_dev->dev_ver == DEV_VER_V2 && !priv_ep->dir) ||
priv_dev->dev_ver > DEV_VER_V2)
if (priv_dev->dev_ver >= DEV_VER_V2 && !priv_ep->dir)
ep_cfg |= EP_CFG_TDL_CHK;
break;
case USB_ENDPOINT_XFER_BULK:
ep_cfg = EP_CFG_EPTYPE(USB_ENDPOINT_XFER_BULK);

if ((priv_dev->dev_ver == DEV_VER_V2 && !priv_ep->dir) ||
priv_dev->dev_ver > DEV_VER_V2)
if (priv_dev->dev_ver >= DEV_VER_V2 && !priv_ep->dir)
ep_cfg |= EP_CFG_TDL_CHK;
break;
default:
Expand Down
7 changes: 4 additions & 3 deletions drivers/usb/cdns3/cdnsp-ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1517,13 +1517,14 @@ irqreturn_t cdnsp_thread_irq_handler(int irq, void *data)
{
struct cdnsp_device *pdev = (struct cdnsp_device *)data;
union cdnsp_trb *event_ring_deq;
unsigned long flags;
int counter = 0;

spin_lock(&pdev->lock);
spin_lock_irqsave(&pdev->lock, flags);

if (pdev->cdnsp_state & (CDNSP_STATE_HALTED | CDNSP_STATE_DYING)) {
cdnsp_died(pdev);
spin_unlock(&pdev->lock);
spin_unlock_irqrestore(&pdev->lock, flags);
return IRQ_HANDLED;
}

Expand All @@ -1539,7 +1540,7 @@ irqreturn_t cdnsp_thread_irq_handler(int irq, void *data)

cdnsp_update_erst_dequeue(pdev, event_ring_deq, 1);

spin_unlock(&pdev->lock);
spin_unlock_irqrestore(&pdev->lock, flags);

return IRQ_HANDLED;
}
Expand Down

0 comments on commit a39b7ba

Please sign in to comment.