History

Merge tag 'usb-5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Grek KH: "Here are some small USB fixes for 5.0-rc6. Nothing huge, the normal amount of USB gadget fixes as well as some USB phy fixes. There's also a typec fix as well. Full details are in the shortlog. All of these have been in linux-next for a while with no reported issues" * tag 'usb-5.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: typec: tcpm: Correct the PPS out_volt calculation usb: gadget: musb: fix short isoc packets with inventra dma usb: phy: am335x: fix race condition in _probe usb: dwc3: exynos: Fix error handling of clk_prepare_enable usb: phy: fix link errors usb: gadget: udc: net2272: Fix bitwise and boolean operations usb: dwc3: gadget: Handle 0 xfer length for OUT EP

Linus Torvalds committed 7 years ago

Commit 00a159a2 parents bd5ff86 a07ddce8 files · +20 −32Browse files

Unified · Split

8 files
  1. drivers/usb/dwc3/dwc3-exynos.c +2 −2
  2. drivers/usb/dwc3/gadget.c +1 −1
  3. drivers/usb/gadget/udc/net2272.c +1 −1
  4. drivers/usb/musb/musb_gadget.c +1 −12
  5. drivers/usb/musb/musbhsdma.c +11 −10
  6. drivers/usb/phy/Kconfig +1 −1
  7. drivers/usb/phy/phy-am335x.c +1 −4
  8. drivers/usb/typec/tcpm/tcpm.c +2 −1
