25 Aug, 2018

1 commit

  • Pull libata updates from Tejun Heo:
    "Nothing too interesting. Mostly ahci and ahci_platform changes, many
    around power management"

    * 'for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: (22 commits)
    ata: ahci_platform: enable to get and control reset
    ata: libahci_platform: add reset control support
    ata: add an extra argument to ahci_platform_get_resources()
    ata: sata_rcar: Add r8a77965 support
    ata: sata_rcar: exclude setting of PHY registers in Gen3
    ata: sata_rcar: really mask all interrupts on Gen2 and later
    Revert "ata: ahci_platform: allow disabling of hotplug to save power"
    ata: libahci: Allow reconfigure of DEVSLP register
    ata: libahci: Correct setting of DEVSLP register
    ata: ahci: Enable DEVSLP by default on x86 with SLP_S0
    ata: ahci: Support state with min power but Partial low power state
    Revert "ata: ahci_platform: convert kcalloc to devm_kcalloc"
    ata: sata_rcar: Add rudimentary Runtime PM support
    ata: sata_rcar: Provide a short-hand for &pdev->dev
    ata: Only output sg element mapped number in verbose debug
    ata: Guard ata_scsi_dump_cdb() by ATA_VERBOSE_DEBUG
    ata: ahci_platform: convert kcalloc to devm_kcalloc
    ata: ahci_platform: convert kzallloc to kcalloc
    ata: ahci_platform: correct parameter documentation for ahci_platform_shutdown
    libata: remove ata_sff_data_xfer_noirq()
    ...

    Linus Torvalds
     

16 Aug, 2018

1 commit

  • Pull SCSI updates from James Bottomley:
    "This is mostly updates to the usual drivers: mpt3sas, lpfc, qla2xxx,
    hisi_sas, smartpqi, megaraid_sas, arcmsr.

    In addition, with the continuing absence of Nic we have target updates
    for tcmu and target core (all with reviews and acks).

    The biggest observable change is going to be that we're (again) trying
    to switch to mulitqueue as the default (a user can still override the
    setting on the kernel command line).

    Other major core stuff is the removal of the remaining Microchannel
    drivers, an update of the internal timers and some reworks of
    completion and result handling"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (203 commits)
    scsi: core: use blk_mq_run_hw_queues in scsi_kick_queue
    scsi: ufs: remove unnecessary query(DM) UPIU trace
    scsi: qla2xxx: Fix issue reported by static checker for qla2x00_els_dcmd2_sp_done()
    scsi: aacraid: Spelling fix in comment
    scsi: mpt3sas: Fix calltrace observed while running IO & reset
    scsi: aic94xx: fix an error code in aic94xx_init()
    scsi: st: remove redundant pointer STbuffer
    scsi: qla2xxx: Update driver version to 10.00.00.08-k
    scsi: qla2xxx: Migrate NVME N2N handling into state machine
    scsi: qla2xxx: Save frame payload size from ICB
    scsi: qla2xxx: Fix stalled relogin
    scsi: qla2xxx: Fix race between switch cmd completion and timeout
    scsi: qla2xxx: Fix Management Server NPort handle reservation logic
    scsi: qla2xxx: Flush mailbox commands on chip reset
    scsi: qla2xxx: Fix unintended Logout
    scsi: qla2xxx: Fix session state stuck in Get Port DB
    scsi: qla2xxx: Fix redundant fc_rport registration
    scsi: qla2xxx: Silent erroneous message
    scsi: qla2xxx: Prevent sysfs access when chip is down
    scsi: qla2xxx: Add longer window for chip reset
    ...

    Linus Torvalds
     

30 Jul, 2018

1 commit

  • Currently when min_power policy is selected, the partial low power state
    is not entered and link will try aggressively enter to only slumber state.
    Add a new policy which still enable DEVSLP but also try to enter partial
    low power state. This policy is presented as "min_power_with_partial".

    For information the difference between partial and slumber
    Partial – PHY logic is powered up, and in a reduced power state. The link
    PM exit latency to active state maximum is 10 ns.
    Slumber – PHY logic is powered up, and in a reduced power state. The link
    PM exit latency to active state maximum is 10 ms.
    Devslp – PHY logic is powered down. The link PM exit latency from this
    state to active state maximum is 20 ms, unless otherwise specified by
    DETO.

    Suggested-and-reviewed-by: Hans de Goede
    Signed-off-by: Srinivas Pandruvada
    Signed-off-by: Tejun Heo

    Srinivas Pandruvada
     

