1. 20 1月, 2007 1 次提交
  2. 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
  3. 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
  4. 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
  5. 27 9月, 2006 1 次提交
  6. 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
  7. 10 8月, 2006 1 次提交
  8. 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
  9. 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
  10. 27 6月, 2006 3 次提交
  11. 23 6月, 2006 2 次提交
  12. 12 6月, 2006 3 次提交
  13. 11 6月, 2006 1 次提交
  14. 31 5月, 2006 9 次提交
    • 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
    • T
      [PATCH] libata-hp-prep: implement followup softreset handling · 664faf09
      Tejun Heo 提交于
      In some cases, hardreset must be followed by SRST.
      
      * some controllers can't classify with hardreset
      * some controllers can't wait for !BSY after hardreset (LLDD should
        explicitly request followup softreset by returning -EAGAIN)
      * (later) PM needs SRST w/ PMP==15 to operate after hardreset
      
      To handle above cases, this patch implements follow-up softreset.
      After a hardreset, ata_eh_reset() checks whether any of above
      conditions are met and do a follow-up softreset if necessary.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      664faf09
    • T
      [PATCH] libata-hp-prep: add prereset() method and implement ata_std_prereset() · f5914a46
      Tejun Heo 提交于
      With hotplug, every reset might be a probing reset and thus something
      similar to probe_init() is needed.  prereset() method is called before
      a series of resets to a port and is the counterpart of postreset().
      prereset() can tell EH to use different type of reset or skip reset by
      modifying ehc->i.action.
      
      This patch also implements ata_std_prereset().  Most controllers
      should be able to use this function directly or with some wrapping.
      After hotplug, different controllers need different actions to resume
      the PHY and detect the newly attached device.  Controllers can be
      categorized as follows.
      
      * Controllers which can wait for the first D2H FIS after hotplug.
        Note that if the waiting is implemented by polling TF status, there
        needs to be a way to set BSY on PHY status change.  It can be
        implemented by hardware or with the help of the driver.
      
      * Controllers which can wait for the first D2H FIS after sending
        COMRESET.  These controllers need to issue COMRESET to wait for the
        first FIS.  Note that the received D2H FIS could be the first D2H
        FIS after POR (power-on-reset) or D2H FIS in response to the
        COMRESET.  Some controllers use COMRESET as TF status
        synchronization point and clear TF automatically (sata_sil).
      
      * Controllers which cannot wait for the first D2H FIS reliably.
        Blindly issuing SRST to spinning-up device often results in command
        issue failure or timeout, causing extended delay.  For these
        controllers, ata_std_prereset() explicitly waits ATA_SPINUP_WAIT
        (currently 8s) to give newly attached device time to spin up, then
        issues reset.  Note that failing to getting ready in ATA_SPINUP_WAIT
        is not critical.  libata will retry.  So, the timeout needs to be
        long enough to spin up most devices.
      
      LLDDs can tell ata_std_prereset() which of above action is needed with
      ATA_FLAG_HRST_TO_RESUME and ATA_FLAG_SKIP_D2H_BSY flags.  These flags
      are PHY-specific property and will be moved to ata_link later.
      
      While at it, this patch unifies function typedef's such that they all
      have named arguments.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      f5914a46
    • 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