1. 18 7月, 2012 1 次提交
  2. 14 7月, 2012 13 次提交
  3. 13 7月, 2012 1 次提交
  4. 12 7月, 2012 6 次提交
  5. 10 7月, 2012 1 次提交
    • P
      scsi: add free_request callback · 8e86b93c
      Paolo Bonzini 提交于
      Most device models have a simple lifecycle for the hba_private field
      and they can free it when a request is completed or cancelled.
      However, in some cases it may be simpler to tie the lifetime
      of hba_private to that of the included SCSIRequest.  This patch
      adds a free_request callback to SCSIBusInfo that lets an HBA
      device model do exactly that.
      
      Normally, device models use req->hba_private == NULL to flag requests
      that have been completed already.  Device models that use free_request
      will still need to track this using a flag.  This is the reason why
      "converting" existing HBAs to use free_request adds complexity and
      makes little sense.  It is simply an additional convenience that is
      provided by the SCSI layer.  USB-attached storage will be the first
      user.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      8e86b93c
  6. 09 7月, 2012 12 次提交
    • M
      fdc: Drop broken code for user-defined floppy geometry · 1f69c2b0
      Markus Armbruster 提交于
      bdrv_get_floppy_geometry_hint() fails to store through its parameter
      drive when bs has a geometry hint.  Makes fd_revalidate() assign
      random crap to drv->drive.
      
      Has been broken that way for ages.  Harmless, because:
      
      * The only way to set a geometry hint is -drive if=none,cyls=...
        Since commit c219331e, probably unintentional.
      
      * The only use of drv->drive is as argument to another
        bdrv_get_floppy_geometry_hint().  Which doesn't use it, since the
        geometry hint is still there.
      
      Drop the broken code, ignore -drive parameter cyls, heads and secs for
      floppies even with if=none, just like before commit c219331e.  Matches
      -help, which explains cyls, heads, secs as "hard disk physical
      geometry".
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      1f69c2b0
    • P
      fdc: fix interrupt handling · 2fee0088
      Pavel Hrdina 提交于
      If you call the SENSE INTERRUPT STATUS command while there is no interrupt
      waiting you get as result unknown command.
      
      Fixed status0 register handling for read/write/format commands.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      2fee0088
    • P
      fdc: rewrite seek and DSKCHG bit handling · 6be01b1e
      Pavel Hrdina 提交于
      This bit is cleared on every successful seek to a different track (cylinder).
      The seek is also called on revalidate or on read/write/format commands which
      also clear the DSKCHG bit.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      6be01b1e
    • G
      usb-host: add trace events for iso xfers · c32da151
      Gerd Hoffmann 提交于
      Replace iso transfer fprintf's with trace points.  Also rename existing
      tracepoints so they all match usb_host_iso_*.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      c32da151
    • G
      usb: fix interface initialization · 7c37e6a4
      Gerd Hoffmann 提交于
      zero is a valid interface number, so don't use it when resetting the
      endpoints.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      7c37e6a4
    • G
      usb: split endpoint init and reset · 19deaa08
      Gerd Hoffmann 提交于
      Create a new usb_ep_reset() function to reset endpoint state, without
      re-initialiting the queues, so we don't unlink in-flight packets just
      because usb-host has to re-parse the descriptor tables.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      19deaa08
    • H
    • H
      ehci: Kick async schedule on wakeup in the non companion case · 37952117
      Hans de Goede 提交于
      Commit 0f588df8, added code
      to ehci_wakeup to kick the async schedule on wakeup, but the else
      was positioned wrong making it trigger for devices which are routed
      to the companion rather then to the ehci controller itself.
      
      This patch fixes this. Note that the "programming style" with using the
      return at the end of the companion block matches how the companion case
      is handled in the other ports ops, and is done this way for consistency.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      37952117
    • H
      usb-ehci: Fix an assert whenever isoc transfers are used · 7341ea07
      Hans de Goede 提交于
      hcd-ehci.c is missing an usb_packet_init() call for the ipacket UsbPacket
      it 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
      USB device.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      7341ea07
    • G
      ehci: don't flush cache on doorbell rings. · 9bc3a3a2
      Gerd Hoffmann 提交于
      Commit 4be23939 makes ehci instantly
      zap any unlinked queue heads when the guest rings the doorbell.
      
      While hacking up uas support this turned out to be a problem.  The linux
      kernel can unlink and instantly relink the very same queue head, thereby
      killing any async packets in flight.  That alone isn't an issue yet, the
      packet will canceled and resubmitted and everything is fine.  We'll run
      into trouble though in case the async packet is completed already, so we
      can't cancel it any more.  The transaction is simply lost then.
      
      usb_ehci_qh_ptrs q (nil) - QH @ 39c4f000: next 39c4f122 qtds 00000000,00000001,39c50000
      usb_ehci_qh_fields QH @ 39c4f000 - rl 0, mplen 0, eps 0, ep 0, dev 0
      usb_ehci_qh_ptrs q 0x7f95feba90a0 - QH @ 39c4f000: next 39c4f122 qtds 00000000,00000001,39c50000
      usb_ehci_qh_fields QH @ 39c4f000 - rl 0, mplen 0, eps 0, ep 0, dev 0
      usb_ehci_qh_ptrs q 0x7f95fe515210 - QH @ 39c4f120: next 39c4f0c2 qtds 29dbce40,29dbc4e0,00000009
      usb_ehci_qh_fields QH @ 39c4f120 - rl 4, mplen 512, eps 2, ep 1, dev 2
      usb_ehci_packet_action q 0x7f95fe515210 p 0x7f95fdec32a0: alloc
      usb_packet_state_change bus 0, port 2, ep 1, packet 0x7f95fdec32e0, state undef -> setup
      usb_ehci_packet_action q 0x7f95fe515210 p 0x7f95fdec32a0: process
      usb_uas_command dev 2, tag 0x2, lun 0, lun64 00000000-00000000
      scsi_req_parsed target 0 lun 0 tag 2 command 42 dir 2 length 16384
      scsi_req_parsed_lba target 0 lun 0 tag 2 command 42 lba 5933312
      scsi_req_alloc target 0 lun 0 tag 2
      scsi_req_continue target 0 lun 0 tag 2
      scsi_req_data target 0 lun 0 tag 2 len 16384
      usb_uas_scsi_data dev 2, tag 0x2, bytes 16384
      usb_uas_write_ready dev 2, tag 0x2
      usb_packet_state_change bus 0, port 2, ep 1, packet 0x7f95fdec32e0, state setup -> complete
      usb_ehci_packet_action q 0x7f95fe515210 p 0x7f95fdec32a0: free
      usb_ehci_qh_ptrs q 0x7f95fdec3210 - QH @ 39c4f0c0: next 39c4f002 qtds 29dbce40,00000001,00000009
      usb_ehci_qh_fields QH @ 39c4f0c0 - rl 4, mplen 512, eps 2, ep 2, dev 2
      usb_ehci_queue_action q 0x7f95fe5152a0: free
      usb_packet_state_change bus 0, port 2, ep 2, packet 0x7f95feba9170, state async -> complete
      ^^^ async packets completes.
      usb_ehci_packet_action q 0x7f95fdec3210 p 0x7f95feba9130: wakeup
      
      usb_ehci_qh_ptrs q (nil) - QH @ 39c4f000: next 39c4f122 qtds 00000000,00000001,39c50000
      usb_ehci_qh_fields QH @ 39c4f000 - rl 0, mplen 0, eps 0, ep 0, dev 0
      usb_ehci_qh_ptrs q 0x7f95feba90a0 - QH @ 39c4f000: next 39c4f122 qtds 00000000,00000001,39c50000
      usb_ehci_qh_fields QH @ 39c4f000 - rl 0, mplen 0, eps 0, ep 0, dev 0
      usb_ehci_qh_ptrs q 0x7f95fe515210 - QH @ 39c4f120: next 39c4f002 qtds 29dbc4e0,29dbc8a0,00000009
      usb_ehci_qh_fields QH @ 39c4f120 - rl 4, mplen 512, eps 2, ep 1, dev 2
      usb_ehci_queue_action q 0x7f95fdec3210: free
      usb_ehci_packet_action q 0x7f95fdec3210 p 0x7f95feba9130: free
      ^^^ endpoint #2 queue head removed from schedule, doorbell makes ehci zap the queue,
          the (completed) usb packet is freed too and gets lost.
      
      usb_ehci_qh_ptrs q (nil) - QH @ 39c4f000: next 39c4f0c2 qtds 00000000,00000001,39c50000
      usb_ehci_qh_fields QH @ 39c4f000 - rl 0, mplen 0, eps 0, ep 0, dev 0
      usb_ehci_qh_ptrs q 0x7f95feba90a0 - QH @ 39c4f000: next 39c4f0c2 qtds 00000000,00000001,39c50000
      usb_ehci_qh_fields QH @ 39c4f000 - rl 0, mplen 0, eps 0, ep 0, dev 0
      usb_ehci_queue_action q 0x7f9600dff570: alloc
      usb_ehci_qh_ptrs q 0x7f9600dff570 - QH @ 39c4f0c0: next 39c4f122 qtds 29dbce40,00000001,00000009
      usb_ehci_qh_fields QH @ 39c4f0c0 - rl 4, mplen 512, eps 2, ep 2, dev 2
      usb_ehci_packet_action q 0x7f9600dff570 p 0x7f95feba9130: alloc
      usb_packet_state_change bus 0, port 2, ep 2, packet 0x7f95feba9170, state undef -> setup
      usb_ehci_packet_action q 0x7f9600dff570 p 0x7f95feba9130: process
      usb_packet_state_change bus 0, port 2, ep 2, packet 0x7f95feba9170, state setup -> async
      usb_ehci_packet_action q 0x7f9600dff570 p 0x7f95feba9130: async
      ^^^ linux kernel relinked the queue head, ehci creates a new usb packet,
          but we should have delivered the completed one instead.
      usb_ehci_qh_ptrs q 0x7f95fe515210 - QH @ 39c4f120: next 39c4f002 qtds 29dbc4e0,29dbc8a0,00000009
      usb_ehci_qh_fields QH @ 39c4f120 - rl 4, mplen 512, eps 2, ep 1, dev 2
      
      So instead of instantly zapping the queue we'll set a flag that the
      queue needs revalidation in case we'll see it again in the schedule.
      ehci then checks that the queue head fields addressing / describing the
      endpoint and the qtd pointer match the cached content before reusing it.
      
      Cc: Hans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      9bc3a3a2
    • G
      ehci: fix td writeback · 4ed1c57a
      Gerd Hoffmann 提交于
      Only write back the dwords the hc is supposed to update.  Should not
      make a difference in theory as the guest must not touch the td while
      it is active to avoid races.  But it is still more correct.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      4ed1c57a
    • G
      ehci: fix ehci_qh_do_overlay · a5e0139a
      Gerd Hoffmann 提交于
      Use ehci_flush_qh to make sure we touch inly the fields the hc is
      allowed to touch.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      a5e0139a
  7. 04 7月, 2012 6 次提交