Re: [PATCH RESEND v2 1/1] usb: musb: implement (un)map_urb_for_dma hooks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, Mar 14, 2013 at 08:12:09PM +0200, Ruslan Bilovol wrote:
> 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 passing them to MUSB
> 
> This increased throughput 80->120 MBits/s over musb@omap4 with
> USB Gigabit ethernet adapter attached.
> 
> Some ideas taken from ehci-tegra.c
> 
> Signed-off-by: Ruslan Bilovol <ruslan.bilovol@xxxxxx>
> ---
>  drivers/usb/musb/musb_core.c |   14 ++++++
>  drivers/usb/musb/musb_host.c |  102 +++++++++++++++++++++++++++++++++++++++++-
>  drivers/usb/musb/musb_host.h |    2 +-
>  3 files changed, 116 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> index 60b41cc..91ac166 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c
> @@ -1431,6 +1431,20 @@ static int musb_core_init(u16 musb_type, struct musb *musb)
>  
>  	/* log release info */
>  	musb->hwvers = musb_read_hwvers(mbase);
> +
> +#ifndef CONFIG_MUSB_PIO_ONLY
> +	/*
> +	 * The DMA engine in RTL1.8 and above cannot handle
> +	 * DMA addresses that are not aligned to a 4 byte boundary.
> +	 * For such engine implemented (un)map_urb_for_dma hooks.
> +	 * Do not use these hooks for RTL<1.8
> +	 */
> +	if (musb->hwvers < MUSB_HWVERS_1800) {

if you move this check to map/unmap and always return error if this is
true, you can avoid removing 'const' from our struct hc_driver. Would
that work ?

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux