1. 25 5月, 2007 2 次提交
  2. 22 5月, 2007 4 次提交
  3. 18 5月, 2007 1 次提交
    • T
      libata: remove libata.spindown_compat · d9aca22c
      Tejun Heo 提交于
      With STANDBYDOWN tracking added, libata.spindown_compat isn't
      necessary anymore.  If userspace shutdown(8) issues STANDBYNOW, libata
      warns.  If userspace shutdown(8) doesn't issue STANDBYNOW, libata does
      the right thing.  Userspace can tell whether kernel supports spindown
      by testing whether sysfs node manage_start_stop exists as before.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d9aca22c
  4. 16 5月, 2007 2 次提交
    • T
      libata: during revalidation, check n_sectors after device is configured · 6ddcd3b0
      Tejun Heo 提交于
      Device might be resized during ata_dev_configure() due to HPA or
      (later) ACPI _GTF.  Currently it's worked around by caching n_sectors
      before turning off HPA.  The cached original size is overwritten if
      the device is reconfigured without being hardreset - which always
      happens after configuring trasnfer mode.  If the device gets hardreset
      for some reason after that, revalidation fails with -ENODEV.
      
      This patch makes size checking more robust by moving n_sectors check
      from ata_dev_reread_id() to ata_dev_revalidate() after the device is
      fully configured.  No matter what happens during configuration, a
      device must have the same n_sectors after fully configured to be
      treated as the same device.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6ddcd3b0
    • T
      libata: separate out ata_dev_reread_id() · fe30911b
      Tejun Heo 提交于
      Separate out ata_dev_reread_id() from ata_dev_revalidate().
      ata_dev_reread_id() reads IDENTIFY page and determines whether the
      same device is still there.  ata_dev_revalidate() reconfigures after
      reread completes.  This will be used by ACPI update.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      fe30911b
  5. 12 5月, 2007 6 次提交
    • T
      libata-acpi: clean up parameters and misc stuff · 3a32a8e9
      Tejun Heo 提交于
      This patch cleans up libata-acpi such that it looks similar to other
      libata files.  This patch doesn't introuce any behavior changes.
      
      * make libata-acpi functions take ata_device instead of ata_port +
        device index
      * s/atadev/dev/
      * de-indent local variable declarations
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      3a32a8e9
    • T
      libata: fallback to the other IDENTIFY on device error, take#2 · 54936f8b
      Tejun Heo 提交于
      It seems the world isn't as frank as we thought and some devices lie
      about who they are.  Fallback to the other IDENTIFY if IDENTIFY is
      aborted by the device.  As this is the strategy used by IDE for a long
      time, it shouldn't cause too much problem.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: William Thompson <wt@electro-mechanical.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      54936f8b
    • T
      libata: ignore EH scheduling during initialization · f4d6d004
      Tejun Heo 提交于
      libata enables SCSI host during ATA host activation which happens
      after IRQ handler is registered and IRQ is enabled.  All ATA ports are
      in frozen state when IRQ is enabled but frozen ports may raise limited
      number of IRQs after being frozen - IOW, ->freeze() is not responsible
      for clearing pending IRQs.  During normal operation, the IRQ handler
      is responsible for clearing spurious IRQs on frozen ports and it
      usually doesn't require any extra code.
      
      Unfortunately, during host initialization, the IRQ handler can end up
      scheduling EH for a port whose SCSI host isn't initialized yet.  This
      results in OOPS in the SCSI midlayer.  This is relatively short window
      and scheduling EH for probing is the first thing libata does after
      initialization, so ignoring EH scheduling until initialization is
      complete solves the problem nicely.
      
      This problem was spotted by Berck E. Nash in the following thread.
      
        http://thread.gmane.org/gmane.linux.kernel/519412Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Berck E. Nash <flyboy@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      f4d6d004
    • T
      libata: clean up SFF init mess · 1626aeb8
      Tejun Heo 提交于
      The intention of using port_mask in SFF init helpers was to eventually
      support exoctic configurations such as combination of legacy and
      native port on the same controller.  This never became actually
      necessary and the related code always has been subtly broken one way
      or the other.  Now that new init model is in place, there is no reason
      to make common helpers capable of handling all corner cases.  Exotic
      cases can simply dealt within LLDs as necessary.
      
      This patch removes port_mask handling in SFF init helpers.  SFF init
      helpers don't take n_ports argument and interpret it into port_mask
      anymore.  All information is carried via port_info.  n_ports argument
      is dropped and always two ports are allocated.  LLD can tell SFF to
      skip certain port by marking it dummy.  Note that SFF code has been
      treating unuvailable ports this way for a long time until recent
      breakage fix from Linus and is consistent with how other drivers
      handle with unavailable ports.
      
      This fixes 1-port legacy host handling still broken after the recent
      native mode fix and simplifies SFF init logic.  The following changes
      are made...
      
      * ata_pci_init_native_host() and ata_init_legacy_host() both now try
        to initialized whatever they can and mark failed ports dummy.  They
        return 0 if any port is successfully initialized.
      
      * ata_pci_prepare_native_host() and ata_pci_init_one() now doesn't
        take n_ports argument.  All info should be specified via port_info
        array.  Always two ports are allocated.
      
      * ata_pci_init_bmdma() exported to be used by LLDs in exotic cases.
      
      * port_info handling in all LLDs are standardized - all port_info
        arrays are const stack variable named ppi.  Unless the second port
        is different from the first, its port_info is specified as NULL
        (tells libata that it's identical to the last non-NULL port_info).
      
      * pata_hpt37x/hpt3x2n: don't modify static variable directly.  Make an
        on-stack copy instead as ata_piix does.
      
      * pata_uli: It has 4 ports instead of 2.  Don't use
        ata_pci_prepare_native_host().  Allocate the host explicitly and use
        init helpers.  It's simple enough.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      1626aeb8
    • T
      libata: implement libata.spindown_compat · 920a4b10
      Tejun Heo 提交于
      Now that libata uses sd->manage_start_stop, libata spins down disk on
      shutdown.  In an attempt to compensate libata's previous shortcoming,
      some distros sync and spin down disks attached via libata in their
      shutdown(8).  Some disks spin back up just to spin down again on
      STANDBYNOW1 if the command is issued when the disk is spun down, so
      this double spinning down causes problem.
      
      This patch implements module parameter libata.spindown_compat which,
      when set to one (default value), prevents libata from spinning down
      disks on shutdown thus avoiding double spinning down.  Note that
      libata spins down disks for suspend to mem and disk, so with
      libata.spindown_compat set to one, disks should be properly spun down
      in all cases without modifying shutdown(8).
      
      shutdown(8) should be fixed eventually.  Some drive do spin up on
      SYNCHRONZE_CACHE even when their cache is clean.  Those disks
      currently spin up briefly when sd tries to shutdown the device and
      then the machine powers off immediately, which can't be good for the
      head.  We can't skip SYNCHRONIZE_CACHE during shudown as it can be
      dangerous data integrity-wise.
      
      So, this spindown_compat parameter is already scheduled for removal by
      the end of the next year and here's what shutdown(8) should do.
      
        * Check whether /sys/modules/libata/parameters/spindown_compat
          exists.  If it does, write 0 to it.
      
        * For each libata harddisk {
      	* Check whether /sys/class/scsi_disk/h:c:i:l/manage_start_stop
      	  exists.  Iff it doesn't, synchronize cache and spin the disk
      	  down as before.
        }
      
      The above procedure will make shutdown(8) work properly with kernels
      before this change, ones with this workaround and later ones without
      it.
      
      To accelerate shutdown(8) updates, if the compat mode is in use, this
      patch prints BIG FAT warning for five seconds during shutdown (the
      optimal interval to annoy the user just the right amount discovered by
      hours of tireless usability testing).
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      920a4b10
    • T
      libata: reimplement suspend/resume support using sdev->manage_start_stop · 9666f400
      Tejun Heo 提交于
      Reimplement suspend/resume support using sdev->manage_start_stop.
      
      * Device suspend/resume is now SCSI layer's responsibility and the
        code is simplified a lot.
      
      * DPM is dropped.  This also simplifies code a lot.  Suspend/resume
        status is port-wide now.
      
      * ata_scsi_device_suspend/resume() and ata_dev_ready() removed.
      
      * Resume now has to wait for disk to spin up before proceeding.  I
        couldn't find easy way out as libata is in EH waiting for the
        disk to be ready and sd is waiting for EH to complete to issue
        START_STOP.
      
      * sdev->manage_start_stop is set to 1 in ata_scsi_slave_config().
        This fixes spindown on shutdown and suspend-to-disk.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      9666f400
  6. 10 5月, 2007 3 次提交
  7. 01 5月, 2007 4 次提交
    • T
      libata: reimplement reset sequencing · 31daabda
      Tejun Heo 提交于
      libata previously depended upon waits in prereset to get resets after
      hotplug right for both spin up and device ready wait.  This was
      necessary both for reliablity and speed as reset was likely to fail if
      initiated too early and each try usually took more than 30secs to
      fail.  Previous patches fixed the reliability part by fixing status
      and SCR handling in resets.  This patch remedies the speed part by
      improving reset sequencing.
      
      Prereset waiting timeout is adjusted to 10s because spinup wait is
      replaced by reset sequencing and !BSY wait is not as important as
      before.  During boot or module loading where the drive is already
      fully spun up, !BSY wait succeeds immediately, so 10s should be enough
      in most cases.  It matters after hotplugging or other error
      conditions, but in those cases, !BSY wait in prereset simply can't be
      relied upon due to the varied and weird behaviors ATA controllers and
      devices show.
      
      Reset is now driven by ata_eh_reset_timeouts[] table which contains
      timeouts for each reset try.  The first reset can be softreset but the
      following ones are always hardreset if available.  Each timeout
      defines deadline for the reset try.  If a reset try fails, reset is
      retried with the next timeout till the end of the timeout table is
      reached.  If a reset try fails before the timeout with error, libata
      waits till the deadline of the failed try before retrying.
      
      IOW, the timeout table defines timetable of reset tries such that the
      n'th try always begins at least after the sum of all previous timeouts
      has passed.  The current timetable defines 4 tries and takes around 1
      minute.
      
      @0	: First try.  This should succeed most of the time during boot.
      @10	: 10s is enough to spin up most consumer harddrives.  Give it
      	  another shot.
      @20	: 20s should spin up > 99% of working drives.  This has 30s
      	  timeout for retarded devices needing long idleness post reset.
      @55	: Final try with 5s timeout just in case.
      
      The above timetable is trade off between not annoying the device too
      much with frequent resets and taking reasonable amount of time in most
      cases.  Some controllers may do better with shorter timeouts while
      others may fare better with longer but we just can't rely upon LLD
      writers to test each controller with wide variety of devices using
      various scenarios.  We need default behavior which reasonably fits
      most cases.
      
      I've tested the above timetable on a dozen SATA controllers and a few
      PATA controllers with about a dozen different drives from all major
      vendors and 4 different ODDs from three different vendors for both
      boot and hotplug (if available) cases.
      
      Boot probing is not affected unless the device is broken in which
      cases new code gives up on the port after a minute rather than five or
      nine minutes.  When hotplugging, most devices get detected on the
      first or second try.  Multi-platter drives with long spin up time
      which sometimes took > 40 secs with the original code, now usually
      comes up during the second try and at least right after the third try
      @20.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      31daabda
    • T
      libata: improve ata_std_prereset() · b8cffc6a
      Tejun Heo 提交于
      This patch updates ata_std_prereset() as follows.
      
      * Don't fail on phy resume failure.  Just whine and continue.  Failure
        from prereset makes libata abort whole reset sequence and give up
        the port, so prereset() should be best effort.  This is more
        important with the coming EH updates as prereset() will be called
        with shorter timeout.
      
      * If ata_wait_ready() fails, whine and request hardreset instead.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      b8cffc6a
    • T
      libata: improve 0xff status handling · 9b89391c
      Tejun Heo 提交于
      For PATA, 0xff status indicates empty port.  For SATA, it depends on
      how the controller emulates status register.  On some controllers,
      0xff is used to represent broken link or certain stage during reset.
      
      libata currently deals SATA the same.  This hasn't caused any problem
      because problematic situations usually only occur after hotplug or
      other link disruption events and libata blindly waited for the device
      to spin up and settle after hotplug giving the link and device
      whatever time to go through those stages.
      
      libata is going to replace unconditional spinup wait with generic
      timed sequence of resets, so not only getting 0xff handling right for
      SATA is, well, the right thing to do, it's much more important now.
      
      This patch makes the following changes.
      
      * Make ata_bus_softreset() return -ENODEV if any of its wait fails
        due to 0xff status.
      
      * Fail soft/hardreset if status wait returns -ENODEV indicating 0xff
        status while SStatus says the link is online.  e.g. Reset fails if
        status is 0xff after reset when SStatus reports the linke is online.
        If SCR registers are not available, everything is the same as
        before.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      9b89391c
    • T
      libata: add deadline support to prereset and reset methods · d4b2bab4
      Tejun Heo 提交于
      Add @deadline to prereset and reset methods and make them honor it.
      ata_wait_ready() which directly takes @deadline is implemented to be
      used as the wait function.  This patch is in preparation for EH timing
      improvements.
      
      * ata_wait_ready() never does busy sleep.  It's only used from EH and
        no wait in EH is that urgent.  This function also prints 'be
        patient' message automatically after 5 secs of waiting if more than
        3 secs is remaining till deadline.
      
      * ata_bus_post_reset() now fails with error code if any of its wait
        fails.  This is important because earlier reset tries will have
        shorter timeout than the spec requires.  If a device fails to
        respond before the short timeout, reset should be retried with
        longer timeout rather than silently ignoring the device.
      
        There are three behavior differences.
      
        1. Timeout is applied to both devices at once, not separately.  This
           is more consistent with what the spec says.
      
        2. When a device passes devchk but fails to become ready before
           deadline.  Previouly, post_reset would just succeed and let
           device classification remove the device.  New code fails the
           reset thus causing reset retry.  After a few times, EH will give
           up disabling the port.
      
        3. When slave device passes devchk but fails to become accessible
           (TF-wise) after reset.  Original code disables dev1 after 30s
           timeout and continues as if the device doesn't exist, while the
           patched code fails reset.  When this happens, new code fails
           reset on whole port rather than proceeding with only the primary
           device.
      
        If the failing device is suffering transient problems, new code
        retries reset which is a better behavior.  If the failing device is
        actually broken, the net effect is identical to it, but not to the
        other device sharing the channel.  In the previous code, reset would
        have succeeded after 30s thus detecting the working one.  In the new
        code, reset fails and whole port gets disabled.  IMO, it's a
        pathological case anyway (broken device sharing bus with working
        one) and doesn't really matter.
      
      * ata_bus_softreset() is changed to return error code from
        ata_bus_post_reset().  It used to return 0 unconditionally.
      
      * Spin up waiting is to be removed and not converted to honor
        deadline.
      
      * To be on the safe side, deadline is set to 40s for the time being.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d4b2bab4
  8. 29 4月, 2007 18 次提交
    • A
      ata: printk warning fixes · bd1d5ec6
      Andrew Morton 提交于
      drivers/ata/libata-core.c: In function 'ata_hpa_resize':
      drivers/ata/libata-core.c:986: warning: format '%lld' expects type 'long long int', but argument 5 has type 'u64'
      drivers/ata/libata-core.c:986: warning: format '%lld' expects type 'long long int', but argument 6 has type 'u64'
      drivers/ata/libata-core.c:990: warning: format '%lld' expects type 'long long int', but argument 4 has type 'u64'
      drivers/ata/libata-core.c:990: warning: format '%lld' expects type 'long long int', but argument 5 has type 'u64'
      drivers/ata/libata-core.c:1003: warning: format '%lld' expects type 'long long int', but argument 4 has type 'u64'
      
      Also fix various 80-col bustage.
      
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: Tejun Heo <htejun@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      bd1d5ec6
    • A
      ata_timing: ensure t->cycle is always correct · 4f701d1e
      Alan Cox 提交于
      Russell King hit a case where quantisation errors accumulated such that
      the cycle time was shorter than rather than equal to the active/recovery
      time. The code already knows how to stretch times to fit the cycle time
      but does not know about the reverse.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4f701d1e
    • M
      libata: Handle drives that require a spin-up command before first access · 169439c2
      Mark Lord 提交于
      (S)ATA drives can be configured for "power-up in standby",
      a mode whereby a specific "spin up now!" command is required
      before the first media access.
      
      Currently, a drive with this feature enabled can not be used at all
      with libata, and once in this mode, the drive becomes a doorstop.
      
      The older drivers/ide subsystem at least enumerates the drive,
      so that it can be woken up after the fact from a userspace HDIO_*
      command, but not libata.
      
      This patch adds support to libata for the "power-up in standby"
      mode where a "spin up now!" command (SET_FEATURES) is needed.
      With this, libata will recognize such drives, spin them up,
      and then re-IDENTIFY them if necessary to get a full/complete
      set of drive features data.
      
      Drives in this state are determined by looking for
      special values in id[2], as documented in the current ATA specs.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      169439c2
    • A
      libata: HPA support · 1e999736
      Alan Cox 提交于
      Signed-off-by: NAlan Cox <alan@redhat.com>
      
      Add support for ignoring the BIOS HPA result (off by default) and setting
      the disk to the full available size unless already frozen.
      
      Tested with various platforms/disks and confirmed to work with the
      Macintosh (which broke earlier) and ata_piix (breakage due to the LBA48
      readback that Tejun fixed).
      
      For normal users this brings us, I believe, to feature parity with old IDE
      (and of course more featured in some areas too).
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      1e999736
    • T
      libata: kill probe_ent and related helpers · 6bfff31e
      Tejun Heo 提交于
      All drivers are converted to new init model.  Kill probe_ent,
      ata_device_add() and ata_pci_init_native_mode().
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6bfff31e
    • T
      libata: add init helpers including ata_pci_prepare_native_host() · 21b0ad4f
      Tejun Heo 提交于
      These will be used to convert LLDs to new init model.
      
      * Add irq_handler field to port_info.  In new init model, requesting
        IRQ is LLD's responsibility and libata doesn't need to know about
        irq_handler.  Most LLDs can simply register their irq_handler but
        some need different irq_handler depending on specific chip.  The
        added port_info->irq_handler field can be used by LLDs to select
        the matching IRQ handler in such cases.
      
      * Add ata_dummy_port_info.
      
      * Implement ata_pci_prepare_native_host(), a helper to alloc ATA host,
        acquire all resources and init the host in one go.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      21b0ad4f
    • T
      libata: convert native PCI host handling to new init model · d491b27b
      Tejun Heo 提交于
      Convert native PCI host handling to alloc-init-register model.  New
      function ata_pci_init_native_host() follows the new init model and
      replaces ata_pci_init_native_mode().  As there are remaining LLD
      users, the old function isn't removed yet.
      
      ata_pci_init_one() is reimplemented using the new function and now
      fully converted to new init model.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d491b27b
    • T
      libata: implement ata_host_alloc_pinfo() and ata_host_register() · f5cda257
      Tejun Heo 提交于
      Implement ata_host_alloc_pinfo() and ata_host_register().  These helpers
      will be used in the following patches to adopt new init model.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      f5cda257
    • T
      libata: separate out ata_host_alloc() and ata_host_register() · f3187195
      Tejun Heo 提交于
      Reorganize ata_host_alloc() and its subroutines into the following
      three functions.
      
      * ata_host_alloc() : allocates host and its ports.  shost is not
        registered automatically.
      
      * ata_scsi_add_hosts() : allocates and adds shosts associated with an
        ATA host.  Used by ata_host_register().
      
      * ata_host_register() : takes a fully initialized ata_host structure
        and registers it to libata layer and probes it.
      
      Only ata_host_alloc() and ata_host_register() are exported.
      ata_device_add() is rewritten using the above functions.  This patch
      does not introduce any observable behavior change.  Things worth
      mentioning.
      
      * print_id is assigned at registration time and LLDs are allowed to
        overallocate ports and reduce host->n_ports during initialization.
        ata_host_register() will throw away unused ports automatically.
      
      * All SCSI host initialization stuff now resides in
        ata_scsi_add_hosts() in libata-scsi.c, where it should be.
      
      * ipr is now the only user of ata_host_init().  Either kill it by
        converting ipr to use ata_host_alloc() and friends or rename and
        move it to libata-scsi.c
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      f3187195
    • T
      libata: separate out ata_host_start() · ecef7253
      Tejun Heo 提交于
      Separate out ata_host_start() from ata_device_add().  ata_host_start()
      calls ->port_start on each port if available and freezes the port.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      ecef7253
    • T
      libata: allocate ap separately from shost · 4911487a
      Tejun Heo 提交于
      Don't embed ap inside shost.  Allocate it separately and point it back
      from shosts's hostdata.  This makes port allocation more flexible and
      allows regular ATA and SAS share host alloc/init paths.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4911487a
    • T
      libata: kill type mismatch compile warning · 03ec52de
      Tejun Heo 提交于
      kill the following compile warning.
      
      drivers/ata/libata-core.c:1786: warning: comparison of distinct pointer types lacks a cast
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      03ec52de
    • T
      libata: improve AC_ERR_DEV handling for ->post_internal_cmd · a51d644a
      Tejun Heo 提交于
      ->post_internal_cmd is simplified EH for internal commands.  Its
      primary mission is to stop the controller such that no rogue memory
      access or other activities occur after the internal command is
      released.  It may provide error diagnostics by setting qc->err_mask
      but this hasn't been a requirement.
      
      To ignore SETXFER failure for CFA devices, libata needs to know
      whether a command was failed by the device or for any other reason.
      ie. internal command needs to get AC_ERR_DEV right.
      
      This patch makes the following changes to AC_ERR_DEV handling and
      ->post_internal_cmd semantics to accomodate this need and simplify
      callback implementation.
      
      1. As long as the correct bits in the result TF registers are set,
         there is no need to set AC_ERR_DEV explicitly.  libata EH core
         takes care of that for both normal and internal commands.
      
      2. The only requirement for ->post_internal_cmd() is to put the
         controller into quiescent state.  It needs not to set any err_mask.
      
      3. ata_exec_internal_sg() performs minimal error analysis such that
         AC_ERR_DEV is automatically set as long as result_tf is filled
         correctly.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      a51d644a
    • M
      libata: add support for READ/WRITE LONG · 5a5dbd18
      Mark Lord 提交于
      The READ/WRITE LONG commands are theoretically obsolete,
      but the majority of drives in existance still implement them.
      
      The WRITE_LONG and WRITE_LONG_ONCE commands are of particular
      interest for fault injection testing -- eg. creating "media errors"
      at specific locations on a disk.
      
      The fussy bit is that these commands require a non-standard
      sector size, usually 520 bytes instead of 512.
      
      This patch adds support to libata for READ/WRITE LONG commands
      issued via SG_IO/ATA_16.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      5a5dbd18
    • J
      [libata] turn on !IORDY filter · e424675f
      Jeff Garzik 提交于
      The previous commit erroneously noted that the !IORDY filter was turned
      on.  No true, that change was split out into this commit.
      
      Originally authored and signed-off-by Alan Cox.
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      e424675f
    • A
      libata: Change prototype of mode_filter to remove ata_port* · a76b62ca
      Alan Cox 提交于
      With Tejun having added adev->ap some time ago we can get rid of the
      almost unused port being passed to mode filters. And while we are
      doing filters, lets turn on the !IORDY filter as well.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      
      With some hand massaging from
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      a76b62ca
    • A
      libata-core: Fix the iordy methods · 432729f0
      Alan Cox 提交于
      This alone isn't sufficient to save the universe from prehistoric disks
      and controllers but it is a first important step. Split off a separate
      function to provide a mode filter when controller iordy is not available.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      432729f0
    • A
      pata: expose set_mode method so it can be wrapped · 04351821
      Alan 提交于
      This splits set_mode into do_set_mode and the wrapper so that a driver can
      call the standard method inside its own.  This in theory also obsoletes
      ->post_set_mode().
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: Tejun Heo <htejun@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      04351821