Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Dec 2012 08:12:29 +1300
From:      Andrew Turner <andrew@fubar.geek.nz>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        Oleksandr Tymoshenko <gonzo@freebsd.org>, freebsd-usb@freebsd.org
Subject:   Re: EHCI on armv6 with Write-Back caches
Message-ID:  <20121219081229.383d9f41@fubar.geek.nz>
In-Reply-To: <201212181306.44926.hselasky@c2i.net>
References:  <20121218204931.5322922d@fubar.geek.nz> <201212180922.22217.hselasky@c2i.net> <20121219000213.269b1371@fubar.geek.nz> <201212181306.44926.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 18 Dec 2012 13:06:44 +0100
Hans Petter Selasky <hselasky@c2i.net> wrote:
> Hi Andrew,
> 
> > The BUS_DMA_COHERENT flag does nothing on armv6 as we need the cache
> > enabled for atomic operations to work correctly and we would have to
> > disable the cache on the entire page. This is acceptable behaviour
> > from the description of the flag in the busdma man page.
> 
> Yes, but when I allocate memory from the USB stack, then I want that
> memory to not be cached. It is simply not that useful to have that
> memory cached. I didn't check the latest state of busdma, but if I'm
> not mistaken, if the BUS_DMA_COHERENT flag is set on the DMA tag, the
> flush/invalidate will simply return and do nothing. Maybe that is the
> problem ...

The exact meaning of BUS_DMA_COHERENT depends on the architecture. The
code is still required to call bus_dmamap_sync with a coherent map but
when the flag is implemented the cost of the operation will be reduced.
It doesn't guarantee the memory is uncached, it may be implemented that
way but the USB code can't rely on it.

Andrew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121219081229.383d9f41>