1. 22 12月, 2011 3 次提交
    • S
      UAS: Free status URB when we can't find the SCSI tag. · 96c1eb98
      Sarah Sharp 提交于
      In the UAS status URB completion handler, we need to free the URB, no
      matter what happens.  Fix a bug where we would leak the URB (and its
      buffer) if we couldn't find a SCSI command that is associated with this
      status phase.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      96c1eb98
    • S
      UAS: Use unique tags on non-streams devices. · 9eb44541
      Sarah Sharp 提交于
      UAS can work with either USB 3.0 devices that support bulk streams, or
      USB 2.0 devices that do not support bulk streams.  When we're working
      with a non-streams device, we need to be able to uniquely identify a
      SCSI command with a tag in the IU.  Devices will barf and abort all
      queued commands if they find a duplicate tag.
      
      uas_queuecommand_lck() sets cmdinfo->stream to zero if the device
      doesn't support streams, which is later passed into uas_alloc_cmd_urb()
      as the variable stream.  This means the UAS driver was setting the tag
      in all commands to zero for non-stream devices.  So the UAS driver won't
      currently work with USB 2.0 devices.
      
      Use the SCSI command tag instead of the stream ID for the command IU
      tag.  We have to add one to the SCSI command tag because SCSI tags are
      zero-based, but stream IDs are one-based, and the command tag must match
      the stream ID that we're queueing the data IUs for.  Untagged SCSI
      commands use stream ID 1.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      9eb44541
    • S
      UAS: Re-add workqueue items if submission fails. · ea9da1c7
      Sarah Sharp 提交于
      If the original submission (or allocation) of the URBs for a SCSI
      command fails, the UAS driver sticks the command structure in a
      workqueue and schedules uas_do_work() to run.  That function removes the
      entire queue before walking across it and attempting to resubmit.
      
      Unfortunately, if the second submission fails, we will leak memory
      (because an allocated URB was not submitted) and possibly leave the SCSI
      command partially enqueued on some of the stream rings.  Fix this by
      checking whether the second submission failed and re-queueing the
      command to the UAS workqueue and scheduling it.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      ea9da1c7
  2. 01 11月, 2011 1 次提交
  3. 16 12月, 2010 5 次提交
  4. 17 11月, 2010 1 次提交
    • J
      SCSI host lock push-down · f281233d
      Jeff Garzik 提交于
      Move the mid-layer's ->queuecommand() invocation from being locked
      with the host lock to being unlocked to facilitate speeding up the
      critical path for drivers who don't need this lock taken anyway.
      
      The patch below presents a simple SCSI host lock push-down as an
      equivalent transformation.  No locking or other behavior should change
      with this patch.  All existing bugs and locking orders are preserved.
      
      Additionally, add one parameter to queuecommand,
      	struct Scsi_Host *
      and remove one parameter from queuecommand,
      	void (*done)(struct scsi_cmnd *)
      
      Scsi_Host* is a convenient pointer that most host drivers need anyway,
      and 'done' is redundant to struct scsi_cmnd->scsi_done.
      
      Minimal code disturbance was attempted with this change.  Most drivers
      needed only two one-line modifications for their host lock push-down.
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      Acked-by: NJames Bottomley <James.Bottomley@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f281233d
  5. 10 11月, 2010 1 次提交
    • C
      block: remove REQ_HARDBARRIER · 02e031cb
      Christoph Hellwig 提交于
      REQ_HARDBARRIER is dead now, so remove the leftovers.  What's left
      at this point is:
      
       - various checks inside the block layer.
       - sanity checks in bio based drivers.
       - now unused bio_empty_barrier helper.
       - Xen blockfront use of BLKIF_OP_WRITE_BARRIER - it's dead for a while,
         but Xen really needs to sort out it's barrier situaton.
       - setting of ordered tags in uas - dead code copied from old scsi
         drivers.
       - scsi different retry for barriers - it's dead and should have been
         removed when flushes were converted to FS requests.
       - blktrace handling of barriers - removed.  Someone who knows blktrace
         better should add support for REQ_FLUSH and REQ_FUA, though.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      02e031cb
  6. 23 10月, 2010 1 次提交