1. 20 7月, 2007 4 次提交
  2. 11 7月, 2007 3 次提交
  3. 10 7月, 2007 4 次提交
    • A
      libata: Support chips with 64K PRD quirk · d26fc955
      Alan Cox 提交于
      Add ata_dumb_qc_prep and supporting logic so that a driver can just
      specify it needs to be helped in this area. 64K entries are split
      as with drivers/ide.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d26fc955
    • T
      libata-acpi: implement _GTM/_STM support · 64578a3d
      Tejun Heo 提交于
      Implement _GTM/_STM support.  acpi_gtm is added to ata_port which
      stores _GTM parameters over suspend/resume cycle.  A new hook
      ata_acpi_on_suspend() is responsible for storing _GTM parameters
      during suspend.  _STM is executed in ata_acpi_on_resume().  With this
      change, invoking _GTF is safe on IDE hierarchy and acpi_sata check
      before _GTF is removed.
      
      ata_acpi_gtm() and ata_acpi_stm() implementation is taken from Alan
      Cox's pata_acpi implementation.  ata_acpi_gtm() is fixed such that the
      result parameter is not shifted by sizeof(union acpi_object).
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      64578a3d
    • T
      libata: reimplement ACPI invocation · 6746544c
      Tejun Heo 提交于
      This patch reimplements ACPI invocation such that, instead of
      exporting ACPI details to the rest of libata, ACPI event handlers -
      ata_acpi_on_resume() and ata_acpi_on_devcfg() - are used.  These two
      functions are responsible for determining whether specific ACPI method
      is used and when.
      
      On resume, _GTF is scheduled by setting ATA_DFLAG_ACPI_PENDING device
      flag.  This is done this way to avoid performing the action on wrong
      device device (device swapping while suspended).
      
      On every ata_dev_configure(), ata_acpi_on_devcfg() is called, which
      performs _SDD and _GTF.  _GTF is performed only after resuming and, if
      SATA, hardreset as the ACPI spec specifies.  As _GTF may contain
      arbitrary commands, IDENTIFY page is re-read after _GTF taskfiles are
      executed.
      
      If one of ACPI methods fails, ata_acpi_on_devcfg() retries on the
      first failure.  If it fails again on the second try, ACPI is disabled
      on the device.  Note that successful configuration clears ACPI failed
      status.
      
      With all feature checks moved to the above two functions,
      do_drive_set_taskfiles() is trivial and thus collapsed into
      ata_acpi_exec_tfs(), which is now static and converted to return the
      number of executed taskfiles to be used by ata_acpi_on_resume().  As
      failures are handled properly, ata_acpi_push_id() now returns -errno
      on errors instead of unconditional zero.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6746544c
    • T
      libata-acpi: implement ata_acpi_associate() · fafbae87
      Tejun Heo 提交于
      * Add acpi_handle to ata_host and ata_port.  Rename
        ata_device->obj_handle to ->acpi_handle and move it above such that
        it doesn't get cleared on reconfiguration.
      
      * Replace ACPI node association which ata_acpi_associate() which is
        called once during host initialization.  Unlike the previous
        implementation, ata_acpi_associate() uses ATA_FLAG_ACPI_SATA to
        choose between IDE or SATA ACPI hierarchy and uses simple child look
        up instead of recursive walk to match the nodes.  This is way safer
        and simpler.  Please read the following message for more info.
      
        http://article.gmane.org/gmane.linux.ide/17554Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      fafbae87
  4. 27 6月, 2007 2 次提交
    • T
      libata: kill ATA_HORKAGE_DMA_RW_ONLY · 40a1d531
      Tejun Heo 提交于
      ATA_HORKAGE_DMA_RW_ONLY for TORiSAN is verified to be subset of using
      DMA for ATAPI commands which aren't aligned to 16 bytes.  As libata
      now doesn't use DMA for unaligned ATAPI commands, the horkage is
      redundant.  Kill it.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      40a1d531
    • T
      libata: kill the infamous abnormal status message · 55f3952d
      Tejun Heo 提交于
      The infamous abnormal status message triggers on not so abnormal cases
      including empty port and even when it's being triggered on actual
      errors the info it provides is redundant and out of context - higher
      level functions will print the info in better safe later anyway.
      
      Also, by being triggered all the time, it leads people to think that
      the abnormality is somehow related to all ATA and system problems
      they're experiencing and gives owners of healthy systems unfounded
      doubts about the integrity of the universe.  Make it a DPRINTK and
      save the universe.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      55f3952d
  5. 10 6月, 2007 1 次提交
    • A
      libata-core/sff: Fix multiple assumptions about DMA · d92e74d3
      Alan Cox 提交于
      The ata IRQ ack functions are only used when debugging. Unfortunately
      almost every controller that calls them can cause crashes in some
      configurations as there are missing checks for bmdma presence.
      
      In addition ata_port_start insists of installing DMA buffers and pad
      buffers for controllers regardless. The SFF controllers actually need to
      make that decision dynamically at controller setup time and all need the
      same helper - so we add ata_sff_port_start. Future patches will switch
      the SFF drivers to use this.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d92e74d3
  6. 05 6月, 2007 1 次提交
    • T
      libata: always use polling SETXFER · 464cf177
      Tejun Heo 提交于
      Several people have reported LITE-ON LTR-48246S detection failed
      because SETXFER fails.  It seems the device raises IRQ too early after
      SETXFER.  This is controller independent.  The same problem has been
      reported for different controllers.
      
      So, now we have pata_via where the controller raises IRQ before it's
      ready after SETXFER and a device which does similar thing.  This patch
      makes libata always execute SETXFER via polling.  As this only happens
      during EH, performance impact is nil.  Setting ATA_TFLAG_POLLING is
      also moved from issue hot path to ata_dev_set_xfermode() - the only
      place where SETXFER can be issued.
      
      Note that ATA_TFLAG_POLLING applies only to drivers which implement
      SFF TF interface and use libata HSM.  More advanced controllers ignore
      the flag.  This doesn't matter for this fix as SFF TF controllers are
      the problematic ones.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      464cf177
  7. 22 5月, 2007 1 次提交
  8. 16 5月, 2007 3 次提交
    • T
      libata: track spindown status and skip spindown_compat if possible · 13b8d09f
      Tejun Heo 提交于
      Our assumption that most distros issue STANDBYNOW seems wrong.  The
      upstream sysvinit and thus many distros including gentoo and opensuse
      don't take any action for libata disks on spindown.  We can skip
      compat handling for these distros so that they don't need to update
      anything to take advantage of kernel-side shutdown.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      13b8d09f
    • T
      libata-acpi: add ATA_FLAG_ACPI_SATA port flag · 3cadbcc0
      Tejun Heo 提交于
      Whether a controller needs IDE or SATA ACPI hierarchy is determined by
      the programming interface of the controller not by whether the
      controller is SATA or PATA, or it supports slave device or not.  This
      patch adds ATA_FLAG_ACPI_SATA port flags which tells libata-acpi that
      the port needs SATA ACPI nodes, and sets the flag for ahci and
      sata_sil24.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      3cadbcc0
    • 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
  9. 12 5月, 2007 4 次提交
    • T
      libata-acpi: s/CONFIG_SATA_ACPI/CONFIG_ATA_ACPI/ · e92351bb
      Tejun Heo 提交于
      ACPI applies to both SATA and PATA.  Drop the 'S' from the config
      variable.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      e92351bb
    • 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: 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
  10. 01 5月, 2007 2 次提交
    • 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: 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
  11. 29 4月, 2007 15 次提交
    • T
      libata: separate ATA_EHI_DID_RESET into DID_SOFTRESET and DID_HARDRESET · 0d64a233
      Tejun Heo 提交于
      Separate ATA_EHI_DID_RESET into ATA_EHI_DID_SOFTRESET and
      ATA_EHI_DID_HARDRESET.  ATA_EHI_DID_RESET is redefined as OR of the
      two flags.  This patch doesn't introduce any behavior change.  This
      will be used later to determine whether _SDD is necessary or not.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      0d64a233
    • 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
    • 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
    • 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
      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
    • 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