1. 23 1月, 2008 18 次提交
    • T
      libata: factor out ata_pci_activate_sff_host() from ata_pci_one() · 4e6b79fa
      Tejun Heo 提交于
      Factor out ata_pci_activate_sff_host() from ata_pci_one().  This does
      about the same thing as ata_host_activate() but needs to be separate
      because SFF controllers use different and multiple IRQs in legacy
      mode.
      
      This will be used to make SFF LLD initialization more flexible.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4e6b79fa
    • J
      libata: make ata_port_queue_task() an internal function · 442eacc3
      Jeff Garzik 提交于
      ata_port_queue_task() served a single user:  ata_pio_task()
      
      Rename to ata_pio_queue_task() and un-export it, as nobody outside of
      libata-core.c uses it.
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      442eacc3
    • T
      libata: make qc->nbytes include extra buffers · 0bcc65ad
      Tejun Heo 提交于
      qc->nbytes didn't use to include extra buffers setup by libata core
      layer and my be odd.  This patch makes qc->nbytes include any extra
      buffers setup by libata core layer and guaranteed to be aligned on 4
      byte boundary.
      
      This value is to be used to program the host controller.  As this
      represents the actual length of buffer available to the controller and
      the controller must be able to deal with short transfers for ATAPI
      commands which can transfer variable length, this shouldn't break any
      controllers while making problems like rounding-down and controllers
      choking up on odd transfer bytes much less likely.
      
      The unmodified value is stored in new field qc->raw_nbytes.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      0bcc65ad
    • T
      libata: convert to chained sg · ff2aeb1e
      Tejun Heo 提交于
      libata used private sg iterator to handle padding sg.  Now that sg can
      be chained, padding can be handled using standard sg ops.  Convert to
      chained sg.
      
      * s/qc->__sg/qc->sg/
      
      * s/qc->pad_sgent/qc->extra_sg[]/.  Because chaining consumes one sg
        entry.  There need to be two extra sg entries.  The renaming is also
        for future addition of other extra sg entries.
      
      * Padding setup is moved into ata_sg_setup_extra() which is organized
        in a way that future addition of other extra sg entries is easy.
      
      * qc->orig_n_elem is unused and removed.
      
      * qc->n_elem now contains the number of sg entries that LLDs should
        map.  qc->mapped_n_elem is added to carry the original number of
        mapped sgs for unmapping.
      
      * The last sg of the original sg list is used to chain to extra sg
        list.  The original last sg is pointed to by qc->last_sg and the
        content is stored in qc->saved_last_sg.  It's restored during
        ata_sg_clean().
      
      * All sg walking code has been updated.  Unnecessary assertions and
        checks for conditions the core layer already guarantees are removed.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      ff2aeb1e
    • T
      libata: kill non-sg DMA interface · 001102d7
      Tejun Heo 提交于
      With atapi_request_sense() converted to use sg, there's no user of
      non-sg interface.  Kill non-sg interface.
      
      * ATA_QCFLAG_SINGLE and ATA_QCFLAG_SG are removed.  ATA_QCFLAG_DMAMAP
        is used instead.  (this way no LLD change is necessary)
      
      * qc->buf_virt is removed.
      
      * ata_sg_init_one() and ata_sg_setup_one() are removed.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Rusty Russel <rusty@rustcorp.com.au>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      001102d7
    • T
      libata: update ->data_xfer hook for ATAPI · 55dba312
      Tejun Heo 提交于
      Depending on how many bytes are transferred as a unit, PIO data
      transfer may consume more bytes than requested.  Knowing how much
      data is consumed is necessary to determine how much is left for
      draining.  This patch update ->data_xfer such that it returns the
      number of consumed bytes.
      
      While at it, it also makes the following changes.
      
      * s/adev/dev/
      * use READ/WRITE constants for rw indication
      * misc clean ups
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      55dba312
    • T
      libata: add ATAPI_* cmd types and implement atapi_cmd_type() · ceb0c642
      Tejun Heo 提交于
      Add ATAPI command types - ATAPI_READ, WRITE, RW_BUF, READ_CD and MISC,
      and implement atapi_cmd_type() which takes SCSI opcode and returns to
      which class the opcode belongs.  This will be used later to improve
      ATAPI handling.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      ceb0c642
    • T
      libata: reimplement ata_acpi_cbl_80wire() using ata_acpi_gtm_xfermask() · 021ee9a6
      Tejun Heo 提交于
      Reimplement ata_acpi_cbl_80wire() using ata_acpi_gtm_xfermask() and
      while at it relocate the function below ata_acpi_gtm_xfermask().
      
      New ata_acpi_cbl_80wire() implementation takes @gtm, in both pata_via
      and pata_amd, use the initial GTM value.  Both are trying to peek
      initial BIOS configuration, so using initial caching value makes
      sense.  This fixes ACPI part of cable detection in pata_amd which
      previously always returned 0 because configuring PIO0 during reset
      clears DMA configuration.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      021ee9a6
    • T
      libata: implement ata_timing_cycle2mode() and use it in libata-acpi and pata_acpi · a0f79b92
      Tejun Heo 提交于
      libata-acpi is using separate timing tables for transfer modes
      although libata-core has the complete ata_timing table.  Implement
      ata_timing_cycle2mode() to look for matching mode given transfer type
      and cycle duration and use it in libata-acpi and pata_acpi to replace
      private timing tables.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      a0f79b92
    • T
      libata: separate out ata_acpi_gtm_xfermask() from pacpi_discover_modes() · 7c77fa4d
      Tejun Heo 提交于
      Finding out matching transfer mode from ACPI GTM values is useful for
      other purposes too.  Separate out the function and timing tables from
      pata_acpi::pacpi_discover_modes().
      
      Other than checking shared-configuration bit after doing
      ata_acpi_gtm() in pacpi_discover_modes() which should be safe, this
      patch doesn't introduce any behavior change.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      7c77fa4d
    • T
      libata: add ATA_CBL_PATA_IGN · c88f90c3
      Tejun Heo 提交于
      ATA_CBL_PATA_UNK indicates that the cable type can't be determined
      from the host side and might be either 80c or 40c.  libata applies
      drive or other generic limit in this case.  However, there are
      controllers where both host and drive side detections are
      misimplemented and the driver has to rely solely on private method -
      peeking BIOS or ACPI configuration or using some other private
      mechanism.
      
      This patch adds ATA_CBL_PATA_IGN which tells libata to ignore the
      cable type completely and just let the LLD determine the transfer mode
      via host transfer mode masks and ->mode_filter().
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      c88f90c3
    • T
      libata: xfer_mask is unsigned long not unsigned int · 7dc951ae
      Tejun Heo 提交于
      Jeff says xfer_mask is unsigned long not unsigned int.  Convert all
      xfermask fields and handling functions to deal with unsigned longs.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      7dc951ae
    • T
      libata: kill ata_id_to_dma_mode() · 9d3501ab
      Tejun Heo 提交于
      ata_id_to_dma_mode() isn't quite generic.  The function is basically
      privately implemented ata_id_xfermask() combined with hardcoded mode
      printing and configuration which are specific to ata_generic.
      
      Kill the function and open code it in generic_set_mode() using generic
      xfermode handling functions.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      9d3501ab
    • T
      libata: clean up xfermode / PATA timing related stuff · 70cd071e
      Tejun Heo 提交于
      * s/ATA_BITS_(PIO|MWDMA|UDMA)/ATA_NR_\1_MODES/g
      
      * Consistently use 0xff to indicate invalid transfer mode (0x00 is
        valid for PIO_SLOW).
      
      * Make ata_xfer_mode2mask() return proper mode mask instead of just
        the highest bit.
      
      * Sort ata_timing table in increasing xfermode order and update
        ata_timing_find_mode() accordingly.
      
      This patch doesn't introduce any behavior change.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      70cd071e
    • T
      libata: export xfermode / PATA timing related functions · 6357357c
      Tejun Heo 提交于
      Export the following xfermode related functions.
      
      * ata_pack_xfermask()
      * ata_unpack_xfermask()
      * ata_xfer_mask2mode()
      * ata_xfer_mode2mask()
      * ata_xfer_mode2shift()
      * ata_mode_string()
      * ata_id_xfermask()
      * ata_timing_find_mode()
      
      These functions will be used later by LLD updates.  While at it,
      change unsigned short @speed to u8 @xfer_mode in
      ata_timing_find_mode() for consistency.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6357357c
    • T
      libata: implement ATA_DFLAG_DUBIOUS_XFER · 00115e0f
      Tejun Heo 提交于
      ATA_DFLAG_DUBIOUS_XFER is set whenever data transfer speed or method
      changes and gets cleared when data transfer command succeeds in the
      newly configured transfer mode.
      
      This will be used to improve speed down logic.
      
      Signed-off-by: Tejun Heo <htejun@gmail.com<
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      00115e0f
    • T
      libata: clean up EH speed down implementation · 3884f7b0
      Tejun Heo 提交于
      Clean up EH speed down implementation.
      
      * is_io boolean variable is replaced eflags.  is_io is ATA_EFLAG_IS_IO.
      
      * Error categories now have names.
      
      * Better comments.
      
      * Reorder 5min and 10min rules in ata_eh_speed_down_verdict()
      
      * Use local variable @link to cache @dev->link in ata_eh_speed_down()
      
      These changes are to improve readability and ease further changes.
      This patch doesn't introduce any behavior change.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      3884f7b0
    • T
      libata: rearrange ATA_DFLAG_* · f20ded38
      Tejun Heo 提交于
      Area for DFLAGs which are cleared on INIT is full.  Extend it by 8
      bits.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      f20ded38
  2. 18 12月, 2007 5 次提交
    • T
      libata: fix ATAPI draining · 140b5e59
      Tejun Heo 提交于
      With ATAPI transfer chunk size properly programmed, libata PIO HSM
      should be able to handle full spurious data chunks.  Also, it's a good
      idea to suppress trailing data warning for misc ATAPI commands as
      there can be many of them per command - for example, if the chunk size
      is 16 and the drive tries to transfer 510 bytes, there can be 31
      trailing data messages.
      
      This patch makes the following updates to libata ATAPI PIO HSM
      implementation.
      
      * Make it drain full spurious chunks.
      
      * Suppress trailing data warning message for misc commands.
      
      * Put limit on how many bytes can be drained.
      
      * If odd, round up consumed bytes and the number of bytes to be
        drained.  This gets the number of bytes to drain right for drivers
        which do 16bit PIO.
      
      This patch is partial backport of improve-ATAPI-data-xfer patchset
      pending for #upstream.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      140b5e59
    • T
      libata-acpi: implement dev->gtf_cache and evaluate _GTF right after _STM during resume · 398e0782
      Tejun Heo 提交于
      On certain implementations, _GTF evaluation depends on preceding _STM
      and both can be pretty picky about the configuration.  Using _GTM
      result cached during controller initialization satisfies the most
      neurotic _STM implementation.  However, libata evaluates _GTF after
      reset during device configuration and the hardware state can be
      different from what _GTF expects and can cause evaluation failure.
      
      This patch adds dev->gtf_cache and updates ata_dev_get_GTF() such that
      it uses the cached value if available.  Cache is cleared with a call
      to ata_acpi_clear_gtf().
      
      Because for SATA ACPI nodes _GTF must be evaluated after _SDD which
      can't be done till IDENTIFY is complete, _GTF caching from
      ata_acpi_on_resume() is used only for IDE ACPI nodes.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      398e0782
    • T
      libata-acpi: implement and use ata_acpi_init_gtm() · c05e6ff0
      Tejun Heo 提交于
      _GTM fetches currently configured transfer mode while _STM configures
      controller according to _GTM parameter and prepares transfer mode
      configuration TFs for _GTF.  In many cases _GTM and _STM
      implementations are quite brittle and can't cope with configuration
      changed by libata.
      
      libata does not depend on ATA ACPI to configure devices.  The only
      reason libata performs _GTM and _STM are to make _GTF evaluation
      succeed and libata also doesn't care about how _GTF TFs configure
      transfer mode.  It overrides that configuration anyway, so from
      libata's POV, it doesn't matter what value is feeded to _STM as long
      as evaluation succeeds for _STM and following _GTF.
      
      This patch adds dev->__acpi_init_gtm and store initial _GTM values on
      host initialization before modified by reset and mode configuration.
      If the field is valid, ata_acpi_init_gtm() returns pointer to the
      saved _GTM structure; otherwise, NULL.
      
      This saved value is used for _STM during resume and peek at
      BIOS/firmware programmed initial timing for later use.  The accessor
      is there to make building w/o ACPI easy as dev->__acpi_init doesn't
      exist if ACPI is not enabled.
      
      On driver detach, the initial BIOS configuration is restored by
      executing _STM with the initial _GTM values such that the next driver
      can also use the initial BIOS configured values.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      c05e6ff0
    • T
      libata: update ata_*_printk() macros such that level can be a variable · c2e366a1
      Tejun Heo 提交于
      Make prink helpers format @lv together rather than prepending to the
      format string as constant.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      c2e366a1
    • T
      libata-acpi: adjust constness in ata_acpi_gtm/stm() parameters · 0d02f0b2
      Tejun Heo 提交于
      * No internal function uses const ata_port.  Drop const from @ap.
      
      * Make ata_acpi_stm() copy @stm before using it and change @stm to
        const.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      0d02f0b2
  3. 19 11月, 2007 2 次提交
  4. 06 11月, 2007 1 次提交
    • A
      libata: handle broken cable reporting · 6bbfd53d
      Alan Cox 提交于
      One or two ancient drives predated the cable spec and didn't sent the
      valid bits for the field. I had hoped to leave this out of libata as a
      piece of historical annoyance but a recent CD drive shows the same bug so
      we have to import support for it.
      
      Same concept as Bartlomiej's changes old IDE except that as we have
      centralised blacklists we can avoid keeping another private table of stuff
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6bbfd53d
  5. 30 10月, 2007 1 次提交
    • T
      libata: implement and use ATA_QCFLAG_QUIET · e027bd36
      Tejun Heo 提交于
      Implement ATA_QCFLAG_QUIET which indicates that there's no need to
      report if the command fails with AC_ERR_DEV and set it for passthrough
      commands.
      
      Combined with previous changes, this now makes device errors for all
      direct commands reported directly to the issuer without going through
      EH actions and reporting.
      
      Note that EH is still invoked after non-IO device errors to determine
      the nature of the error and resume command execution (some controller
      requires special care after error to continue).  It just performs
      default maintenance after error, examines what's going on, realizes
      that it's none of its business and reports the command failure without
      logging any error messages.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      e027bd36
  6. 29 10月, 2007 3 次提交
    • K
      [libata] Link power management infrastructure · ca77329f
      Kristen Carlson Accardi 提交于
      Device Initiated Power Management, which is defined
      in SATA 2.5 can be enabled for disks which support it.
      This patch enables DIPM when the user sets the link
      power management policy to "min_power".
      
      Additionally, libata drivers can define a function
      (enable_pm) that will perform hardware specific actions to
      enable whatever power management policy the user set up
      for Host Initiated Power management (HIPM).
      This power management policy will be activated after all
      disks have been enumerated and intialized.  Drivers should
      also define disable_pm, which will turn off link power
      management, but not change link power management policy.
      
      Documentation/scsi/link_power_management_policy.txt has additional
      information.
      Signed-off-by: NKristen Carlson Accardi <kristen.c.accardi@intel.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      ca77329f
    • T
      libata: implement ata_wait_after_reset() · 88ff6eaf
      Tejun Heo 提交于
      On certain device/controller combination, 0xff status is asserted
      after reset and doesn't get cleared during 150ms post-reset wait.  As
      0xff status is interpreted as no device (for good reasons), this can
      lead to misdetection on such cases.
      
      This patch implements ata_wait_after_reset() which replaces the 150ms
      sleep and waits upto ATA_TMOUT_FF_WAIT if status is 0xff.
      ATA_TMOUT_FF_WAIT is currently 800ms which is enough for
      HHD424020F7SV00 to get detected but not enough for Quantum GoVault
      drive which is known to take upto 2s.
      
      Without parallel probing, spending 2s on 0xff port would incur too
      much delay on ata_piix's which use 0xff to indicate empty port and
      doesn't have SCR register, so GoVault needs to wait till parallel
      probing.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      88ff6eaf
    • T
      libata: track SLEEP state and issue SRST to wake it up · 054a5fba
      Tejun Heo 提交于
      ATA devices in SLEEP mode don't respond to any commands.  SRST is
      necessary to wake it up.  Till now, when a command is issued to a
      device in SLEEP mode, the command times out, which makes EH reset the
      device and retry the command after that, causing a long delay.
      
      This patch makes libata track SLEEP state and issue SRST automatically
      if a command is about to be issued to a device in SLEEP.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Bruce Allen <ballen@gravity.phys.uwm.edu>
      Cc: Andrew Paprocki <andrew@ishiboo.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      054a5fba
  7. 24 10月, 2007 1 次提交
  8. 19 10月, 2007 1 次提交
    • J
      [libata] kill ata_sg_is_last() · 3be6cbd7
      Jeff Garzik 提交于
      Short term, this works around a bug introduced by early sg-chaining
      work.
      
      Long term, removing this function eliminates a branch from a hot
      path loop in each scatter/gather table build.  Also, as this code
      demonstrates, we don't need to _track_ the end of the s/g list, as
      long as we mark it in some way.  And doing so programatically is nice.
      So its a useful cleanup, regardless of its short term effects.
      
      Based conceptually on a quick patch by Jens Axboe.
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      3be6cbd7
  9. 16 10月, 2007 1 次提交
  10. 13 10月, 2007 7 次提交
    • J
      [libata] struct pci_dev related cleanups · 2855568b
      Jeff Garzik 提交于
      * remove pointless pci_dev_to_dev() wrapper.  Just directly reference
        the embedded struct device like everyone else does.
      
      * pata_cs5520: delete cs5520_remove_one(), it was a duplicate of
        ata_pci_remove_one()
      
      * linux/libata.h: don't bother including linux/pci.h, we don't need it.
        Simply declare 'struct pci_dev' and assume interested parties will
        include the header, as they should be doing anyway.
      
      * linux/libata.h: consolidate all CONFIG_PCI declarations into a
        single location in the header.
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      2855568b
    • T
      libata: use ata_exec_internal() for PMP register access · b06ce3e5
      Tejun Heo 提交于
      PMP registers used to be accessed with dedicated accessors ->pmp_read
      and ->pmp_write.  During reset, those callbacks are called with the
      port frozen so they should be able to run without depending on
      interrupt delivery.  To achieve this, they were implemented polling.
      
      However, as resetting the host port makes the PMP to isolate fan-out
      ports until SError.X is cleared, resetting fan-out ports while port is
      frozen doesn't buy much additional safety.
      
      This patch updates libata PMP support such that PMP registers are
      accessed using regular ata_exec_internal() mechanism and kills
      ->pmp_read/write() callbacks.  The following changes are made.
      
      * PMP access helpers - sata_pmp_read_init_tf(), sata_pmp_read_val(),
        sata_pmp_write_init_tf() are folded into sata_pmp_read/write() which
        are now standalone PMP register access functions.
      
      * sata_pmp_read/write() returns err_mask instead of rc.  This is
        consistent with other functions which issue internal commands and
        allows more detailed error reporting.
      
      * ahci interrupt handler is modified to ignore BAD_PMP and
        spurious/illegal completion IRQs while reset is in progress.  These
        conditions are expected during reset.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      b06ce3e5
    • T
      libata: implement ATA_PFLAG_RESETTING · afaa5c37
      Tejun Heo 提交于
      Implement ATA_PFLAG_RESETTING.  This flag is set while reset is in
      progress.  It's set before prereset is called and cleared after reset
      fails or postreset is finished.
      
      This flag itself doesn't have any function.  It will be used by LLDs
      to tell whether reset is in progress if it needs to behave differently
      during reset.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      afaa5c37
    • A
      libata-core: Expose gtm methods for driver use · badff03d
      Alan Cox 提交于
      Talk to the dark side our driver has to, yes. Much misleading is the
      data. Store it in a structure we do so that it may be parsed.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      --
      Whats small, old and shouts phrases out of order across mountains ?
      Yodla..
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      badff03d
    • A
      libata: Add a drivers/ide style DMA disable · b3a70601
      Alan Cox 提交于
      This is useful when debugging, handling problem systems, or for
      distributions just to get the system installed so it can be sorted
      out later.
      
      This is a bit smarter than the old IDE one and lets you do
      
      libata.dma=0	Disable all PATA DMA like old IDE
      libata.dma=1	Disk DMA only
      libata.dma=2	ATAPI DMA only
      libata.dma=4	CF DMA only
      
      (or combinations thereof - 0,1,3 being the useful ones I suspect)
      
      (I've split CF as it seems to be a seperate case of pain and suffering
      different to the others and caused by assorted PIO wired adapters etc)
      Signed-off-by: NAlan Cox <alan@redhat.com>
      
      [edited to work on SATA too, changing name from 'pata_dma' to 'dma']
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      b3a70601
    • T
      libata-pmp: implement qc_defer for command switching PMP support · 31f88384
      Tejun Heo 提交于
      Implement sata_pmp_qc_defer_cmd_switch() - standard qc_defer for
      command switching PMP support.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      31f88384
    • T
      libata-pmp: implement Port Multiplier support · 3af9a77a
      Tejun Heo 提交于
      Implement Port Multiplier support.  To support PMP, a LLDD has to
      supply ops->pmp_read() and pmp_write().  If non-null, ->pmp_attach and
      ->pmp_detach are called on PMP attach and detach, respectively.
      
      ->pmp_read/write() can be called while the port is frozen, so they
      must be implemented by polling.  This patch supplies several helpers
      to ease ->pmp_read/write() implementation.
      
      Also, irq_handler and error_handler must be PMP aware.  Most of PMP
      aware EH can be done by calling ata_pmp_do_eh() with appropriate
      methods.  PMP EH uses separate set of reset methods and this patch
      implements standard prereset, hardreset and postreset methods.
      
      This patch only implements PMP support.  The next patch will integrate
      PMP into the reset of libata and thus enable PMP support.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      3af9a77a