1. 29 4月, 2007 3 次提交
    • A
      libata: cable detection fixes · be0d18df
      Alan Cox 提交于
      2.6.21-rc has horrible problems with libata and PATA cable types (and
      thus speeds). This occurs because Tejun fixed a pile of other bugs and
      we now do cable detect enforcement for drive side detection properly.
      
      Unfortunately we don't do the process around cable detection right. Tejun
      identified the problem and pointed to the right Annex in the spec, this patch
      implements the rest of the needed changes.
      
      We add a ->cable_detect() method called after the identify
      sequence which allows a host to do host side detection at this point
      should it wish, or to modify the results of the drive side identify.
      
      This separate ->cable_detect method also cleans up a lot of code because
      many drivers have their own error_handler methods which really just set
      the cable type.
      
      If there is no ->cable_detect method the cable type is left alone so a
      driver setting it earlier (eg because it has the SATA flags set or
      because it uses the old error_handler approach) will still do the right
      thing (or at least the same thing) as before.
      
      This patch simply adds the cable_detect method and helpers it doesn't use
      them but other follow up patches will (ie Adrian please don't submit
      patches to unexport them ;))
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      be0d18df
    • A
      libata: dev_config does not need ap and adev passing · cd0d3bbc
      Alan 提交于
      It used to be impossible to get from ata_device to ata_port but that is
      no longer true. Various methods have been cleaned up over time but
      dev_config still takes both and most users don't need both anyway. Tidy
      this one up
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      cd0d3bbc
    • J
      [libata] export sata_print_link_status() · 43727fbc
      Jeff Garzik 提交于
      To be used in sata_mv's exception handling code, and overall is a
      generally useful function.
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      43727fbc
  2. 04 4月, 2007 3 次提交
  3. 03 3月, 2007 2 次提交
    • T
      libata: add CONFIG_PM to libata core layer · 6ffa01d8
      Tejun Heo 提交于
      Conditionalize all PM related stuff in libata core layer using
      CONFIG_PM.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6ffa01d8
    • A
      libata-core: Fix simplex handling · 032af1ce
      Alan 提交于
      The initial simplex handling code is fooled if you suspend and resume.
      This also causes problems with some single channel controllers which
      claim to be simplex.
      
      The fix is fairly simple, instead of keeping a flag to remember if we
      gave away the simplex channel we remember the actual owner. As the owner
      is always part of the host_set we don't even need a refcount.
      
      Knowing the owner also means we can reassign simplex DMA channels in
      future hotplug code etc if we need to
      Signed-off-by: NAlan Cox <alan@redhat.com>
      (and a signed-off for the patch I sent before while I remember)
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      032af1ce
  4. 26 2月, 2007 1 次提交
  5. 21 2月, 2007 4 次提交
    • T
      libata: s/ap->id/ap->print_id/g · 44877b4e
      Tejun Heo 提交于
      ata_port has two different id fields - id and port_no.  id is
      system-wide 1-based unique id for the port while port_no is 0-based
      host-wide port number.  The former is primarily used to identify the
      ATA port to the user in printk messages while the latter is used in
      various places in libata core and LLDs to index the port inside the
      host.
      
      The two fields feel quite similar and sometimes ap->id is used in
      place of ap->port_no, which is very difficult to spot.  This patch
      renames ap->id to ap->print_id to reduce the possibility of such bugs.
      
      Some printk messages are adjusted such that id string (ata%u[.%u])
      isn't printed twice and/or to use ata_*_printk() instead of hardcoded
      id format.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      44877b4e
    • T
      libata: separate out ata_ncq_enabled() · 6d1245bf
      Tejun Heo 提交于
      Separate out ata_ncq_enabled().
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6d1245bf
    • T
      libata: put some intelligence into EH speed down sequence · 7d47e8d4
      Tejun Heo 提交于
      The current EH speed down code is more of a proof that the EH
      framework is capable of adjusting transfer speed in response to error.
      This patch puts some intelligence into EH speed down sequence.  The
      rules are..
      
      * If there have been more than three timeout, HSM violation or
        unclassified DEV errors for known supported commands during last 10
        mins, NCQ is turned off.
      
      * If there have been more than three timeout or HSM violation for known
        supported command, transfer mode is slowed down.  If DMA is active,
        it is first slowered by one grade (e.g. UDMA133->100).  If that
        doesn't help, it's slowered to 40c limit (UDMA33).  If PIO is
        active, it's slowered by one grade first.  If that doesn't help,
        PIO0 is forced.  Note that this rule does not change transfer mode.
        DMA is never degraded into PIO by this rule.
      
      * If there have been more than ten ATA bus, timeout, HSM violation or
        unclassified device errors for known supported commands && speeding
        down DMA mode didn't help, the device is forced into PIO mode.  Note
        that this rule is considered only for PATA devices and is pretty
        difficult to trigger.
      
      One error can only trigger one rule at a time.  After a rule is
      triggered, error history is cleared such that the next speed down
      happens only after some number of errors are accumulated.  This makes
      sense because now speed down is done in bigger stride.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      7d47e8d4
    • A
      libata: PATA driver for Celleb · a619f981
      Akira Iguchi 提交于
      This is the patch for PATA controller of Celleb.
      
      This driver uses the managed iomap (devres).
      
      Because this driver needs special taskfile accesses, there is
      a copy of ata_std_softreset(). ata_dev_try_classify() is exported
      so that it can be used in this function.
      Signed-off-by: NKou Ishizaki <kou.ishizaki@toshiba.co.jp>
      Signed-off-by: NAkira Iguchi <akira2.iguchi@toshiba.co.jp>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      a619f981
  6. 17 2月, 2007 1 次提交
  7. 16 2月, 2007 1 次提交
  8. 10 2月, 2007 10 次提交
  9. 03 2月, 2007 1 次提交
  10. 26 1月, 2007 1 次提交
  11. 25 1月, 2007 1 次提交
  12. 24 1月, 2007 2 次提交
  13. 20 1月, 2007 1 次提交
    • T
      libata: initialize qc->dma_dir to DMA_NONE · 501e0c50
      Tejun Heo 提交于
      libata didn't used to init qc->dma_dir to any specific value on qc
      initialization and command translation path didn't set qc->dma_dir if
      the command doesn't need data transfer.  This made non-data commands
      to have random qc->dma_dir.
      
      This usually doesn't cause problem because LLDs usually check
      qc->protocol first and look at qc->dma_dir iff the command needs data
      transfer but this doesn't hold for all LLDs.
      
      It might be worthwhile to rename qc->dma_dir to qc->data_dir as we use
      the field to tag data direction for both PIO and DMA protocols.
      
      This problem has been spotted by James Bottomley.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: James Bottomley <James.Bottomley@SteelEye.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      501e0c50
  14. 03 12月, 2006 3 次提交
    • 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: implement ATA_FLAG_SETXFER_POLLING and use it in pata_via, take #2 · 3d3cca37
      Tejun Heo 提交于
      This patch implements ATA_FLAG_SETXFER_POLLING and use in pata_via.
      If this flag is set, transfer mode setting performed by polling not by
      interrupt.  This should help those controllers which raise interrupt
      before the command is actually complete on SETXFER.
      
      Rationale for this approach.
      
      * uses existing facility and relatively simple
      * no busy sleep in the interrupt handler
      * updating drivers is easy
      
      While at it, kill now unused flag ATA_FLAG_SRST in pata_via.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      3d3cca37
    • T
      [PATCH] libata: remove unused HSM_ST_UNKNOWN · 582982e6
      Tejun Heo 提交于
      HSM_ST_UNKNOWN is not used anywhere.  Its value is zero and supposed
      to serve sanity check purpose but HSM_ST_IDLE is used for that
      purpose.  This unused state causes confusion.  After a port is
      initialized but before the first command is executed, the idle hsm
      state is UNKNOWN.  However, once a command has completed, the idle hsm
      state is IDLE.  This defeats sanity check in ata_pio_task() for the
      first command.
      
      This patch removes HSM_ST_UNKNOWN and consequently make HSM_ST_IDLE
      the default state.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      582982e6
  15. 02 12月, 2006 6 次提交
    • 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: use FLUSH_EXT only when driver is larger than LBA28 limit · 6fc49adb
      Tejun Heo 提交于
      Many drives support LBA48 even when its capacity is smaller than
      1<<28, as LBA48 is required for many functionalities.  FLUSH_EXT is
      mandatory for drives w/ LBA48 support.
      
      Interestingly, at least one of such drives (ST960812A) has problems
      dealing with FLUSH_EXT.  It eventually completes the command but takes
      around 7 seconds to finish in many cases thus drastically slowing down
      IO transactions.  This seems to be a firmware bug which sneaked into
      production probably because no other ATA driver including linux IDE
      issues FLUSH_EXT to drives which report support for LBA48 & FLUSH_EXT
      but is smaller than 1<<28 blocks.
      
      This patch adds ATA_DFLAG_FLUSH_EXT which is set iff the drive
      supports LBA48 & FLUSH_EXT and is larger than LBA28 limit.  Both cache
      flush paths are updated to issue FLUSH_EXT only when the flag is set.
      Note that the changed behavior is more inline with the rest of libata.
      libata prefers shorter commands whenever possible.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Danny Kukawka <dkukawka@novell.com>
      Cc: Stefan Seyfried <seife@novell.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6fc49adb
    • 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
    • T
      [PATCH] libata: separate out and export sata_port_hardreset() · b6103f6d
      Tejun Heo 提交于
      Separate out sata_port_hardreset() from sata_std_hardreset().  This
      will be used by LLD hardreset implementation and later by PMP.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      b6103f6d
    • T
      [PATCH] libata: move ata_irq_on() into libata-sff.c · 90088bb4
      Tejun Heo 提交于
      ata_irq_on() isn't used outside of libata core layer.  The function is
      TF/SFF interface specific but currently used by core path with some
      hack too.  Move it from include/linux/libata.h to
      drivers/ata/libata-sff.c.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      90088bb4