| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Analysed by and ok claudio@
|
|
|
|
| |
ok ratchov@
|
|
|
|
| |
ok mpi
|
|
|
|
|
|
|
|
|
| |
After each MSE, ensuire usbd_complete_transfer() is called for each
missed transfer, for which there's no transfer completion event. Fixes
crashes and deadlocks in upper layers caused by the missing
completion.
ok deraadt, patrick; help from mpi, patrick, gmlocker
|
|
|
|
|
|
| |
code in xhci_event_xfer() to the generic handler function.
suggested and ok mpi@
|
|
|
|
|
|
|
|
| |
functions for isoc and !isoc xfers.
Suggested by mpi@.
ok patrick@, stsp@
|
| |
|
|
|
|
|
|
| |
to one single function.
ok mpi@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
frame has to be enqueued as Transfer Descriptor. This means each frame
starts with an isoch TRB and may also contain further normal TRBs. The
TDs each throw at least one interrupt for a successful completion or
possibly more in case of a short xfer. We have to account the amount
of data transfered for each frame using the completion of the matching
TD and its TRBs.
Thanks to stsp@ for initiating this, and many more thanks to mglocker@
for reworking and cleaning up my initial diff. Further improvements
can happen in-tree now.
Tested by mglocker@, phessler@ and stsp@
ok mglocker@, stsp@
|
|
|
|
|
|
|
| |
as in: Since there's always one transfer, 0 means 1. Thus we have
to add 1 (not OR) to get to the desired number.
ok mglocker@ mpi@ stsp@
|
|
|
|
| |
ok mpi@
|
| |
|
|
|
|
|
|
|
|
|
| |
we know that the last non-link TRB has been written and we can look at
the flags to set the chain bit in the link TRB. Since we will now toggle
the cycle bit on the first TRB of a ring, set it on the ring reset.
Tested by jcs@, jsg@ and visa@
"commit it" jcs@
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
needs the Chain Bit set or not instead of using the last parameter,
which is used to mark the last TRB in a USB transfer, not in a TD.
To make that work we need to setup the recently acquired TRB before
calling xhci_xfer_get_trb() the next time. Thus setting up the
initial TRB has to happen right away. To kick the transfer off we
simply flip the toggle bit on the first TRB right at the end.
Fixes regression for jcs@, dhill@ and stsp@
Initially discussed with mpi@
ok stsp@
|
|
|
|
|
|
|
|
|
|
|
|
| |
thus have the Link TRB inbetween must have the Chain Bit set in the
Link TRB. Otherwise xHCI controllers might think that the transfer
ends at that point.
Fixes an issue that was most prominently seen as Invalid CSW error
when using umass0 on octeon and i.MX8M.
Tested by visa@
ok mpi@
|
| |
|
|
|
|
|
|
|
|
| |
the device is gone and give back the descriptor to the stack.
Without this usbd_abort_pipe() could end up in an infinite loop.
Issue reported by Tom Murphy.
|
|
|
|
|
|
|
| |
Prevent triggering an assert if two drivers try to submit a command
at the same time.
Issue reported by Tom Murphy.
|
| |
|
|
|
|
|
|
| |
flip before the rest of the TRB is updated.
OK dlg@, pirofti@, mpi@
|
|
|
|
| |
ok patrick@, kettenis@
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Use this helper to calculate the Transfer Burst Count (TBC) and Transfer
Last Burst Packet Count (TLBPC) required for isochronous support.
Note that SS companion descriptors are still not read.
While here print the ETE and IST values in debug mode.
|
| |
|
|
|
|
|
|
| |
While here use UE_GET_SIZE() coherently.
ok pirofti@, stsp@, visa@
|
|
|
|
| |
ok stsp@
|
|
|
|
| |
ok stsp@
|
|
|
|
|
|
|
|
|
| |
This is just a step forward which allows further progress to happen in-tree.
The isochronous code path remains disabled for now. Playing audio over
xhci(4) does not work properly yet, and I haven't even tested video input.
Based on a work-in-progress diff by mpi@ from 2015.
ok mpi@
|
|
|
|
| |
It made one of my machines get stuck during boot.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each TRB contains a remaining TD size, which allows hardware to tell whether
additional TRBs follow within the current transfer without reading ahead.
The length of the first TRB was subtracted from the total length before
calculating the remaining TD sizes. This is wrong because remaining TD sizes
are relative to the size of the entire transfer, including the first TRB.
Our current USB code does not trigger this bug because there is no code in
upper layers yet which triggers use of multiple TRBs per transfer.
ok mpi@
|
|
|
|
|
|
| |
access.
ok visa@, mpi@, deraadt@
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
*_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@
|
|
|
|
|
|
|
|
|
| |
Do not fold multiple DMA synchronizations into one when chaining TRBs
as the ring might wrap.
Add missing "READ" transfer direction from the HC to host when applicable.
From Marius Strobl.
|
|
|
|
|
|
| |
size based on the device speed.
Tested by and ok jsg@, mlarkin@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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);
|
|
|
|
|
|
|
|
|
|
| |
stack.
Unbreak polling mode when the host Babbles because a reset of the ring
is necessary and xhci_waitintr() stops polling as soon as the xfer
status changed.
Problem reported by and ok krw@
|
|
|
|
|
|
|
|
|
|
|
|
| |
indicating a warm reset has happened. Communicate this as UPS_C_BH_PORT_RESET
to the upper layers and make uhub(4) clear this bit such that we receive
further connection status change notifications. Make sure we only do this
for super speed (USB 3.0) hubs as high speed (USB 2.0) hubs use the same bit
for UPS_C_PORT_L1.
Make hotplugging USB 3.0 devices work on my MacBookPro12,1.
ok mpi@
|
|
|
|
| |
ok visa@
|
|
|
|
|
|
| |
bytes to transfer is superior to the length of the transfer.
Found by krw@ with an ETRON controller.
|
|
|
|
|
|
|
|
| |
Allow to re-plug USB3 devices on the root hub withtout going through a
suspend/resume cycle (or rebooting) with Intel ICH7 xHCI as found the
hardway by sobrado@.
Debugging help from M.A.R. Osorio, tested by sobrado@
|
|
|
|
|
|
|
|
|
|
| |
There's not bit to indicate the speed of a USB3.0 device attached to a hub
port so do not abuse the PORT_TEST bit. Instead make the xhci(4) root hub
report the PORT_POWER_SS bit when appropriate and use it to determin the
speed of a new device.
While here make the root hub report the link state and config error, from
FreeBSD.
|
|
|
|
| |
From FreeBSD, OK mpi
|
|
|
|
| |
Reported by Takahiro HAYASHI on bugs@, thanks!
|
|
|
|
|
|
|
|
|
|
|
| |
because the HC has been shut down (during suspend/hibernate) or
removed (PCIe card).
In both cases the hardware wont complete the commands, resulting in
timeouts. Instead just do the software part of the abort process.
Unbreak suspend/resume with USB a device connected to xhci(4) as
reported by Fabian Raetz on bugs@.
|
|
|
|
| |
maintain a list of possibly submitted commands.
|
|
|
|
|
|
|
|
|
|
| |
Because our USB stack wants the aborted xfer to be removed from the
pipe during abort(), we have to sleep in the abort function.
Regarding the xHCI process, when a TD is being aborted, we simply stop
the endpoint and then move the dequeue pointer past its last TRB. This
is fairly simple for the moment since only one xfer can be pending on a
given pipe.
|