1. 11 May, 2009 1 commit
    • Tejun Heo's avatar
      block: add rq->resid_len · c3a4d78c
      Tejun Heo authored
      
      
      rq->data_len served two purposes - the length of data buffer on issue
      and the residual count on completion.  This duality creates some
      headaches.
      
      First of all, block layer and low level drivers can't really determine
      what rq->data_len contains while a request is executing.  It could be
      the total request length or it coulde be anything else one of the
      lower layers is using to keep track of residual count.  This
      complicates things because blk_rq_bytes() and thus
      [__]blk_end_request_all() relies on rq->data_len for PC commands.
      Drivers which want to report residual count should first cache the
      total request length, update rq->data_len and then complete the
      request with the cached data length.
      
      Secondly, it makes requests default to reporting full residual count,
      ie. reporting that no data transfer occurred.  The residual count is
      an exception not the norm; however, the driver should clear
      rq->data_len to zero to signify the normal cases while leaving it
      alone means no data transfer occurred at all.  This reverse default
      behavior complicates code unnecessarily and renders block PC on some
      drivers (ide-tape/floppy) unuseable.
      
      This patch adds rq->resid_len which is used only for residual count.
      
      While at it, remove now unnecessasry blk_rq_bytes() caching in
      ide_pc_intr() as rq->data_len is not changed anymore.
      
      Boaz	: spotted missing conversion in osd
      Sergei	: spotted too early conversion to blk_rq_bytes() in ide-tape
      
      [ Impact: cleanup residual count handling, report 0 resid by default ]
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Cc: Borislav Petkov <petkovbb@googlemail.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Mike Miller <mike.miller@hp.com>
      Cc: Eric Moore <Eric.Moore@lsi.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Doug Gilbert <dgilbert@interlog.com>
      Cc: Mike Miller <mike.miller@hp.com>
      Cc: Eric Moore <Eric.Moore@lsi.com>
      Cc: Darrick J. Wong <djwong@us.ibm.com>
      Cc: Pete Zaitcev <zaitcev@redhat.com>
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      c3a4d78c
  2. 16 Jan, 2009 1 commit
  3. 02 Jan, 2009 2 commits
  4. 09 Oct, 2008 1 commit
  5. 28 Sep, 2008 1 commit
    • Tejun Heo's avatar
      libata: make SCR access ops per-link · 82ef04fb
      Tejun Heo authored
      
      
      Logically, SCR access ops should take @link; however, there was no
      compelling reason to convert all SCR access ops when adding @link
      abstraction as there's one-to-one mapping between a port and a non-PMP
      link.  However, that assumption won't hold anymore with the scheduled
      addition of slave link.
      
      Make SCR access ops per-link.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      82ef04fb
  6. 27 Jul, 2008 1 commit
  7. 17 Apr, 2008 6 commits
    • Tejun Heo's avatar
      libata: kill ata_noop_dev_select() · c9f75b04
      Tejun Heo authored
      
      
      Now that SFF assumptions are separated out from non-SFF reset
      sequence, port_ops->sff_dev_select() is no longer necessary for
      non-SFF controllers.  Kill ata_noop_dev_select() and ->sff_dev_select
      initialization from base and other non-SFF port_ops.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      c9f75b04
    • Tejun Heo's avatar
      libata: remove check_status from non-SFF drivers · 520d06f9
      Tejun Heo authored
      
      
      Now that all SFF stuff is separated out of core layer, core layer
      doesn't call ops->[alt_]check_status().  In fact, no one calls them
      for non-SFF drivers anymore.  Kill them.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      520d06f9
    • Tejun Heo's avatar
      libata: replace tf_read with qc_fill_rtf for non-SFF drivers · 4c9bf4e7
      Tejun Heo authored
      
      
      Now that all SFF stuff is separated out of core layer, core layer
      doesn't call ops->tf_read directly.  It gets called only via
      ops->qc_fill_rtf() for non-SFF drivers.  This patch directly
      implements private ops->qc_fill_rtf() for non-SFF controllers and kill
      ops->tf_read().
      
      This is much cleaner for non-SFF controllers as some of them have to
      cache SFF register values in private data structure and report the
      cached values via ops->tf_read().  Also, ops->tf_read() gets nasty for
      controllers which don't have clear notion of TF registers when
      operation is not in progress.
      
      As this change makes default ops->qc_fill_rtf unnecessary, move
      ata_sff_qc_fill_rtf() form ata_base_port_ops to ata_sff_port_ops where
      it belongs.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      4c9bf4e7
    • Tejun Heo's avatar
      libata: add qc_fill_rtf port operation · 22183bf5
      Tejun Heo authored
      
      
      On command completion, ata_qc_complete() directly called ops->tf_read
      to fill qc->result_tf.  This patch adds ops->qc_fill_rtf to replace
      hardcoded ops->tf_read usage.
      
      ata_sff_qc_fill_rtf() which uses ops->tf_read to fill result_tf is
      implemented and set in ata_base_port_ops and other ops tables which
      don't inherit from ata_base_port_ops, so this patch doesn't introduce
      any behavior change.
      
      ops->qc_fill_rtf() is similar to ops->sff_tf_read() but can only be
      called when a command finishes.  As some non-SFF controllers don't
      have TF registers defined unless they're associated with in-flight
      commands, this limited operation makes life easier for those drivers
      and help lifting SFF assumptions from libata core layer.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      22183bf5
    • Tejun Heo's avatar
      libata: rename SFF port ops · 5682ed33
      Tejun Heo authored
      
      
      Add sff_ prefix to SFF specific port ops.
      
      This rename is in preparation of separating SFF support out of libata
      core layer.  This patch strictly renames ops and doesn't introduce any
      behavior difference.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      5682ed33
    • Al Viro's avatar
  8. 07 Apr, 2008 1 commit
  9. 27 Mar, 2008 1 commit
  10. 23 Feb, 2008 3 commits
  11. 22 Feb, 2008 2 commits
    • James Bottomley's avatar
      [SCSI] libsas: correctly flush the LU queue on error recovery · 63e4563b
      James Bottomley authored
      
      
      The current sas_scsi_clear_queue_lu() is wrongly checking for commands
      which match the pointer to the one passed in.  It should be checking for
      commands which are on the same logical unit as the one passed in.  Fix
      this by checking target pointer and LUN for equality.
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
      63e4563b
    • James Bottomley's avatar
      [SCSI] libsas: fix error handling · a8e14fec
      James Bottomley authored
      
      
      The libsas error handler has two fairly fatal bugs
      
      1. scsi_sas_task_done calls scsi_eh_finish_cmd() too early.  This
         happens if the task completes after it has been aborted but before
         the error handler starts up.  Because scsi_eh_finish_cmd()
         decrements host_failed and adds the task to the done list, the
         error handler start check (host_failed == host_busy) never passes
         and the eh never starts.
      
      2. The multiple task completion paths sas_scsi_clear_queue_... all
         simply delete the task from the error queue.  This causes it to
         disappear into the ether, since a command must be placed on the
         done queue to be finished off by the error handler.  This behaviour
         causes the HBA to hang on pending commands.
      
      Fix 1. by moving the SAS_TASK_STATE_ABORTED check to an exit clause at
      the top of the routine and calling ->scsi_done() unconditionally (it
      is a nop if the timer has fired).  This keeps the task in the error
      handling queue until the eh starts.
      
      Fix 2. by making sure every task goes through task complete followed
      by scsi_eh_finish_cmd().
      
      Tested this by firing resets across a disk running a hammer test (now
      it actually survives without hanging the system)
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
      a8e14fec
  12. 19 Feb, 2008 1 commit
    • James Bottomley's avatar
      libata: eliminate the home grown dma padding in favour of · dde20207
      James Bottomley authored
      
      
      that provided by the block layer
      
      ATA requires that all DMA transfers begin and end on word boundaries.
      Because of this, a large amount of machinery grew up in ide to adjust
      scatterlists on this basis.  However, as of 2.5, the block layer has a
      dma_alignment variable which ensures both the beginning and length of a
      DMA transfer are aligned on the dma_alignment boundary.  Although the
      block layer does adjust the beginning of the transfer to ensure this
      happens, it doesn't actually adjust the length, it merely makes sure
      that space is allocated for transfers beyond the declared length.  The
      upshot of this is that scatterlists may be padded to any size between
      the actual length and the length adjusted to the dma_alignment safely
      knowing that memory is allocated in this region.
      
      Right at the moment, SCSI takes the default dma_aligment which is on a
      512 byte boundary.  Note that this aligment only applies to transfers
      coming in from user space.  However, since all kernel allocations are
      automatically aligned on a minimum of 32 byte boundaries, it is safe to
      adjust them in this manner as well.
      
      tj: * Adjusting sg after padding is done in block layer.  Make libata
            set queue alignment correctly for ATAPI devices and drop broken
            sg mangling from ata_sg_setup().
          * Use request->raw_data_len for ATAPI transfer chunk size.
          * Killed qc->raw_nbytes.
          * Separated out killing qc->n_iter.
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      dde20207
  13. 25 Jan, 2008 1 commit
  14. 24 Jan, 2008 1 commit
  15. 23 Jan, 2008 5 commits
  16. 11 Jan, 2008 5 commits
  17. 19 Oct, 2007 1 commit
  18. 12 Oct, 2007 2 commits
    • Jeff Garzik's avatar
      [libata] Remove ->port_disable() hook · ac8869d5
      Jeff Garzik authored
      
      
      It was always set to ata_port_disable().  Removed the hook, and replaced
      the very few ap->ops->port_disable() callsites with direct calls to
      ata_port_disable().
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      ac8869d5
    • Tejun Heo's avatar
      libata-link: introduce ata_link · 9af5c9c9
      Tejun Heo authored
      
      
      Introduce ata_link.  It abstracts PHY and sits between ata_port and
      ata_device.  This new level of abstraction is necessary to support
      SATA Port Multiplier, which basically adds a bunch of links (PHYs) to
      a ATA host port.  Fields related to command execution, spd_limit and
      EH are per-link and thus moved to ata_link.
      
      This patch only defines the host link.  Multiple link handling will be
      added later.  Also, a lot of ap->link derefences are added but many of
      them will be removed as each part is converted to deal directly with
      ata_link instead of ata_port.
      
      This patch introduces no behavior change.
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Cc: James Bottomley <James.Bottomley@SteelEye.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      9af5c9c9
  19. 31 Jul, 2007 1 commit
  20. 28 Jul, 2007 1 commit
  21. 26 Jul, 2007 1 commit
  22. 24 Jul, 2007 1 commit