Re: [PATCH v2] usb: musb: fail unaligned DMA transfers on v1.8 and above

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

 



2010/11/8 Felipe Balbi <balbi@xxxxxx>:
> On Mon, Nov 08, 2010 at 12:20:30AM -0600, Gadiyar, Anand 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 <gadiyar@xxxxxx>
>> Tested-by: Ming Lei <tom.leiming@xxxxxxxxx>
>> Cc: Felipe Balbi <balbi@xxxxxx>
>> Cc: Ajay Kumar Gupta <ajay.gupta@xxxxxx>
>> Cc: Mike Frysinger <vapier@xxxxxxxxxx>
>
> applied, thanks

Suggest the revised patch "usb: musb: gadget: Unmapping the dma buffer
when switching to PIO mode" [1]  is applied too, otherwise some odd data
inconsistent or corruption things may be triggered when fallback to PIO,
which will be very frequent in g_ether.

[1], http://marc.info/?l=linux-usb&m=128532510705381&w=2

>
> (I thought we already had that in mainline :-p)
>
> Note to self: later we might want to use a bounce buffer instead of
> simply failing DMA. Gotta measure what's faster: use PIO or
> dma_alloc_coherent() + memcpy()
>


thanks,
-- 
Lei Ming
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux