03 Sep, 2020

1 commit

  • All three generations of Sandisk SSDs lock up hard intermittently.
    Experiments showed that disabling NCQ lowered the failure rate significantly
    and the kernel has been disabling NCQ for some models of SD7's and 8's,
    which is obviously undesirable.

    Karthik worked with Sandisk to root cause the hard lockups to trim commands
    larger than 128M. This patch implements ATA_HORKAGE_MAX_TRIM_128M which
    limits max trim size to 128M and applies it to all three generations of
    Sandisk SSDs.

    Signed-off-by: Tejun Heo
    Cc: Karthik Shivaram
    Cc: stable@vger.kernel.org
    Signed-off-by: Jens Axboe

    Tejun Heo
     

28 Jun, 2020

1 commit

  • Pull SCSI fixes from James Bottomley:
    "Six small fixes, five in drivers and one to correct another minor
    regression from cc97923a5bcc ("block: move dma drain handling to
    scsi") where we still need the drain stub to be built in to the kernel
    for the modular libata, non-modular SAS driver case"

    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
    scsi: mptscsih: Fix read sense data size
    scsi: zfcp: Fix panic on ERP timeout for previously dismissed ERP action
    scsi: lpfc: Avoid another null dereference in lpfc_sli4_hba_unset()
    scsi: libata: Fix the ata_scsi_dma_need_drain stub
    scsi: qla2xxx: Keep initiator ports after RSCN
    scsi: qla2xxx: Set NVMe status code for failed NVMe FCP request

    Linus Torvalds
     

24 Jun, 2020

1 commit

  • We not only need the stub when libata is disabled, but also if it is
    modular and there are built-in SAS drivers (which can happen when
    SCSI_SAS_ATA is disabled).

    Link: https://lore.kernel.org/r/20200620071302.462974-2-hch@lst.de
    Fixes: b8f1d1e05817 ("scsi: Wire up ata_scsi_dma_need_drain for SAS HBA drivers")
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    Christoph Hellwig
     

21 Jun, 2020

1 commit

  • Pull SCSI fixes from James Bottomley:
    "One minor fix and two patches reworking the ata dma drain for the
    !CONFIG_LIBATA case. The latter is a 5.7 regression fix"

    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
    scsi: Wire up ata_scsi_dma_need_drain for SAS HBA drivers
    scsi: libata: Provide an ata_scsi_dma_need_drain stub for !CONFIG_ATA
    scsi: ufs-bsg: Fix runtime PM imbalance on error

    Linus Torvalds
     

20 Jun, 2020

1 commit


18 Jun, 2020

1 commit

  • Commit 130f4caf145c ("libata: Ensure ata_port probe has completed before
    detach") may cause system freeze during suspend.

    Using async_synchronize_full() in PM callbacks is wrong, since async
    callbacks that are already scheduled may wait for not-yet-scheduled
    callbacks, causes a circular dependency.

    Instead of using big hammer like async_synchronize_full(), use async
    cookie to make sure port probe are synced, without affecting other
    scheduled PM callbacks.

    Fixes: 130f4caf145c ("libata: Ensure ata_port probe has completed before detach")
    Suggested-by: John Garry
    Signed-off-by: Kai-Heng Feng
    Tested-by: John Garry
    BugLink: https://bugs.launchpad.net/bugs/1867983
    Signed-off-by: Jens Axboe

    Kai-Heng Feng
     

16 Jun, 2020

2 commits

  • There is a regular need in the kernel to provide a way to declare having a
    dynamically sized set of trailing elements in a structure. Kernel code should
    always use “flexible array members”[1] for these cases. The older style of
    one-element or zero-length arrays should no longer be used[2].

    [1] https://en.wikipedia.org/wiki/Flexible_array_member
    [2] https://github.com/KSPP/linux/issues/21

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

    Gustavo A. R. Silva
     
  • SAS drivers can be compiled with ata support disabled. Provide a stub so
    that the drivers don't have to ifdef around wiring up
    ata_scsi_dma_need_drain.

    Link: https://lore.kernel.org/r/20200615064624.37317-2-hch@lst.de
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    Christoph Hellwig
     

23 Apr, 2020

1 commit

  • Don't burden the common block code with with specifics of the libata DMA
    draining mechanism. Instead move most of the code to the scsi midlayer.

    That also means the nr_phys_segments adjustments in the blk-mq fast path
    can go away entirely, given that SCSI never looks at nr_phys_segments
    after mapping the request to a scatterlist.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

27 Mar, 2020

15 commits

  • * move ata_eh_analyze_ncq_error() and ata_eh_read_log_10h() to
    libata-sata.c

    * add static inline for ata_eh_analyze_ncq_error() for
    CONFIG_SATA_HOST=n case (link->sactive is non-zero only if
    NCQ commands are actually queued so empty function body is
    sufficient)

    Code size savings on m68k arch using (modified) atari_defconfig:

    text data bss dec hex filename
    before:
    16164 18 0 16182 3f36 drivers/ata/libata-eh.o
    after:
    15446 18 0 15464 3c68 drivers/ata/libata-eh.o

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     
  • Start separating SATA specific code from libata-eh.c:

    * move sata_async_notification() to libata-sata.c:

    Code size savings on m68k arch using (modified) atari_defconfig:

    text data bss dec hex filename
    before:
    16243 18 0 16261 3f85 drivers/ata/libata-eh.o
    after:
    16164 18 0 16182 3f36 drivers/ata/libata-eh.o

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     
  • * un-inline:
    - ata_scsi_dump_cdb()
    - __ata_scsi_queuecmd()

    * un-static:
    - ata_scsi_sdev_config()
    - ata_scsi_dev_config()
    - ata_scsi_dump_cdb()
    - __ata_scsi_queuecmd()

    * move ata_sas_*() to libata-sata.c:

    * add static inlines for CONFIG_SATA_HOST=n case for
    ata_sas_{allocate,free}_tag()

    Code size savings on m68k arch using (modified) atari_defconfig:

    text data bss dec hex filename
    before:
    19137 23 576 19736 4d18 drivers/ata/libata-scsi.o
    after:
    18330 23 576 18929 49f1 drivers/ata/libata-scsi.o

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     
  • Start separating SATA specific code from libata-scsi.c:

    * un-static ata_scsi_find_dev()

    * move following code to libata-sata.c:
    - SATA only sysfs device attributes handling
    - __ata_change_queue_depth()
    - ata_scsi_change_queue_depth()

    * cover with CONFIG_SATA_HOST ifdef SATA only sysfs device
    attributes handling code and ATA_SHT_NCQ() macro in

    Code size savings on m68k arch using (modified) atari_defconfig:

    text data bss dec hex filename
    before:
    20702 105 576 21383 5387 drivers/ata/libata-scsi.o
    after:
    19137 23 576 19736 4d18 drivers/ata/libata-scsi.o

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     
  • * move sata_deb_timing_*() to libata-sata.c

    * add static inline for sata_ehc_deb_timing() for
    CONFIG_SATA_HOST=n case

    Code size savings on m68k arch using (modified) atari_defconfig:

    text data bss dec hex filename
    before:
    32158 572 40 32770 8002 drivers/ata/libata-core.o
    after:
    32015 572 40 32627 7f73 drivers/ata/libata-core.o

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     
  • * move ata_qc_complete_multiple() to libata-sata.c

    Code size savings on m68k arch using (modified) atari_defconfig:

    text data bss dec hex filename
    before:
    32559 572 40 33171 8193 drivers/ata/libata-core.o
    after:
    32162 572 40 32774 8006 drivers/ata/libata-core.o

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     
  • * move sata_link_hardreset() to libata-sata.c

    * add static inline for CONFIG_SATA_HOST=n case

    * make sata_set_spd_needed() static

    Code size savings on m68k arch using (modified) atari_defconfig:

    text data bss dec hex filename
    before:
    32724 572 40 33336 8238 drivers/ata/libata-core.o
    after:
    32559 572 40 33171 8193 drivers/ata/libata-core.o

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     
  • * move sata_link_{debounce,resume}() to libata-sata.c

    * add static inline for CONFIG_SATA_HOST=n case (only one,
    for sata_link_resume() is needed)

    Code size savings on m68k arch using (modified) atari_defconfig:

    text data bss dec hex filename
    before:
    32816 572 40 33428 8294 drivers/ata/libata-core.o
    after:
    32724 572 40 33336 8238 drivers/ata/libata-core.o

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     
  • * move *sata_set_spd*() to libata-sata.c

    * add static inlines for CONFIG_SATA_HOST=n case

    Code size savings on m68k arch using (modified) atari_defconfig:

    text data bss dec hex filename
    before:
    32842 572 40 33458 82ae drivers/ata/libata-core.o
    after:
    32812 572 40 33428 8290 drivers/ata/libata-core.o

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     
  • * move sata_scr_*() to libata-sata.c

    * add static inlines for CONFIG_SATA_HOST=n case

    Code size savings on m68k arch using (modified) atari_defconfig:

    text data bss dec hex filename
    before:
    35642 572 40 36254 8d9e drivers/ata/libata-core.o
    16607 18 0 16625 40f1 drivers/ata/libata-eh.o
    after:
    32846 572 40 33458 82b2 drivers/ata/libata-core.o
    16243 18 0 16261 3f85 drivers/ata/libata-eh.o

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     
  • Start separating SATA specific code from libata-core.c:

    * move following functions to libata-sata.c:
    - ata_tf_to_fis()
    - ata_tf_from_fis()
    - sata_link_scr_lpm()
    - ata_slave_link_init()
    - sata_lpm_ignore_phy_events()

    * group above functions together in

    * include libata-sata.c in the build when CONFIG_SATA_HOST=y

    Code size savings on m68k arch using (modified) atari_defconfig:

    text data bss dec hex filename
    before:
    37582 572 40 38194 9532 drivers/ata/libata-core.o
    after:
    36762 572 40 37374 91fe drivers/ata/libata-core.o

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     
  • When CONFIG_SATA_HOST=n there are no NCQ capable host drivers
    built so it is safe to hardwire ata_ncq_enabled() to always
    return zero.

    Code size savings on m68k arch using (modified) atari_defconfig:

    text data bss dec hex filename
    before:
    37820 572 40 38432 9620 drivers/ata/libata-core.o
    21040 105 576 21721 54d9 drivers/ata/libata-scsi.o
    17405 18 0 17423 440f drivers/ata/libata-eh.o
    after:
    37582 572 40 38194 9532 drivers/ata/libata-core.o
    20702 105 576 21383 5387 drivers/ata/libata-scsi.o
    17353 18 0 17371 43db drivers/ata/libata-eh.o

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     
  • Separate PATA timings code from libata-core.c:

    * add PATA_TIMINGS config option and make corresponding PATA
    host drivers (and ATA ACPI code) select it

    * move following PATA timings code to libata-pata-timings.c:
    - ata_timing_quantize()
    - ata_timing_merge()
    - ata_timing_find_mode()
    - ata_timing_compute()

    * group above functions together in

    * include libata-pata-timings.c in the build when PATA_TIMINGS
    config option is enabled

    * cover ata_timing_cycle2mode() with CONFIG_ATA_ACPI ifdef (it
    depends on code from libata-core.c and libata-pata-timings.c
    while its only user is ATA ACPI)

    Code size savings on m68k arch using (modified) atari_defconfig:

    text data bss dec hex filename
    before:
    39688 573 40 40301 9d6d drivers/ata/libata-core.o
    after:
    37820 572 40 38432 9620 drivers/ata/libata-core.o

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     
  • Optimize struct ata_force_param size by:
    - using u8 for cbl and spd_limit fields
    - using u16 for lflags field

    Code size savings on m68k arch using (modified) atari_defconfig:

    text data bss dec hex filename
    before:
    41064 573 40 41677 a2cd drivers/ata/libata-core.o
    after:
    40654 573 40 41267 a133 drivers/ata/libata-core.o

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     
  • There is no point in exposing ncq_enable_prio sysfs attribute for
    devices on PATA and non-NCQ capable SATA hosts so:

    * remove dev_attr_ncq_prio_enable from ata_common_sdev_attrs[]

    * add ata_ncq_sdev_attrs[]

    * update ATA_NCQ_SHT() macro to use ata_ncq_sdev_attrs[]

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     

12 Mar, 2020

1 commit


06 Feb, 2020

1 commit

  • Pull libata updates from Jens Axboe:

    - Add a Sandisk CF card to supported pata_pcmcia list (Christian)

    - Move pata_arasan_cf away from legacy API (Peter)

    - Ensure ahci DMA/ints are shut down on shutdown (Prabhakar)

    * tag 'libata-5.6-2020-02-05' of git://git.kernel.dk/linux-block:
    ata: pata_arasan_cf: Use dma_request_chan() instead dma_request_slave_channel()
    ata: ahci: Add shutdown to freeze hardware resources of ahci
    pata_pcmia: add SanDisk High (>8G) CF card to supported list

    Linus Torvalds
     

30 Jan, 2020

1 commit

  • device_shutdown() called from reboot or power_shutdown expect
    all devices to be shutdown. Same is true for even ahci pci driver.
    As no ahci shutdown function is implemented, the ata subsystem
    always remains alive with DMA & interrupt support. File system
    related calls should not be honored after device_shutdown().

    So defining ahci pci driver shutdown to freeze hardware (mask
    interrupt, stop DMA engine and free DMA resources).

    Signed-off-by: Prabhakar Kushwaha
    Signed-off-by: Jens Axboe

    Prabhakar Kushwaha
     

03 Jan, 2020

1 commit

  • The ata_sas_scsi_ioctl() function implements a number of HDIO_* commands
    for SCSI devices, it is used by all libata drivers as well as a few
    drivers that support SAS attached SATA drives.

    The only command that is not safe for compat ioctls here is
    HDIO_GET_32BIT. Change the implementation to check for in_compat_syscall()
    in order to do both cases correctly, and change all callers to use it
    as both native and compat callback pointers, including the indirect
    callers through sas_ioctl and ata_scsi_ioctl.

    Reviewed-by: Ben Hutchings
    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     

26 Dec, 2019

1 commit

  • ata_qc_complete_multiple() is called with a mask of the still active
    tags.

    mv_sata doesn't have this information directly and instead calculates
    the still active tags from the started tags (ap->qc_active) and the
    finished tags as (ap->qc_active ^ done_mask)

    Since 28361c40368 the hw_tag and tag are no longer the same and the
    equation is no longer valid. In ata_exec_internal_sg() ap->qc_active is
    initialized as 1ULL << ATA_TAG_INTERNAL, but in hardware tag 0 is
    started and this will be in done_mask on completion. ap->qc_active ^
    done_mask becomes 0x100000000 ^ 0x1 = 0x100000001 and thus tag 0 used as
    the internal tag will never be reported as completed.

    This is fixed by introducing ata_qc_get_active() which returns the
    active hardware tags and calling it where appropriate.

    This is tested on mv_sata, but sata_fsl and sata_nv suffer from the same
    problem. There is another case in sata_nv that most likely needs fixing
    as well, but this looks a little different, so I wasn't confident enough
    to change that.

    Fixes: 28361c403683 ("libata: add extra internal command")
    Cc: stable@vger.kernel.org
    Tested-by: Pali Rohár
    Signed-off-by: Sascha Hauer

    Add missing export of ata_qc_get_active(), as per Pali.

    Signed-off-by: Jens Axboe

    Sascha Hauer
     

01 Nov, 2019

2 commits

  • In case a driver wants to return an error from qc_prep, return enum
    ata_completion_errors. sata_mv is one of those drivers -- see the next
    patch. Other drivers return the newly defined AC_ERR_OK.

    [v2] use enum ata_completion_errors and AC_ERR_OK.

    Signed-off-by: Jiri Slaby
    Cc: Jens Axboe
    Cc: linux-ide@vger.kernel.org
    Signed-off-by: Jens Axboe

    Jiri Slaby
     
  • Since we will return enum ata_completion_errors from qc_prep in the next
    patch, let's define AC_ERR_OK to mark the OK status.

    Signed-off-by: Jiri Slaby
    Cc: Jens Axboe
    Cc: linux-ide@vger.kernel.org
    Signed-off-by: Jens Axboe

    Jiri Slaby
     

21 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 or at your option any
    later version this program is distributed in the hope that it will
    be useful but without any warranty without even the implied warranty
    of merchantability or fitness for a particular purpose see the gnu
    general public license for more details you should have received a
    copy of the gnu general public license along with this program see
    the file copying if not write to the free software foundation 675
    mass ave cambridge ma 02139 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 52 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Jilayne Lovejoy
    Reviewed-by: Steve Winslow
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190519154042.342335923@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

09 Feb, 2019

1 commit

  • Clang warns several times in the scsi subsystem (trimmed for brevity):

    drivers/scsi/hpsa.c:6209:7: warning: overflow converting case value to
    switch condition type (2147762695 to 18446744071562347015) [-Wswitch]
    case CCISS_GETBUSTYPES:
    ^
    drivers/scsi/hpsa.c:6208:7: warning: overflow converting case value to
    switch condition type (2147762694 to 18446744071562347014) [-Wswitch]
    case CCISS_GETHEARTBEAT:
    ^

    The root cause is that the _IOC macro can generate really large numbers,
    which don't fit into type 'int', which is used for the cmd parameter in
    the ioctls in scsi_host_template. My research into how GCC and Clang are
    handling this at a low level didn't prove fruitful. However, looking at
    the rest of the kernel tree, all ioctls use an 'unsigned int' for the
    cmd parameter, which will fit all of the _IOC values in the scsi/ata
    subsystems.

    Make that change because none of the ioctls expect a negative value for
    any command, it brings the ioctls inline with the reset of the kernel,
    and it removes ambiguity, which is never good when dealing with compilers.

    Link: https://github.com/ClangBuiltLinux/linux/issues/85
    Link: https://github.com/ClangBuiltLinux/linux/issues/154
    Link: https://github.com/ClangBuiltLinux/linux/issues/157
    Signed-off-by: Nathan Chancellor
    Acked-by: Bradley Grove
    Acked-by: Don Brace
    Reviewed-by: Bart Van Assche
    Tested-by: Nick Desaulniers
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    Nathan Chancellor
     

19 Dec, 2018

1 commit

  • Most SCSI drivers want to enable "clustering", that is merging of
    segments so that they might span more than a single page. Remove the
    ENABLE_CLUSTERING define, and require drivers to explicitly set
    DISABLE_CLUSTERING to disable this feature.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Martin K. Petersen

    Christoph Hellwig
     

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
     

12 Jul, 2018

1 commit

  • ata_sff_data_xfer_noirq() is invoked via the ->sff_data_xfer hook. The
    latter is invoked by ata_pio_sector(), atapi_send_cdb() and
    __atapi_pio_bytes() which in turn is invoked by ata_sff_hsm_move().
    The latter function requires that the "ap->lock" lock is held which
    needs to be taken with disabled interrupts.

    There is no need have to have ata_sff_data_xfer_noirq() which invokes
    ata_sff_data_xfer32() with disabled interrupts because at this point the
    interrupts are already disabled.
    Remove the function and its references to it and replace all callers
    with ata_sff_data_xfer32().

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Tejun Heo

    Sebastian Andrzej Siewior
     

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