1. 04 4月, 2013 1 次提交
    • S
      libata: Use integer return value for atapi_command_packet_set · d8668fcb
      Shan Hai 提交于
      The function returns type of ATAPI drives so it should return integer value.
      The commit 4dce8ba9 (libata: Use 'bool' return value for ata_id_XXX) since
      v2.6.39 changed the type of return value from int to bool, the change would
      cause all of the ATAPI class drives to be treated as TYPE_TAPE and the
      max_sectors of the drives to be set to 65535 because of the commit
      f8d8e579(libata: increase 128 KB / cmd limit for ATAPI tape drives), for the
      function would return true for all ATAPI class drives and the TYPE_TAPE is
      defined as 0x01.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NShan Hai <shan.hai@windriver.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      d8668fcb
  2. 15 1月, 2013 1 次提交
  3. 14 12月, 2012 1 次提交
    • J
      Revert "libata: check SATA_SETTINGS log with HW Feature Ctrl" · 8349e5ae
      Jeff Garzik 提交于
      This reverts commit de90cd71.
      
      Shane Huang writes:
      
        Please suspend this patch because I just received two new
        DevSlp drives but found word 78 bit 5 is _not_ set.
      
        I'm checking with the drive vendor whether he gave me
        the wrong information. If bit 5 is not the necessary and
        sufficient condition, I will implement another patch to
        replace ata_device->sata_settings into ->devslp_timing.
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      8349e5ae
  4. 03 12月, 2012 1 次提交
    • S
      libata: check SATA_SETTINGS log with HW Feature Ctrl · de90cd71
      Shane Huang 提交于
      NCQ capability was used to check availability of SATA Settings page
      from Identify Device Data Log, which contains DevSlp timing variables.
      It does not work on some HDDs and leads to error messages.
      IDENTIFY word 78 bit 5(Hardware Feature Control) should be used.
      
      Quoting SATA spec 3.1:
      If Hardware Feature Control is supported, then:
      a) IDENTIFY DEVICE data word 78 bit 5 (see 13.2.1.18) shall be
      set to one;
      b) the SET FEATURES Select Hardware Feature Control subcommand
      shall be supported (see 13.3.8);
      c) page 08h of the Identify Device Data log (see 13.7.7) shall
      be supported;
      
      This patch is not tested on SATA HDD with DevSlp supported.
      Reported-by: NBorislav Petkov <bp@amd64.org>
      Signed-off-by: NShane Huang <shane.huang@amd.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      de90cd71
  5. 13 9月, 2012 2 次提交
  6. 29 6月, 2012 1 次提交
  7. 15 3月, 2011 1 次提交
  8. 14 3月, 2011 1 次提交
  9. 22 10月, 2010 1 次提交
  10. 20 5月, 2010 1 次提交
  11. 09 4月, 2010 1 次提交
  12. 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
  13. 04 2月, 2010 1 次提交
  14. 04 12月, 2009 2 次提交
  15. 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
  16. 06 10月, 2009 2 次提交
  17. 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
  18. 16 6月, 2009 1 次提交
  19. 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
  20. 07 4月, 2009 1 次提交
  21. 25 3月, 2009 2 次提交
  22. 06 3月, 2009 1 次提交
  23. 03 2月, 2009 1 次提交
  24. 11 10月, 2008 6 次提交
  25. 09 10月, 2008 1 次提交
  26. 29 9月, 2008 1 次提交
  27. 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
  28. 19 8月, 2008 3 次提交