1. 21 2月, 2007 1 次提交
    • T
      libata: improve ata_down_xfermask_limit() · 458337db
      Tejun Heo 提交于
      Make ata_down_xfermask_limit() accept @sel instead of @force_pio0.
      @sel selects how the xfermask limit will be adjusted.  The following
      selectors are defined.
      
      * ATA_DNXFER_PIO	: only speed down PIO
      * ATA_DNXFER_DMA	: only speed down DMA, don't cause transfer mode change
      * ATA_DNXFER_40C	: apply 40c cable limit
      * ATA_DNXFER_FORCE_PIO	: force PIO
      * ATA_DNXFER_FORCE_PIO0	: force PIO0 (same as original with @force_pio0 == 1)
      * ATA_DNXFER_ANY	: same as original with @force_pio0 == 0
      
      Currently, only ANY and FORCE_PIO0 are used to maintain the original
      behavior.  Other selectors will be used later to improve EH speed down
      sequence.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      458337db
  2. 10 2月, 2007 1 次提交
    • T
      libata: kill qc->nsect and cursect · 726f0785
      Tejun Heo 提交于
      libata used two separate sets of variables to record request size and
      current offset for ATA and ATAPI.  This is confusing and fragile.
      This patch replaces qc->nsect/cursect with qc->nbytes/curbytes and
      kills them.  Also, ata_pio_sector() is updated to use bytes for
      qc->cursg_ofs instead of sectors.  The field used to be used in bytes
      for ATAPI and in sectors for ATA.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      726f0785
  3. 27 1月, 2007 1 次提交
  4. 20 1月, 2007 1 次提交
  5. 03 12月, 2006 2 次提交
    • T
      [PATCH] libata: always use polling IDENTIFY · 800b3996
      Tejun Heo 提交于
      libata switched to IRQ-driven IDENTIFY when IRQ-driven PIO was
      introduced.  This has caused a lot of problems including device
      misdetection and phantom device.
      
      ATA_FLAG_DETECT_POLLING was added recently to selectively use polling
      IDENTIFY on problemetic drivers but many controllers and devices are
      affected by this problem and trying to adding ATA_FLAG_DETECT_POLLING
      for each such case is diffcult and not very rewarding.
      
      This patch makes libata always use polling IDENTIFY.  This is
      consistent with libata's original behavior and drivers/ide's behavior.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      800b3996
    • T
      [PATCH] libata: don't request sense if the port is frozen · a569a30d
      Tejun Heo 提交于
      If EH command is issued to a frozen port, it fails with AC_ERR_SYSTEM.
      libata used to request sense even when the port is frozen needlessly
      adding AC_ERR_SYSTEM to err_mask.  Don't do it.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      a569a30d
  6. 02 12月, 2006 6 次提交
    • T
      [PATCH] libata: print cdb[0] in failed qc report · 664e8503
      Tejun Heo 提交于
      Print cdb[0] in failed qc report.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      664e8503
    • T
      [PATCH] libata: improve failed qc reporting · 8a937581
      Tejun Heo 提交于
      Improve failed qc reporting.  The original message didn't include the
      actual command nor full error status and it was necessary to
      temporarily patch the code to find out exactly which command is
      causing problem.  This patch makes EH report full command and result
      TFs along with data direction and length.  This change will make bug
      reports more useful.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      8a937581
    • T
      [PATCH] libata: implement presence detection via polling IDENTIFY · 55a8e2c8
      Tejun Heo 提交于
      On some controllers (ICHs in piix mode), there is *NO* reliable way to
      determine device presence other than issuing IDENTIFY and see how the
      transaction proceeds by watching the TF status register.
      
      libata acted this way before irq-pio and phantom devices caused very
      little problem but now that IDENTIFY is performed using IRQ drive PIO,
      such phantom devices now result in multiple 30sec timeouts during
      boot.
      
      This patch implements ATA_FLAG_DETECT_POLLING.  If a LLD sets this
      flag, libata core issues the initial IDENTIFY in polling mode and if
      the initial data transfer fails w/ HSM violation, the port is
      considered to be empty thus replicating the old libata and IDE
      behavior.
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      55a8e2c8
    • T
      [PATCH] libata: convert @post_reset to @flags in ata_dev_read_id() · bff04647
      Tejun Heo 提交于
      Make ata_dev_read_id() take @flags instead of @post_reset.  Currently
      there is only one flag defined - ATA_READID_POSTRESET, which is
      equivalent to @post_reset.  This is preparation for polling presence
      detection.
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      bff04647
    • T
      [PATCH] libata: implement ATA_EHI_SETMODE and ATA_EHI_POST_SETMODE · baa1e78a
      Tejun Heo 提交于
      libata EH used to perform ata_set_mode() iff the EH session performed
      reset as indicated by ATA_EHI_DID_RESET.  This is incorrect because
      ->dev_config() called by revalidation is allowed to modify transfer
      mode which ata_set_mode() should take care of.  This patch implements
      the following two flags.
      
      * ATA_EHI_SETMODE: set during EH to schedule ata_set_mode().  Both new
        device attachment and revalidation set this flag.
      
      * ATA_EHI_POST_SETMODE: set while the device is revalidated after
        ata_set_mode().  Post-setmode revalidation is different from initial
        configuaration and EH revalidation in that ->dev_config() is not
        allowed tune transfer mode.  LLD can use this flag to determine
        whether it's allowed to tune transfer mode.  Note that POST_SETMODE
        ->dev_config() is guaranteed to be preceded by non-POST_SETMODE
        ->dev_config().
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      baa1e78a
    • T
      [PATCH] libata: implement ATA_EHI_PRINTINFO · efdaedc4
      Tejun Heo 提交于
      Implement ehi flag ATA_EHI_PRINTINFO.  This flag is set when device
      configuration needs to print out device info.  This used to be handled
      by @print_info argument to ata_dev_configure() but LLDs also need to
      know about it in ->dev_config() callback.
      
      This patch replaces @print_info w/ ATA_EHI_PRINTINFO and make sata_sil
      print workaround messages only on the initial configuration.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      efdaedc4
  7. 22 11月, 2006 1 次提交
    • D
      WorkStruct: Separate delayable and non-delayable events. · 52bad64d
      David Howells 提交于
      Separate delayable work items from non-delayable work items be splitting them
      into a separate structure (delayed_work), which incorporates a work_struct and
      the timer_list removed from work_struct.
      
      The work_struct struct is huge, and this limits it's usefulness.  On a 64-bit
      architecture it's nearly 100 bytes in size.  This reduces that by half for the
      non-delayable type of event.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      52bad64d
  8. 27 9月, 2006 1 次提交
  9. 24 8月, 2006 1 次提交
    • J
      libata: Grand renaming. · cca3974e
      Jeff Garzik 提交于
      The biggest change is that ata_host_set is renamed to ata_host.
      
      * ata_host_set			=> ata_host
      * ata_probe_ent->host_flags	=> ata_probe_ent->port_flags
      * ata_probe_ent->host_set_flags	=> ata_probe_ent->_host_flags
      * ata_host_stats		=> ata_port_stats
      * ata_port->host		=> ata_port->scsi_host
      * ata_port->host_set		=> ata_port->host
      * ata_port_info->host_flags	=> ata_port_info->flags
      * ata_(.*)host_set(.*)\(\)	=> ata_\1host\2()
      
      The leading underscore in ata_probe_ent->_host_flags is to avoid
      reusing ->host_flags for different purpose.  Currently, the only user
      of the field is libata-bmdma.c and probe_ent itself is scheduled to be
      removed.
      
      ata_port->host is reused for different purpose but this field is used
      inside libata core proper and of different type.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      cca3974e
  10. 10 8月, 2006 1 次提交
  11. 20 7月, 2006 3 次提交
    • T
      [PATCH] libata: improve EH action and EHI flag handling · 13abf50d
      Tejun Heo 提交于
      Update ata_eh_about_to_do() and ata_eh_done() to improve EH action and
      EHI flag handling.
      
      * There are two types of EHI flags - one which expires on successful
        EH and the other which expires on a successful reset.  Make this
        distinction clear.
      
      * Unlike other EH actions, reset actions are represented by two EH
        action masks and a EHI modifier.  Implement correct about_to_do/done
        semantics for resets.  That is, prior to reset, related EH info is
        sucked in from ehi and cleared, and after reset is complete, related
        EH info in ehc is cleared.
      
      These changes improve consistency and remove unnecessary EH actions
      caused by stale EH action masks and EHI flags.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      13abf50d
    • T
      [PATCH] libata: fix eh_skip_recovery condition · 7c8c2cff
      Tejun Heo 提交于
      * (ata_dev_absent() || ata_dev_ready()) test doesn't indicate
        SUSPENDED state properly.  Fix it.
      
      * Link resuming resets shouldn't be skipped.  Don't skip recovery on
        EHI_RESUME_LINK.  This doesn't matter for host ports as EHI_RESUME
        always coincides with EHI_HOTPLUGGED which makes attached disabled
        devices vacant.  However, PMP reset causes non-hotplug link-resuming
        resets which shouldn't be skipped.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      7c8c2cff
    • T
      [PATCH] libata: fix autopsy ehc->i.action and ehc->i.dev handling · 4528e4da
      Tejun Heo 提交于
      Commit 0662c58b updated
      ata_eh_autopsy() to OR determined action to ehc->i.action to preserve
      action mask set directly into ehc->i.action by nested functions.  This
      broke action mask clearing on SENSE_VALID case causing revalidation
      and EH complete message on successful ATAPI CC.
      
      This patch removes two local variables - action and failed_dev - which
      cache ehc->i.action and ehc->i.dev respectively, and make the function
      directly modify ehc->i.* fields to remove aliasing issues.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4528e4da
  12. 06 7月, 2006 6 次提交
    • T
      [PATCH] libata: reimplement controller-wide PM · 500530f6
      Tejun Heo 提交于
      Reimplement controller-wide PM.  ata_host_set_suspend/resume() are
      defined to suspend and resume a host_set.  While suspended, EHs for
      all ports in the host_set are pegged using ATA_FLAG_SUSPENDED and
      frozen.
      
      Because SCSI device hotplug is done asynchronously against the rest of
      libata EH and the same mutex is used when adding new device, suspend
      cannot wait for hotplug to complete.  So, if SCSI device hotplug is in
      progress, suspend fails with -EBUSY.
      
      In most cases, host_set resume is followed by device resume.  As each
      resume operation requires a reset, a single host_set-wide resume
      operation may result in multiple resets.  To avoid this, resume waits
      upto 1 second giving PM to request resume for devices.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      500530f6
    • T
      [PATCH] libata: implement PM EH actions · 02670bf3
      Tejun Heo 提交于
      Implement two PM per-dev EH actions - ATA_EH_SUSPEND and
      ATA_EH_RESUME.  Each action puts the target device into suspended mode
      and resumes from it respectively.
      
      Once a device is put to suspended mode, no EH operations other than
      RESUME is allowed on the device.  The device will stay suspended till
      it gets resumed and thus reset and revalidated.  To implement this, a
      new device state helper - ata_dev_ready() - is implemented and used in
      EH action implementations to make them operate only on attached &
      running devices.
      
      If all possible devices on a port are suspended, reset is skipped too.
      This prevents spurious events including hotplug events from disrupting
      suspended devices.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      02670bf3
    • T
      [PATCH] libata: implement ATA_EHI_NO_AUTOPSY and QUIET · 1cdaf534
      Tejun Heo 提交于
      Implement ATA_EHI_NO_AUTOPSY and QUIET.  These used to be implied by
      ATA_PFLAG_LOADING, but new power management and PMP support need to
      use these separately.  e.g. Suspend/resume operations shouldn't print
      full EH messages and resume shouldn't be recorded as an error.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      1cdaf534
    • T
      [PATCH] libata: replace ap_lock w/ ap->lock in ata_scsi_error() · e30349d2
      Tejun Heo 提交于
      ap_lock was used because &ap->host_set->lock was too long and used a
      lot.  Now that &ap->host_set->lock is replaced with ap->lock, there's
      no reason to keep ap_lock.
      
      [ed. note: that's not entirely true.  ap_lock is a local variable,
      caching the results of a de-ref.  In theory, if the compiler is smart
      enough, this patch is cosmetic.  However, since this is not a fast
      path (it is the error path), this patch is nonetheless acceptable,
      even though it _may_ introduce a performance regression.]
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      e30349d2
    • T
      [PATCH] libata: fix ehc->i.action setting in ata_eh_autopsy() · 0662c58b
      Tejun Heo 提交于
      ata_eh_autopsy() used to directly assign determined action mask to
      ehc->i.action thus overriding actions set by some of nested analyze
      functions.  This patch makes ata_eh_autopsy() add action masks just as
      it's done in other places.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      0662c58b
    • T
      [PATCH] libata: add ap->pflags and move core dynamic flags to it · b51e9e5d
      Tejun Heo 提交于
      ap->flags is way too clamped.  Separate out core dynamic flags to
      ap->pflags.  ATA_FLAG_DISABLED is a dynamic flag but left alone as
      it's referenced by a lot of LLDs and it's gonna be removed once all
      LLDs are converted to new EH.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      b51e9e5d
  13. 27 6月, 2006 3 次提交
  14. 23 6月, 2006 2 次提交
  15. 12 6月, 2006 3 次提交
  16. 11 6月, 2006 1 次提交
  17. 31 5月, 2006 6 次提交
    • T
      [PATCH] libata-hp: move ata_do_reset() to libata-eh.c · d87fa38e
      Tejun Heo 提交于
      With ops->probe_init() gone, no user is left in libata-core.c.  Move
      ata_do_reset() to libata-eh.c and make it static.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      d87fa38e
    • T
      [PATCH] libata-hp: update unload-unplug · 720ba126
      Tejun Heo 提交于
      Update unload unplug - driver unloading / PCI removal.  This is done
      by ata_port_detach() which short-circuits EH, disables all devices and
      freezes the port.  With this patch, EH and unloading/unplugging are
      properly synchronized.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      720ba126
    • T
      [PATCH] libata-hp: implement bootplug · 3e706399
      Tejun Heo 提交于
      Implement bootplug - boot probing via hotplug path.  While loading,
      ata_host_add() simply schedules probing and invokes EH.  After EH
      completes, ata_host_add() scans and assicates them with SCSI devices.
      EH path is slightly modified to handle this (e.g. no autopsy during
      bootplug).  The SCSI part is left in ata_host_add() because it's
      shared with legacy path and to keep probing order as before (ATA scan
      all ports in host_set then attach all).
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      3e706399
    • T
      [PATCH] libata-hp: implement SCSI part of hotplug · 580b2102
      Tejun Heo 提交于
      Implement SCSI part of hotplug.
      
      This must be done in a separate context as SCSI makes use of EH during
      probing.  SCSI scan fails silently if EH is in progress.  In such
      cases, libata pauses briefly and retries until every device is
      attached.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      580b2102
    • T
      [PATCH] libata-hp: implement hotplug · 084fe639
      Tejun Heo 提交于
      Implement ATA part of hotplug.  To avoid probing broken devices over
      and over again, disabled devices are not automatically detached.  They
      are detached only if probing is requested for the device or the
      associated port is offline.  Also, to avoid infinite probing loop,
      Each device is probed only once per EH run.
      
      As SATA PHY status is fragile, devices are detached only after it has
      used up its recovery chances unless explicitly requested by LLDD or
      user (LLDD may request direct detach if, for example, it supports cold
      presence detection).
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      084fe639
    • T
      [PATCH] libata-hp: implement ata_eh_detach_dev() · 0ea035a3
      Tejun Heo 提交于
      Implement ata_eh_detach_dev().  This function is responsible for
      detaching an ATA device and offlining the associated SCSI device
      atomically so that the detached device is not accessed after ATA
      detach is complete.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      0ea035a3