1. 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
  2. 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
  3. 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
  4. 22 5月, 2007 1 次提交
  5. 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
  6. 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
  7. 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
  8. 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
  9. 04 4月, 2007 3 次提交
  10. 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
  11. 26 2月, 2007 1 次提交
  12. 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
  13. 17 2月, 2007 1 次提交