usb: musb: implement (un)map_urb_for_dma hooks

usb: musb: implement (un)map_urb_for_dma hooks

MUSB controller cannot work in DMA mode with misaligned buffers,
switching in PIO mode.

HCD core has hooks that allow to override the default DMA
mapping and unmapping routines for host controllers that have
special DMA requirements, such as alignment contraints.

It is observed that work in PIO mode is slow and it's better
to align buffers properly before pass them to MUSB

Some ideas taken from ehci-tegra.c

Change-Id: Id6eeaa811063d408f121c79012aba921f26eb582
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
usb: hcd: Add a dma_align flag

usb: hcd: Add a dma_align flag

Some host controllers has special DMA requirements,
such as alignment contraints.
Added a flag dma_align for indicating this requirement

Change-Id: I06277ade030429a832e6db38cc695128a1033f08
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
usb: musb: indicate DMA alignment requirement

The MUSB host controller requires DMA buffers to be aligned.
If DMA buffers are misaligned it will use (un)map_urb_for_dma
for re-aligning buffers.
This often happens with USB network adapters, where skbuff
alignment is often in the middle of a 4-byte dword.
Indicate host controller DMA alignment requirement for such cases

Change-Id: I8a03f392caff762e9b48b65d31a119fdd833ae69
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
usb: ehci-omap: indicate DMA alignment requirement

usb: ehci-omap: indicate DMA alignment requirement

The OMAP host controller requires DMA buffers to be aligned.
If DMA buffers are misaligned then DMA transfers may take more
time.
This often happens with USB network adapters, where skbuff
alignment is often in the middle of a 4-byte dword.
Indicate host controller DMA alignment requirement for such cases

Change-Id: Ic2191f3f339cb189b02218d43b6d432cfe136269
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
kernel: Move REPEAT_BYTE definition into linux/kernel.h

And make sure that everything using it explicitly includes
that header file.

Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
modified for Linux 3.0 from Linux 3.4+ by faux123
ARM: rwlocks: remove unused branch labels from trylock routines

The ARM arch_{read,write}_trylock implementations include unused
backwards branch labels, since we don't retry the locking operation
if the exclusive store fails.

This patch removes the labels.

Signed-off-by: Will Deacon <will.deacon@arm.com>
ARM: spinlock: use ticket algorithm for ARMv6+ locking implementation

Ticket spinlocks ensure locking fairness by reducing the thundering herd
effect when acquiring a lock. This is especially important on systems
where memory-access times are not necessarily uniform when accessing
the lock structure (for example, on a multi-cluster platform where the
lock is allocated into L1 when a CPU releases it).

This patch implements the ticket spinlock algorithm for ARM, replacing
the simpler implementation for ARMv6+ processors.

Signed-off-by: Will Deacon <will.deacon@arm.com>