Skip to content

Commit 87be92b

Browse files
committed
Merge tag 'fixes-for-v5.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus
Felipe writes: usb: fixes for v5.1-rc2 One deadlock fix on f_hid. NET2280 got a fix on its dequeue implementation and a fix for overrun of OUT messages. DWC3 learned about another Intel product: Comment Lake PCH. NET2272 got a similar fix to NET2280 on its dequeue implementation. * tag 'fixes-for-v5.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: USB: gadget: f_hid: fix deadlock in f_hidg_write() usb: gadget: net2272: Fix net2272_dequeue() usb: gadget: net2280: Fix net2280_dequeue() usb: gadget: net2280: Fix overrun of OUT messages usb: dwc3: pci: add support for Comet Lake PCH ID
2 parents f276e00 + 072684e commit 87be92b

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

drivers/usb/dwc3/dwc3-pci.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#define PCI_DEVICE_ID_INTEL_BXT_M 0x1aaa
3030
#define PCI_DEVICE_ID_INTEL_APL 0x5aaa
3131
#define PCI_DEVICE_ID_INTEL_KBP 0xa2b0
32+
#define PCI_DEVICE_ID_INTEL_CMLH 0x02ee
3233
#define PCI_DEVICE_ID_INTEL_GLK 0x31aa
3334
#define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee
3435
#define PCI_DEVICE_ID_INTEL_CNPH 0xa36e
@@ -305,6 +306,9 @@ static const struct pci_device_id dwc3_pci_id_table[] = {
305306
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MRFLD),
306307
(kernel_ulong_t) &dwc3_pci_mrfld_properties, },
307308

309+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_CMLH),
310+
(kernel_ulong_t) &dwc3_pci_intel_properties, },
311+
308312
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_SPTLP),
309313
(kernel_ulong_t) &dwc3_pci_intel_properties, },
310314

drivers/usb/gadget/function/f_hid.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,20 +391,20 @@ static ssize_t f_hidg_write(struct file *file, const char __user *buffer,
391391
req->complete = f_hidg_req_complete;
392392
req->context = hidg;
393393

394+
spin_unlock_irqrestore(&hidg->write_spinlock, flags);
395+
394396
status = usb_ep_queue(hidg->in_ep, req, GFP_ATOMIC);
395397
if (status < 0) {
396398
ERROR(hidg->func.config->cdev,
397399
"usb_ep_queue error on int endpoint %zd\n", status);
398-
goto release_write_pending_unlocked;
400+
goto release_write_pending;
399401
} else {
400402
status = count;
401403
}
402-
spin_unlock_irqrestore(&hidg->write_spinlock, flags);
403404

404405
return status;
405406
release_write_pending:
406407
spin_lock_irqsave(&hidg->write_spinlock, flags);
407-
release_write_pending_unlocked:
408408
hidg->write_pending = 0;
409409
spin_unlock_irqrestore(&hidg->write_spinlock, flags);
410410

drivers/usb/gadget/udc/net2272.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,7 @@ net2272_dequeue(struct usb_ep *_ep, struct usb_request *_req)
945945
break;
946946
}
947947
if (&req->req != _req) {
948+
ep->stopped = stopped;
948949
spin_unlock_irqrestore(&ep->dev->lock, flags);
949950
return -EINVAL;
950951
}

drivers/usb/gadget/udc/net2280.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -866,9 +866,6 @@ static void start_queue(struct net2280_ep *ep, u32 dmactl, u32 td_dma)
866866
(void) readl(&ep->dev->pci->pcimstctl);
867867

868868
writel(BIT(DMA_START), &dma->dmastat);
869-
870-
if (!ep->is_in)
871-
stop_out_naking(ep);
872869
}
873870

874871
static void start_dma(struct net2280_ep *ep, struct net2280_request *req)
@@ -907,6 +904,7 @@ static void start_dma(struct net2280_ep *ep, struct net2280_request *req)
907904
writel(BIT(DMA_START), &dma->dmastat);
908905
return;
909906
}
907+
stop_out_naking(ep);
910908
}
911909

912910
tmp = dmactl_default;
@@ -1275,9 +1273,9 @@ static int net2280_dequeue(struct usb_ep *_ep, struct usb_request *_req)
12751273
break;
12761274
}
12771275
if (&req->req != _req) {
1276+
ep->stopped = stopped;
12781277
spin_unlock_irqrestore(&ep->dev->lock, flags);
1279-
dev_err(&ep->dev->pdev->dev, "%s: Request mismatch\n",
1280-
__func__);
1278+
ep_dbg(ep->dev, "%s: Request mismatch\n", __func__);
12811279
return -EINVAL;
12821280
}
12831281

0 commit comments

Comments
 (0)