20 Jul, 2016

3 commits

  • `changeable` is the "version" of mode page requested by the user.
    It will be less confusing/misleading if we do not check it
    "together" with the setting bits of the drive.

    Not to mention that we currently have ata_mselect_*() implemented
    in a way that each of them will serve exclusively a particular bit
    on each page. The old style will hence make the condition look even
    more unnecessarily arcane if the ata_msense_*() is reflecting more
    than one bit.

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

    Tom Yan
     
  • Due to PCI subsystem behaviour, unloading AHCI driver will disable
    MSI and enable INTx. When HBA supports MSIx or Multiple MSI, Driver's
    irq handler doesn't clear GHC.IS register. It works well when reading or
    writing data and GHC.IS is always non-zero. But when unloading driver
    (or any other operation which causes disable MSIx and enable INTx), PCI
    subsystem uses config write(Rx04.bit10) to enable INTx. Because
    GHC.IS is non-zero, HBA will falsely assume some port needs interrupt
    service. Then it asserts INTx. To make things worse, when AHCI controller
    shares the same interrupt pin with other PCI device, that PCI device's ISR
    will be called and nobody de-asserts previous INTx.
    This patch clears GHC.IS in ahci_port_stop() even when using MSIx or
    MMSI to prevent this case. It ensures GHC.IS is zero before PCI subsystem
    enables INTx.

    tj: Minor updates to the comment.

    Signed-off-by: Raymond Pang
    Signed-off-by: Tejun Heo

    Pang Raymond
     
  • There is a error message within devm_ioremap_resource
    already, so remove the dev_err call to avoid redundant
    error message.

    Signed-off-by: Wei Yongjun
    Signed-off-by: Tejun Heo

    Wei Yongjun
     

19 Jul, 2016

4 commits


15 Jul, 2016

4 commits

  • The reset_all variable name is misleading as this bit is also applicable to
    open, close, and finish actions. So rename that variable to "all" and remove
    the unnecessary mask operation that's already done earlier.

    Signed-off-by: Damien Le Moal
    [hch: split from the previous patch]
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Tejun Heo

    Damien Le Moal
     
  • The subcommand for NCQ NON-DATA must be specified in the feature
    (low byte), not the high-order count byte. Also make sure to properly
    cast the all bit to a u16 before shiting it by 8 to avoid undefined
    behavior.

    Signed-off-by: Damien Le Moal
    [hch: split the original patch into two, updated changelog]
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Tejun Heo

    Damien Le Moal
     
  • Include reporting options when translating REPORT ZONES commmand to
    ATA NCQ, and make sure we only look at the actually specified bits
    in the CDB for the options.

    Signed-off-by: Damien Le Moal
    [hch: update patch description]
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Tejun Heo

    Damien Le Moal
     
  • Add a new taskfile protocol ATA_PROT_NCQ_NODATA to handle
    ATA NCQ NO-DATA commands correctly.
    And fixup ata_scsi_zbc_out_xlat() to use it.

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

    Hannes Reinecke
     

14 Jul, 2016

5 commits


13 Jul, 2016

4 commits

  • 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
     
  • Currently if a WRITE SAME (16) command is issued to the SATL with
    "number of blocks" that is larger than the "Maximum write same length"
    (which is the maximum number of blocks per TRIM command allowed in
    libata, currently 65535 * 512 / 8 blocks), the SATL will accept the
    command and translate it to a TRIM command with the upper limit.

    However, according to SBC (as of sbc4r11.pdf), the "device server"
    should terminate the command with "Invalid field in CDB" in that case.

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

    Tom Yan
     
  • To make it consistent with the recently added ata_mselect_control().
    We probably shouldn't have the word "mode" in its name anyway, since
    that's not the case for other ata_msense_*() / ata_mselect_*() either.

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

    Tom Yan
     
  • The bit should always be set to 1 when the requested version of
    page is "changeable" because we've made it so in ata_mselect_control().
    Also, it should always be set to 1 if ATA_DFLAG_D_SENSE is set (when
    the requested version of page is "current" or "default").

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

    Tom Yan
     

12 Jul, 2016

5 commits

  • According to the HPT366 data sheet, PCI config space dword 0x40-0x43
    bits 11:8 specify the primary drive cmd_high_time, however,
    currently just 3 bits of the 4 are being used because the mask
    is 0x700 and not 0x0f00. Fix the mask, allowing for the 40MHz clock
    to be detected.

    Signed-off-by: Colin Ian King
    Signed-off-by: Tejun Heo

    Colin Ian King
     
  • The comment suggests we should be having an SPC-3 version descriptor
    but the 0260h is the code for "SPC-2 (no version claimed)". Correct
    it to 0300h so that it has the "SPC-3 (no version claimed)" descriptor.

    Note that we are claiming SPC-3 version compatibility in the VERSION
    field of the standard INQUIRY data. Therefore, I assume the typo was
    on the code but not on the comment.

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

    Tom Yan
     
  • Avoid performance bottleneck when being SCSI pass-through'd to
    virtual machines with other OSes (e.g. Windows) via virtio-scsi
    and scsi-block in qemu.

    Ref.: https://github.com/YanVugenfirer/kvm-guest-drivers-windows/issues/63

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

    Tom Yan
     
  • Without this fix, the DRA bit of the caching mode page would not
    be updated when the read look-ahead feature is toggled (e.g. with
    `smartctl --set`), but will only be until, for example, the write
    cache feature is touched.

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

    Tom Yan
     
  • Commit 856c46639309 ("libata: support device-managed ZAC devices")
    had the line that "bumps" the VERSION field in standard INQUIRY data
    removed. Add it back and claim SPC-5 version compatibility, which
    matches with the current version descriptor "SPC-5 (no version claimed)"
    that is used for ZAC devices.

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

    Tom Yan
     

07 Jul, 2016

2 commits


29 Jun, 2016

1 commit


18 Jun, 2016

1 commit

  • The sysfs file for the libata error handling has multiple issues
    in the way it prints time stamps:

    * it prints a 9-digit nanosecond value using a %06lu format string,
    which drops some leading zeroes
    * it converts a 64-bit jiffes value to a timespec using
    jiffies_to_timespec(), which takes a 'long' argument, so the
    result is wrong after a jiffies overflow (49 days).
    * we try to avoid using timespec because that generally overflows
    in 2038, although this particular usage is ok.

    This replaces the jiffies_to_timespec call with an open-coded
    implementation that gets it right.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Tejun Heo

    Arnd Bergmann
     

17 Jun, 2016

7 commits


27 May, 2016

4 commits