1. 23 1月, 2008 4 次提交
    • 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: rename ATA_PROT_ATAPI_* to ATAPI_PROT_* · 0dc36888
      Tejun Heo 提交于
      ATA_PROT_ATAPI_* are ugly and naming schemes between ATA_PROT_* and
      ATA_PROT_ATAPI_* are inconsistent causing confusion.  Rename them to
      ATAPI_PROT_* and make them consistent with ATA counterpart.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      0dc36888
    • T
      libata: make atapi_request_sense() use sg · 93f8fecb
      Tejun Heo 提交于
      atapi_request_sense() is now the only left user of ata_sg_init_one().
      Convert it to use sg interface.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Rusty Russel <rusty@rustcorp.com.au>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      93f8fecb
    • A
      libata: Disable ATA8-ACS proposed Trusted Computing features by default · ae8d4ee7
      Alan Cox 提交于
      Historically word 48 in the identify data was used to mean 32bit I/O
      was supported for VLB IDE etc. ATA8 reassigns this word to the Trusted
      Computing Group, where it is used for TCG features. This means that
      an ATA8 TCG drive is going to trigger 32bit I/O on some systems which
      will be funny.
      
      Anyway we need to sort this out ready for ATA8 so:
      - Reorder the ata.h header a bit so the ata_version function occurs early
        in it
      - Make dword_io check the ATA version
      - Add an ATA8 version checking TCG presence test
      
      While we are at it the current drafts have a flaw where it may not be
      possible to disable TCG features at boot (and opt out of the trusted
      model) as TCG intends because it relies on presence of a different
      optional feature (DCS). Handle this in software by refusing the TCG
      commands if libata.allow_tpm is not set. (We must make it possible
      as some environments such as proprietary VDR devices will doubtless
      want to use it to lock up content)
      
      Finally as with CPRM print a warning so that the user knows they may
      not be able to full access and use the device.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      ae8d4ee7
  2. 15 1月, 2008 1 次提交
  3. 11 1月, 2008 1 次提交
  4. 27 11月, 2007 1 次提交
    • T
      libata: bump transfer chunk size if it's odd · e190222d
      Tejun Heo 提交于
      None of the drives I have follows what the standard says about
      transfer chunk size.  Of the four SATA and six PATA ATAPI devices
      tested, four ignore transfer chunk size completely and the ones which
      honor it don't behave according to the spec when it's odd.
      
      According to the spec, transfer chunk size can be odd if the amount of
      data to transfer equals or is smaller than the chunk size and the
      device can indicate the same odd number and transfer the whole thing
      at one go with a pad byte appended.  However, in reality, none of the
      drives I have does that.  They all indicate and transfer even number
      of bytes one byte shorter than the chunk size first; then indicate and
      transfer two bytes, which is clearly out of spec.
      
      In addition to unnecessary second PIO data phase, this also creates a
      weird problem when combined with SATA controllers which perform PIO
      via DMA.  Some of these controllers use actualy number of bytes
      received to update DMA pointer so chunks which are sized 4n + 2 makes
      DMA pointer off by two bytes.  This causes data corruption and buffer
      overruns.
      
      This patch rounds nbytes up to the nearest even number such that ATAPI
      devices don't split data transfer for the last odd byte.  This
      shouldn't confuse controllers which depend on transfer chunk size as
      devices will report the rounded-up number, actually transfer that much
      and padding buffer is there to receive them.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      e190222d
  5. 19 11月, 2007 1 次提交
    • M
      libata-scsi: be tolerant of 12-byte ATAPI commands in 16-byte CDBs · 607126c2
      Mark Lord 提交于
      Sebastian Kemper reported that issuing CD/DVD commands under libata is
      not fully compatible with ide-scsi.  In particular, the
      GPCMD_SET_STREAMING was being rejected at the host level in some
      instances.
      
      The reason is that libata-scsi insists upon the cmd_len field exactly
      matching the SCSI opcode being issued, whereas ide-scsi tolerates
      12-byte commands contained within a 16-byte (cmd_len) CDB.
      
      There doesn't seem to be a good reason for us to not be compatible
      there, so here is a patch to fix libata-scsi to permit SCSI opcodes so
      long as they fit within whatever size CDB is provided.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      607126c2
  6. 04 11月, 2007 1 次提交
  7. 03 11月, 2007 1 次提交
  8. 30 10月, 2007 2 次提交
    • 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
    • T
      libata: flush is an IO command · b666da35
      Tejun Heo 提交于
      ATA_QCFLAG_IO is used to mark commands which are used to perform
      regluar IO transfers via block layer.  These commands are assumed to
      be valid and taken more seriously during error handling.  Cache flush
      is used by regular IO path and necessary for data integrity.  Mark it
      with ATA_QCFLAG_IO.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      b666da35
  9. 29 10月, 2007 2 次提交
    • 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: relocate and fix post-command processing · 4dbfa39b
      Tejun Heo 提交于
      Some commands need post-processing after successful completion.  This
      was done in ata_scsi_qc_complete() till now but this has the following
      problems.
      
      * Post-command processing gets executed when qc is completed from EH.
        Some qc's are retried from EH with zero err_mask and thus triggers
        unnecessary/incorrect post-command processing.
      
      * Command post processing doesn't belong to SAT layer.
      
      * Link-wide revalidation was scheduled where device revalidation
        suffices.
      
      This patch moves post-command processing to success completion path of
      ata_qc_complete() which is travelled iff the command is going to be
      completed without passing through EH and updates post-command
      processing such that device-specific action is used.  While at it,
      restructure code a bit for readability.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4dbfa39b
  10. 24 10月, 2007 1 次提交
  11. 23 10月, 2007 1 次提交
  12. 16 10月, 2007 3 次提交
  13. 13 10月, 2007 17 次提交
  14. 24 7月, 2007 1 次提交
  15. 20 7月, 2007 1 次提交
    • T
      libata: improve SCSI scan failure handling · 1ae46317
      Tejun Heo 提交于
      SCSI scan may fail due to memory allocation failure even if EH is not
      in progress.  Due to use of GFP_ATOMIC in SCSI scan path, allocation
      failure isn't too rare especially while probing multiple devices at
      once which is the case when a bunch of devices are connected to PMP.
      
      This patch moves SCSI scan failure detetion logic from
      ata_scsi_hotplug() to ata_scsi_scan_host() and implement synchronous
      scan behavior.  The synchronous path sleeps briefly and repeats SCSI
      scan if some devices aren't attached properly.  It contains robust
      retry loop to minimize the chance of device misdetection during boot
      and falls back to async retry if everything fails.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      1ae46317
  16. 10 7月, 2007 1 次提交
  17. 27 6月, 2007 1 次提交