13 Jul, 2018

1 commit


02 Jul, 2018

1 commit

  • There have been several reports of LPM related hard freezes about once
    a day on multiple Lenovo 50 series models. Strange enough these reports
    where not disk model specific as LPM issues usually are and some users
    with the exact same disk + laptop where seeing them while other users
    where not seeing these issues.

    It turns out that enabling LPM triggers a firmware bug somewhere, which
    has been fixed in later BIOS versions.

    This commit adds a new ahci_broken_lpm() function and a new ATA_FLAG_NO_LPM
    for dealing with this.

    The ahci_broken_lpm() function contains DMI match info for the 4 models
    which are known to be affected by this and the DMI BIOS date field for
    known good BIOS versions. If the BIOS date is older then the one in the
    table LPM will be disabled and a warning will be printed.

    Note the BIOS dates are for known good versions, some older versions may
    work too, but we don't know for sure, the table is using dates from BIOS
    versions for which users have confirmed that upgrading to that version
    makes the problem go away.

    Unfortunately I've been unable to get hold of the reporter who reported
    that BIOS version 2.35 fixed the problems on the W541 for him. I've been
    able to verify the DMI_SYS_VENDOR and DMI_PRODUCT_VERSION from an older
    dmidecode, but I don't know the exact BIOS date as reported in the DMI.
    Lenovo keeps a changelog with dates in their release notes, but the
    dates there are the release dates not the build dates which are in DMI.
    So I've chosen to set the date to which we compare to one day past the
    release date of the 2.34 BIOS. I plan to fix this with a follow up
    commit once I've the necessary info.

    Cc: stable@vger.kernel.org
    Signed-off-by: Hans de Goede
    Signed-off-by: Tejun Heo

    Hans de Goede
     

20 Jun, 2018

1 commit

  • Commit 2623c7a5f2 ("libata: add refcounting to ata_host") v4.17+ introduced
    refcounting to ata_host and will increase or decrease the refcount when
    adding or deleting transport ATA port.

    Now the ata host for libsas is embedded in domain_device, and the ->kref
    member is not initialized. Afer we add ata transport class, ata_host_get()
    will be called when adding transport ATA port and a warning will be
    triggered as below:

    refcount_t: increment on 0; use-after-free.
    WARNING: CPU: 2 PID: 103 at
    lib/refcount.c:153 refcount_inc+0x40/0x48 ...... Call trace:
    refcount_inc+0x40/0x48
    ata_host_get+0x10/0x18
    ata_tport_add+0x40/0x120
    ata_sas_tport_add+0xc/0x14
    sas_ata_init+0x7c/0xc8
    sas_discover_domain+0x380/0x53c
    process_one_work+0x12c/0x288
    worker_thread+0x58/0x3f0
    kthread+0xfc/0x128
    ret_from_fork+0x10/0x18

    And also when removing transport ATA port ata_host_put() will be called and
    another similar warning will be triggered. If the refcount decreased to
    zero, the ata host will be freed. But this ata host is only part of
    domain_device, it cannot be freed directly.

    So we have to change this embedded static ata host to a dynamically
    allocated ata host and initialize the ->kref member. To use ata_host_get()
    and ata_host_put() in libsas, we need to move the declaration of these
    functions to the public libata.h and export them.

    Fixes: b6240a4df018 ("scsi: libsas: add transport class for ATA devices")
    Signed-off-by: Jason Yan
    CC: John Garry
    CC: Taras Kondratiuk
    CC: Tejun Heo
    Acked-by: Tejun Heo
    Signed-off-by: Martin K. Petersen

    Jason Yan
     

13 Jun, 2018

