1. 02 3月, 2010 1 次提交
    • B
      ata: Detect Delkin Devices compact flash · 4b7d1c05
      Ben Gardner 提交于
      I have a Delkin Devices compact flash card that isn't being recognized using the
      SATA/PATA drivers.
      The card is recognized and works with the deprecated ATA drivers.
      
      The error I am seeing is:
      ata1.00: failed to IDENTIFY (device reports invalid type, err_mask=0x0)
      
      I tracked it down to ata_id_is_cfa() in include/linux/ata.h.
      The Delkin card has id[0] set to 0x844a and id[83] set to 0.
      This isn't what the kernel expects and is probably incorrect.
      
      The simplest work-around is to add a check for 0x844a to ata_id_is_cfa().
      Signed-off-by: NBen Gardner <gardner.ben@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      4b7d1c05
  2. 04 2月, 2010 1 次提交
  3. 04 12月, 2009 2 次提交
  4. 03 12月, 2009 1 次提交
    • C
      libata: add translation for SCSI WRITE SAME (aka TRIM support) · 18f0f978
      Christoph Hellwig 提交于
      Add support for the ATA TRIM command in libata.  We translate a WRITE SAME 16
      command with the unmap bit set into an ATA TRIM command and export enough
      information in READ CAPACITY 16 and the block limits EVPD page so that the new
      SCSI layer discard support will driver this for us.
      
      Note that I hardcode the WRITE_SAME_16 opcode for now as the patch to introduce
      the symbolic is not in 2.6.32 yet but only in the SCSI tree - as soon as it is
      merged we can fix it up to properly use the symbolic name.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      18f0f978
  5. 06 10月, 2009 2 次提交
  6. 02 9月, 2009 2 次提交
    • R
      libata: add command name parsing for error output · 6521148c
      Robert Hancock 提交于
      This patch improve libata's output for error/notification messages
      to allow easier comprehension and debugging:
      
      When ATAPI commands issued through the SCSI layer fail, use SCSI
      functions to print the CDB in human-readable form instead of just
      dumping out the CDB in hex.
      
      Print out the name of the failed command (as defined by the ATA
      specification) in error handling output along with the raw register
      contents.
      
      When reporting status of ACPI taskfile commands executed on resume,
      also output the names of the commands being executed (or not) in
      readable form.
      
      Since the extra data for printing command names increases kernel
      size slightly, a config option has been added to allow disabling
      command name output (as well as some of the error register parsing)
      for those highly sensitive to kernel text size.
      Signed-off-by: NRobert Hancock <hancockrwd@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      6521148c
    • S
      [libata] add DMA setup FIS auto-activate feature · 388539f3
      Shaohua Li 提交于
      Hopefully results in fewer on-the-wire FIS's and no breakage.  We'll see!
      Signed-off-by: NShaohua Li <shaohua.li@intel.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      388539f3
  7. 16 6月, 2009 1 次提交
  8. 16 5月, 2009 1 次提交
    • M
      libata: Media rotation rate and form factor heuristics · 4bca3286
      Martin K. Petersen 提交于
      This patch provides new heuristics for parsing both the form factor and
      media rotation rate ATA IDENFITY words.
      
      The reported ATA version must be 7 or greater and the device must return
      values defined as valid in the standard.  Only then are the
      characteristics reported to SCSI via the VPD B1 page.
      
      This seems like a reasonable compromise to me considering that we have
      been shipping several kernel releases that key off the rotation rate bit
      without any version checking whatsoever.  With no complaints so far.
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      4bca3286
  9. 07 4月, 2009 1 次提交
  10. 25 3月, 2009 2 次提交
  11. 06 3月, 2009 1 次提交
  12. 03 2月, 2009 1 次提交
  13. 11 10月, 2008 6 次提交
  14. 09 10月, 2008 1 次提交
  15. 29 9月, 2008 1 次提交
  16. 14 9月, 2008 1 次提交
    • T
      [libata] LBA28/LBA48 off-by-one bug in ata.h · 97b697a1
      Taisuke Yamada 提交于
      I recently bought 3 HGST P7K500-series 500GB SATA drives and
      had trouble accessing the block right on the LBA28-LBA48 border.
      Here's how it fails (same for all 3 drives):
      
        # dd if=/dev/sdc bs=512 count=1 skip=268435455 > /dev/null
        dd: reading `/dev/sdc': Input/output error
        0+0 records in
        0+0 records out
        0 bytes (0 B) copied, 0.288033 seconds, 0.0 kB/s
        # dmesg
        ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
        ata1.00: BMDMA stat 0x25
        ata1.00: cmd c8/00:08:f8:ff:ff/00:00:00:00:00/ef tag 0 dma 4096 in
        res 51/04:08:f8:ff:ff/00:00:00:00:00/ef Emask 0x1 (device error)
        ata1.00: status: { DRDY ERR }
        ata1.00: error: { ABRT }
        ata1.00: configured for UDMA/33
        ata1: EH complete
        ...
      
      After some investigations, it turned out this seems to be caused
      by misinterpretation of the ATA specification on LBA28 access.
      Following part is the code in question:
      
        === include/linux/ata.h ===
        static inline int lba_28_ok(u64 block, u32 n_block)
        {
          /* check the ending block number */
          return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block <= 256);
        }
      
      HGST drive (sometimes) fails with LBA28 access of {block = 0xfffffff,
      n_block = 1}, and this behavior seems to be comformant. Other drives,
      including other HGST drives are not that strict, through.
      
      >From the ATA specification:
      (http://www.t13.org/Documents/UploadedDocuments/project/d1410r3b-ATA-ATAPI-6.pdf)
      
        8.15.29  Word (61:60): Total number of user addressable sectors
        This field contains a value that is one greater than the total number
        of user addressable sectors (see 6.2). The maximum value that shall
        be placed in this field is 0FFFFFFFh.
      
      So the driver shouldn't use the value of 0xfffffff for LBA28 request
      as this exceeds maximum user addressable sector. The logical maximum
      value for LBA28 is 0xffffffe.
      
      The obvious fix is to cut "- 1" part, and the patch attached just do
      that. I've been using the patched kernel for about a month now, and
      the same fix is also floating on the net for some time. So I believe
      this fix works reliably.
      
      Just FYI, many Windows/Intel platform users also seems to be struck
      by this, and HGST has issued a note pointing to Intel ICH8/9 driver.
      
        "28-bit LBA command is being used to access LBAs 29-bits in length"
      http://www.hitachigst.com/hddt/knowtree.nsf/cffe836ed7c12018862565b000530c74/b531b8bce8745fb78825740f00580e23
      
      Also, *BSDs seems to have similar fix included sometime around ~2004,
      through I have not checked out exact portion of the code.
      Signed-off-by: NTaisuke Yamada <tai@rakugaki.org>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      97b697a1
  17. 19 8月, 2008 3 次提交
  18. 24 2月, 2008 1 次提交
    • T
      libata: automatically use DMADIR if drive/bridge requires it · 91163006
      Tejun Heo 提交于
      Back in 2.6.17-rc2, a libata module parameter was added for atapi_dmadir.
      
      That's nice, but most SATA devices which need it will tell us about it
      in their IDENTIFY PACKET response, as bit-15 of word-62 of the
      returned data (as per ATA7, ATA8 specifications).
      
      So for those which specify it, we should automatically use the DMADIR bit.
      Otherwise, disc writing will fail by default on many SATA-ATAPI drives.
      
      This patch adds ATA_DFLAG_DMADIR and make ata_dev_configure() set it
      if atapi_dmadir is set or identify data indicates DMADIR is necessary.
      atapi_xlat() is converted to check ATA_DFLAG_DMADIR before setting
      DMADIR.
      
      Original patch is from Mark Lord.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Mark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      91163006
  19. 23 1月, 2008 5 次提交
    • A
      libata annotations and fixes · 4ca4e439
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4ca4e439
    • 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: 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: implement protocol tests · 405e66b3
      Tejun Heo 提交于
      Implement protocol tests - ata_is_atapi(), ata_is_nodata(),
      ata_is_pio(), ata_is_dma(), ata_is_ncq() and ata_is_data() and use
      them to replace is_atapi_taskfile() and hard coded protocol tests.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      405e66b3
    • 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
  20. 16 1月, 2008 1 次提交
  21. 18 12月, 2007 1 次提交
  22. 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
  23. 05 11月, 2007 1 次提交
  24. 03 11月, 2007 1 次提交
    • T
      libata: increase 128 KB / cmd limit for ATAPI tape drives · f8d8e579
      Tony Battersby 提交于
      Commands sent to ATAPI tape drives via the SCSI generic (sg) driver are
      limited in the amount of data that they can transfer by the max_sectors
      value.  The max_sectors value is currently calculated according to the
      command set for disk drives, which doesn't apply to tape drives.  The
      default max_sectors value of 256 limits ATAPI tape drive commands to
      128 KB.  This patch against 2.6.24-rc1 increases the max_sectors value
      for tape drives to 65535, which permits tape drive commands to transfer
      just under 32 MB.
      
      Tested with a SuperMicro PDSME motherboard, AHCI, and a Sony SDX-570V
      SATA tape drive.
      
      Note that some of the chipset drivers also set their own max_sectors
      value, which may override the value set in libata-core.  I don't have
      any of these chipsets to test, so I didn't go messing with them.  Also,
      ATAPI devices other than tape drives may benefit from similar changes,
      but I have only tape drives and disk drives to test.
      Signed-off-by: NTony Battersby <tonyb@cybernetics.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      f8d8e579
  25. 29 10月, 2007 1 次提交
    • 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