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