1. 31 5月, 2006 7 次提交
    • T
      [PATCH] libata-hp-prep: implement sata_phy_debounce() · d7bb4cc7
      Tejun Heo 提交于
      With hotplug, PHY always needs to be debounced before a reset as any
      reset might find new devices.  Extract PHY waiting code from
      sata_phy_resume() and extend it to include SStatus debouncing.  Note
      that sata_phy_debounce() is superset of what used to be done inside
      sata_phy_resume().
      
      Three default debounce timing parameters are defined to be used by
      hot/boot plug.  As resume failure during probing will be properly
      handled as errors, timeout doesn't have to be long as before.
      probeinit() uses the same timeout to retain the original behavior.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      d7bb4cc7
    • T
      [PATCH] libata-hp-prep: make probing related functions global · a9beec95
      Tejun Heo 提交于
      Hotplug will be implemented in libata-eh.c.  Make ata_dev_read_id()
      and ata_dev_configure() global.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      a9beec95
    • T
      [PATCH] libata-hp-prep: add ata_aux_wq · 453b07ac
      Tejun Heo 提交于
      It's best to run ATA hotplug from EH but attaching SCSI devices needs
      working EH.  ata_aux_wq is used to give SCSI hotplug operations a
      separate context.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      453b07ac
    • T
      [PATCH] libata-hp-prep: implement ap->hw_sata_spd_limit · 5a04bf4b
      Tejun Heo 提交于
      Add ap->hw_sata_spd_limit and initialize it once during the boot
      initialization (or driver load initialization).  ap->sata_spd_limit is
      reset to ap->hw_sata_spd_limit on hotplug.  This prevents spd limits
      introduced by earlier devices from affecting new devices.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      5a04bf4b
    • T
      [PATCH] libata-hp-prep: make some ata_device fields persistent · 72fa4b74
      Tejun Heo 提交于
      Lifetimes of some fields span over device plugging/unplugging.  This
      patch moves such persistent fields to the top of ata_device and
      separate them with ATA_DEVICE_CLEAR_OFFSET.  Fields above the offset
      are initialized once during host initializatino while all other fields
      are cleared before hotplugging.  Currently ->ap, devno and part of
      flags are persistent.
      
      Note that flags is partially cleared while holding host_set lock.
      This is to synchronize with later warm plug implementation which will
      record hotplug request in dev->flags.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      72fa4b74
    • T
      [PATCH] libata-hp-prep: implement ata_dev_init() · 3ef3b43d
      Tejun Heo 提交于
      Move initialization of struct ata_device into ata_dev_init() in
      preparation for hotplug.  This patch calls ata_dev_init() from
      ata_host_init() and thus makes no functional difference.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      3ef3b43d
    • T
      [PATCH] libata: implement ata_eh_wait() · c6cf9e99
      Tejun Heo 提交于
      Implement ata_eh_wait().  On return from this function, it's
      guaranteed that the EH which was pending or in progress when the
      function was called is complete - including the tailing part of SCSI
      EH.  This will be used by hotplug and others to synchronize with EH.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      c6cf9e99
  2. 29 5月, 2006 2 次提交
    • B
      libata debugging: set initial dbg value · ef282407
      Borislav Petkov 提交于
      This patch sets the prerequisites for the new debugging scheme that more or
      less resembles Donald Becker's net driver example. This one liner doesn't
      change any functionality beside setting the appropriate debug level for the
      msg_enable control in the ata_port struct, which will be later used by the
      ata_msg_* macros to control the amount of debug information sent to printk.
      
      Signed-off-by: <petkov@uni-muenster.de>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      ef282407
    • M
      [PATCH] the latest consensus libata resume fix · 0737ac89
      Mark Lord 提交于
      Okay, just to sum things up.
      
      This forces libata to wait for up to 2 seconds for BUSY|DRQ to clear
      on resume before continuing.
      
      [jgarzik adds...]  During testing we never saw DRQ asserted, but
      nonetheless (a) this works and (b) testing for DRQ won't hurt.
      Signed-off-by: NMark Lord <liml@rtr.ca>
      Acked-by: NJens Axboe <axboe@suse.de>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      0737ac89
  3. 27 5月, 2006 1 次提交
  4. 24 5月, 2006 3 次提交
  5. 20 5月, 2006 3 次提交
  6. 15 5月, 2006 24 次提交
    • T
      [PATCH] libata-ncq: implement NCQ device configuration · a6e6ce8e
      Tejun Heo 提交于
      Now that all NCQ related stuff are in place, implement NCQ device
      configuration and bump ATA_MAX_QUEUE to 32 thus activating NCQ
      support.
      
      Original implementation is from Jens Axboe.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      a6e6ce8e
    • T
      [PATCH] libata-ncq: implement NCQ command translation and exclusion · 3dc1d881
      Tejun Heo 提交于
      This patch implements NCQ command translation and exclusion.  Note
      that NCQ commands don't use ata_rwcmd_protocol() to choose ATA
      command.  This is because, unlike non-NCQ RW commands, NCQ commands
      can only be used for NCQ protocol and FUA handling is done with a flag
      rather than separate command.
      
      NCQ enabled device will have queue depth larger than one but no two
      non-NCQ commands can be issued simultaneously, neither can a non-NCQ
      command and NCQ commands.  This patch makes ata_scsi_translate()
      return SCSI_MLQUEUE_DEVICE_BUSY if such exclusion is necessary.  SCSI
      midlayer will retry the command later.
      
      As SCSI midlayer always retries once a command completes, this doesn't
      incur unnecessary delays and as most commands will be NCQ ones for NCQ
      device, so the overhead should be negligible.
      
      Initial implementation is from Jens Axboe and using
      SCSI_MLQUEUE_DEVICE_BUSY for exclusion is suggested by Jeff Garzik.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      3dc1d881
    • T
      [PATCH] libata-ncq: implement ap->qc_active, ap->sactive and complete helper · dedaf2b0
      Tejun Heo 提交于
      Add ap->qc_active and ap->sactive, mask of all active qcs and libata's
      view of the SActive register, respectively.  Also, implement
      ata_qc_complete_multiple() which takes new qc_active mask and complete
      multiple qcs according to the mask.
      
      These will be used to track NCQ commands and complete them.  The
      distinction between ap->qc_active and ap->sactive is also useful for
      later PM implementation.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      dedaf2b0
    • T
      [PATCH] libata-ncq: rename ap->qactive to ap->qc_allocated · 6cec4a39
      Tejun Heo 提交于
      Rename ap->qactive to ap->qc_allocated.  This is to accomodate
      addition of ap->qc_active, mask of active qcs.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      6cec4a39
    • T
      [PATCH] libata: fix irq-pio merge · c17ea20d
      Tejun Heo 提交于
      * kill ata_poll_qc_complete() and implement/use ata_hsm_qc_complete()
        which completes qcs in new EH compliant manner from HSM
      
      * don't print error message from ata_hsm_move().  it's responsibility
        of EH.
      
      * kill ATA_FLAG_NOINTR usage in bmdma EH
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      c17ea20d
    • T
      [PATCH] libata-eh: implement BMDMA EH · 6d97dbd7
      Tejun Heo 提交于
      Implement stock BMDMA error handling methods.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      6d97dbd7
    • T
      [PATCH] libata-eh: implement new EH · 022bdb07
      Tejun Heo 提交于
      Implement new EH.  The exported interface is ata_do_eh() which is to
      be called from ->error_handler and performs the following steps to
      recover the failed port.
      
      ata_eh_autopsy() : analyze SError/TF, determine the cause of failure
      		   and required recovery actions and record it in
      		   ap->eh_context
      ata_eh_report()	 : report the failure to user
      ata_eh_recover() : perform recovery actions described in ap->eh_context
      ata_eh_finish()	 : finish failed qcs
      
      LLDDs can customize error handling by modifying eh_context before
      calling ata_do_eh() or, if necessary, doing so inbetween each major
      steps by calling each step explicitly.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      022bdb07
    • T
      [PATCH] libata-eh-fw: update ata_exec_internal() for new EH · d95a717f
      Tejun Heo 提交于
      Update ata_exec_internal() such that it uses new EH framework.
      ->post_internal_cmd() is always invoked regardless of completion
      status.  Also, when ata_exec_internal() detects a timeout condition
      and new EH is in place, it freezes the port as timeout for normal
      commands would do.
      
      Note that ata_port_flush_task() is called regardless of
      wait_for_completion status.  This is necessary as exceptions unrelated
      to the qc can abort the qc, in which case PIO task could still be
      running after the wait for completion returns.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      d95a717f
    • T
      [PATCH] libata-eh-fw: implement new EH scheduling from PIO · dafadcde
      Tejun Heo 提交于
      PIO executes without holding host_set lock, so it cannot be
      synchronized using the same mechanism as interrupt driven execution.
      port_task framework makes sure that EH is not entered until PIO task
      is flushed, so PIO task can be sure the qc in progress won't go away
      underneath it.  One thing it cannot be sure of is whether the qc has
      already been scheduled for EH by another exception condition while
      host_set lock was released.
      
      This patch makes ata_poll_qc-complete() handle such conditions
      properly and make it freeze the port if HSM violation is detected
      during PIO execution.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      dafadcde
    • T
      [PATCH] libata-eh-fw: implement freeze/thaw · e3180499
      Tejun Heo 提交于
      Freezing is performed atomic w.r.t. host_set->lock and once frozen
      LLDD is not allowed to access the port or any qc on it.  Also, libata
      makes sure that no new qc gets issued to a frozen port.
      
      A frozen port is thawed after a reset operation completes
      successfully, so reset methods must do its job while the port is
      frozen.  During initialization all ports get frozen before requesting
      IRQ, so reset methods are always invoked on a frozen port.
      
      Optional ->freeze and ->thaw operations notify LLDD that the port is
      being frozen and thawed, respectively.  LLDD can disable/enable
      hardware interrupt in these callbacks if the controller's IRQ mask can
      be changed dynamically.  If the controller doesn't allow such
      operation, LLDD can check for frozen state in the interrupt handler
      and ack/clear interrupts unconditionally while frozen.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      e3180499
    • T
      [PATCH] libata-eh-fw: implement ata_port_schedule_eh() and ata_port_abort() · 7b70fc03
      Tejun Heo 提交于
      ata_port_schedule_eh() directly schedules EH for @ap without
      associated qc.  Once EH scheduled, no further qc is allowed and EH
      kicks in as soon as all currently active qc's are drained.
      
      ata_port_abort() schedules all currently active commands for EH by
      qc_completing them with ATA_QCFLAG_FAILED set.  If ata_port_abort()
      doesn't find any qc to abort, it directly schedule EH using
      ata_port_schedule_eh().
      
      These two functions provide ways to invoke EH for conditions which
      aren't directly related to any specfic qc.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      7b70fc03
    • T
      [PATCH] libata-eh-fw: implement new EH scheduling via error completion · f686bcb8
      Tejun Heo 提交于
      There are several ways a qc can get schedule for EH in new EH.  This
      patch implements one of them - completing a qc with ATA_QCFLAG_FAILED
      set or with non-zero qc->err_mask.  ALL such qc's are examined by EH.
      
      New EH schedules a qc for EH from completion iff ->error_handler is
      implemented, qc is marked as failed or qc->err_mask is non-zero and
      the command is not an internal command (internal cmd is handled via
      ->post_internal_cmd).  The EH scheduling itself is performed by asking
      SCSI midlayer to schedule EH for the specified scmd.
      
      For drivers implementing old-EH, nothing changes.  As this change
      makes ata_qc_complete() rather large, it's not inlined anymore and
      __ata_qc_complete() is exported to other parts of libata for later
      use.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      f686bcb8
    • T
      [PATCH] libata-eh-fw: update ata_qc_from_tag() to enforce normal/EH qc ownership · f69499f4
      Tejun Heo 提交于
      New EH framework has clear distinction about who owns a qc.  Every qc
      starts owned by normal execution path - PIO, interrupt or whatever.
      When an exception condition occurs which affects the qc, the qc gets
      scheduled for EH.  Note that some events (say, link lost and regained,
      command timeout) may schedule qc's which are not directly related but
      could have been affected for EH too.  Scheduling for EH is atomic
      w.r.t. ap->host_set->lock and once schedule for EH, normal execution
      path is not allowed to access the qc in whatever way.  (PIO
      synchronization acts a bit different and will be dealt with later)
      
      This patch make ata_qc_from_tag() check whether a qc is active and
      owned by normal path before returning it.  If conditions don't match,
      NULL is returned and thus access to the qc is denied.
      __ata_qc_from_tag() is the original ata_qc_from_tag() and is used by
      libata core/EH layers to access inactive/failed qc's.
      
      This change is applied only if the associated LLDD implements new EH
      as indicated by non-NULL ->error_handler
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      f69499f4
    • T
      [PATCH] libata-eh-fw: use special reserved tag and qc for internal commands · 2ab7db1f
      Tejun Heo 提交于
      New EH may issue internal commands to recover from error while failed
      qc's are still hanging around.  To allow such usage, reserve tag
      ATA_MAX_QUEUE-1 for internal command.  This also makes it easy to tell
      whether a qc is for internal command or not.  ata_tag_internal() test
      implements this test.
      
      To avoid breaking existing drivers, ata_exec_internal() uses
      ATA_TAG_INTERNAL only for drivers which implement ->error_handler.
      For drivers using old EH, tag 0 is used.  Note that this makes
      ata_tag_internal() test valid only when ->error_handler is
      implemented.  This is okay as drivers on old EH should not and does
      not have any reason to use ata_tag_internal().
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      2ab7db1f
    • T
      [PATCH] libata-eh-fw: clear SError in ata_std_postreset() · dc2b3515
      Tejun Heo 提交于
      Clear SError in ata_std_postreset().  This is to clear SError bits
      which get set during reset.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      dc2b3515
    • T
      [PATCH] libata: use ATA printk helpers · f15a1daf
      Tejun Heo 提交于
      Use ATA printk helpers.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      f15a1daf
    • T
      [PATCH] libata: use dev->ap · 3373efd8
      Tejun Heo 提交于
      Use dev->ap where possible and eliminate superflous @ap from functions
      and structures.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      3373efd8
    • T
      [PATCH] libata: add dev->ap · 38d87234
      Tejun Heo 提交于
      Add dev->ap which points back to the port the device belongs to.  This
      makes it unnecessary to pass @ap for silly reasons (e.g. printks).
      Also, this change is necessary to accomodate later PM support which
      will introduce ATA link inbetween port and device.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      38d87234
    • T
      [PATCH] libata: use new SCR and on/offline functions · 81952c54
      Tejun Heo 提交于
      Use new SCR and on/offline functions.  Note that for LLDD which know
      it implements SCR callbacks, SCR functions are guaranteed to succeed
      and ata_port_online() == !ata_port_offline().
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      81952c54
    • T
      [PATCH] libata: implement new SCR handling and port on/offline functions · 34bf2170
      Tejun Heo 提交于
      Implement ata_scr_{valid|read|write|write_flush}() and
      ata_port_{online|offline}().  These functions replace
      scr_{read|write}() and sata_dev_present().
      
      Major difference between between the new SCR functions and the old
      ones is that the new ones have a way to signal error to the caller.
      This makes handling SCR-available and SCR-unavailable cases in the
      same path easier.  Also, it eases later PM implementation where SCR
      access can fail due to various reasons.
      
      ata_port_{online|offline}() functions return 1 only when they are
      affirmitive of the condition.  e.g.  if SCR is unaccessible or
      presence cannot be determined for other reasons, these functions
      return 0.  So, ata_port_online() != !ata_port_offline().  This
      distinction is useful in many exception handling cases.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      34bf2170
    • T
      [PATCH] libata: init ap->cbl to ATA_CBL_SATA early · 838df628
      Tejun Heo 提交于
      Init ap->cbl to ATA_CBL_SATA in ata_host_init().  This is necessary
      for soon-to-follow SCR handling function changes.  LLDDs are free to
      change ap->cbl during probing.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      838df628
    • T
      [PATCH] libata: implement qc->result_tf · e61e0672
      Tejun Heo 提交于
      Add qc->result_tf and ATA_QCFLAG_RESULT_TF.  This moves the
      responsibility of loading result TF from post-compltion path to qc
      execution path.  qc->result_tf is loaded if explicitly requested or
      the qc failsa.  This allows more efficient completion implementation
      and correct handling of result TF for controllers which don't have
      global TF representation such as sil3124/32.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      e61e0672
    • T
      [PATCH] libata: remove postreset handling from ata_do_reset() · 96bd39ec
      Tejun Heo 提交于
      Make ata_do_reset() deal only with reset.  postreset is now the
      responsibility of the caller.  This is simpler and eases later
      prereset addition.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      96bd39ec
    • T
      [PATCH] libata: move ->set_mode() handling into ata_set_mode() · 3adcebb2
      Tejun Heo 提交于
      Move ->set_mode() handlng into ata_set_mode().
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      3adcebb2