Re: CPU Cache and busdma usage in USB

2009-07-14 Thread Piotr Zięcik
1) My analysis: Only the data areas are being flushed/invalidated. No transfer descriptors are flushed/invalidated. I see no cache operations happening on any DMA control structures, even though there are calls from EHCI to xxx_pc_flush() and xxx_pc_invalidate(). This is 100% correct if

Re: CPU Cache and busdma usage in USB

2009-07-09 Thread Piotr Zięcik
. In later versions is bug in ARM pmap causing segmentation fault in ehci atatch code (for more details loot at http://www.nabble.com/pmap-problem-in-FreeBSD-current-td24352351.html). -- Pozdrawiam. Piotr Zięcik ___ freebsd-usb@freebsd.org mailing list

Re: CPU Cache and busdma usage in USB

2009-07-09 Thread Piotr Zięcik
Wednesday 08 July 2009 12:30:46 Sebastian Huber napisał(a): Device to memory DMA transfer of a buffer: (...) 3. all accesses to the buffer via the cache must wait until the DMA has finished And this is the problem in my oppinion - USB stack does not wait. -- Best Regards. Piotr Zięcik

Re: CPU Cache and busdma usage in USB

2009-07-08 Thread Piotr Zięcik
Wednesday 08 July 2009 11:03:43 Hans Petter Selasky napisał(a): And what about my patch suggestion in my previous e-mail having the same subject. Does it work? I have tested it and it does not work. By the way Writeback before Writeback Invalidate did not change cache behaviour too much.

Re: CPU Cache and busdma usage in USB

2009-07-07 Thread Piotr Zięcik
(0xC3A9E480, 0xC3BB8080, [PREREAD _]) - Writeback Invalidate 0xC3BB2770 (size: 0x000D) = bus_dmamap_sync(0xC3A9E480, 0xC3BB8080, [PREREAD _]) - Writeback Invalidate 0xC3BB2770 (size: 0x000D) -- Best regards, Piotr Zięcik

Re: CPU Cache and busdma usage in USB

2009-06-30 Thread Piotr Zięcik
Monday 29 June 2009 15:16:56 Hans Petter Selasky napisał(a): You want to change the flags passed to bus_dmamap_sync() so that the flush/invalidate mapping gets right. I understand why your patch makes it work. That's not the problem. In src/sys/arm/arm/busdma_machdep.c there is a function

Re: CPU Cache and busdma usage in USB

2009-06-29 Thread Piotr Zięcik
Sunday 28 June 2009 11:54:40 Hans Petter Selasky napisał(a): Hi Piotr and Rafal, Your patch is not fully correct. It will break support for x86 and more when bounce pages are uses. Let's get the definitions right: man busdma (...) My view: XXX_PREXXX functions should be used prior to

Re: CPU Cache and busdma usage in USB

2009-06-29 Thread Piotr Zięcik
Monday 29 June 2009 13:37:41 Hans Petter Selasky napisał(a): Look into ehci_check_transfer() function (http://fxr.watson.org/fxr/source/dev/usb/controller/ehci.c#L1294) usb_pc_cpu_invalidate() [bus_dmamap_sync()] is not used in this function correcly. It is not paired with

Re: CPU Cache and busdma usage in USB

2009-06-29 Thread Piotr Zięcik
Monday 29 June 2009 13:37:41 Hans Petter Selasky napisał(a): if (op BUS_DMASYNC_POSTREAD) { if (bpage-vaddr_nocache == 0) { cpu_dcache_inv_range(bpage-vaddr, bpage-datacount);

Re: CPU Cache and busdma usage in USB

2009-06-24 Thread Piotr Zięcik
is a bit different thing. -- Pozdrawiam. Piotr Zięcik ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org

CPU Cache and busdma usage in USB

2009-06-23 Thread Piotr Zięcik
While bringing up EHCI (8-CURRENT, new USB stack) on ARM machine we have found cache-related problem in the USB stack. The usb_pc_cpu_flush() and usb_pc_cpu_invalidate() functions are used to flush/invalidate CPU caches in various places in USB code. Internally, the functions are implemented