Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jan 2015 16:27:18 +0100
From:      Hans Petter Selasky <hps@selasky.org>
To:        Ian Lepore <ian@freebsd.org>, kott <kmatpral@yahoo.com>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: usb_pc_cpu_flush
Message-ID:  <54B53956.4090708@selasky.org>
In-Reply-To: <1421160576.14601.175.camel@freebsd.org>
References:  <1419359192795-5975583.post@n5.nabble.com> <5499E734.1070507@selasky.org> <1419392511197-5975691.post@n5.nabble.com> <549A811D.3060204@selasky.org> <1419416870924-5975752.post@n5.nabble.com> <1419423740820-5975763.post@n5.nabble.com> <549AB711.8070005@selasky.org> <1419431704871-5975773.post@n5.nabble.com> <549BF430.8000207@selasky.org> <1419877515606-5976832.post@n5.nabble.com> <1421133295061-5980199.post@n5.nabble.com> <1421160576.14601.175.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 01/13/15 15:49, Ian Lepore wrote:
> On Tue, 2015-01-13 at 00:14 -0700, kott wrote:
>> Yes with cache disabled, this problem is not seen. Seems to be with a issue
>> with l2 cache.
>> Thanks kott
>
> Except that there are no known problems with l2 cache on armv7 right
> now.  There are known problems with the USB driver using the busdma
> routines incorrectly, which accidentally works okay on x86 platforms but
> likely not so well on others.
>

Hi,

If there is a problem it is in "usb_pc_cpu_flush()" or 
"usb_pc_cpu_invalidate()":

void
usb_pc_cpu_flush(struct usb_page_cache *pc)
{
         if (pc->page_offset_end == pc->page_offset_buf) {
                 /* nothing has been loaded into this page cache! */
                 return;
         }
         bus_dmamap_sync(pc->tag, pc->map, BUS_DMASYNC_PREWRITE);
}

USB has a very simple DMA sync language, either flush or invalidate. 
These are used correctly from what I can see with regard to the FreeBSD 
USB specification.

If the "usb_pc_cpu_flush()" function does not cause the CPU cache to be 
written to RAM before the function returns, please let me know.

--HPS



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