History | View | Annotate | Download (75.1 kB)
ehci: fix assertion typo
Signed-off-by: Alejandro Martinez Ruiz <alex@securiforest.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
ehci: raise irq in the frame timer
With the async schedule being kicked from other places than the frametimer (commit 0f588df8b3688b00e77aabaa32e26ece5f19bd39) it may happenthat we call ehci_commit_interrupt() more than once per frame.
Move the call from the async schedule handler to the frame timer to...
ehci: implement Interrupt Threshold Control support
Also reorganize and comment the irq functions while being at it.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ehci: improve expire time calculation
Move down the expire time calculation down in the frame timer, to thepoint where the timer is actually reloaded. This way we'll notice anyasync_stepdown changes (especially resetting to 0 due to usb activity).
usb-ehci: Fix an assert whenever isoc transfers are used
hcd-ehci.c is missing an usb_packet_init() call for the ipacket UsbPacketit uses for isoc transfers, triggering an assert (taking the entire vm down)in usb_packet_setup as soon as any isoc transfers are done by a high speed...
ehci: Kick async schedule on wakeup in the non companion case
Commit 0f588df8b3688b00e77aabaa32e26ece5f19bd39, added codeto ehci_wakeup to kick the async schedule on wakeup, but the elsewas positioned wrong making it trigger for devices which are routed...
ehci: don't flush cache on doorbell rings.
Commit 4be23939ab0d7019c7e59a37485b416fbbf0f073 makes ehci instantlyzap any unlinked queue heads when the guest rings the doorbell.
While hacking up uas support this turned out to be a problem. The linuxkernel can unlink and instantly relink the very same queue head, thereby...
ehci: fix ehci_qh_do_overlay
Use ehci_flush_qh to make sure we touch inly the fields the hc isallowed to touch.
ehci: fix td writeback
Only write back the dwords the hc is supposed to update. Should notmake a difference in theory as the guest must not touch the td whileit is active to avoid races. But it is still more correct.
usb: Convert usb_packet_{map, unmap} to universal DMA helpers
The USB UHCI and EHCI drivers were converted some time ago to use thepci_dma_*() helper functions. However, this conversion was not completebecause in some places both these drivers do DMA via the usb_packet_map()...
ehci: add live migration support
ehci: tracing improvements
ehci: add ehci_*_enabled() helpers
Add helper functions to query whenever the async / periodic scheduleis enabled or not. Put them into use too.
ehci: update status bits in ehci_set_state
Update the status register in the ehci_set_state function, to make surethe guest-visible register is in sync with our internal schedule state.
ehci: fix halt status handling
When the enable bits for controller / async schedule / periodic schedulechange just make sure we kick the frame timer and letehci_advance_periodic_state and ehci_advance_async_state handle thecontroller state changes.
This will make ehci set USBSTS_HALT when the controller shutdown is...
ehci: remove unused attach_poll_counter
ehci: create ehci_update_frindex
Factor out code from ehci_frame_timer.
ehci: adaptive wakeup rate.
Adapt the frame timer sleeps according to the actual needs. With theperiodic schedule being active we'll have to wakeup 1000 times persecond and go check for work. In case only the async schedule is activewe can be more lazy though. When idle ehci will increate the sleep time...
ehci: rework frame skipping
Move the framecount check out of the loop and use the newehci_update_frindex function to skip frames if needed.
ehci: add EHCIPacket
Add a separate EHCIPacket struct and move fields over from EHCIQueue.Preparing for supporting multiple packets per queue being in flight atthe same time. No functional changes yet.
Fix some codestyle issues along the way.
ehci: make ehci_execute work on EHCIPacket instead of EHCIQueue
This way it is possible to use ehci_execute to submit others than thefirst EHCIPacket of the EHCIQueue.
ehci: cache USBDevice in EHCIQueue
Keep a USBDevice pointer in EHCIQueue so we don't have to lookup thedevice on each usb packet submission.
ehci: move ehci_flush_qh
Move ehci_flush_qh() function up in the source code.No code change.
ehci: add queuing support
Add packet queuing. Follow the qTD chain to see if there are morepackets we can submit. Improves performance on larger transfers,especially with usb-host, as we don't have to wait for a packet tofinish before sending the next one to the host for processing....
ehci: tweak queue initialization
Little tweak for the queue initialization, set the QH address in theallocation function.
ehci: add async field to EHCIQueue
Keep track whenever a EHCIQueue is part of the async or periodicschedule. This way we don't have to pass around the async flageverywhere but can look it up from the EHCIQueue struct when needed.
ehci: move async schedule to bottom half
This way we can kick the async schedule independant from theperiodic frame timer.
ehci: schedule async bh on async packet completion
When a packet completes which happens to be part of the async schedulekick the async bottom half for processing,
ehci: kick async schedule on wakeup
Kick async schedule when we get a wakeupnotification from a usb device.
ehci: fix reset
Check for the reset bit first when processing USBCMD register writes.Also break out of the switch, there is no need to check the other bits.
fix some common typos
These were identified using: http://github.com/lyda/misspell-checkand run like this to create a bourne shell script using GNU sed's-i option:
git ls-files|grep -vF .bin | misspellings -f - |grep -v '^ERROR:' |perl \-pe 's/^(.*?)\[(\d+)\]: (\w+) -> "(.*?)"$/sed -i '\''${2}s!$3!$4!'\'' $1/'...
usb-ehci: remove hack
To answer the question in the comment removed by this patch: I thinkthis was needed because several places in the ehci emulation did notcheck the T bit of link entries correctly and thus might have followedinvalid references. See commit 2a5ff735dc1074171a0cbb1dc228d6d6e907f571...
usb-ehci: add missing usb_packet_init() call
usb-ehci: Ensure frindex writes leave a valid frindex value
frindex is a 14 bits counter, so bits 31-14 should always be 0, andafter the commit titled "usb-ehci: frindex always is a 14 bits counter" we rely on frindex always being a multiple of 8. I've not seen this in...
usb-ehci: drop assert()
Not sure what the purpose of the assert() was, in any case it is bogous.We can arrive there if transfer descriptors passed to us from the guestfailed to pass sanity checks, i.e. it is guest-triggerable. We dealwith that case by resetting the host controller. Everything is ok, no...
usb-ehci: fix ehci_child_detach
Looks like a cut+paste bug from ehci_detach. When the device itself isdetached from a ehci port (ehci_detach op) we have to clear thedevice pointer for the companion port too. When a device gets removedfrom a downstream port of a usb hub (ehci_child_detach op) the ehci port...
usb-ehci: frindex always is a 14 bits counter
frindex always is a 14 bits counter, and not a 13 bits one as we wereemulating. There are some subtle hints to this in the spec, first of all"Table 2-12. FRINDEX - Frame Index Register" says:"Bit 13:0 Frame Index. The value in this register increments at the end of...
usb-ehci: Drop unused sofv value
The sofv value only ever gets a value assigned and is never used (read)anywhere, so we can just drop it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: the big rename
Reorganize usb source files. Create a new hw/usb/ directory and moveall usb source code to that place. Also make filenames a bit moredescriptive. Host adapters are prefixed with "hch-" now, usb deviceemulations are prefixed with "dev-". Fixup paths Makefile and include...
usb-ehci: drop unused isoch_pause variable