Hello.

On 31-10-2010 8:25, Anand Gadiyar wrote:

The Inventra DMA engine in version 1.8 and later of the MUSB
controller cannot handle DMA addresses that are not aligned
to a 4 byte boundary. It ends up ignoring the last two bits
programmed in the DMA_ADDR register. This is a deliberate
design change in the controller and is documented in the
programming guide.

Earlier versions of the controller could handle these
accesses just fine.

Fail dma_channel_program if we see an unaligned address when
using the newer controllers, so that the caller can carry out
the transfer using PIO mode.
(Current callers already have this backup path in place).

Signed-off-by: Anand Gadiyar<gadi...@ti.com>
Cc: Felipe Balbi<ba...@ti.com>
Cc: Ming Lei<tom.leim...@gmail.com>
Cc: Ajay Kumar Gupta<ajay.gu...@ti.com>
Cc: Mike Frysinger<vap...@gentoo.org>
[...]

Index: mainline/drivers/usb/musb/musbhsdma.c
===================================================================
--- mainline.orig/drivers/usb/musb/musbhsdma.c
+++ mainline/drivers/usb/musb/musbhsdma.c
[...]
@@ -167,6 +169,18 @@ static int dma_channel_program(struct dm
        BUG_ON(channel->status == MUSB_DMA_STATUS_UNKNOWN ||
                channel->status == MUSB_DMA_STATUS_BUSY);

+       /*
+        * The DMA engine in RTL1.8 and above cannot handle
+        * DMA addresses that are not aligned to a 4 byte boundary.
+        * It ends up masking the last two bits of the address
+        * programmed in DMA_ADDR.
+        *
+        * Fail such DMA transfers, so that the backup PIO mode
+        * can carry out the transfer
+        */
+       if ((musb->hwvers >= MUSB_HWVERS_1800) && (dma_addr %4))

   Also need space after %.

+               return false;
+

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to