Skip to content

Commit 00a159a

Browse files
committed
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
2 parents bd5ff86 + a07ddce commit 00a159a

File tree

8 files changed

+20
-32
lines changed

8 files changed

+20
-32
lines changed

drivers/usb/dwc3/dwc3-exynos.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
7878
for (i = 0; i < exynos->num_clks; i++) {
7979
ret = clk_prepare_enable(exynos->clks[i]);
8080
if (ret) {
81-
while (--i > 0)
81+
while (i-- > 0)
8282
clk_disable_unprepare(exynos->clks[i]);
8383
return ret;
8484
}
@@ -223,7 +223,7 @@ static int dwc3_exynos_resume(struct device *dev)
223223
for (i = 0; i < exynos->num_clks; i++) {
224224
ret = clk_prepare_enable(exynos->clks[i]);
225225
if (ret) {
226-
while (--i > 0)
226+
while (i-- > 0)
227227
clk_disable_unprepare(exynos->clks[i]);
228228
return ret;
229229
}

drivers/usb/dwc3/gadget.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ static void dwc3_prepare_one_trb_linear(struct dwc3_ep *dep,
11191119
unsigned int maxp = usb_endpoint_maxp(dep->endpoint.desc);
11201120
unsigned int rem = length % maxp;
11211121

1122-
if (rem && usb_endpoint_dir_out(dep->endpoint.desc)) {
1122+
if ((!length || rem) && usb_endpoint_dir_out(dep->endpoint.desc)) {
11231123
struct dwc3 *dwc = dep->dwc;
11241124
struct dwc3_trb *trb;
11251125

drivers/usb/gadget/udc/net2272.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2083,7 +2083,7 @@ static irqreturn_t net2272_irq(int irq, void *_dev)
20832083
#if defined(PLX_PCI_RDK2)
20842084
/* see if PCI int for us by checking irqstat */
20852085
intcsr = readl(dev->rdk2.fpga_base_addr + RDK2_IRQSTAT);
2086-
if (!intcsr & (1 << NET2272_PCI_IRQ)) {
2086+
if (!(intcsr & (1 << NET2272_PCI_IRQ))) {
20872087
spin_unlock(&dev->lock);
20882088
return IRQ_NONE;
20892089
}

drivers/usb/musb/musb_gadget.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -452,13 +452,10 @@ void musb_g_tx(struct musb *musb, u8 epnum)
452452
}
453453

454454
if (request) {
455-
u8 is_dma = 0;
456-
bool short_packet = false;
457455

458456
trace_musb_req_tx(req);
459457

460458
if (dma && (csr & MUSB_TXCSR_DMAENAB)) {
461-
is_dma = 1;
462459
csr |= MUSB_TXCSR_P_WZC_BITS;
463460
csr &= ~(MUSB_TXCSR_DMAENAB | MUSB_TXCSR_P_UNDERRUN |
464461
MUSB_TXCSR_TXPKTRDY | MUSB_TXCSR_AUTOSET);
@@ -476,16 +473,8 @@ void musb_g_tx(struct musb *musb, u8 epnum)
476473
*/
477474
if ((request->zero && request->length)
478475
&& (request->length % musb_ep->packet_sz == 0)
479-
&& (request->actual == request->length))
480-
short_packet = true;
476+
&& (request->actual == request->length)) {
481477

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) {
489478
/*
490479
* On DMA completion, FIFO may not be
491480
* available yet...

drivers/usb/musb/musbhsdma.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,10 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data)
346346
channel->status = MUSB_DMA_STATUS_FREE;
347347

348348
/* 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))) {
355353
u8 epnum = musb_channel->epnum;
356354
int offset = musb->io.ep_offset(epnum,
357355
MUSB_TXCSR);
@@ -363,11 +361,14 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data)
363361
*/
364362
musb_ep_select(mbase, epnum);
365363
txcsr = musb_readw(mbase, offset);
366-
txcsr &= ~(MUSB_TXCSR_DMAENAB
364+
if (channel->desired_mode == 1) {
365+
txcsr &= ~(MUSB_TXCSR_DMAENAB
367366
| 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+
}
371372
txcsr |= MUSB_TXCSR_TXPKTRDY;
372373
musb_writew(mbase, offset, txcsr);
373374
}

drivers/usb/phy/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ config AB8500_USB
2121

2222
config FSL_USB2_OTG
2323
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
2525
depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y'
2626
select USB_PHY
2727
help

drivers/usb/phy/phy-am335x.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ static int am335x_phy_probe(struct platform_device *pdev)
6161
if (ret)
6262
return ret;
6363

64-
ret = usb_add_phy_dev(&am_phy->usb_phy_gen.phy);
65-
if (ret)
66-
return ret;
6764
am_phy->usb_phy_gen.phy.init = am335x_init;
6865
am_phy->usb_phy_gen.phy.shutdown = am335x_shutdown;
6966

@@ -82,7 +79,7 @@ static int am335x_phy_probe(struct platform_device *pdev)
8279
device_set_wakeup_enable(dev, false);
8380
phy_ctrl_power(am_phy->phy_ctrl, am_phy->id, am_phy->dr_mode, false);
8481

85-
return 0;
82+
return usb_add_phy_dev(&am_phy->usb_phy_gen.phy);
8683
}
8784

8885
static int am335x_phy_remove(struct platform_device *pdev)

drivers/usb/typec/tcpm/tcpm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2297,7 +2297,8 @@ static unsigned int tcpm_pd_select_pps_apdo(struct tcpm_port *port)
22972297
pdo_pps_apdo_max_voltage(snk));
22982298
port->pps_data.max_curr = min_pps_apdo_current(src, snk);
22992299
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));
23012302
port->pps_data.op_curr = min(port->pps_data.max_curr,
23022303
port->pps_data.op_curr);
23032304
}

0 commit comments

Comments
 (0)