1. 01 8月, 2007 1 次提交
  2. 20 7月, 2007 8 次提交
    • T
      libata: implement EH fast drain · 5ddf24c5
      Tejun Heo 提交于
      In most cases, when EH is scheduled, all in-flight commands are
      aborted causing EH to kick in immediately.  However, in some cases
      (especially with PMP), it's unclear which commands are affected by the
      error condition and although aborting all in-flight commands work, it
      isn't optimal and may cause unnecessary disruption.  On the other
      hand, waiting for in-flight commands to drain themselves can take up
      to 30seconds.
      
      This patch implements EH fast drain to handle such situations.  It
      gives in-flight commands some time to finish up but doesn't wait for
      too long.  After EH is scheduled, fast drain timer is started and if
      no other completion occurs in ATA_EH_FASTDRAIN_INTERVAL all in-flight
      commands are aborted.  If any completion occurred in the interval, the
      port is given another interval to finish up itself.
      
      Currently ATA_EH_FASTDRAIN_INTERVAL is 3 secs which should be enough
      for finishing up most commands.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      5ddf24c5
    • T
      libata: improve SCSI scan failure handling · 1ae46317
      Tejun Heo 提交于
      SCSI scan may fail due to memory allocation failure even if EH is not
      in progress.  Due to use of GFP_ATOMIC in SCSI scan path, allocation
      failure isn't too rare especially while probing multiple devices at
      once which is the case when a bunch of devices are connected to PMP.
      
      This patch moves SCSI scan failure detetion logic from
      ata_scsi_hotplug() to ata_scsi_scan_host() and implement synchronous
      scan behavior.  The synchronous path sleeps briefly and repeats SCSI
      scan if some devices aren't attached properly.  It contains robust
      retry loop to minimize the chance of device misdetection during boot
      and falls back to async retry if everything fails.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      1ae46317
    • T
      libata: quickly trigger SATA SPD down after debouncing failed · f1545154
      Tejun Heo 提交于
      Debouncing failure is a good indicator of basic link problem.  Use
      -EPIPE to indicate debouncing failure and make ata_eh_reset() invoke
      sata_down_spd_limit() if the error occurs during reset.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      f1545154
    • T
      libata: improve SATA PHY speed down logic · 008a7896
      Tejun Heo 提交于
      sata_down_spd_limit() first reads the current SPD from SStatus and
      limit the speed to the lower one of one below the current limit or one
      below the current SPD in SStatus.  SPD may not be accessible or valid
      when SPD down is requested making sata_down_spd_limit() fail when it's
      most needed.
      
      This patch makes the current SPD cached after each successful reset
      and forces GEN I speed (1.5Gbps) if neither of SStatus or the cached
      value is valid, so sata_down_spd_limit() is now guaranteed to lower
      the speed limit if lower speed is available.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      008a7896
    • T
      libata: make ->scr_read/write callbacks return error code · da3dbb17
      Tejun Heo 提交于
      Convert ->scr_read/write callbacks to return error code to better
      indicate failure.  This will help handling of SCR_NOTIFICATION.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      da3dbb17
    • T
      libata: improve EH report formatting · b64bbc39
      Tejun Heo 提交于
      Requiring LLDs to format multiple error description messages properly
      doesn't work too well.  Help LLDs a bit by making ata_ehi_push_desc()
      insert ", " on each invocation.  __ata_ehi_push_desc() is the raw
      version without the automatic separator.
      
      While at it, make ehi_desc interface proper functions instead of
      macros.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      b64bbc39
    • T
      libata: add @is_cmd to ata_tf_to_fis() · 9977126c
      Tejun Heo 提交于
      Add @is_cmd to ata_tf_to_fis().  This controls bit 7 of the second
      byte which tells the device whether this H2D FIS is for a command or
      not.  This cleans up ahci a bit and will be used by PMP.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      9977126c
    • T
      libata: add ST9160821AS 3.CLF to NONCQ blacklist · 3fb6589c
      Tejun Heo 提交于
      Yay, the first one from Seagate.  3.ALC firmware is okay.  This was
      reported by Sam Freed on bugzilla bug 8759.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NSam Freed <sam@freed.net>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      3fb6589c
  3. 13 7月, 2007 2 次提交
  4. 11 7月, 2007 6 次提交
  5. 10 7月, 2007 4 次提交
    • A
      libata: Support chips with 64K PRD quirk · d26fc955
      Alan Cox 提交于
      Add ata_dumb_qc_prep and supporting logic so that a driver can just
      specify it needs to be helped in this area. 64K entries are split
      as with drivers/ide.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d26fc955
    • T
      libata: replace ap->cbl tests with ATA_FLAG_SATA tests · a16abc0b
      Tejun Heo 提交于
      ap->cbl == ATA_CBL_SATA indicates SATA cable while ap->flags &
      ATA_FLAG_SATA indicates SATA host port.  Till now they always gave the
      same result but SATA/PATA bridge handling will change that.  Switch to
      ATA_FLAG_SATA test if we're testing for host port type.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      a16abc0b
    • T
      libata: reimplement ACPI invocation · 6746544c
      Tejun Heo 提交于
      This patch reimplements ACPI invocation such that, instead of
      exporting ACPI details to the rest of libata, ACPI event handlers -
      ata_acpi_on_resume() and ata_acpi_on_devcfg() - are used.  These two
      functions are responsible for determining whether specific ACPI method
      is used and when.
      
      On resume, _GTF is scheduled by setting ATA_DFLAG_ACPI_PENDING device
      flag.  This is done this way to avoid performing the action on wrong
      device device (device swapping while suspended).
      
      On every ata_dev_configure(), ata_acpi_on_devcfg() is called, which
      performs _SDD and _GTF.  _GTF is performed only after resuming and, if
      SATA, hardreset as the ACPI spec specifies.  As _GTF may contain
      arbitrary commands, IDENTIFY page is re-read after _GTF taskfiles are
      executed.
      
      If one of ACPI methods fails, ata_acpi_on_devcfg() retries on the
      first failure.  If it fails again on the second try, ACPI is disabled
      on the device.  Note that successful configuration clears ACPI failed
      status.
      
      With all feature checks moved to the above two functions,
      do_drive_set_taskfiles() is trivial and thus collapsed into
      ata_acpi_exec_tfs(), which is now static and converted to return the
      number of executed taskfiles to be used by ata_acpi_on_resume().  As
      failures are handled properly, ata_acpi_push_id() now returns -errno
      on errors instead of unconditional zero.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6746544c
    • T
      libata-acpi: implement ata_acpi_associate() · fafbae87
      Tejun Heo 提交于
      * Add acpi_handle to ata_host and ata_port.  Rename
        ata_device->obj_handle to ->acpi_handle and move it above such that
        it doesn't get cleared on reconfiguration.
      
      * Replace ACPI node association which ata_acpi_associate() which is
        called once during host initialization.  Unlike the previous
        implementation, ata_acpi_associate() uses ATA_FLAG_ACPI_SATA to
        choose between IDE or SATA ACPI hierarchy and uses simple child look
        up instead of recursive walk to match the nodes.  This is way safer
        and simpler.  Please read the following message for more info.
      
        http://article.gmane.org/gmane.linux.ide/17554Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      fafbae87
  6. 03 7月, 2007 1 次提交
    • T
      libata: fix assigned IRQ reporting · 4031826b
      Tejun Heo 提交于
      host->irq and host->irq2 should be set before ata_host_register() for
      IRQ reporting to work.  Move up host->irq assignment in
      ata_host_activate() and add it to ata_pci_init_one() native path and
      pata_cs5520.
      
      The port info printing in ata_host_register() doesn't fit all the
      different controllers.  It should probably be moved out to LLDs with
      some helpers in the future.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4031826b
  7. 02 7月, 2007 2 次提交
  8. 27 6月, 2007 4 次提交
  9. 21 6月, 2007 2 次提交
  10. 11 6月, 2007 2 次提交
    • T
      libata: limit post SRST nsect/lbal wait to ~100ms · e141d999
      Tejun Heo 提交于
      After SRST, libata used to wait for nsect/lbal to be set to 1/1 for
      the slave device.  However, some ATAPI devices don't set nsect/lbal
      after SRST and the wait itself isn't too useful as we're gonna wait
      for !BSY right after that anyway.
      
      Before reset-seq update, nsect/lbal wait failure used to be ignored
      and caused 30sec delay during detection.  After reset-seq, all
      timeouts are considered error conditions making libata fail to detect
      such ATAPI devices.
      
      This patch limits nsect/lbal wait to around 100ms.  This should give
      acceptable behavior to such ATAPI devices while not disturbing the
      heavily used code path too much.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      e141d999
    • T
      libata: force PIO on IOMEGA ZIP 250 ATAPI · 5acd50f6
      Tejun Heo 提交于
      IOMEGA ZIP 250 ATAPI claims MWDMA0 support but fails SETXFERMODE if
      asked to configure itself to MWDMA0.  Force PIO.
      
      This fixes bugzilla bug#8497.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Calvin Walton <calvin.walton@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      5acd50f6
  11. 10 6月, 2007 6 次提交
  12. 05 6月, 2007 1 次提交
    • T
      libata: always use polling SETXFER · 464cf177
      Tejun Heo 提交于
      Several people have reported LITE-ON LTR-48246S detection failed
      because SETXFER fails.  It seems the device raises IRQ too early after
      SETXFER.  This is controller independent.  The same problem has been
      reported for different controllers.
      
      So, now we have pata_via where the controller raises IRQ before it's
      ready after SETXFER and a device which does similar thing.  This patch
      makes libata always execute SETXFER via polling.  As this only happens
      during EH, performance impact is nil.  Setting ATA_TFLAG_POLLING is
      also moved from issue hot path to ata_dev_set_xfermode() - the only
      place where SETXFER can be issued.
      
      Note that ATA_TFLAG_POLLING applies only to drivers which implement
      SFF TF interface and use libata HSM.  More advanced controllers ignore
      the flag.  This doesn't matter for this fix as SFF TF controllers are
      the problematic ones.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      464cf177
  13. 28 5月, 2007 1 次提交