aboutsummaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)Author
2012-10-11usb-host: allow emulated (non-async) control requests without USBPacketGerd Hoffmann
xhci needs this for USB_REQ_SET_ADDRESS due to the way usb addressing is handled by the xhci hardware. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 63587e31353b6652cadfcfb869f5692a2b69daeb) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11qxl: dont update invalid areaDunrong Huang
This patch fixes the following error: $ ~/usr/bin/qemu-system-x86_64 -enable-kvm -m 1024 -spice port=5900,disable-ticketing -vga qxl -cdrom ~/Images/linuxmint-13-mate-dvd-32bit.iso (/home/mathslinux/usr/bin/qemu-system-x86_64:10068): SpiceWorker-CRITICAL **: red_worker.c:4599:red_update_area: condition `area->left >= 0 && area->top >= 0 && area->left < area->right && area->top < area->bottom' failed Aborted spice server terminates QEMU process if we pass invalid area to it, so dont update those invalid areas. Signed-off-by: Dunrong Huang <riegamaths@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit ccc2960d654a233a6ed415b37d8ff41728d817c5) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11xhci: allow bytewise capability register readsGerd Hoffmann
Some guests need this according to Alejandro Martinez Ruiz <alex@securiforest.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 6ee021d41078844df60a3a466e3829a3e82776f3) Conflicts: hw/usb/hcd-xhci.c Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11xhci: fix runtime write tracepointGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 8e9f18b6db1cd67f0a7efd7d0285bee489445197) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11xhci: drop bufferingGerd Hoffmann
This patch splits the xhci_xfer_data function into three. The xhci_xfer_data function used to do does two things: (1) copy transfer data between guest memory and a temporary buffer. (2) report transfer results to the guest using events. Now we three functions to handle this: (1) xhci_xfer_map creates a scatter list for the transfer and uses that (instead of the temporary buffer) to build a USBPacket. (2) xhci_xfer_unmap undoes the mapping. (3) xhci_xfer_report sends out events. The patch also fixes reporting of transaction errors which must be reported unconditinally, not only in case the guest asks for it using the ISP flag. [ v2: fix warning ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit d5a15814b413869667b2a3215772986885be574a) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11xhci: rip out background transfer codeGerd Hoffmann
original xhci code (the one which used libusb directly) used to use 'background transfers' for iso streams. In upstream qemu the iso stream buffering is handled by usb-host & usb-redir, so we will never ever need this. It has been left in as reference, but is dead code anyway. Rip it out. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 331e9406f152b6bae6859a153d36e5076c58901d) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11usb-audio: fix usb versionGerd Hoffmann
usb-audio is a full speed (1.1) device, but bcdUSB claims it is usb 2.0. Fix it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 2bbd086c41a00dc4384727ec895a94890c688eb5) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11Better name usb braille deviceSamuel Thibault
Windows users need to know that they have to use the Baum driver to make the qemu braille device work. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 2964cd9bfa5100e433471d3e3fedcc9d62891894) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11usb-redir: Return babble when getting more bulk data then requestedHans de Goede
Babble is the appropriate error in this case (rather then signalling a stall). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 2979a36183a3902cd75665e7c6bbc8668668fd17) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11usb-redir: Move to core packet id and queue handlingHans de Goede
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit de550a6afb468ed3b8171019e19b63ae8254886d) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11usb-redir: Get rid of unused async-struct dev memberHans de Goede
This is a preparation patch for completely getting rid of the async-packet struct in usb-redir, instead relying on the (new) per ep queues in the qemu usb core. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 206e7f20fe7b920b362bcc02608680c5d5527f2a) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11usb-redir: Get rid of local shadow copy of packet headersHans de Goede
The shadow copy only serves as an extra check (besides the packet-id) to ensure the packet we get back is a reply to the packet we think it is. This check has never triggered in all the time usb-redir is in use now, and since the verified data in the returned packet-header is not used otherwise, removing the check does not open any possibilities for the usbredirhost to confuse us. This is a preparation patch for completely getting rid of the async-packet struct in usb-redir, instead relying on the (new) per ep queues in the qemu usb core. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 104981d52b63dc3d68f39d4442881c667f44bbb9) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11usb-redir: Get rid of async-struct get memberHans de Goede
This is a preparation patch for completely getting rid of the async-packet struct in usb-redir, instead relying on the (new) per ep queues in the qemu usb core. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit cb897117cdedd488f19985c8ec5ea05971103a27) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11usb-redir: Don't delay handling of open events to a bottom halfHans de Goede
There is no need for this, and doing so means that a backend trying to write immediately after an open event will see qemu_chr_be_can_write returning 0, which not all backends handle well as there is no wakeup mechanism to detect when the frontend does become writable. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit ed9873bfbf145c084d039baab08c63b9d67e7bd3) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11usb-redir: Never return USB_RET_NAK for async handled packetsHans de Goede
USB_RET_NAK is not a valid response for async handled packets (and will trigger an assert as such). Also drop the warning when receiving a status of cancelled for packets not cancelled by qemu itself, this can happen when a device gets unredirected by the usbredir-host while transfers are pending. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 181133404f520fab40a3ad40d935d91cf3cf546c) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11ehci: Correct a comment in fetchqtd packet processingHans de Goede
Since my previous comment said "Should never happen", I tried changing the next line to an assert(0), which did not go well, which as the new comments explains is logical if you think about it for a moment. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit cf1f81691d1998fa8fe5bfcb8b498fb3723cf3c3) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11ehci: Handle USB_RET_PROCERR in ehci_fill_queueHans de Goede
USB_RET_PROCERR can be triggered by the guest (by for example requesting more then BUFFSIZE bytes), so don't assert on it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit eff6dce79bd7ad3c16d75c5e55b5a2a137ba6a60) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11ehci: Fix memory leak in handling of NAK-ed packetsHans de Goede
Currently each time we try to execute a NAK-ed packet we redo ehci_init_transfer, and usb_packet_map, re-allocing (without freeing) the sg list every time. This patch fixes this, it does this by introducing another async state, so that we also properly cleanup a NAK-ed packet on cancel. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit ef5b234477df80700b128f561f5877a0688a70c8) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11ehci: Add some additional ehci_trace_guest_bug() callsHans de Goede
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 3a8ca08e01ea4baafff2a513655008cdd00feebf) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11ehci: add doorbell trace eventsGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 1defcbd1e81d67476b6e4e486bcd4d869162900d) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11ehci: trace guest bugsGerd Hoffmann
make qemu_queue_{cancel,reset} return the number of packets released, so the caller can figure whenever there have been active packets even though there shouldn't have been any. Add tracepoint to log this. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 5c514681abbb3ae2f61f517c1aa3197f2f3ca93c) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11ehci: check for EHCI_ASYNC_FINISHED first in ehci_free_packetGerd Hoffmann
Otherwise we'll see the packet free twice in the trace log even though it actually happens only once. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 616789cde2a83fad5e634880fd20214f0c984fd5) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11ehci: Properly report completed but not yet processed packets to the guestHans de Goede
Reported packets which have completed before being cancelled as such to the host. Note that the new code path this patch adds is untested since it I've been unable to actually trigger the race which needs this code path. Signed-off-by: Hans de Goede <hdegoede@redhat.com> (cherry picked from commit 4b63a0df3bda8a2c278e45d9d94d9ba6d5791d8d) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11ehci: Properly cleanup packets on cancelHans de Goede
Signed-off-by: Hans de Goede <hdegoede@redhat.com> (cherry picked from commit 0e7953525f52aa6c098dc0c1ce0b4a80ce82da45) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11ehci: Update copyright headers to reflect recent workHans de Goede
Update copyright headers to reflect all the work Gerd and I have been doing on the EHCI emulation. Signed-off-by: Hans de Goede <hdegoede@redhat.com> (cherry picked from commit 522079dd4461c38b9a88bf31a65ea038c5b2be45) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11ehci: Validate qh is not changed unexpectedly by the guestHans de Goede
-combine the qh check with the check for devaddr changes -also ensure that p gets set to NULL when the queue gets cancelled on devaddr change, which was not done properly before this patch Signed-off-by: Hans de Goede <hdegoede@redhat.com> (cherry picked from commit dafe31fc2a8653b535d58f8c7b250c0827b14420) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11Revert "ehci: don't flush cache on doorbell rings."Hans de Goede
This reverts commit 9bc3a3a216e2689bfcdd36c3e079333bbdbf3ba0, which got added to fix an issue where the real, underlying cause was not stopping the ep queue on an error. Now that the underlying cause is fixed by the "usb: Halt ep queue and cancel pending packets on a packet error" patch, the "don't flush" fix is no longer needed. Not only is it not needed, it causes us to see cancellations (unlinks) done by the Linux EHCI driver too late, which in combination with the new usb-core packet-id generation where qtd addresses are used as ids, causes duplicate ids for in flight packets. Signed-off-by: Hans de Goede <hdegoede@redhat.com> (cherry picked from commit 66f092d25697e11847b61d761c38ddebedaed8d1) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11usb-core: Allow the first packet of a pipelined ep to complete immediatelyHans de Goede
This can happen with usb-redir live-migration when the packet gets re-queued after the migration and the original queuing from the migration source side has already finished. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 9c1f67654ab611553bbfca54a1e0922728c25760) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11usb-core: Add a usb_ep_find_packet_by_id() helper functionHans de Goede
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit c13a9e61366cc3e28299d8faeb65e65c6e5964cf) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11usb-core: Don't set packet state to complete on a nakHans de Goede
This way the hcd can re-use the same packet to retry without needing to re-init it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit cc40997489260f405aecccd30d4626ceee862502) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-11usb: controllers do not need to check for babble themselvesHans de Goede
If an (emulated) usb-device tries to write more data to a packet then its iov len, this will trigger an assert in usb_packet_copy(), and if a driver somehow circumvents that check and writes more data to the iov then there is space, we have a much bigger problem then not correctly reporting babble to the guest. In practice babble will only happen with (real) redirected devices, and there both the usb-host os and the qemu usb-device code already check for it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 45b339b18c660eb85af2ba25bfcaed5469660d77) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-09hw/mcf5206: Fix buffer overflow for MBAR read / writeStefan Weil
Report from smatch: mcf5206.c:384 m5206_mbar_readb(7) error: buffer overflow 'm5206_mbar_width' 128 <= 128 mcf5206.c:403 m5206_mbar_readw(8) error: buffer overflow 'm5206_mbar_width' 128 <= 128 mcf5206.c:427 m5206_mbar_readl(8) error: buffer overflow 'm5206_mbar_width' 128 <= 128 mcf5206.c:451 m5206_mbar_writeb(9) error: buffer overflow 'm5206_mbar_width' 128 <= 128 mcf5206.c:475 m5206_mbar_writew(9) error: buffer overflow 'm5206_mbar_width' 128 <= 128 mcf5206.c:503 m5206_mbar_writel(9) error: buffer overflow 'm5206_mbar_width' 128 <= 128 m5206_mbar_width has 0x80 elements and supports 0 <= offset < 0x200. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit a32354e206895400d17c3de9a8df1de96d3df289) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-09hw/wm8750: Fix potential buffer overflowStefan Weil
Report from smatch: hw/wm8750.c:369 wm8750_tx(12) error: buffer overflow 's->i2c_data' 2 <= 2 It looks like the preprocessor statements were simply misplaced. Replace also __FUNCTION__ by __func__ to please checkpatch.pl. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 149eeb5fe57b853081e8059575d91b8a58a4f96c) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-09musicpal: Fix flash mappingJan Kiszka
The old arithmetic assumed 32 physical address bits which is no longer true for ARM since 3cc0cd61f4. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> (cherry picked from commit 0c267217ca9985e6d118ec8368bebd382db7a099) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-09lan9118: fix multicast filteringAurelien Jarno
The lan9118 emulation tries to compute the multicast index by calling directly the crc32() function from zlib, but fails to get the correct result. Use the common compute_mcast_idx() function instead, which gives the correct result. This fixes IPv6 support. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 449bc90e1f2e2fbafb64eb0c76d16c9352b0d2df) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-09fix entry pointer for ELF kernels loaded with -kernel optionHenning Schild
Find a hopefully proper patch attached. Take it or leave it. Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Henning Schild <henning@hennsch.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 7e9c7ffe9fd9dfc3d0168dd584936db8144b230b) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-09pcie_aer: clear cmask for Advanced Error Interrupt Message NumberJason Baron
The Advanced Error Interrupt Message Number (bits 31:27 of the Root Error Status Register) is updated when the number of msi messages assigned to a device changes. Migration of windows 7 on q35 chipset failed because the check in get_pci_config_device() fails due to cmask being set on these bits. Its valid to update these bits and we must restore this state across migration. Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit 0e180d9c8a7429c55d23d2e7855f1e490a063aaa) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-09pcie: drop version_id field for live migrationJason Baron
While testing q35 live migration, I found that the migration would abort with the following error: "Unknown savevm section type 76". The error is due to this check failing in 'vmstate_load_state()': while(field->name) { if ((field->field_exists && field->field_exists(opaque, version_id)) || (!field->field_exists && field->version_id <= version_id)) { The VMSTATE_PCIE_DEVICE() currently has a 'version_id' set to 2. However, 'version_id' in the above check is 1. And thus we fail to load the pcie device field. Further the code returns to 'qemu_loadvm_state()' which produces the error that I saw. I'm proposing to fix this by simply dropping the 'version_id' field from VMSTATE_PCIE_DEVICE(). VMSTATE_PCI_DEVICE() defines no such field and further the vmstate_pcie_device that VMSTATE_PCI_DEVICE() refers to is already versioned. Thus, any versioning issues could be detected at the vmsd level. Taking a step back, I think that the 'field->version_id' should be compared against a saved version number for the field not the 'version_id'. Futhermore, once vmstate_load_state() is called recursively on another vmsd, the check of: if (version_id > vmsd->version_id) { return -EINVAL; } Will never fail since version_id is always equal to vmsd->version_id. So I'm wondering why we aren't storing the vmsd version id of the source in the migration stream? This patch also renames the 'name' field of vmstate_pcie_device from: PCIDevice -> PCIEDevice to differentiate it from vmstate_pci_device. Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit 1de53459272d89c52bb21b45d5d970de40fbb642) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-09qxl: add QXL_IO_MONITORS_CONFIG_ASYNCAlon Levy
Revision bumped to 4 for new IO support, enabled for spice-server >= 0.11.1. New io enabled if revision is 4. Revision can be set to 4. [ kraxel: 3 continues to be the default revision. Once we have a new stable spice-server release and the qemu patches to enable the new bits merged we'll go flip the switch and make rev4 the default ] This io calls the corresponding new spice api spice_qxl_monitors_config_async to let spice-server read a new guest set monitors config and notify the client. On migration reissue spice_qxl_monitors_config_async. RHBZ: 770842 Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> fixup Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 020af1c45fec664d5d4cf3b8e5117f8bc1d691f2) Conflicts: hw/qxl.c Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-09qxl/update_area_io: guest_bug on invalid parametersAlon Levy
Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 511b13e2c9b426b3c56060909693de5097f0b496) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-09spice: notify on vm state change only via spice_server_vm_start/stopYonit Halperin
QXLWorker->start/stop are deprecated since spice-server 0.11.2 Signed-off-by: Yonit Halperin <yhalperi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> (cherry picked from commit 71d388d420e68ac77cd42f15f7e68cf5a6fb01b2) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-10-09Remove unused CONFIG_TCG_PASS_AREG0 and dead codeBlue Swirl
Now that CONFIG_TCG_PASS_AREG0 is enabled for all targets, remove dead code and support for !CONFIG_TCG_PASS_AREG0 case. Remove dyngen-exec.h and all references to it. Although included by hw/spapr_hcall.c, it does not seem to use it. Remove unused HELPER_CFLAGS. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-08-31uas: move transfer kickoffGerd Hoffmann
Kick next scsi transfer from request release callback instead of command completion callback, otherwise we might get stuck in case scsi_req_unref() doesn't release the request instantly due to someone else holding a reference too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-08-31ehci: Fix interrupt endpoints no longer workingHans de Goede
One of the recent changes (likely the addition of queuing support) has broken interrupt endpoints, this patch fixes this. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-08-31ehci: handle TD deactivation of inflight packetsGerd Hoffmann
Check the TDs of inflight packets, cancel packets in case the guest clears the active bit. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-08-31ehci: add ehci_cancel_queue()Gerd Hoffmann
Factor out function to cancel all packets of a queue. No behavior change. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-08-31ehci: simplify ehci_state_executingHans de Goede
ehci_state_executing does not need to check for p->usb_status == USB_RET_ASYNC or USB_RET_PROCERR, since ehci_execute_complete already does a similar check and will trigger an assert if either value is encountered. USB_RET_ASYNC should never be the packet status when execute_complete runs for obvious reasons, and USB_RET_PROCERR is only used by ehci_state_execute / ehci_execute not by ehci_state_executing / ehci_execute_complete. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-08-31ehci: Remove unnecessary ehci_flush_qh callHans de Goede
ehci_qh_do_overlay() already calls ehci_flush_qh() before it returns, calling it twice is useless. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-08-31ehci: Schedule async-bh when IAAD bit gets setHans de Goede
After the "ehci: Print a warning when a queue unexpectedly contains packets on cancel" commit. Under certain reproducable conditions I was getting the following message: "EHCI: Warning queue not empty on queue reset". After aprox. 8 hours of debugging I've finally found the cause. The Linux EHCI driver has an IAAD watchdog, to work around certain EHCI hardware sometimes not acknowledging the doorbell at all. This watchdog has a timeout of 10 ms, which is less then the time between 2 runs through the async schedule when async_stepdown is at its highest value. Thus the watchdog can trigger, after which Linux clears the IAAD bit and re-uses the QH. IOW we were not properly detecting the unlink of the qh, due to us missing (ignoring for more then 10 ms) the IAAD command, which triggered the warning. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-08-31ehci: Fix NULL ptr deref when unplugging an USB dev with an iso stream activeHans de Goede
Signed-off-by: Hans de Goede <hdegoede@redhat.com>