25 Aug, 2016

2 commits


19 Jul, 2016

2 commits

  • This avoid the need to always translate between the two in ata_prot_flags
    and generally cleans up the taskfile protocol usage.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Tejun Heo

    Christoph Hellwig
     
  • Since we set ATA_MAX_SECTORS_LBA48 to 65535 to avoid the corner case
    in some drives that commands with "count" set to 0000h (which
    reprsents 65536) does not work as expected, lba_48_ok(), which is
    used for number-of-blocks checking when libata pack commands, should
    use the same limit as well. In fact, there is no reason for the two
    functions not to use the macros anyway.

    Signed-off-by: Tom Yan
    Signed-off-by: Tejun Heo

    Tom Yan
     

15 Jul, 2016

1 commit


13 Jul, 2016

1 commit

  • Currently libata statically allows only 1-block (512-byte) payload
    for each TRIM command. Each payload can carry 64 TRIM ranges since
    each range requires 8 bytes.

    It is silly to keep doing the calculation (512 / 8) in different
    places. Hence, define the new ATA_MAX_TRIM_RNUM for the result.

    Signed-off-by: Tom Yan
    Signed-off-by: Tejun Heo

    Tom Yan
     

12 Jul, 2016

1 commit


24 May, 2016

1 commit

  • Pull libata ZAC support from Tejun Heo:
    "This contains Zone ATA Command support for Shingled Magnetic Recording
    devices.

    In addition to sending the new commands down to the device, as ZAC
    commands depend on getting a lot of responses from the device, piping
    up responses is beefed up too. However, it doesn't involve changes to
    libata core mechanism or its interaction with upper layers, so I'm not
    expecting too many fallouts.

    Kudos to Hannes for driving SMR support"

    * 'for-4.7-zac' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: (28 commits)
    libata: support host-aware and host-managed ZAC devices
    libata: support device-managed ZAC devices
    libata: NCQ encapsulation for ZAC MANAGEMENT OUT
    libata: Implement ZBC OUT translation
    libata: implement ZBC IN translation
    libata: fixup ZAC device disabling
    libata-scsi: Generate sense code for disabled devices
    libata-trace: decode subcommands
    libata: Check log page directory before accessing pages
    libata: Add command definitions for NCQ Encapsulation for READ LOG DMA EXT
    libata: Separate out ata_dev_config_ncq_send_recv()
    libata/libsas: Define ATA_CMD_NCQ_NON_DATA
    libsas: enable FPDMA SEND/RECEIVE
    libata: do not attempt to retrieve sense code twice
    libata-scsi: Set information sense field for invalid parameter
    libata-scsi: set bit pointer for sense code information
    libata-scsi: Set field pointer in sense code
    scsi: add scsi_set_sense_field_pointer()
    libata: Implement control mode page to select sense format
    libata-scsi: generate correct ATA pass-through sense
    ...

    Linus Torvalds
     

10 May, 2016

9 commits


05 Apr, 2016

3 commits

  • When spinning up a drive from powered on standby mode (PUIS),
    SETFEATURES_SPINUP is executed with the default timeout used
    for any SETFEATURES subcommand, that is 5+10 seconds. The
    total 15s is too short for some drives to complete spinup
    (e.g. drives with a large indirection table stored on media),
    resulting in ata_dev_read_id to fail twice on the execution
    of SETFEATURES_SPINUP. For this feature, allow a larger
    default timeout of 30 seconds. However, in the same spirit
    as with the timeout of other feature subcommands, do not
    ignore ata_probe_timeout if it is set).

    Signed-off-by: Damien Le Moal
    Signed-off-by: Tejun Heo

    Damien Le Moal
     
  • ACS-4 defines a sense data reporting feature set.
    This patch implements support for it.

    tj: Cosmetic formatting updates.

    Signed-off-by: Hannes Reinecke
    Signed-off-by: Tejun Heo

    Hannes Reinecke
     
  • Some newer devices support NCQ autosense (cf ACS-4), so we should
    be using it to retrieve the sense code and speed up recovery.

    Signed-off-by: Hannes Reinecke
    Signed-off-by: Tejun Heo

    Hannes Reinecke
     

11 Feb, 2016