1 commit

  • The kzalloc() function has a 2-factor argument form, kcalloc(). This
    patch replaces cases of:

    kzalloc(a * b, gfp)

    with:
    kcalloc(a * b, gfp)

    as well as handling cases of:

    kzalloc(a * b * c, gfp)

    with:

    kzalloc(array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    kzalloc_array(array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    kzalloc(4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    type TYPE;
    expression THING, E;
    @@

    (
    kzalloc(
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    kzalloc(
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    kzalloc(
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    identifier SIZE, COUNT;
    @@

    - kzalloc
    + kcalloc
    (
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    kzalloc(
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    kzalloc(
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    kzalloc(
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    kzalloc(sizeof(THING) * C2, ...)
    |
    kzalloc(sizeof(TYPE) * C2, ...)
    |
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(C1 * C2, ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

06 Jun, 2018

1 commit

  • Pull libata updates from Tejun Heo:

    - libata has always been limiting the maximum queue depth to 31, with
    one entry set aside mostly for historical reasons. This didn't use to
    make much difference but Jens found out that modern hard drives can
    actually perform measurably better with the extra one queue depth.
    Jens updated libata core so that it can make use of full 32 queue
    depth

    - Damien updated command retry logic in error handling so that it
    doesn't unnecessarily retry when upper layer (SCSI) is gonna handle
    them

    - A couple misc changes

    * 'for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
    sata_fsl: use the right type for tag bitshift
    ahci: enable full queue depth of 32
    libata: don't clamp queue depth to ATA_MAX_QUEUE - 1
    libata: add extra internal command
    sata_nv: set host can_queue count appropriately
    libata: remove assumption that ATA_MAX_QUEUE - 1 is the max
    libata: use ata_tag_internal() consistently
    libata: bump ->qc_active to a 64-bit type
    libata: convert core and drivers to ->hw_tag usage
    libata: introduce notion of separate hardware tags
    libata: Fix command retry decision
    libata: Honor RQF_QUIET flag
    libata: Make ata_dev_set_mode() less verbose
    libata: Fix ata_err_string()
    libata: Fix comment typo in ata_eh_analyze_tf()
    sata_nv: don't use block layer bounce buffer
    ata: hpt37x: Convert to use match_string() helper

    Linus Torvalds
     

31 May, 2018

1 commit

  • Commit 184add2ca23c ("libata: Apply NOLPM quirk for SanDisk
    SD7UB3Q*G1001 SSDs") disabled LPM for SanDisk SD7UB3Q*G1001 SSDs.

    This has lead to several reports of users of that SSD where LPM
    was working fine and who know have a significantly increased idle
    power consumption on their laptops.

    Likely there is another problem on the T450s from the original
    reporter which gets exposed by the uncore reaching deeper sleep
    states (higher PC-states) due to LPM being enabled. The problem as
    reported, a hardfreeze about once a day, already did not sound like
    it would be caused by LPM and the reports of the SSD working fine
    confirm this. The original reporter is ok with dropping the quirk.

    A X250 user has reported the same hard freeze problem and for him
    the problem went away after unrelated updates, I suspect some GPU
    driver stack changes fixed things.

    TL;DR: The original reporters problem were triggered by LPM but not
    an LPM issue, so drop the quirk for the SSD in question.

    BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1583207
    Cc: stable@vger.kernel.org
    Cc: Richard W.M. Jones
    Cc: Lorenzo Dalrio
    Reported-by: Lorenzo Dalrio
    Signed-off-by: Hans de Goede
    Signed-off-by: Tejun Heo
    Acked-by: "Richard W.M. Jones"

    Hans de Goede
     

21 May, 2018

1 commit

  • While whitelisting Micron M500DC drives, the tweaked blacklist entry
    enabled queued TRIM from M500IT variants also. But these do not support
    queued TRIM. And while using those SSDs with the latest kernel we have
    seen errors and even the partition table getting corrupted.

    Some part from the dmesg:
    [ 6.727384] ata1.00: ATA-9: Micron_M500IT_MTFDDAK060MBD, MU01, max UDMA/133
    [ 6.727390] ata1.00: 117231408 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
    [ 6.741026] ata1.00: supports DRM functions and may not be fully accessible
    [ 6.759887] ata1.00: configured for UDMA/133
    [ 6.762256] scsi 0:0:0:0: Direct-Access ATA Micron_M500IT_MT MU01 PQ: 0 ANSI: 5

    and then for the error:
    [ 120.860334] ata1.00: exception Emask 0x1 SAct 0x7ffc0007 SErr 0x0 action 0x6 frozen
    [ 120.860338] ata1.00: irq_stat 0x40000008
    [ 120.860342] ata1.00: failed command: SEND FPDMA QUEUED
    [ 120.860351] ata1.00: cmd 64/01:00:00:00:00/00:00:00:00:00/a0 tag 0 ncq dma 512 out
    res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x5 (timeout)
    [ 120.860353] ata1.00: status: { DRDY }
    [ 120.860543] ata1: hard resetting link
    [ 121.166128] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
    [ 121.166376] ata1.00: supports DRM functions and may not be fully accessible
    [ 121.186238] ata1.00: supports DRM functions and may not be fully accessible
    [ 121.204445] ata1.00: configured for UDMA/133
    [ 121.204454] ata1.00: device reported invalid CHS sector 0
    [ 121.204541] sd 0:0:0:0: [sda] tag#18 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
    [ 121.204546] sd 0:0:0:0: [sda] tag#18 Sense Key : 0x5 [current]
    [ 121.204550] sd 0:0:0:0: [sda] tag#18 ASC=0x21 ASCQ=0x4
    [ 121.204555] sd 0:0:0:0: [sda] tag#18 CDB: opcode=0x93 93 08 00 00 00 00 00 04 28 80 00 00 00 30 00 00
    [ 121.204559] print_req_error: I/O error, dev sda, sector 272512

    After few reboots with these errors, and the SSD is corrupted.
    After blacklisting it, the errors are not seen and the SSD does not get
    corrupted any more.

    Fixes: 243918be6393 ("libata: Do not blacklist Micron M500DC")
    Cc: Martin K. Petersen
    Cc: stable@vger.kernel.org
    Signed-off-by: Sudip Mukherjee
    Signed-off-by: Tejun Heo

    Sudip Mukherjee
     

14 May, 2018

1 commit

  • Without this patch the drive errors out regularly:

    [ 1.090154] ata1.00: ATA-8: SAMSUNG SSD PM830 mSATA 256GB,
    CXM13D1Q, max UDMA/133
    (...)
    [ 345.154996] ata1.00: exception Emask 0x40 SAct 0x0 SErr 0xc0800 action 0x6
    [ 345.155006] ata1.00: irq_stat 0x40000001
    [ 345.155013] ata1: SError: { HostInt CommWake 10B8B }
    [ 345.155018] ata1.00: failed command: SET FEATURES
    [ 345.155032] ata1.00: cmd ef/05:e1:00:00:00/00:00:00:00:00/40 tag 7
    res 51/04:e1:00:00:00/00:00:00:00:00/40 Emask 0x41 (internal error)
    [ 345.155038] ata1.00: status: { DRDY ERR }
    [ 345.155042] ata1.00: error: { ABRT }
    [ 345.155051] ata1: hard resetting link
    [ 345.465661] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
    [ 345.466955] ata1.00: configured for UDMA/133
    [ 345.467085] ata1: EH complete

    Signed-off-by: François Cami
    Acked-by: Hans de Goede
    Signed-off-by: Tejun Heo

    François Cami
     

12 May, 2018

6 commits


11 May, 2018

1 commit

  • For a successful setting of the device transfer speed mode in
    ata_dev_set_mode(), do not print the message
    "ataX.XX: configured for xxx" if the EH context has the quiet flag set,
    unless the device port is being reset.

    This preserves the output of the message during device scan but removes
    it in the case of a simple device revalidation such as trigerred by
    enabling the NCQ I/O priority feature of the device
    e.g. echo 1 > /sys/block/sdxx/device/ncq_iprio_enable

    Signed-off-by: Damien Le Moal
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Tejun Heo

    Damien Le Moal
     

09 May, 2018

1 commit


27 Apr, 2018

2 commits

  • Richard Jones has reported that using med_power_with_dipm on a T450s
    with a Sandisk SD7UB3Q256G1001 SSD (firmware version X2180501) is
    causing the machine to hang.

    Switching the LPM to max_performance fixes this, so it seems that
    this Sandisk SSD does not handle LPM well.

    Note in the past there have been bug-reports about the following
    Sandisk models not working with min_power, so we may need to extend
    the quirk list in the future: name - firmware
    Sandisk SD6SB2M512G1022I - X210400
    Sandisk SD6PP4M-256G-1006 - A200906

    Cc: stable@vger.kernel.org
    Cc: Richard W.M. Jones
    Reported-and-tested-by: Richard W.M. Jones
    Signed-off-by: Hans de Goede
    Signed-off-by: Tejun Heo

    Hans de Goede
     
  • Kevin Shanahan reports the following repeating errors when using LPM,
    causing long delays accessing the disk:

    Apr 23 10:21:43 link kernel: ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x50000 action 0x6 frozen
    Apr 23 10:21:43 link kernel: ata1: SError: { PHYRdyChg CommWake }
    Apr 23 10:21:43 link kernel: ata1.00: failed command: WRITE DMA
    Apr 23 10:21:43 link kernel: ata1.00: cmd ca/00:08:60:5d:cd/00:00:00:00:00/e1 tag 9 dma 4096 out
    res 50/01:01:01:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
    Apr 23 10:21:43 link kernel: ata1.00: status: { DRDY }
    Apr 23 10:21:43 link kernel: ata1.00: error: { AMNF }
    Apr 23 10:21:43 link kernel: ata1: hard resetting link
    Apr 23 10:21:43 link kernel: ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
    Apr 23 10:21:43 link kernel: ata1.00: configured for UDMA/133
    Apr 23 10:21:43 link kernel: ata1: EH complete

    These go away when switching from med_power_with_dipm to medium_power.

    This is somewhat weird as the PM830 datasheet explicitly mentions DIPM
    being supported and the idle power-consumption is specified with DIPM
    enabled.

    There are many OEM customized firmware versions for the PM830, so for now
    lets assume this is firmware version specific and blacklist LPM based on
    the firmware version.

    Cc: Kevin Shanahan
    Reported-by: Kevin Shanahan
    Signed-off-by: Hans de Goede
    Signed-off-by: Tejun Heo

    Hans de Goede
     

04 Apr, 2018

2 commits

  • Pull libata updates from Tejun Heo:
    "Nothing too interesting.

    The biggest change is refcnting fix for ata_host - the bug is recent
    and can only be triggered on controller hotplug, so very few are
    hitting it.

    There also are a number of trivial license / error message changes and
    some hardware specific changes"

    * 'for-4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: (23 commits)
    ahci: imx: add the imx8qm ahci sata support
    libata: ensure host is free'd on error exit paths
    ata: ahci-platform: add reset control support
    ahci: imx: fix the build warning
    ata: add Amiga Gayle PATA controller driver
    ahci: imx: add the imx6qp ahci sata support
    ata: change Tegra124 to Tegra
    ata: ahci_tegra: Add AHCI support for Tegra210
    ata: ahci_tegra: disable DIPM
    ata: ahci_tegra: disable devslp for Tegra124
    ata: ahci_tegra: initialize regulators from soc struct
    ata: ahci_tegra: Update initialization sequence
    dt-bindings: Tegra210: add binding documentation
    libata: add refcounting to ata_host
    pata_bk3710: clarify license version and use SPDX header
    pata_falcon: clarify license version and use SPDX header
    pata_it821x: Delete an error message for a failed memory allocation in it821x_firmware_command()
    pata_macio: Delete an error message for a failed memory allocation in two functions
    pata_mpc52xx: Delete an error message for a failed memory allocation in mpc52xx_ata_probe()
    sata_dwc_460ex: Delete an error message for a failed memory allocation in sata_dwc_port_start()
    ...

    Linus Torvalds
     
  • ….anaszewski/linux-leds

    Pull LED updates from Jacek Anaszewski:
    "New LED class driver:
    - add driver for Mellanox regmap LEDs

    Improvement to ledtrig-disk:
    - extend disk trigger for reads and writes

    Improvements and fixes to existing LED class drivers:
    - add more product/board names for PC Engines APU2
    - fix wrong dmi_match on PC Engines APU LEDs
    - clarify chips supported by LM355x driver
    - fix Kconfig text for MLXCPLD, SYSCON, MC13783, NETXBIG
    - allow leds-mlxcpld compilation for 32 bit arch"

    * tag 'leds_for_4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
    leds: Fix wrong dmi_match on PC Engines APU LEDs
    leds: Extends disk trigger for reads and writes
    leds: Add more product/board names for PC Engines APU2
    leds: add driver for support Mellanox regmap LEDs for BMC and x86 platform
    leds: fix Kconfig text for MLXCPLD, SYSCON, MC13783, NETXBIG
    leds: Clarify supported chips by LM355x driver
    leds: leds-mlxcpld: Allow compilation for 32 bit arch

    Linus Torvalds
     

27 Mar, 2018

1 commit

  • The host structure is not being kfree'd on two error exit paths
    leading to memory leaks. Add in new err_free label and kfree host.

    Detected by CoverityScan, CID#1466103 ("Resource leak")

    Fixes: 2623c7a5f279 ("libata: add refcounting to ata_host")
    Signed-off-by: Colin Ian King
    Signed-off-by: Tejun Heo

    Colin Ian King
     

19 Mar, 2018

3 commits

  • When commit 9c7be59fc519af ("libata: Apply NOLPM quirk to Crucial MX100
    512GB SSDs") was added it inherited the ATA_HORKAGE_NO_NCQ_TRIM quirk
    from the existing "Crucial_CT*MX100*" entry, but that entry sets model_rev
    to "MU01", where as the entry adding the NOLPM quirk sets it to NULL.

    This means that after this commit we no apply the NO_NCQ_TRIM quirk to
    all "Crucial_CT512MX100*" SSDs even if they have the fixed "MU02"
    firmware. This commit splits the "Crucial_CT512MX100*" quirk into 2
    quirks, one for the "MU01" firmware and one for all other firmware
    versions, so that we once again only apply the NO_NCQ_TRIM quirk to the
    "MU01" firmware version.

    Fixes: 9c7be59fc519af ("libata: Apply NOLPM quirk to ... MX100 512GB SSDs")
    Cc: stable@vger.kernel.org
    Signed-off-by: Hans de Goede
    Signed-off-by: Tejun Heo

    Hans de Goede
     
  • Commit b17e5729a630 ("libata: disable LPM for Crucial BX100 SSD 500GB
    drive"), introduced a ATA_HORKAGE_NOLPM quirk for Crucial BX100 500GB SSDs
    but limited this to the MU02 firmware version, according to:
    http://www.crucial.com/usa/en/support-ssd-firmware

    MU02 is the last version, so there are no newer possibly fixed versions
    and if the MU02 version has broken LPM then the MU01 almost certainly
    also has broken LPM, so this commit changes the quirk to apply to all
    firmware versions.

    Fixes: b17e5729a630 ("libata: disable LPM for Crucial BX100 SSD 500GB...")
    Cc: stable@vger.kernel.org
    Cc: Kai-Heng Feng
    Signed-off-by: Hans de Goede
    Signed-off-by: Tejun Heo

    Hans de Goede
     
  • There have been reports of the Crucial M500 480GB model not working
    with LPM set to min_power / med_power_with_dipm level.

    It has not been tested with medium_power, but that typically has no
    measurable power-savings.

    Note the reporters Crucial_CT480M500SSD3 has a firmware version of MU03
    and there is a MU05 update available, but that update does not mention any
    LPM fixes in its changelog, so the quirk matches all firmware versions.

    In my experience the LPM problems with (older) Crucial SSDs seem to be
    limited to higher capacity versions of the SSDs (different firmware?),
    so this commit adds a NOLPM quirk for the 480 and 960GB versions of the
    M500, to avoid LPM causing issues with these SSDs.

    Cc: stable@vger.kernel.org
    Reported-and-tested-by: Martin Steigerwald
    Signed-off-by: Hans de Goede
    Signed-off-by: Tejun Heo

    Hans de Goede
     

14 Mar, 2018

2 commits

  • Samsung explicitly states that queued TRIM is supported for Linux with
    860 PRO and 860 EVO.

    Make the previous blacklist to cover only 840 and 850 series.

    Signed-off-by: Park Ju Hyung
    Reviewed-by: Martin K. Petersen
    Signed-off-by: Tejun Heo
    Cc: stable@vger.kernel.org

    Ju Hyung Park
     
  • After commit 9a6d6a2ddabb ("ata: make ata port as parent device of scsi
    host") manual driver unbind/remove causes use-after-free.

    Unbind unconditionally invokes devres_release_all() which calls
    ata_host_release() and frees ata_host/ata_port memory while it is still
    being referenced as a parent of SCSI host. When SCSI host is finally
    released scsi_host_dev_release() calls put_device(parent) and accesses
    freed ata_port memory.

    Add reference counting to make sure that ata_host lives long enough.

    Bug report: https://lkml.org/lkml/2017/11/1/945
    Fixes: 9a6d6a2ddabb ("ata: make ata port as parent device of scsi host")
    Cc: Tejun Heo
    Cc: Lin Ming
    Cc: linux-ide@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Taras Kondratiuk
    Signed-off-by: Tejun Heo

    Taras Kondratiuk
     

12 Mar, 2018

1 commit

  • This adds two new disk triggers for triggering on reads
    and writes respectively, named "disk-read" and "disk-write".

    The use case comes from working on the D-Link DNS-313 NAS
    box. This features an RGB LED for disk activity. with
    these two triggers I can couple the green LED to read
    activity and the red LED to write activity, which gives
    the appropriate user feedback about what is happening
    on the disk. When tested it gave exactly the feedback
    desired.

    The in-kernel interface is simply changed to pass a bool
    indicating if the activity is write activity and update
    each trigger (and the composite "disk-activity" trigger)
    depending on what is passed in.

    Signed-off-by: Linus Walleij
    Reviewed-by: Bartlomiej Zolnierkiewicz
    Acked-by: Pavel Machek
    Acked-by: Tejun Heo
    Acked-by: David S. Miller
    Signed-off-by: Jacek Anaszewski

    Linus Walleij
     

21 Feb, 2018

1 commit

  • After Laptop Mode Tools starts to use min_power for LPM, a user found
    out Crucial BX100 SSD can't get mounted.

    Crucial BX100 SSD 500GB drive don't work well with min_power. This also
    happens to med_power_with_dipm.

    So let's disable LPM for Crucial BX100 SSD 500GB drive.

    BugLink: https://bugs.launchpad.net/bugs/1726930
    Signed-off-by: Kai-Heng Feng
    Signed-off-by: Tejun Heo
    Cc: stable@vger.kernel.org

    Kai-Heng Feng
     

18 Feb, 2018

1 commit

  • Various people have reported the Crucial MX100 512GB model not working
    with LPM set to min_power. I've now received a report that it also does
    not work with the new med_power_with_dipm level.

    It does work with medium_power, but that has no measurable power-savings
    and given the amount of people being bitten by the other levels not
    working, this commit just disables LPM altogether.

    Note all reporters of this have either the 512GB model (max capacity), or
    are not specifying their SSD's size. So for now this quirk assumes this is
    a problem with the 512GB model only.

    Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=89261
    Buglink: https://github.com/linrunner/TLP/issues/84
    Cc: stable@vger.kernel.org
    Signed-off-by: Hans de Goede
    Signed-off-by: Tejun Heo

    Hans de Goede
     

13 Feb, 2018

1 commit

  • syzkaller hit a WARN() in ata_qc_issue() when writing to /dev/sg0. This
    happened because it issued a READ_6 command with no data buffer.

    Just remove the WARN(), as it doesn't appear indicate a kernel bug. The
    expected behavior is to fail the command, which the code does.

    Here's a reproducer that works in QEMU when /dev/sg0 refers to a disk of
    the default type ("82371SB PIIX3 IDE"):

    #include
    #include

    int main()
    {
    char buf[42] = { [36] = 0x8 /* READ_6 */ };

    write(open("/dev/sg0", O_RDWR), buf, sizeof(buf));
    }

    Fixes: f92a26365a72 ("libata: change ATA_QCFLAG_DMAMAP semantics")
    Reported-by: syzbot+f7b556d1766502a69d85071d2ff08bd87be53d0f@syzkaller.appspotmail.com
    Cc: # v2.6.25+
    Signed-off-by: Eric Biggers
    Signed-off-by: Tejun Heo

    Eric Biggers
     

19 Dec, 2017

1 commit


05 Dec, 2017

1 commit

  • During hotplug, it is possible for 6Gbps link speed to be limited all
    the way down to 1.5 Gbps which may lead to a slower link speed when
    drive is re-connected.

    This behavior has been seen on a Intel Lewisburg SATA controller
    (8086:a1d2) with HGST HUH728080ALE600 drive where SATA link speed was
    limited to 1.5 Gbps and when re-connected the link came up 3.0 Gbps.

    This patch was retested on above configuration and showed the
    hotplugged link to come back online at max speed (6Gbps). I did not
    see the downgrade when testing on Intel C600/X79, but retested patched
    linux-4.14-rc5 kernel and didn't see any side effects from this
    change. Also, successfully retested hotplug on port multiplier 3Gbps
    link.

    tj: Minor comment updates.

    Signed-off-by: David Milburn
    Signed-off-by: Tejun Heo

    David Milburn
     

16 Nov, 2017

1 commit

  • Pull libata updates from Tejun Heo:
    "Nothing too interesting or alarming. Other than a new power saving
    mode addition to ahci and crash fix on a tracepoint, all changes are
    trivial or device-specific"

    * 'for-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: (22 commits)
    ahci: imx: Handle increased read failures for IMX53 temperature sensor in low frequency mode.
    ata: sata_dwc_460ex: Propagate platform device ID to DMA driver
    ata: fixes kernel crash while tracing ata_eh_link_autopsy event
    ata: pata_pdc2027x: Fix space before '[' error.
    libata: fix spelling mistake: 'ambigious' -> 'ambiguous'
    ata: ceva: Add SMMU support for SATA IP
    ata: ceva: Correct the suspend and resume logic for SATA
    ata: ceva: Correct the AXI bus configuration for SATA ports
    ata: ceva: Add CCI support for SATA if CCI is enabled
    ata: ceva: Make RxWaterMark value as module parameter
    ata: ceva: Disable Device Sleep capability
    ata: ceva: Add gen 3 mode support in driver
    ata: ceva: Move sata port phy oob settings to device-tree
    devicetree: bindings: Add sata port phy config parameters in ahci-ceva
    ata: mark expected switch fall-throughs
    ata: sata_mv: remove a redundant assignment to pointer ehi
    ahci: Add support for Cavium's fifth generation SATA controller
    ata: sata_rcar: Use of_device_get_match_data() helper
    libata: make ata_port_type const
    libata: make static arrays const, reduces object code size
    ...

    Linus Torvalds
     

30 Oct, 2017

1 commit


23 Oct, 2017

1 commit

  • In preparation to enabling -Wimplicit-fallthrough, mark switch cases
    where we are expecting to fall through.

    In cases where a "drop through" comment was already in place, I replaced
    it with a proper "fall through" comment, which is what GCC is expecting
    to find.

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Tejun Heo

    Gustavo A. R. Silva
     

17 Oct, 2017

1 commit

  • In preparation for unconditionally passing the struct timer_list pointer to
    all timer callbacks, switch to using the new timer_setup() and from_timer()
    to pass the timer pointer explicitly.

    Signed-off-by: Kees Cook
    Signed-off-by: Thomas Gleixner
    Acked-by: Tejun Heo
    Cc: linux-ide@vger.kernel.org
    Link: https://lkml.kernel.org/r/20171005004842.GA23011@beast

    Kees Cook
     

03 Oct, 2017

1 commit

  • Make this const as it is only stored in the const field of a device
    structure. Make the declaration in header const too.

    Structure found using Coccinelle and changes done by hand.

    Signed-off-by: Bhumika Goyal
    Signed-off-by: Tejun Heo

    Bhumika Goyal