Commit 00a159a0 authored by Linus Torvalds's avatar Linus Torvalds

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
parents bd5ff862 a07ddce4
...@@ -78,7 +78,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev) ...@@ -78,7 +78,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
for (i = 0; i < exynos->num_clks; i++) { for (i = 0; i < exynos->num_clks; i++) {
ret = clk_prepare_enable(exynos->clks[i]); ret = clk_prepare_enable(exynos->clks[i]);
if (ret) { if (ret) {
while (--i > 0) while (i-- > 0)
clk_disable_unprepare(exynos->clks[i]); clk_disable_unprepare(exynos->clks[i]);
return ret; return ret;
} }
...@@ -223,7 +223,7 @@ static int dwc3_exynos_resume(struct device *dev) ...@@ -223,7 +223,7 @@ static int dwc3_exynos_resume(struct device *dev)
for (i = 0; i < exynos->num_clks; i++) { for (i = 0; i < exynos->num_clks; i++) {
ret = clk_prepare_enable(exynos->clks[i]); ret = clk_prepare_enable(exynos->clks[i]);
if (ret) { if (ret) {
while (--i > 0) while (i-- > 0)
clk_disable_unprepare(exynos->clks[i]); clk_disable_unprepare(exynos->clks[i]);
return ret; return ret;
} }
......
...@@ -1119,7 +1119,7 @@ static void dwc3_prepare_one_trb_linear(struct dwc3_ep *dep, ...@@ -1119,7 +1119,7 @@ static void dwc3_prepare_one_trb_linear(struct dwc3_ep *dep,
unsigned int maxp = usb_endpoint_maxp(dep->endpoint.desc); unsigned int maxp = usb_endpoint_maxp(dep->endpoint.desc);
unsigned int rem = length % maxp; unsigned int rem = length % maxp;
if (rem && usb_endpoint_dir_out(dep->endpoint.desc)) { if ((!length || rem) && usb_endpoint_dir_out(dep->endpoint.desc)) {
struct dwc3 *dwc = dep->dwc; struct dwc3 *dwc = dep->dwc;
struct dwc3_trb *trb; struct dwc3_trb *trb;
......
...@@ -2083,7 +2083,7 @@ static irqreturn_t net2272_irq(int irq, void *_dev) ...@@ -2083,7 +2083,7 @@ static irqreturn_t net2272_irq(int irq, void *_dev)
#if defined(PLX_PCI_RDK2) #if defined(PLX_PCI_RDK2)
/* see if PCI int for us by checking irqstat */ /* see if PCI int for us by checking irqstat */
intcsr = readl(dev->rdk2.fpga_base_addr + RDK2_IRQSTAT); intcsr = readl(dev->rdk2.fpga_base_addr + RDK2_IRQSTAT);
if (!intcsr & (1 << NET2272_PCI_IRQ)) { if (!(intcsr & (1 << NET2272_PCI_IRQ))) {
spin_unlock(&dev->lock); spin_unlock(&dev->lock);
return IRQ_NONE; return IRQ_NONE;
} }
......
...@@ -452,13 +452,10 @@ void musb_g_tx(struct musb *musb, u8 epnum) ...@@ -452,13 +452,10 @@ void musb_g_tx(struct musb *musb, u8 epnum)
} }
if (request) { if (request) {
u8 is_dma = 0;
bool short_packet = false;
trace_musb_req_tx(req); trace_musb_req_tx(req);
if (dma && (csr & MUSB_TXCSR_DMAENAB)) { if (dma && (csr & MUSB_TXCSR_DMAENAB)) {
is_dma = 1;
csr |= MUSB_TXCSR_P_WZC_BITS; csr |= MUSB_TXCSR_P_WZC_BITS;
csr &= ~(MUSB_TXCSR_DMAENAB | MUSB_TXCSR_P_UNDERRUN | csr &= ~(MUSB_TXCSR_DMAENAB | MUSB_TXCSR_P_UNDERRUN |
MUSB_TXCSR_TXPKTRDY | MUSB_TXCSR_AUTOSET); MUSB_TXCSR_TXPKTRDY | MUSB_TXCSR_AUTOSET);
...@@ -476,16 +473,8 @@ void musb_g_tx(struct musb *musb, u8 epnum) ...@@ -476,16 +473,8 @@ void musb_g_tx(struct musb *musb, u8 epnum)
*/ */
if ((request->zero && request->length) if ((request->zero && request->length)
&& (request->length % musb_ep->packet_sz == 0) && (request->length % musb_ep->packet_sz == 0)
&& (request->actual == request->length)) && (request->actual == request->length)) {
short_packet = true;
if ((musb_dma_inventra(musb) || musb_dma_ux500(musb)) &&
(is_dma && (!dma->desired_mode ||
(request->actual &
(musb_ep->packet_sz - 1)))))
short_packet = true;
if (short_packet) {
/* /*
* On DMA completion, FIFO may not be * On DMA completion, FIFO may not be
* available yet... * available yet...
......
...@@ -346,12 +346,10 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) ...@@ -346,12 +346,10 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data)
channel->status = MUSB_DMA_STATUS_FREE; channel->status = MUSB_DMA_STATUS_FREE;
/* completed */ /* completed */
if ((devctl & MUSB_DEVCTL_HM) if (musb_channel->transmit &&
&& (musb_channel->transmit) (!channel->desired_mode ||
&& ((channel->desired_mode == 0) (channel->actual_len %
|| (channel->actual_len & musb_channel->max_packet_sz))) {
(musb_channel->max_packet_sz - 1)))
) {
u8 epnum = musb_channel->epnum; u8 epnum = musb_channel->epnum;
int offset = musb->io.ep_offset(epnum, int offset = musb->io.ep_offset(epnum,
MUSB_TXCSR); MUSB_TXCSR);
...@@ -363,11 +361,14 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data) ...@@ -363,11 +361,14 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data)
*/ */
musb_ep_select(mbase, epnum); musb_ep_select(mbase, epnum);
txcsr = musb_readw(mbase, offset); txcsr = musb_readw(mbase, offset);
txcsr &= ~(MUSB_TXCSR_DMAENAB if (channel->desired_mode == 1) {
txcsr &= ~(MUSB_TXCSR_DMAENAB
| MUSB_TXCSR_AUTOSET); | MUSB_TXCSR_AUTOSET);
musb_writew(mbase, offset, txcsr); musb_writew(mbase, offset, txcsr);
/* Send out the packet */ /* Send out the packet */
txcsr &= ~MUSB_TXCSR_DMAMODE; txcsr &= ~MUSB_TXCSR_DMAMODE;
txcsr |= MUSB_TXCSR_DMAENAB;
}
txcsr |= MUSB_TXCSR_TXPKTRDY; txcsr |= MUSB_TXCSR_TXPKTRDY;
musb_writew(mbase, offset, txcsr); musb_writew(mbase, offset, txcsr);
} }
......
...@@ -21,7 +21,7 @@ config AB8500_USB ...@@ -21,7 +21,7 @@ config AB8500_USB
config FSL_USB2_OTG config FSL_USB2_OTG
bool "Freescale USB OTG Transceiver Driver" bool "Freescale USB OTG Transceiver Driver"
depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_OTG_FSM && PM depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_OTG_FSM=y && PM
depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y' depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y'
select USB_PHY select USB_PHY
help help
......
...@@ -61,9 +61,6 @@ static int am335x_phy_probe(struct platform_device *pdev) ...@@ -61,9 +61,6 @@ static int am335x_phy_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
ret = usb_add_phy_dev(&am_phy->usb_phy_gen.phy);
if (ret)
return ret;
am_phy->usb_phy_gen.phy.init = am335x_init; am_phy->usb_phy_gen.phy.init = am335x_init;
am_phy->usb_phy_gen.phy.shutdown = am335x_shutdown; am_phy->usb_phy_gen.phy.shutdown = am335x_shutdown;
...@@ -82,7 +79,7 @@ static int am335x_phy_probe(struct platform_device *pdev) ...@@ -82,7 +79,7 @@ static int am335x_phy_probe(struct platform_device *pdev)
device_set_wakeup_enable(dev, false); device_set_wakeup_enable(dev, false);
phy_ctrl_power(am_phy->phy_ctrl, am_phy->id, am_phy->dr_mode, false); phy_ctrl_power(am_phy->phy_ctrl, am_phy->id, am_phy->dr_mode, false);
return 0; return usb_add_phy_dev(&am_phy->usb_phy_gen.phy);
} }
static int am335x_phy_remove(struct platform_device *pdev) 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) ...@@ -2297,7 +2297,8 @@ static unsigned int tcpm_pd_select_pps_apdo(struct tcpm_port *port)
pdo_pps_apdo_max_voltage(snk)); pdo_pps_apdo_max_voltage(snk));
port->pps_data.max_curr = min_pps_apdo_current(src, snk); port->pps_data.max_curr = min_pps_apdo_current(src, snk);
port->pps_data.out_volt = min(port->pps_data.max_volt, port->pps_data.out_volt = min(port->pps_data.max_volt,
port->pps_data.out_volt); max(port->pps_data.min_volt,
port->pps_data.out_volt));
port->pps_data.op_curr = min(port->pps_data.max_curr, port->pps_data.op_curr = min(port->pps_data.max_curr,
port->pps_data.op_curr); port->pps_data.op_curr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment