1. 18 Jul, 2016 2 commits
  2. 15 Jul, 2016 1 commit
  3. 12 Jul, 2016 2 commits
  4. 09 May, 2016 9 commits
  5. 04 Apr, 2016 3 commits
  6. 11 Feb, 2016 1 commit
    • Arnd Bergmann's avatar
      libata: fix HDIO_GET_32BIT ioctl · 287e6611
      Arnd Bergmann authored
      As reported by Soohoon Lee, the HDIO_GET_32BIT ioctl does not
      work correctly in compat mode with libata.
      
      I have investigated the issue further and found multiple problems
      that all appeared with the same commit that originally introduced
      HDIO_GET_32BIT handling in libata back in linux-2.6.8 and presumably
      also linux-2.4, as the code uses "copy_to_user(arg, &val, 1)" to copy
      a 'long' variable containing either 0 or 1 to user space.
      
      The problems with this are:
      
      * On big-endian machines, this will always write a zero because it
        stores the wrong byte into user space.
      
      * In compat mode, the upper three bytes of the variable are updated
        by the compat_hdio_ioctl() function, but they now contain
        uninitialized stack data.
      
      * The hdparm tool calling this ioctl uses a 'static long' variable
        to store the result. This means at least the upper bytes are
        initialized to zero, but calling another ioctl like HDIO_GET_MULTCOUNT
        would fill them with data that remains stale when the low byte
        is overwritten. Fortunately libata doesn't implement any of the
        affected ioctl commands, so this would only happen when we query
        both an IDE and an ATA device in the same command such as
        "hdparm -N -c /dev/hda /dev/sda"
      
      * The libata code for unknown reasons started using ATA_IOC_GET_IO32
        and ATA_IOC_SET_IO32 as aliases for HDIO_GET_32BIT and HDIO_SET_32BIT,
        while the ioctl commands that were added later use the normal
        HDIO_* names. This is harmless but rather confusing.
      
      This addresses all four issues by changing the code to use put_user()
      on an 'unsigned long' variable in HDIO_GET_32BIT, like the IDE subsystem
      does, and by clarifying the names of the ioctl commands.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reported-by: default avatarSoohoon Lee <Soohoon.Lee@f5.com>
      Tested-by: default avatarSoohoon Lee <Soohoon.Lee@f5.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      287e6611
  7. 03 Aug, 2015 2 commits
    • Tejun Heo's avatar
      Revert "libata: Implement NCQ autosense" · 74a80d67
      Tejun Heo authored
      This reverts commit 42b966fb.
      
      As implemented, ACS-4 sense reporting for ATA devices bypasses error
      diagnosis and handling in libata degrading EH behavior significantly.
      Revert the related changes for now.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: stable@vger.kernel.org #v4.1+
      74a80d67
    • Tejun Heo's avatar
      Revert "libata: Implement support for sense data reporting" · 84ded2f8
      Tejun Heo authored
      This reverts commit fe7173c2.
      
      As implemented, ACS-4 sense reporting for ATA devices bypasses error
      diagnosis and handling in libata degrading EH behavior significantly.
      Revert the related changes for now.
      
      ATA_ID_COMMAND_SET_3/4 constants are not reverted as they're used by
      later changes.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: stable@vger.kernel.org #v4.1+
      84ded2f8
  8. 15 Jul, 2015 1 commit
  9. 05 May, 2015 1 commit
  10. 27 Mar, 2015 4 commits
  11. 25 Dec, 2014 1 commit
  12. 27 Oct, 2013 1 commit
  13. 25 Aug, 2013 1 commit
  14. 16 Jul, 2013 1 commit
  15. 03 Apr, 2013 1 commit
    • Shan Hai's avatar
      libata: Use integer return value for atapi_command_packet_set · d8668fcb
      Shan Hai authored
      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: default avatarShan Hai <shan.hai@windriver.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      d8668fcb
  16. 14 Jan, 2013 1 commit
  17. 14 Dec, 2012 1 commit
    • Jeff Garzik's avatar
      Revert "libata: check SATA_SETTINGS log with HW Feature Ctrl" · 8349e5ae
      Jeff Garzik authored
      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: default avatarJeff Garzik <jgarzik@redhat.com>
      8349e5ae
  18. 03 Dec, 2012 1 commit
    • Shane Huang's avatar
      libata: check SATA_SETTINGS log with HW Feature Ctrl · de90cd71
      Shane Huang authored
      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: default avatarBorislav Petkov <bp@amd64.org>
      Signed-off-by: default avatarShane Huang <shane.huang@amd.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      de90cd71
  19. 12 Sep, 2012 2 commits
  20. 29 Jun, 2012 1 commit
  21. 15 Mar, 2011 1 commit
  22. 14 Mar, 2011 1 commit
  23. 21 Oct, 2010 1 commit