summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_mem.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Instead of passing the flags as part of a struct that's supposed to bepatrick2020-03-211-3/+4
| | | | | | | filled by the callee, change the usb_allocmem() API to take another argument for the flags. ok mpi@
* Switch USB to use non-coherent buffers for data transfers. Sincepatrick2020-03-191-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the import in '99 all buffers allocated using usb_allocmem() have been mapped COHERENT. On some ARM SoCs, where the USB controller is not coherent with the caches, this means the buffers were mapped uncached. This drastically reduces the performance, especially on reads. We already added cache syncs before and after USB transfers, but so far those have essentially been no-ops. Since other drivers make use of the same allocation code, and those haven't been proven to have correct syncs, we can't just remove the COHERENT flag. This splits the allocation into coherent and non-coherent blocks. All drivers who call usb_allocmem() themselves now pass a flag to show they require coherent blocks. Onced verified that they also work fine without coherent, or once they have been refactored, we can remove this again. On a ure(4) connected to an i.MX8MQ, the receive performance is 10x as fast as before. The Raspberry Pi's ethernet receive speed doubled. Debugged using dt(4) Original diff from Marius Strobl Feedback from kettenis@ Tested on an i.MX8MQ (arm64) by patrick@ Tested on a Raspberry Pi (arm64) by tobhe@ Tested on an ERL (octeon) by Janne Johansson ok mpi@ gerhard@ tobhe@
* usb_block_allocmem() won't sleep.gerhard2018-12-051-4/+1
| | | | ok mpi@
* Use "%s", __func__ in DPRINTF() to reduce grep noise.mpi2018-11-181-7/+7
|
* Replace non-functioning checks for use of the usb memory block allocator injmatthew2018-03-071-13/+3
| | | | | | interrupt context with assertwaitok(), which does work. ok dlg@
* A pile of sizes to free(9). In test for a few days in snapshots.deraadt2017-04-081-3/+3
| | | | | Errors will result in nice clean panic messages so we know what's wrong. Reviewed by dhill visa natano jsg.
* Do not overlay DMA fragment decriptors with free list handling.mpi2016-11-301-11/+14
| | | | | | | | | This "cleverness" increase the risk of races due to caching and/or prefetching between the HC and DMA engine. Many of the bug reports on bugs@ involving memory corruptions in usb_allocmem() should be easier to diagnose when not avoided with this change. From Marius Strobl, ok kettenis@
* Even in interrupt context curproc is not NULL.mpi2014-10-311-9/+2
| | | | ok miod@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-3/+3
| | | | after discussions with beck deraadt kettenis.
* Get rid of various 'typedef struct' definitions and use plain structuremglocker2013-04-151-13/+13
| | | | | | | | | definitions instead. We don't change usb.h for now to stay compatible with userland. Tested by mpi@ on macppc and myself on i386. ok mpi@
* proc.h is way too much header for usb to handle.tedu2013-03-281-5/+1
|
* - use nitems() no binary change on amd64jasper2011-04-051-2/+2
| | | | "reads OK" claudio@
* Add DMA sync operations. Fixes problems on macppc with gcc4 becausekettenis2010-09-291-1/+8
| | | | | | | apparently it reorders stores in a bad way. Mostly from NetBSD. earlier diff tested by landry@ (who noticed the problems on macppc) ok deraadt@
* First pass at removing clauses 3 and 4 from NetBSD licenses.ray2008-06-261-8/+1
| | | | | | | | | Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
* more (*&@#$ timeout.h falloutderaadt2007-06-151-1/+2
|
* Remove the "Static" declaration of many functions. It was defined to be emptymbalmer2007-06-051-8/+8
| | | | | | | and it was not consistently used. It was confusing as it suggested these functions were static, which they were not. discussed with dlg and jsg, ok jsg.
* Last part of FreeBSD/NetBSD sepcific code removal.mbalmer2007-06-041-7/+1
| | | | ok jsg@
* Remove logprintf macrojsg2007-05-211-3/+3
|
* put "do { } while (0)" wrappers on all the debug maroc functionsderaadt2004-07-081-3/+3
|
* Fix a memleak on error in usb_block_allocmem(); Patrick Latifimillert2003-08-061-5/+8
| | | | deraadt@ OK
* Sync USB code with NetBSD.nate2003-07-081-4/+10
| | | | This includes numerous fixes and paves the way for usb 2.0 support.
* get rid of trailing whitespacenate2002-07-251-6/+6
|
* Use correct $NetBSD$nate2002-05-051-2/+2
|
* Sync with NetBSD. Too many changes to mention. For now I have skippedaaron2000-11-081-22/+11
| | | | umass.c and ukbd.c as the diffs are a bit hairier.
* sync with NetBSD... well almost. someone w/ the hw should check umass.fgsch2000-07-041-2/+2
|
* Sync with NetBSD. USB Ethernet drivers should work now.aaron2000-03-301-9/+9
|
* Much cleaner sync with NetBSD. Some #if defined() magic has been sent in theaaron2000-03-281-6/+9
| | | | | | form of a diff to augustss@netbsd.org so that future syncs will be very easy. This commit also adds support for ADMtek AN986 "Pegasus" based USB Ethernet, CATC USB-EL1210A based USB Ethernet, and USB Printers (all untested).
* Sync with NetBSD.aaron2000-03-261-16/+17
|
* sync with NetBSD.fgsch1999-11-071-7/+7
|
* Sync with NetBSD.fgsch1999-09-271-13/+12
|
* Sync with NetBSD;fgsch1999-08-271-6/+10
| | | | | | | Make sure not to call tsleep() from suspend/resume routine. Move more of the transfer completion processing to HC independent code. Fix some problems with transfer abort & timeout. Merge the soft_{td,qh} with the real {td,qh}. This saves time and space.
* Sync with NetBSD.fgsch1999-08-191-6/+13
|
* Sync with NetBSD. Mostly FreeBSD related changes.fgsch1999-08-161-3/+3
| | | | Diffs sent to augustsson.
* From NetBSD; USB support.fgsch1999-08-131-0/+277