1. 04 Dec, 2006 2 commits
  2. 03 Dec, 2006 17 commits
    • Mikael Pettersson's avatar
      [PATCH] sata_promise: PHYMODE4 fixup · 599b7202
      Mikael Pettersson authored
      
      
      This patch adds code to fix up the PHYMODE4 "align timing"
      register value on second-generation Promise SATA chips.
      Failure to correct this value on non-x86 machines makes
      drive detection prone to failure due to timeouts. (I've
      observed about 50% detection failure rates on SPARC64.)
      
      The HW boots with a bad value in this register, but on x86
      machines the Promise BIOS corrects it to the value recommended
      by the manual, so most people have been unaffected by this issue.
      
      After developing the patch I checked Promise's SATAII driver,
      and discovered that it also corrects PHYMODE4 just like this
      patch does.
      
      This patch depends on the sata_promise SATAII updates
      patch I sent recently.
      
      Signed-off-by: default avatarMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      599b7202
    • Tejun Heo's avatar
      [PATCH] libata: always use polling IDENTIFY · 800b3996
      Tejun Heo authored
      
      
      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: default avatarTejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      800b3996
    • Jeff Garzik's avatar
      [libata] pata_cs5535: fix build · 3ac551a6
      Jeff Garzik authored
      
      
      Noticed by Tejun and others.
      
      Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
      3ac551a6
    • Tejun Heo's avatar
      [PATCH] ahci: do not powerdown during initialization · 8e16f941
      Tejun Heo authored
      
      
      ahci_init_controller() calls ahci_deinit_port() to make sure the
      controller is stopped before initializing the controller.  In turn,
      ahci_deinit_port() invokes ahci_power_down() to power down the port.
      If the controller supports slumber mode, the link is put into it.
      
      Unfortunately, some devices don't implement link powersaving mode
      properly and show erratic behavior after link is put into slumber
      mode.  For example, HL-DT-ST DVD-RAM GSA-H30N completely locks up on
      slumber transition and can only be recovered with the *REAL* hard
      reset - power removal and reapply.
      
      Note that this makes the first probing reset different from all
      others.  If the above dvd-ram is hotplugged after ahci is initialized,
      no problem occurs because ahci is already fully initialized with phy
      powered up.  So, this might also be the reason for other weird AHCI
      initial probing abnormalities.
      
      This patch moves power up/down out of port init/deinit and call them
      only when needed.
      
      Power down is now called only when suspending.  As system suspend
      usually involves powering down 12v for storage devices, this shouldn't
      cause problem even if the attached device doesn't support slumber
      mode.  However, in partial power management and suspend failure cases,
      devices might lock up after suspend attempt.  I thought about removing
      transition to slumber mode altogether but ahci spec mandates it before
      HBA D3 state transition.  Blacklisting such devices might be the
      solution.
      
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      8e16f941
    • Tejun Heo's avatar
      [PATCH] libata: prepare ata_sg_clean() for invocation from EH · 70e6ad0c
      Tejun Heo authored
      
      
      Make ata_sg_clean() global and don't allow NCQ for internal commands.
      
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      70e6ad0c
    • Tejun Heo's avatar
      [PATCH] libata: separate out rw ATA taskfile building into ata_build_rw_tf() · bd056d7e
      Tejun Heo authored
      
      
      Separate out rw ATA taskfile building from ata_scsi_rw_xlat() into
      ata_build_rw_tf().  This will be used to improve media error handling.
      
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      bd056d7e
    • Tejun Heo's avatar
      [PATCH] libata: implement ata_exec_internal_sg() · 2432697b
      Tejun Heo authored
      
      
      Sg'ify ata_exec_internal() and call it ata_exec_internal_sg().
      Wrapper function around ata_exec_internal_sg() is implemented to
      provide ata_exec_internal() interface.
      
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      2432697b
    • Tejun Heo's avatar
      [PATCH] libata: make sure IRQ is cleared after ata_bmdma_freeze() · 0f0a3ad3
      Tejun Heo authored
      
      
      Now that BMDMA status is recorded in irq handler.  ata_bmdma_freeze()
      is free to manipulate host status.  Under certain circumstances, some
      controllers (ICH7 in enhanced mode w/ IRQ shared) raise IRQ when CTL
      register is written to and ATA_NIEN doesn't mask it.
      
      This patch makes ata_bmdma_freeze() clear all pending IRQs after
      freezing a port.  This change makes explicit clearing in
      ata_device_add() unnecessary and thus kills it.  The removed code was
      SFF-specific and was in the wrong place.
      
      Note that ->freeze() handler is always called under ap->lock held and
      irq disabled.  Even if CTL manipulation causes stuck IRQ, it's cleared
      immediately.  This should be safe (enough) even in SMP environment.
      More correct solution is to mask the IRQ from IRQ controller but that
      would be an overkill.
      
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      0f0a3ad3
    • Tejun Heo's avatar
      [PATCH] libata: move BMDMA host status recording from EH to interrupt handler · ea54763f
      Tejun Heo authored
      
      
      For certain errors, interrupt handler alter BMDMA host status before
      entering EH (clears active and intr).  Thus altered BMDMA host status
      value is recorded by BMDMA EH and reported to user.  Move BMDMA host
      status recording from EH to interrupt handler.
      
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      ea54763f
    • Tejun Heo's avatar
      [PATCH] libata: make sure sdev doesn't go away while rescanning · f84e7e41
      Tejun Heo authored
      
      
      ata_scsi_dev_rescan() doesn't synchronize against SCSI device detach
      and the target sdev might go away in the middle.  Fix it.
      
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      f84e7e41
    • Tejun Heo's avatar
      [PATCH] libata: don't request sense if the port is frozen · a569a30d
      Tejun Heo authored
      
      
      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: default avatarTejun Heo <htejun@gmail.com>
      a569a30d
    • Tejun Heo's avatar
      [PATCH] libata: fix READ CAPACITY simulation · 6a36261e
      Tejun Heo authored
      
      
      * READ CAPACITY (16) implementation fixed.  Result was shifted by two
        bytes.  Carlos Pardo spotted this problem and submitted preliminary
        patch.  Capacity => 2TB is handled correctly now.  (verifid w/ fake
        capacity)
      
      * Use dev->n_sectors instead of re-reading directly from ID data.
      
      * Define and use ATA_SCSI_RBUF_SET() which considers rbuf length.
        This should be done for all simulation functions.  Userland can
        issue any simulated command with arbitrary buffer length.
      
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      Cc: Carlos Pardo <Carlos.Pardo@siliconimage.com>
      6a36261e
    • Tejun Heo's avatar
      [PATCH] libata: implement ATA_FLAG_SETXFER_POLLING and use it in pata_via, take #2 · 3d3cca37
      Tejun Heo authored
      
      
      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: default avatarTejun Heo <htejun@gmail.com>
      3d3cca37
    • Tejun Heo's avatar
      [PATCH] libata: set IRQF_SHARED for legacy PCI IDE IRQs · 8070217d
      Tejun Heo authored
      
      
      There are machines out there which share legacy PCI IDE IRQs w/ other
      devices.  libata SFF interrupt/HSM code is ready for shared IRQ and
      has been setting IRQF_SHARED for devices in native PCI mode.  Device
      in legacy mode is still a PCI device and thus supposedly uses
      active-low level triggered IRQ.
      
      Machines with such setup should be quite rare and w/o this flag libata
      is likely to fail loading and render the system unuseable.  Also, IDE
      driver has been setting IRQF_SHARED for devices in legacy mode for a
      looooong time.
      
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      8070217d
    • Tejun Heo's avatar
      [PATCH] libata: remove unused HSM_ST_UNKNOWN · 582982e6
      Tejun Heo authored
      
      
      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: default avatarTejun Heo <htejun@gmail.com>
      582982e6
    • Tejun Heo's avatar
      [PATCH] libata: kill unnecessary sht->max_sectors initializations · 2eab80ac
      Tejun Heo authored
      
      
      sht->max_sectors is overrided unconditionally in ->slave_configure.
      There's no reason to set it to any value.
      
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      2eab80ac
    • Tejun Heo's avatar
      [PATCH] libata: add missing sht->slave_destroy · c972b60b
      Tejun Heo authored
      
      
      Add missing sht->slave_destroy.  Most drivers received this fix in
      didn't.  Fix those four drives.
      
      Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
      c972b60b
  3. 02 Dec, 2006 21 commits