1 commit

  • 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: Arnd Bergmann
    Reported-by: Soohoon Lee
    Tested-by: Soohoon Lee
    Cc: stable@vger.kernel.org
    Signed-off-by: Tejun Heo

    Arnd Bergmann
     

04 Aug, 2015

2 commits

  • This reverts commit 42b966fbf35da9c87f08d98f9b8978edf9e717cf.

    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: Tejun Heo
    Cc: Hannes Reinecke
    Cc: stable@vger.kernel.org #v4.1+

    Tejun Heo
     
  • This reverts commit fe7173c206de63fc28475ee6ae42ff95c05692de.

    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: Tejun Heo
    Cc: Hannes Reinecke
    Cc: stable@vger.kernel.org #v4.1+

    Tejun Heo
     

15 Jul, 2015

1 commit

  • Since no longer limiting max_sectors to BLK_DEF_MAX_SECTORS (commit 34b48db66e08),
    data corruption may occur on ST380013AS drive configured on 82801JI (ICH10 Family)
    SATA controller. This patch will allow the driver to limit max_sectors as before

    # cat /sys/block/sdb/queue/max_sectors_kb
    512

    I was able to double the max_sectors_kb value up to 16384 on linux-4.2.0-rc2
    before seeing corruption, but seems safer to use previous limit. Without this
    patch max_sectors_kb will be 32767.

    tj: Minor comment update.

    Reported-by: Jeff Moyer
    Signed-off-by: David Milburn
    Signed-off-by: Tejun Heo
    Cc: stable@vger.kernel.org # v3.19 and later
    Fixes: 34b48db66e08 ("block: remove artifical max_hw_sectors cap")

    David Milburn
     

05 May, 2015

1 commit


27 Mar, 2015

4 commits


26 Dec, 2014

1 commit


27 Oct, 2013

1 commit


25 Aug, 2013

1 commit


16 Jul, 2013

1 commit

  • Move 'struct ata_taskfile', ata_prot_flags() and their friends from
    to . They were misplaced from the beginning, as
    should cover ATA/ATAPI and related standards only -- to which the
    aforementioned structure and function have only remote relation.

    I would have moved 'enum ata_tf_protocols' closely related to 'struct
    ata_taskfile' but it unfortunately gets used by 'drivers/ide/ide-ioctls.c'...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Tejun Heo

    Sergei Shtylyov
     

04 Apr, 2013

1 commit

  • The function returns type of ATAPI drives so it should return integer value.
    The commit 4dce8ba94c7 (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
    f8d8e5799b7(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: Shan Hai
    Signed-off-by: Jeff Garzik

    Shan Hai
     

15 Jan, 2013

1 commit

  • 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) can't work either
    because it is only the sufficient condition of Identify Device data
    log, not the necessary condition.

    This patch replaced ata_device->sata_settings with ->devslp_timing
    to only save DevSlp timing variables(8 bytes), instead of the whole
    SATA Settings page(512 bytes).

    Addresses https://bugzilla.kernel.org/show_bug.cgi?id=51881

    Reported-by: Borislav Petkov
    Signed-off-by: Shane Huang
    Cc: stable@vger.kernel.org
    Signed-off-by: Jeff Garzik

    Shane Huang
     

13 Sep, 2012

2 commits

  • Device Sleep is a feature as described in AHCI 1.3.1 Technical Proposal.
    This feature enables an HBA and SATA storage device to enter the DevSleep
    interface state, enabling lower power SATA-based systems.

    Aggressive Device Sleep enables the HBA to assert the DEVSLP signal as
    soon as there are no commands outstanding to the device and the port
    specific Device Sleep idle timer has expired. This enables autonomous
    entry into the DevSleep interface state without waiting for software
    in power sensitive systems.

    This patch enables Aggressive Device Sleep only if both host controller
    and device support it.

    Tested on AMD reference board together with Device Sleep supported device
    sample.

    Signed-off-by: Shane Huang
    Reviewed-by: Aaron Lu
    Signed-off-by: Jeff Garzik

    Shane Huang
     
  • Define enumeration constants for IDENTIFY DEVICE words.

    Signed-off-by: Shane Huang
    Signed-off-by: Jeff Garzik

    Shane Huang
     

29 Jun, 2012

1 commit


15 Mar, 2011

1 commit


14 Mar, 2011

1 commit