diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-29 07:56:14 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-29 07:56:14 -0400 |
commit | 87be92b903abd0fafbfdde71f3caa24f9cd5ecbe (patch) | |
tree | c73dcafcea8a71f999b709f786d3a917566cdaf5 | |
parent | f276e002793cdb820862e8ea8f76769d56bba575 (diff) | |
parent | 072684e8c58d17e853f8e8b9f6d9ce2e58d2b036 (diff) |
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
-rw-r--r-- | drivers/usb/dwc3/dwc3-pci.c | 4 | ||||
-rw-r--r-- | drivers/usb/gadget/function/f_hid.c | 6 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/net2272.c | 1 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/net2280.c | 8 |
4 files changed, 11 insertions, 8 deletions
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index fdc6e4e403e8..8cced3609e24 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #define PCI_DEVICE_ID_INTEL_BXT_M 0x1aaa | 29 | #define PCI_DEVICE_ID_INTEL_BXT_M 0x1aaa |
30 | #define PCI_DEVICE_ID_INTEL_APL 0x5aaa | 30 | #define PCI_DEVICE_ID_INTEL_APL 0x5aaa |
31 | #define PCI_DEVICE_ID_INTEL_KBP 0xa2b0 | 31 | #define PCI_DEVICE_ID_INTEL_KBP 0xa2b0 |
32 | #define PCI_DEVICE_ID_INTEL_CMLH 0x02ee | ||
32 | #define PCI_DEVICE_ID_INTEL_GLK 0x31aa | 33 | #define PCI_DEVICE_ID_INTEL_GLK 0x31aa |
33 | #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee | 34 | #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee |
34 | #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e | 35 | #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e |
@@ -305,6 +306,9 @@ static const struct pci_device_id dwc3_pci_id_table[] = { | |||
305 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MRFLD), | 306 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_MRFLD), |
306 | (kernel_ulong_t) &dwc3_pci_mrfld_properties, }, | 307 | (kernel_ulong_t) &dwc3_pci_mrfld_properties, }, |
307 | 308 | ||
309 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_CMLH), | ||
310 | (kernel_ulong_t) &dwc3_pci_intel_properties, }, | ||
311 | |||
308 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_SPTLP), | 312 | { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_SPTLP), |
309 | (kernel_ulong_t) &dwc3_pci_intel_properties, }, | 313 | (kernel_ulong_t) &dwc3_pci_intel_properties, }, |
310 | 314 | ||
diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c index 75b113a5b25c..f3816a5c861e 100644 --- a/drivers/usb/gadget/function/f_hid.c +++ b/drivers/usb/gadget/function/f_hid.c | |||
@@ -391,20 +391,20 @@ try_again: | |||
391 | req->complete = f_hidg_req_complete; | 391 | req->complete = f_hidg_req_complete; |
392 | req->context = hidg; | 392 | req->context = hidg; |
393 | 393 | ||
394 | spin_unlock_irqrestore(&hidg->write_spinlock, flags); | ||
395 | |||
394 | status = usb_ep_queue(hidg->in_ep, req, GFP_ATOMIC); | 396 | status = usb_ep_queue(hidg->in_ep, req, GFP_ATOMIC); |
395 | if (status < 0) { | 397 | if (status < 0) { |
396 | ERROR(hidg->func.config->cdev, | 398 | ERROR(hidg->func.config->cdev, |
397 | "usb_ep_queue error on int endpoint %zd\n", status); | 399 | "usb_ep_queue error on int endpoint %zd\n", status); |
398 | goto release_write_pending_unlocked; | 400 | goto release_write_pending; |
399 | } else { | 401 | } else { |
400 | status = count; | 402 | status = count; |
401 | } | 403 | } |
402 | spin_unlock_irqrestore(&hidg->write_spinlock, flags); | ||
403 | 404 | ||
404 | return status; | 405 | return status; |
405 | release_write_pending: | 406 | release_write_pending: |
406 | spin_lock_irqsave(&hidg->write_spinlock, flags); | 407 | spin_lock_irqsave(&hidg->write_spinlock, flags); |
407 | release_write_pending_unlocked: | ||
408 | hidg->write_pending = 0; | 408 | hidg->write_pending = 0; |
409 | spin_unlock_irqrestore(&hidg->write_spinlock, flags); | 409 | spin_unlock_irqrestore(&hidg->write_spinlock, flags); |
410 | 410 | ||
diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c index b77f3126580e..c2011cd7df8c 100644 --- a/drivers/usb/gadget/udc/net2272.c +++ b/drivers/usb/gadget/udc/net2272.c | |||
@@ -945,6 +945,7 @@ net2272_dequeue(struct usb_ep *_ep, struct usb_request *_req) | |||
945 | break; | 945 | break; |
946 | } | 946 | } |
947 | if (&req->req != _req) { | 947 | if (&req->req != _req) { |
948 | ep->stopped = stopped; | ||
948 | spin_unlock_irqrestore(&ep->dev->lock, flags); | 949 | spin_unlock_irqrestore(&ep->dev->lock, flags); |
949 | return -EINVAL; | 950 | return -EINVAL; |
950 | } | 951 | } |
diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c index f63f82450bf4..898339e5df10 100644 --- a/drivers/usb/gadget/udc/net2280.c +++ b/drivers/usb/gadget/udc/net2280.c | |||
@@ -866,9 +866,6 @@ static void start_queue(struct net2280_ep *ep, u32 dmactl, u32 td_dma) | |||
866 | (void) readl(&ep->dev->pci->pcimstctl); | 866 | (void) readl(&ep->dev->pci->pcimstctl); |
867 | 867 | ||
868 | writel(BIT(DMA_START), &dma->dmastat); | 868 | writel(BIT(DMA_START), &dma->dmastat); |
869 | |||
870 | if (!ep->is_in) | ||
871 | stop_out_naking(ep); | ||
872 | } | 869 | } |
873 | 870 | ||
874 | static void start_dma(struct net2280_ep *ep, struct net2280_request *req) | 871 | 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) | |||
907 | writel(BIT(DMA_START), &dma->dmastat); | 904 | writel(BIT(DMA_START), &dma->dmastat); |
908 | return; | 905 | return; |
909 | } | 906 | } |
907 | stop_out_naking(ep); | ||
910 | } | 908 | } |
911 | 909 | ||
912 | tmp = dmactl_default; | 910 | tmp = dmactl_default; |
@@ -1275,9 +1273,9 @@ static int net2280_dequeue(struct usb_ep *_ep, struct usb_request *_req) | |||
1275 | break; | 1273 | break; |
1276 | } | 1274 | } |
1277 | if (&req->req != _req) { | 1275 | if (&req->req != _req) { |
1276 | ep->stopped = stopped; | ||
1278 | spin_unlock_irqrestore(&ep->dev->lock, flags); | 1277 | spin_unlock_irqrestore(&ep->dev->lock, flags); |
1279 | dev_err(&ep->dev->pdev->dev, "%s: Request mismatch\n", | 1278 | ep_dbg(ep->dev, "%s: Request mismatch\n", __func__); |
1280 | __func__); | ||
1281 | return -EINVAL; | 1279 | return -EINVAL; |
1282 | } | 1280 | } |
1283 | 1281 | ||