]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge tag 'fixes-for-v3.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi...
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Oct 2012 15:14:10 +0000 (08:14 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Oct 2012 15:14:10 +0000 (08:14 -0700)
usb: fixes for v3.7-rc2

Here's the first set of fixes for v3.7-rc cycle.

DesignWare Core USB3 Driver (dwc3) got two fixes. The first one fixes a long
standing bug which would keep endpoint with BUSY flag set forever if we cancel
a transfer which has already been started by the controller. The second fix
will just switch PHYs back off when DWC3 driver is removed.

MUSB fixed a bug which would cause a Kernel Oops at least on AM3517 when
removing a device. For some reason that particular device can fall into a
situation where you have both Disconnect and Endpoint IRQs happen
simultaneously (have both bits set in IRQ_STATUS register) and, because
Disconnect Interrupt is handled before Endpoint Interrupts, we would try to
transfer data over a disconnected device, thus generating a kernel oops.

Renensas' USB DRD driver got two fixes which are a) fixing an off-by-one bug on
the pipe iterator implementation and b) fixing Interrupt Status Clear procedure
in order to properly clear a single Interrupt event without clearing (and
masking) other events we didn't handle yet.

drivers/usb/dwc3/core.c
drivers/usb/dwc3/gadget.c
drivers/usb/gadget/lpc32xx_udc.c
drivers/usb/musb/am35x.c
drivers/usb/renesas_usbhs/mod.c
drivers/usb/renesas_usbhs/pipe.h

index b415c0c859d3d2b3e990fc571b57d4e6e88f81fd..c14ebc975ba422028b663b4b90ac6e605c1c6115 100644 (file)
@@ -409,6 +409,10 @@ static void dwc3_core_exit(struct dwc3 *dwc)
 {
        dwc3_event_buffers_cleanup(dwc);
        dwc3_free_event_buffers(dwc);
+
+       usb_phy_shutdown(dwc->usb2_phy);
+       usb_phy_shutdown(dwc->usb3_phy);
+
 }
 
 #define DWC3_ALIGN_MASK                (16 - 1)
index c9e729a4bf6562876ba58b1776ce235ecc5ca5ed..7b7deddf6a52a264f02b7d47fa84d1916c461e6f 100644 (file)
@@ -1904,7 +1904,7 @@ static void dwc3_stop_active_transfer(struct dwc3 *dwc, u32 epnum)
        ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, &params);
        WARN_ON_ONCE(ret);
        dep->resource_index = 0;
-
+       dep->flags &= ~DWC3_EP_BUSY;
        udelay(100);
 }
 
index f696fb9b136ded4b8c32ba8b360ef2550551f73d..21a9861dabf0a9660a3c1cf74f04d055fbb0b649 100644 (file)
@@ -2930,10 +2930,10 @@ static void vbus_work(struct work_struct *work)
 
                /* Get the VBUS status from the transceiver */
                value = i2c_smbus_read_byte_data(udc->isp1301_i2c_client,
-                                                ISP1301_I2C_OTG_CONTROL_2);
+                                                ISP1301_I2C_INTERRUPT_SOURCE);
 
                /* VBUS on or off? */
-               if (value & OTG_B_SESS_VLD)
+               if (value & INT_SESS_VLD)
                        udc->vbus = 1;
                else
                        udc->vbus = 0;
index 457f25e62c519a33be80e39dcbb8b222cee8de12..c964d6af178bd0196e20a80bd482529c38369900 100644 (file)
@@ -305,6 +305,12 @@ static irqreturn_t am35x_musb_interrupt(int irq, void *hci)
                ret = IRQ_HANDLED;
        }
 
+       /* Drop spurious RX and TX if device is disconnected */
+       if (musb->int_usb & MUSB_INTR_DISCONNECT) {
+               musb->int_tx = 0;
+               musb->int_rx = 0;
+       }
+
        if (musb->int_tx || musb->int_rx || musb->int_usb)
                ret |= musb_interrupt(musb);
 
index 35c5208f32494d7c55f4fd98fa79cf517425ca46..61933a90e5bfdbe41fed1679979977e6ff849b4b 100644 (file)
@@ -273,9 +273,9 @@ static irqreturn_t usbhs_interrupt(int irq, void *data)
        usbhs_write(priv, INTSTS0, ~irq_state.intsts0 & INTSTS0_MAGIC);
        usbhs_write(priv, INTSTS1, ~irq_state.intsts1 & INTSTS1_MAGIC);
 
-       usbhs_write(priv, BRDYSTS, 0);
-       usbhs_write(priv, NRDYSTS, 0);
-       usbhs_write(priv, BEMPSTS, 0);
+       usbhs_write(priv, BRDYSTS, ~irq_state.brdysts);
+       usbhs_write(priv, NRDYSTS, ~irq_state.nrdysts);
+       usbhs_write(priv, BEMPSTS, ~irq_state.bempsts);
 
        /*
         * call irq callback functions
index 08786c06dcf1d21f0784ea6d02553c381a11dfd0..3d80c7b1fd1b4ba15133e2ffcd3c5db7be2e9933 100644 (file)
@@ -54,7 +54,7 @@ struct usbhs_pipe_info {
  * pipe list
  */
 #define __usbhs_for_each_pipe(start, pos, info, i)     \
-       for (i = start, pos = (info)->pipe;             \
+       for (i = start, pos = (info)->pipe + i;         \
             i < (info)->size;                          \
             i++, pos = (info)->pipe + i)