| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
is detected, simply keep track of the faulty xfer instead of completing
all the pending ones.
Fix a race condition where we could end up aborting a freshly enqueued
xfer when two different threads are submitting control transfers (i.e.
usbdevs(8) and a kernel driver).
|
|
|
|
|
|
| |
order to read last TRB of the event ring.
Fix a bug introduced in r1.1.
|
|
|
|
|
|
|
| |
bus_dmamap_unload(9) on a map that failed to load is a bad idea and causes
panics on some architectures (such as sparc64).
ok mpi@
|
|
|
|
|
|
|
|
|
| |
This is a workaround needed at least by Renesas controllers. I didn't
find any documentation about this issue and I guess other open source
xHCI implementations do not see this race because they do much more work
upon resume.
Thanks to Remi Locherer for reporting this issue on bugs@.
|
|
|
|
|
|
|
| |
the stack. This will allow stricter checks when aborting transfers.
While here update a comment about short transfer and multi-TRB TD since
bulk transfers can also use a chain now.
|
|
|
|
|
|
|
|
|
|
| |
4.11.2.4 instead of using one TRB per packet. Also make sure that
it is not greater than 31.
While here be paranoid about xfer buffer crossing a 64k boundary
and use a supplementary TRB in such case.
Fix a problem with uplcom(4) on Intel xHCI reported by jasper@.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Chain TRBs when submitting bulk or interrupt transfers with a length
bigger than the Maxium Packet Size of the endpoint.
Append a supplementary TRB if a zero length packet is required.
While here, set the flags of each TRB at once. Even if this driver
implementation fills the first TRB of a chain last, be safe and make
sure the hardware wont miss any flag.
Note that with this change, DMA sync operations might not cover the
whole chain, just like for control transfers, if the ring is starting
over.
Previous version of this diff tested by Peter N. M. Hansteen, thanks!
|
| |
|
|
|
|
| |
ok dlg@ mpi@ bcook@ millert@ miod@
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since xhci(4) does not allocate memory for its rings in interrupt
context, it has no use for the free lists offered by the USB memory
allocator.
Using bus_dmamem_alloc(9) and friends also allows us to respect the
boundary requirement for the various structures specified in Table 54.
While here make use of defines for every alignment and boundary
requirements which are different than a page size.
|
|
|
|
|
| |
dequeue pointer past the last enqueued TRB and let xhci_xfer_done()
properly accounts free TRBs.
|
|
|
|
|
| |
As explained in section 4.11.7 it should be used when a device is
allowed to supply less data than the provided buffer space.
|
|
|
|
| |
a different index value for a chained TRB and a freed one.
|
|
|
|
| |
when submitting a command. No change for non-XHCI_DEBUG kernel.
|
|
|
|
|
|
|
|
|
| |
1. Always unmask the slot context for the "Set Address" command.
2. Use the right spl when submitting a transfer to prevent from
setting up a timer on an already completed xfer.
Analyzed with and ok jsg@
|
|
|
|
|
|
|
|
| |
the second "Set Address" command is issued. This would lead the
HC to reprocess TRBs corresponding to completed transfers.
This was the cause of the "xhci0: NULL xfer pointer" message that
could be seen after attaching a device and reported by naddy@.
|
|
|
|
|
| |
This code is violating various layers of abstraction, just like ehci(4)
does. Transaction translators need a bit more love.
|
|
|
|
|
|
|
|
|
| |
Some Low/Full speed devices do not like to get a SET_ADDRESS command
before we have read (some bits of) their device descriptor. So change
the attach logic to issue two "Device Address" command with a BSR dance.
This should fix the "device problem, disabling port" error seen on root
hubs with some Low/Full speed devices, reported by miod@.
|
|
|
|
|
|
| |
context, not the whole array of endpoints. Yeah, pointers are hard.
Fix a panic reported by Dimitris Papastamos on tech@
|
|
|
|
|
|
| |
xHCI specification r1.1 are handled in this implementation. This is a
bit tricky because our bus interface is pipe-oriented. Hopefully this
will help other people squash the remaining bugs in this area.
|
|
|
|
|
|
| |
protection.
Fix a panic reported by Patrick Wildt.
|
|
|
|
| |
work with xhci(4).
|
|
|
|
| |
might be NULL. Prevent from crashing in this case 8)
|
|
|
|
|
|
|
|
| |
Even if it's very handy to know where a thread is sleeping in order to
debug HC drivers, users might not like to have to restart their machine
if a transfer timed and nothing will wakeup the discovery thread.
Note that I still haven't seen any hardware timeout in all my tests.
|
|
|
|
| |
Patrick Wildt.
|
|
|
|
|
|
|
| |
Express Card is plugged with USB devices on it.
While here do not print an unitialized error value if xhci_init() fails,
from Patrick Wildt.
|
|
|
|
|
|
|
| |
not enough to attach Super Speed devices below USB 3 hubs, but we're
getting there.
While here reset `acten` when re-enqueuing an interrupt transfers.
|
|
|
|
| |
transfer. While here remove/fix other XXXs.
|
|
|
|
|
| |
error. Makes Intel Series 7 controllers happy and no longer report an
illegal context state transition when detaching devices.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
it to the stack when a Short Transfer condition is reported.
In this dummy implementation the ``Event Data TRB'' of a read control
transfer is the only TRB that can trigger an interrupt without being
the last TRB of a transfer. This is done in order to report the
remaining length of a short transfer. But when that happens, we want
to wait until all Transfer TRBs are completed before passing the xfer
to the stack.
Note that clearing the ISP and IOC flags in all Transfer TRBs like it
is specified in 4.10.1.1.1 might not work in our cases because the HC
has most of the time already processed all Transfer TRBs when the driver
dequeues the events in the softinterrupt path.
While here, use the right spl protection when aborting a xfer.
|
| |
|
|
|
|
|
| |
have a separate function anymore, it is just a wrapper around the "set
address" command.
|
|
|
|
| |
with the correct ipl to prevent your CPU from locking against itself.
|
|
|
|
| |
in every HC driver.
|