RE: using cacheable buffer for descriptor

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Russell King - ARM Linux <linux@...>, Ming Lei <tom.leiming@...>
Cc: Alan Stern <stern@...>, <linux-usb@...>, Xiao Richard-a2590c <a2590c@...>, Luan James-WLJL13 <James.Luan@...>, <linux-arm-kernel@...>
Date: Saturday, July 4, 2009 - 5:01 pm

On Sat, Jul 04, 2009 at 11:41:46PM +0800, Ming Lei wrote:
nothing.

dma transfer
functions.
being owned
and remains there
the DMA agent
access the
subsequently without a

That is right, I don't think in our case the buffer is being accessed
during DMA transfer.

In drivers/usb/core/config.c, function usb_get_descriptor calls
usb_control_msg to submit URB, and that is a blocking call, it wouldn't
return until DMA to RAM is finished.
As Alan pointed out, if dma_map_single() invalidates cache lines for IN
URB, nothing special needs to be done on URB completion.
But the fact that a call to dma_cache_maint before CPU accessing the
buffer makes the inconsistency problem go away is leading me to the
dma_cache_maint function itself, is it possible that, under certain
condition, dma_cache_maint fails to invalidate the cache lines? Because
of the random nature of this problem, calling dma_cache_maint the second
time just happened to help.
Any idea how to check for dma_cache_maint failures?

Fei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
using cacheable buffer for descriptor, Yang Fei-AFY095, (Fri Jul 3, 12:43 am)
Re: using cacheable buffer for descriptor, Alan Stern, (Fri Jul 3, 5:16 pm)
RE: using cacheable buffer for descriptor, Yang Fei-AFY095, (Fri Jul 3, 6:06 pm)
RE: using cacheable buffer for descriptor, Alan Stern, (Fri Jul 3, 7:19 pm)
RE: using cacheable buffer for descriptor, Yang Fei-AFY095, (Fri Jul 3, 11:43 pm)
Re: using cacheable buffer for descriptor, Ming Lei, (Sat Jul 4, 5:11 am)
Re: using cacheable buffer for descriptor, Ming Lei, (Sat Jul 4, 11:41 am)
Re: using cacheable buffer for descriptor, Russell King - ARM Linux, (Sat Jul 4, 2:07 pm)
Re: using cacheable buffer for descriptor, Ming Lei, (Sat Jul 4, 10:38 pm)
Re: using cacheable buffer for descriptor, Russell King - ARM Linux, (Sun Jul 5, 2:46 am)
RE: using cacheable buffer for descriptor, Yang Fei-AFY095, (Sat Jul 4, 5:01 pm)
Re: using cacheable buffer for descriptor, Alan Stern, (Sat Jul 4, 11:51 am)