| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
usbd_clear_endpoint_stall(), which in turn will call
usbd_clear_endpoint_toggle(). It can be a common situation that when
this happens, there is still a transfer in the stalled queue being
in progress. The ehci(4) clear toggle function is currently doing a
panic() in the diagnostic code in this situation, which is a bit of
an overkill. The device still can be recovered by detaching/attaching
it. Therefore change the panic() in to a printf().
ok mpi@
|
|
|
|
|
|
| |
to DPRINTF's.
From Mikolaj Kucharski <mikolaj AT kucharski DOT name>
|
|
|
|
|
|
| |
already in revision 1.57 IMO.
From Mikolaj Kucharski <mikolaj AT kucharski DOT name>
|
|
|
|
| |
ok mpi@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
stack into the USB controller driver, since not all of the xfers
actually use DMA and some invalidations might even be harmful.
The important part is to sync before handing the buffer to the
controller, and to sync on a successful transfer before handing
it back to the USB stack. For isoc transfers it's easier to sync
the complete length of the transfer, since the buffer to flush is
not filled in a contiguous fashion.
For dwc2 there's a common point which takes care of the start
of transfers from or to devices, where we can make sure that our
buffers are synced. On completion, there's a common point before
handing it off to the USB stack.
For ehci there are three places which take care of the start
of transfers from or to devices, where one already does the sync,
while the two other places still need the sync. There are two
completion handler (isoc and non-isoc), where one already has a
comment asking for the need of a sync. The done handler for intr
xfers does a sync that is not needed anymore after adding the sync
in the completion handler.
For ohci there are three places which take care of the start
of transfers from or to devices, where all of them were still in
need of the sync. For completion, there is one place for isoc
xfers and two places for handling successful generic xfers.
For uhci there are two places which take care of the start
of transfers from or to device, where all of them were still in
need of the sync. For completion, there is one handler for both
isoc and non-isoc xfers where syncs need to occur.
For xhci there are three places which take care of the start
of transfers from or to device, where all of them were still in
need of the sync. For completion, there is one handler for isoc
and one for non-isoc xfers where syncs need to occur.
With this we can revert the workaround that implicitly allocated
buffers are COHERENT, since now control transfers fulfilled by the
driver code (instead of the controller doing DMA) are not flushed
into oblivion anymore.
Tested by Janne Johansson with dwc2 (octeon)
Tested by kettenis@ with xhci(4) (octeon)
Tested by patrick@ with ehci(4) on a Cubox-i (armv7)
Tested by patrick@ with xhci(4) on an i.MX8MQ (arm64)
Tested by tobhe@ with dwc2 on a rPi 3b (arm64)
ok kettenis@
|
|
|
|
| |
CID 980279
|
|
|
|
|
|
|
| |
filled by the callee, change the usb_allocmem() API to take another
argument for the flags.
ok mpi@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
| |
ok mpi@
|
|
|
|
| |
ok visa@, kn@, cheloha@
|
| |
|
| |
|
|
|
|
|
|
| |
to avoid confilicting with split isochronous transfer which use same TT.
ok mpi@
|
|
|
|
|
|
|
|
|
| |
(interrupt) transfer.
When RL is not zero, interrupt transfer cannot work correctly.
It causes USB2.0 hub cannot detect device attach/detach.
ok by mpi@
|
|
|
|
| |
USB is the last real user of IPL_SOFTNET.
|
|
|
|
|
| |
Errors will result in nice clean panic messages so we know what's wrong.
Reviewed by dhill visa natano jsg.
|
|
|
|
| |
them, but for release let's be conservative and use 0.
|
|
|
|
|
|
|
|
|
|
|
| |
*_root_ctrl_start() routines are synchronous and all end up calling
usb_transfer_complete() in the non-error case. After calling this
function it is unsafe to dereference ``xfer'' since the transfer
callback has been called. So returning USBD_IN_PROGRESS is wrong in
this case since transfers are always completed at this point.
So return USBD_NORMAL_COMPLETION or the corresponding error code if
something wrong happen.
|
|
|
|
|
|
|
|
|
| |
This code contains a use-after-free which be addressed in an upcoming
diff.
This fix xhci(4) polling mode.
ok kettenis@
|
|
|
|
|
|
| |
all HCs.
ok patrick@
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
controller. This register controls whether the controller is in device or
host mode on many dual role controllers and gets reset during a reset of
the controller, placing the controller in (non-functional) idle mode. By
saving and restoring it, we keep the controller in host mode. Since this is
a non-standard register, add a new EHCIF_USBMODE flag and only do the save and
restore if it has been set.
Makes the upper "OTG" port of the Cubox-i work.
ok mpi@, jsg@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the ioff argument to pool_init() is unused and has been for many
years, so this replaces it with an ipl argument. because the ipl
will be set on init we no longer need pool_setipl.
most of these changes have been done with coccinelle using the spatch
below. cocci sucks at formatting code though, so i fixed that by hand.
the manpage and subr_pool.c bits i did myself.
ok tedu@ jmatthew@
@ipl@
expression pp;
expression ipl;
expression s, a, o, f, m, p;
@@
-pool_init(pp, s, a, o, f, m, p);
-pool_setipl(pp, ipl);
+pool_init(pp, s, a, ipl, f, m, p);
|
|
|
|
| |
ok millert@ stsp@
|
|
|
|
|
|
| |
This should hopefully help people reporting errors with SB700.
From FreeBSD, ok kettenis@, krw@
|
|
|
|
|
|
|
|
|
|
|
| |
Do not set the "Port Number", "Hub Address" and "Split Completion Mask"
fields in Isochronous Queue Heads for high-speed devices.
These fields should be ignored by the host controller unless the EPS
field indicates a full- or low-speed device, but that's not the case
with Nvidia controllers.
From NetBSD via miod@
|
| |
|
|
|
|
|
|
| |
to mark ehci_intr() as IPL_MPSAFE.
Earlier version tested by ratchov@, ok visa@
|
|
|
|
|
|
| |
this break some devices.
As found the hardway by Hugo Sastre via sobrado@
|
|
|
|
|
|
|
|
| |
when an isochronous transfer is done.
Frame lengths are just input values and no driver mess with them.
ok ratchov@, jmatthew@
|
|
|
|
| |
found by and fix confirmed by jsg@.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
scheduling.
More work is required to properly budget and schedule micro-frames, most
of it at the HUB level. But this let people use USB1.1 uaudio(4) devices
on ehci(4)-only systems.
Thanks to all the testers!
ok ratchov@, sthen@, naddy@
|
|
|
|
|
|
|
|
|
|
| |
ehci(4) is using a TAILQ_* to keep track of the pending transfers. In
this context "pending" means submitted to the hardware. Now that we
are no longer fiddling with the internal of the TAILQ_* there's no good
reason to keep these macro, but more importantly this will let us reuse
the 'inext' field to get rid of the other hand-rolled lists of xfers.
No functional change.
|
|
|
|
| |
what's done with other transfer types. No functional change.
|
| |
|
|
|
|
| |
xhci(4) does.
|
|
|
|
|
|
| |
Over the years I understood that debugging USB HCD problems without
hardware access do not work and even in this case it's easier to write
a specific debug/prinf diff.
|
|
|
|
|
|
|
|
| |
As soon as a transfer is being cancelled, remove it from the list of pending
xfers. This way the soft interrupt routine won't try to process it before
ehci_abort() gives it back to the stack.
Problem analysed by and previous diff ok stsp@
|
|
|
|
|
|
| |
reported by Remi Locherer on bugs@.
ok deraadt@
|
|
|
|
|
|
|
|
| |
As soon as a transfer is being cancelled, remove it from the list of pending
xfers. This way the soft interrupt routine won't try to process it before
ehci_abort() gives it back to the stack.
Problem analysed by and ok stsp@
|
| |
|
|
|
|
| |
ok dlg@ mpi@ bcook@ millert@ miod@
|
|
|
|
|
|
| |
hardware.
ok mpi@, deraadt@
|
|
|
|
| |
ok deraadt@ tedu@
|
|
|
|
| |
to include that than rdnvar.h. ok deraadt dlg
|
|
|
|
|
|
| |
this hack in the drivers that need it.
Tested by many, thanks! ok pirofti@, kettenis@
|
|
|
|
| |
reported by Bryan Linton on bugs@.
|
|
|
|
|
|
|
|
| |
list. Use a queue head per xfer and no longer per pipe. Since queue
heads are now setup when a transfer is submited we do not need to open
the control pipe more than once. This also simplify transfer abortion.
Tested by many, thanks!
|
|
|
|
| |
with the correct ipl to prevent your CPU from locking against itself.
|
|
|
|
| |
in every HC driver.
|