On 01/14/15 16:03, Ian Lepore wrote:
If you are allocating the memory using bus_dmamem_alloc() then no,
absolutely not.  It's working for you by accident because of the
USB_HOST_ALIGN hacks which I think date back to freebsd 8 or so.

When I talked to you a couple years ago about doing it the right way,
you were outraged (perhaps rightly so) about the inefficiency involved,
because of things like allocating a 16 byte buffer causing the
allocation of a full page just so that the caching attributes could be
changed.  So I fixed that with the busdma zone allocator stuff that
makes it very efficient to allocate many tiny dma buffers (coherent or
not), and when you use buffers allocated that way, the sync operations
code can make some safe assumptions and avoid doing bounces due to
cacheline alignments.

If buffers were allocated right-sized now that it's efficient to do so,
the USB_HOST_ALIGN hack could go away.   Hmm, actually it might be
necessary to start using the busdma zone allocator in mips as well
before undoing the hack.

Hi Ian,

This sounds good. I'll make a quick patch you can try this week which splits the USB busdma allocations again. It is a quite trivial thing to do. Can you or Kott then test this patch?

--HPS
_______________________________________________
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"

Reply via email to