drivers/usb/dwc3/dwc3-exynos.c+2−2
@@ -78,7 +78,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev) · 77 unmodified lines
78 for (i = 0; i < exynos->num_clks; i++) {78 for (i = 0; i < exynos->num_clks; i++) {
79 ret = clk_prepare_enable(exynos->clks[i]);79 ret = clk_prepare_enable(exynos->clks[i]);
80 if (ret) {80 if (ret) {
81 while (--i > 0)81 while (i-- > 0)
82 clk_disable_unprepare(exynos->clks[i]);82 clk_disable_unprepare(exynos->clks[i]);
83 return ret;83 return ret;
84 }84 }
@@ -223,7 +223,7 @@ static int dwc3_exynos_resume(struct device *dev) · 138 unmodified lines
223 for (i = 0; i < exynos->num_clks; i++) {223 for (i = 0; i < exynos->num_clks; i++) {
224 ret = clk_prepare_enable(exynos->clks[i]);224 ret = clk_prepare_enable(exynos->clks[i]);
225 if (ret) {225 if (ret) {
226 while (--i > 0)226 while (i-- > 0)
227 clk_disable_unprepare(exynos->clks[i]);227 clk_disable_unprepare(exynos->clks[i]);
228 return ret;228 return ret;
229 }229 }
drivers/usb/dwc3/gadget.c+1−1
@@ -1119,7 +1119,7 @@ static void dwc3_prepare_one_trb_linear(struct dwc3_ep *dep, · 1118 unmodified lines
1119 unsigned int maxp = usb_endpoint_maxp(dep->endpoint.desc);1119 unsigned int maxp = usb_endpoint_maxp(dep->endpoint.desc);
1120 unsigned int rem = length % maxp;1120 unsigned int rem = length % maxp;
1121 1121
1122 if (rem && usb_endpoint_dir_out(dep->endpoint.desc)) {1122 if ((!length || rem) && usb_endpoint_dir_out(dep->endpoint.desc)) {
1123 struct dwc3 *dwc = dep->dwc;1123 struct dwc3 *dwc = dep->dwc;
1124 struct dwc3_trb *trb;1124 struct dwc3_trb *trb;
1125 1125
drivers/usb/gadget/udc/net2272.c+1−1
@@ -2083,7 +2083,7 @@ static irqreturn_t net2272_irq(int irq, void *_dev) · 2082 unmodified lines
2083#if defined(PLX_PCI_RDK2)2083#if defined(PLX_PCI_RDK2)
2084 /* see if PCI int for us by checking irqstat */2084 /* see if PCI int for us by checking irqstat */
2085 intcsr = readl(dev->rdk2.fpga_base_addr + RDK2_IRQSTAT);2085 intcsr = readl(dev->rdk2.fpga_base_addr + RDK2_IRQSTAT);
2086 if (!intcsr & (1 << NET2272_PCI_IRQ)) {2086 if (!(intcsr & (1 << NET2272_PCI_IRQ))) {
2087 spin_unlock(&dev->lock);2087 spin_unlock(&dev->lock);
2088 return IRQ_NONE;2088 return IRQ_NONE;
2089 }2089 }
drivers/usb/musb/musb_gadget.c+1−12
@@ -452,13 +452,10 @@ void musb_g_tx(struct musb *musb, u8 epnum) · 451 unmodified lines
452 }452 }
453 453
454 if (request) {454 if (request) {
455 u8 is_dma = 0;
456 bool short_packet = false;
457 455
458 trace_musb_req_tx(req);456 trace_musb_req_tx(req);
459 457
460 if (dma && (csr & MUSB_TXCSR_DMAENAB)) {458 if (dma && (csr & MUSB_TXCSR_DMAENAB)) {
461 is_dma = 1;
462 csr |= MUSB_TXCSR_P_WZC_BITS;459 csr |= MUSB_TXCSR_P_WZC_BITS;
463 csr &= ~(MUSB_TXCSR_DMAENAB | MUSB_TXCSR_P_UNDERRUN |460 csr &= ~(MUSB_TXCSR_DMAENAB | MUSB_TXCSR_P_UNDERRUN |
464 MUSB_TXCSR_TXPKTRDY | MUSB_TXCSR_AUTOSET);461 MUSB_TXCSR_TXPKTRDY | MUSB_TXCSR_AUTOSET);
@@ -476,16 +473,8 @@ void musb_g_tx(struct musb *musb, u8 epnum) · 11 unmodified lines
476 */473 */
477 if ((request->zero && request->length)474 if ((request->zero && request->length)
478 && (request->length % musb_ep->packet_sz == 0)475 && (request->length % musb_ep->packet_sz == 0)
479 && (request->actual == request->length))476 && (request->actual == request->length)) {
480 short_packet = true;
481 477
482 if ((musb_dma_inventra(musb) || musb_dma_ux500(musb)) &&
483 (is_dma && (!dma->desired_mode ||
484 (request->actual &
485 (musb_ep->packet_sz - 1)))))
486 short_packet = true;
487
488 if (short_packet) {
489 /*478 /*
490 * On DMA completion, FIFO may not be479 * On DMA completion, FIFO may not be
491 * available yet...480 * available yet...
drivers/usb/musb/musbhsdma.c+11−10
@@ -346,12 +346,10 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) · 345 unmodified lines
346 channel->status = MUSB_DMA_STATUS_FREE;346 channel->status = MUSB_DMA_STATUS_FREE;
347 347
348 /* completed */348 /* completed */
349 if ((devctl & MUSB_DEVCTL_HM)349 if (musb_channel->transmit &&
350 && (musb_channel->transmit)350 (!channel->desired_mode ||
351 && ((channel->desired_mode == 0)351 (channel->actual_len %
352 || (channel->actual_len &352 musb_channel->max_packet_sz))) {
353 (musb_channel->max_packet_sz - 1)))
354 ) {
355 u8 epnum = musb_channel->epnum;353 u8 epnum = musb_channel->epnum;
356 int offset = musb->io.ep_offset(epnum,354 int offset = musb->io.ep_offset(epnum,
357 MUSB_TXCSR);355 MUSB_TXCSR);
@@ -363,11 +361,14 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) · 5 unmodified lines
363 */361 */
364 musb_ep_select(mbase, epnum);362 musb_ep_select(mbase, epnum);
365 txcsr = musb_readw(mbase, offset);363 txcsr = musb_readw(mbase, offset);
366 txcsr &= ~(MUSB_TXCSR_DMAENAB364 if (channel->desired_mode == 1) {
365 txcsr &= ~(MUSB_TXCSR_DMAENAB
367 | MUSB_TXCSR_AUTOSET);366 | MUSB_TXCSR_AUTOSET);
368 musb_writew(mbase, offset, txcsr);367 musb_writew(mbase, offset, txcsr);
369 /* Send out the packet */368 /* Send out the packet */
370 txcsr &= ~MUSB_TXCSR_DMAMODE;369 txcsr &= ~MUSB_TXCSR_DMAMODE;
370 txcsr |= MUSB_TXCSR_DMAENAB;
371 }
371 txcsr |= MUSB_TXCSR_TXPKTRDY;372 txcsr |= MUSB_TXCSR_TXPKTRDY;
372 musb_writew(mbase, offset, txcsr);373 musb_writew(mbase, offset, txcsr);
373 }374 }
drivers/usb/phy/Kconfig+1−1
@@ -21,7 +21,7 @@ config AB8500_USB · 20 unmodified lines
21 21
22config FSL_USB2_OTG22config FSL_USB2_OTG
23 bool "Freescale USB OTG Transceiver Driver"23 bool "Freescale USB OTG Transceiver Driver"
24 depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_OTG_FSM && PM24 depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_OTG_FSM=y && PM
25 depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y'25 depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y'
26 select USB_PHY26 select USB_PHY
27 help27 help
drivers/usb/phy/phy-am335x.c+1−4
@@ -61,9 +61,6 @@ static int am335x_phy_probe(struct platform_device *pdev) · 60 unmodified lines
61 if (ret)61 if (ret)
62 return ret;62 return ret;
63 63
64 ret = usb_add_phy_dev(&am_phy->usb_phy_gen.phy);
65 if (ret)
66 return ret;
67 am_phy->usb_phy_gen.phy.init = am335x_init;64 am_phy->usb_phy_gen.phy.init = am335x_init;
68 am_phy->usb_phy_gen.phy.shutdown = am335x_shutdown;65 am_phy->usb_phy_gen.phy.shutdown = am335x_shutdown;
69 66
@@ -82,7 +79,7 @@ static int am335x_phy_probe(struct platform_device *pdev) · 12 unmodified lines
82 device_set_wakeup_enable(dev, false);79 device_set_wakeup_enable(dev, false);
83 phy_ctrl_power(am_phy->phy_ctrl, am_phy->id, am_phy->dr_mode, false);80 phy_ctrl_power(am_phy->phy_ctrl, am_phy->id, am_phy->dr_mode, false);
84 81
85 return 0;82 return usb_add_phy_dev(&am_phy->usb_phy_gen.phy);
86}83}
87 84
88static int am335x_phy_remove(struct platform_device *pdev)85static int am335x_phy_remove(struct platform_device *pdev)
drivers/usb/typec/tcpm/tcpm.c+2−1
@@ -2297,7 +2297,8 @@ static unsigned int tcpm_pd_select_pps_apdo(struct tcpm_port *port) · 2296 unmodified lines
2297 pdo_pps_apdo_max_voltage(snk));2297 pdo_pps_apdo_max_voltage(snk));
2298 port->pps_data.max_curr = min_pps_apdo_current(src, snk);2298 port->pps_data.max_curr = min_pps_apdo_current(src, snk);
2299 port->pps_data.out_volt = min(port->pps_data.max_volt,2299 port->pps_data.out_volt = min(port->pps_data.max_volt,
2300 port->pps_data.out_volt);2300 max(port->pps_data.min_volt,
2301 port->pps_data.out_volt));
2301 port->pps_data.op_curr = min(port->pps_data.max_curr,2302 port->pps_data.op_curr = min(port->pps_data.max_curr,
2302 port->pps_data.op_curr);2303 port->pps_data.op_curr);
2303 }2304 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t