15 Oct, 2020

1 commit

  • Pull SCSI updates from James Bottomley:
    "The usual driver updates (ufs, qla2xxx, tcmu, ibmvfc, lpfc, smartpqi,
    hisi_sas, qedi, qedf, mpt3sas) and minor bug fixes.

    There are only three core changes: adding sense codes, cleaning up
    noretry and adding an option for limitless retries"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (226 commits)
    scsi: hisi_sas: Recover PHY state according to the status before reset
    scsi: hisi_sas: Filter out new PHY up events during suspend
    scsi: hisi_sas: Add device link between SCSI devices and hisi_hba
    scsi: hisi_sas: Add check for methods _PS0 and _PR0
    scsi: hisi_sas: Add controller runtime PM support for v3 hw
    scsi: hisi_sas: Switch to new framework to support suspend and resume
    scsi: hisi_sas: Use hisi_hba->cq_nvecs for calling calling synchronize_irq()
    scsi: qedf: Remove redundant assignment to variable 'rc'
    scsi: lpfc: Remove unneeded variable 'status' in lpfc_fcp_cpu_map_store()
    scsi: snic: Convert to use DEFINE_SEQ_ATTRIBUTE macro
    scsi: qla4xxx: Delete unneeded variable 'status' in qla4xxx_process_ddb_changed
    scsi: sun_esp: Use module_platform_driver to simplify the code
    scsi: sun3x_esp: Use module_platform_driver to simplify the code
    scsi: sni_53c710: Use module_platform_driver to simplify the code
    scsi: qlogicpti: Use module_platform_driver to simplify the code
    scsi: mac_esp: Use module_platform_driver to simplify the code
    scsi: jazz_esp: Use module_platform_driver to simplify the code
    scsi: mvumi: Fix error return in mvumi_io_attach()
    scsi: lpfc: Drop nodelist reference on error in lpfc_gen_req()
    scsi: be2iscsi: Fix a theoretical leak in beiscsi_create_eqs()
    ...

    Linus Torvalds
     

23 Sep, 2020

1 commit


16 Sep, 2020

1 commit


10 Sep, 2020

1 commit

  • In sas_notify_lldd_dev_found(), if we can't allocate the necessary
    resources, then it seems like the wrong thing to mark the device as found
    and to increment the reference count. None of the callers ever drop the
    reference in that situation.

    [mkp: tweaked commit desc based on feedback from John]

    Link: https://lore.kernel.org/r/20200905125836.GF183976@mwanda
    Fixes: 735f7d2fedf5 ("[SCSI] libsas: fix domain_device leak")
    Reviewed-by: Jason Yan
    Acked-by: John Garry
    Signed-off-by: Dan Carpenter
    Signed-off-by: Martin K. Petersen

    Dan Carpenter
     

09 Sep, 2020

1 commit

  • Pull SCSI fixes from James Bottomley:
    "Eleven fixes, mostly in drivers or minor fixes in driver related
    infrastructure libraries (target, libfc and libsas).

    Most of the bugs fixed only show up under rare circumstances, the
    exception being the endianness problem in qla2xxx which is used as a
    device on some sparc systems"

    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
    scsi: mpt3sas: Don't call disable_irq from IRQ poll handler
    scsi: megaraid_sas: Don't call disable_irq from process IRQ poll
    scsi: target: iscsi: Fix hang in iscsit_access_np() when getting tpg->np_login_sem
    scsi: libsas: Set data_dir as DMA_NONE if libata marks qc as NODATA
    scsi: target: iscsi: Fix data digest calculation
    scsi: lpfc: Update lpfc version to 12.8.0.4
    scsi: lpfc: Extend the RDF FPIN Registration descriptor for additional events
    scsi: lpfc: Fix FLOGI/PLOGI receive race condition in pt2pt discovery
    scsi: lpfc: Fix setting IRQ affinity with an empty CPU mask
    scsi: qla2xxx: Fix regression on sparc64
    scsi: libfc: Fix for double free()
    scsi: pm8001: Fix memleak in pm8001_exec_internal_task_abort

    Linus Torvalds
     

02 Sep, 2020

1 commit

  • It was discovered that sdparm will fail when attempting to disable write
    cache on a SATA disk connected via libsas.

    In the ATA command set the write cache state is controlled through the SET
    FEATURES operation. This is roughly corresponds to MODE SELECT in SCSI and
    the latter command is what is used in the SCSI-ATA translation layer. A
    subtle difference is that a MODE SELECT carries data whereas SET FEATURES
    is defined as a non-data command in ATA.

    Set the DMA data direction to DMA_NONE if the requested ATA command is
    identified as non-data.

    [mkp: commit desc]

    Fixes: fa1c1e8f1ece ("[SCSI] Add SATA support to libsas")
    Link: https://lore.kernel.org/r/1598426666-54544-1-git-send-email-luojiaxing@huawei.com
    Reviewed-by: John Garry
    Reviewed-by: Jason Yan
    Signed-off-by: Luo Jiaxing
    Signed-off-by: Martin K. Petersen

    Luo Jiaxing
     

24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

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

    Gustavo A. R. Silva
     

25 Jul, 2020

3 commits

  • The variable 'res' is being initialized with a value that is never read and
    it is being updated later with a new value. The initialization is redundant
    and can be removed.

    Link: https://lore.kernel.org/r/20200722154404.959267-1-colin.king@canonical.com
    Reviewed-by: John Garry
    Signed-off-by: Colin Ian King
    Signed-off-by: Martin K. Petersen
    Addresses-Coverity: ("Unused value")

    Colin Ian King
     
  • libata currently attempts to reset even if the SATA disk is unplugged. To
    avoid the meaningless reset of a missing disk, libsas should report offline
    status to libata. libata already provides a .prereset callback for this
    purpose. This is called by ata_eh_reset() and can be used to influence
    whether a reset attempt should be made.

    Add sas_ata_preset callback to check status of phy and disk. If the disk is
    already offline or phy is disabled, we return -ENOENT to libata to avoid
    the reset.

    Link: https://lore.kernel.org/r/1595408643-63011-3-git-send-email-luojiaxing@huawei.com
    Reviewed-by: John Garry
    Reviewed-by: Jason Yan
    Signed-off-by: Luo Jiaxing
    Signed-off-by: Martin K. Petersen

    Luo Jiaxing
     
  • sas_sata_ops uses ata_std_postreset as .postreset callback. However,
    ata_std_postreset() calls sata_scr_read()/sata_scr_write() which need to
    access the ATA SCR register. This register not available in the libsas case
    and the functions always return -EOPNOTSUPP.

    Drop the .postreset callback.

    Link: https://lore.kernel.org/r/1595408643-63011-2-git-send-email-luojiaxing@huawei.com
    Reviewed-by: John Garry
    Reviewed-by: Jason Yan
    Signed-off-by: Luo Jiaxing
    Signed-off-by: Martin K. Petersen

    Luo Jiaxing
     

15 Apr, 2020

1 commit

  • Sparse reports a warning at sas_ata_qc_issue()

    warning: context imbalance in sas_ata_qc_issue() - unexpected unlock
    The root cause is the missing annotation at sas_ata_qc_issue()

    Add the missing __must_hold(ap->lock) annotation

    Link: https://lore.kernel.org/r/20200411001933.10072-7-jbi.octave@gmail.com
    Reviewed-by: John Garry
    Signed-off-by: Jules Irenge
    Signed-off-by: Martin K. Petersen

    Jules Irenge
     

27 Mar, 2020

1 commit

  • There is no reason to expose SATA_PMP config option when no SATA
    host drivers are enabled. To fix it add SATA_HOST config option,
    make all SATA host drivers select it and finally make SATA_PMP
    config options depend on it.

    This also serves as preparation for the future changes which
    optimize libata core code size on PATA only setups.

    CC: "James E.J. Bottomley"
    Reviewed-by: Martin K. Petersen # for SCSI bits
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     

22 Dec, 2019

1 commit

  • Currently we use a mixture of %016llx, %llx, and %16llx when printing a SAS
    address.

    Since the most significant nibble of the SAS address is always 5 - as per
    standard - this formatting is not so important; but some fake SAS addresses
    for SATA devices may not be. And we have mangled/invalid address to
    consider also. And it's better to be consistent in the code, so use a fixed
    format.

    The SAS address is a fixed size at 64b, so we want to 0 byte extend to 16
    nibbles, so use %016llx globally.

    Also make some prints to be explicitly hex, and tidy some whitespace issue.

    Link: https://lore.kernel.org/r/1576758957-227350-1-git-send-email-john.garry@huawei.com
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    John Garry
     

10 Dec, 2019

1 commit

  • The discovering of sas port is driven by workqueue in libsas. When libsas
    is processing port events or phy events in workqueue, new events may rise
    up and change the state of some structures such as asd_sas_phy. This may
    cause some problems such as follows:

    ==>thread 1 ==>thread 2

    ==>phy up
    ==>phy_up_v3_hw()
    ==>oob_mode = SATA_OOB_MODE;
    ==>phy down quickly
    ==>hisi_sas_phy_down()
    ==>sas_ha->notify_phy_event()
    ==>sas_phy_disconnected()
    ==>oob_mode = OOB_NOT_CONNECTED
    ==>workqueue wakeup
    ==>sas_form_port()
    ==>sas_discover_domain()
    ==>sas_get_port_device()
    ==>oob_mode is OOB_NOT_CONNECTED and device
    is wrongly taken as expander

    This at last lead to the panic when libsas trying to issue a command to
    discover the device.

    [183047.614035] Unable to handle kernel NULL pointer dereference at
    virtual address 0000000000000058
    [183047.622896] Mem abort info:
    [183047.625762] ESR = 0x96000004
    [183047.628893] Exception class = DABT (current EL), IL = 32 bits
    [183047.634888] SET = 0, FnV = 0
    [183047.638015] EA = 0, S1PTW = 0
    [183047.641232] Data abort info:
    [183047.644189] ISV = 0, ISS = 0x00000004
    [183047.648100] CM = 0, WnR = 0
    [183047.651145] user pgtable: 4k pages, 48-bit VAs, pgdp =
    00000000b7df67be
    [183047.657834] [0000000000000058] pgd=0000000000000000
    [183047.662789] Internal error: Oops: 96000004 [#1] SMP
    [183047.667740] Process kworker/u16:2 (pid: 31291, stack limit =
    0x00000000417c4974)
    [183047.675208] CPU: 0 PID: 3291 Comm: kworker/u16:2 Tainted: G
    W OE 4.19.36-vhulk1907.1.0.h410.eulerosv2r8.aarch64 #1
    [183047.687015] Hardware name: N/A N/A/Kunpeng Desktop Board D920S10,
    BIOS 0.15 10/22/2019
    [183047.695007] Workqueue: 0000:74:02.0_disco_q sas_discover_domain
    [183047.700999] pstate: 20c00009 (nzCv daif +PAN +UAO)
    [183047.705864] pc : prep_ata_v3_hw+0xf8/0x230 [hisi_sas_v3_hw]
    [183047.711510] lr : prep_ata_v3_hw+0xb0/0x230 [hisi_sas_v3_hw]
    [183047.717153] sp : ffff00000f28ba60
    [183047.720541] x29: ffff00000f28ba60 x28: ffff8026852d7228
    [183047.725925] x27: ffff8027dba3e0a8 x26: ffff8027c05fc200
    [183047.731310] x25: 0000000000000000 x24: ffff8026bafa8dc0
    [183047.736695] x23: ffff8027c05fc218 x22: ffff8026852d7228
    [183047.742079] x21: ffff80007c2f2940 x20: ffff8027c05fc200
    [183047.747464] x19: 0000000000f80800 x18: 0000000000000010
    [183047.752848] x17: 0000000000000000 x16: 0000000000000000
    [183047.758232] x15: ffff000089a5a4ff x14: 0000000000000005
    [183047.763617] x13: ffff000009a5a50e x12: ffff8026bafa1e20
    [183047.769001] x11: ffff0000087453b8 x10: ffff00000f28b870
    [183047.774385] x9 : 0000000000000000 x8 : ffff80007e58f9b0
    [183047.779770] x7 : 0000000000000000 x6 : 000000000000003f
    [183047.785154] x5 : 0000000000000040 x4 : ffffffffffffffe0
    [183047.790538] x3 : 00000000000000f8 x2 : 0000000002000007
    [183047.795922] x1 : 0000000000000008 x0 : 0000000000000000
    [183047.801307] Call trace:
    [183047.803827] prep_ata_v3_hw+0xf8/0x230 [hisi_sas_v3_hw]
    [183047.809127] hisi_sas_task_prep+0x750/0x888 [hisi_sas_main]
    [183047.814773] hisi_sas_task_exec.isra.7+0x88/0x1f0 [hisi_sas_main]
    [183047.820939] hisi_sas_queue_command+0x28/0x38 [hisi_sas_main]
    [183047.826757] smp_execute_task_sg+0xec/0x218
    [183047.831013] smp_execute_task+0x74/0xa0
    [183047.834921] sas_discover_expander.part.7+0x9c/0x5f8
    [183047.839959] sas_discover_root_expander+0x90/0x160
    [183047.844822] sas_discover_domain+0x1b8/0x1e8
    [183047.849164] process_one_work+0x1b4/0x3f8
    [183047.853246] worker_thread+0x54/0x470
    [183047.856981] kthread+0x134/0x138
    [183047.860283] ret_from_fork+0x10/0x18
    [183047.863931] Code: f9407a80 528000e2 39409281 72a04002 (b9405800)
    [183047.870097] kernel fault(0x1) notification starting on CPU 0
    [183047.875828] kernel fault(0x1) notification finished on CPU 0
    [183047.881559] Modules linked in: unibsp(OE) hns3(OE) hclge(OE)
    hnae3(OE) mem_drv(OE) hisi_sas_v3_hw(OE) hisi_sas_main(OE)
    [183047.892418] ---[ end trace 4cc26083fc11b783 ]---
    [183047.897107] Kernel panic - not syncing: Fatal exception
    [183047.902403] kernel fault(0x5) notification starting on CPU 0
    [183047.908134] kernel fault(0x5) notification finished on CPU 0
    [183047.913865] SMP: stopping secondary CPUs
    [183047.917861] Kernel Offset: disabled
    [183047.921422] CPU features: 0x2,a2a00a38
    [183047.925243] Memory Limit: none
    [183047.928372] kernel reboot(0x2) notification starting on CPU 0
    [183047.934190] kernel reboot(0x2) notification finished on CPU 0
    [183047.940008] ---[ end Kernel panic - not syncing: Fatal exception
    ]---

    Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver")
    Link: https://lore.kernel.org/r/20191206011118.46909-1-yanaijie@huawei.com
    Reported-by: Gao Chuan
    Reviewed-by: John Garry
    Signed-off-by: Jason Yan
    Signed-off-by: Martin K. Petersen

    Jason Yan
     

21 Aug, 2019

1 commit

  • Mark switch cases where we are expecting to fall through.

    Fix the following warning (Building: mtx1_defconfig mips):

    drivers/scsi/libsas/sas_discover.c: In function ‘sas_discover_domain’:
    ./include/linux/printk.h:309:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
    printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/scsi/libsas/sas_discover.c:459:3: note: in expansion of macro ‘pr_notice’
    pr_notice("ATA device seen but CONFIG_SCSI_SAS_ATA=N so cannot attach\n");
    ^~~~~~~~~
    drivers/scsi/libsas/sas_discover.c:462:2: note: here
    default:
    ^~~~~~~

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

    Gustavo A. R. Silva
     

21 Jul, 2019

1 commit

  • Pull SCSI fixes from James Bottomley:
    "This is the final round of mostly small fixes in our initial submit.

    It's mostly minor fixes and driver updates. The only change of note is
    adding a virt_boundary_mask to the SCSI host and host template to
    parametrise this for NVMe devices instead of having them do a call in
    slave_alloc. It's a fairly straightforward conversion except in the
    two NVMe handling drivers that didn't set it who now have a virtual
    infinity parameter added"

    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (24 commits)
    scsi: megaraid_sas: set an unlimited max_segment_size
    scsi: mpt3sas: set an unlimited max_segment_size for SAS 3.0 HBAs
    scsi: IB/srp: set virt_boundary_mask in the scsi host
    scsi: IB/iser: set virt_boundary_mask in the scsi host
    scsi: storvsc: set virt_boundary_mask in the scsi host template
    scsi: ufshcd: set max_segment_size in the scsi host template
    scsi: core: take the DMA max mapping size into account
    scsi: core: add a host / host template field for the virt boundary
    scsi: core: Fix race on creating sense cache
    scsi: sd_zbc: Fix compilation warning
    scsi: libfc: fix null pointer dereference on a null lport
    scsi: zfcp: fix GCC compiler warning emitted with -Wmaybe-uninitialized
    scsi: zfcp: fix request object use-after-free in send path causing wrong traces
    scsi: zfcp: fix request object use-after-free in send path causing seqno errors
    scsi: megaraid_sas: Update driver version to 07.710.50.00
    scsi: megaraid_sas: Add module parameter for FW Async event logging
    scsi: megaraid_sas: Enable msix_load_balance for Invader and later controllers
    scsi: megaraid_sas: Fix calculation of target ID
    scsi: lpfc: reduce stack size with CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE
    scsi: devinfo: BLIST_TRY_VPD_PAGES for SanDisk Cruzer Blade
    ...

    Linus Torvalds
     

12 Jul, 2019

2 commits

  • The function sas_wait_eh is declared static and marked EXPORT_SYMBOL, which
    is at best an odd combination. Because the function is not used outside of
    the drivers/scsi/libsas/sas_scsi_host.c file it is defined in, this commit
    removes the EXPORT_SYMBOL() marking.

    Signed-off-by: Denis Efremov
    Reviewed-by: Jason Yan
    Signed-off-by: Martin K. Petersen

    Denis Efremov
     
  • Pull SCSI updates from James Bottomley:
    "This is mostly update of the usual drivers: qla2xxx, hpsa, lpfc, ufs,
    mpt3sas, ibmvscsi, megaraid_sas, bnx2fc and hisi_sas as well as the
    removal of the osst driver (I heard from Willem privately that he
    would like the driver removed because all his test hardware has
    failed). Plus number of minor changes, spelling fixes and other
    trivia.

    The big merge conflict this time around is the SPDX licence tags.
    Following discussion on linux-next, we believe our version to be more
    accurate than the one in the tree, so the resolution is to take our
    version for all the SPDX conflicts"

    Note on the SPDX license tag conversion conflicts: the SCSI tree had
    done its own SPDX conversion, which in some cases conflicted with the
    treewide ones done by Thomas & co.

    In almost all cases, the conflicts were purely syntactic: the SCSI tree
    used the old-style SPDX tags ("GPL-2.0" and "GPL-2.0+") while the
    treewide conversion had used the new-style ones ("GPL-2.0-only" and
    "GPL-2.0-or-later").

    In these cases I picked the new-style one.

    In a few cases, the SPDX conversion was actually different, though. As
    explained by James above, and in more detail in a pre-pull-request
    thread:

    "The other problem is actually substantive: In the libsas code Luben
    Tuikov originally specified gpl 2.0 only by dint of stating:

    * This file is licensed under GPLv2.

    In all the libsas files, but then muddied the water by quoting GPLv2
    verbatim (which includes the or later than language). So for these
    files Christoph did the conversion to v2 only SPDX tags and Thomas
    converted to v2 or later tags"

    So in those cases, where the spdx tag substantially mattered, I took the
    SCSI tree conversion of it, but then also took the opportunity to turn
    the old-style "GPL-2.0" into a new-style "GPL-2.0-only" tag.

    Similarly, when there were whitespace differences or other differences
    to the comments around the copyright notices, I took the version from
    the SCSI tree as being the more specific conversion.

    Finally, in the spdx conversions that had no conflicts (because the
    treewide ones hadn't been done for those files), I just took the SCSI
    tree version as-is, even if it was old-style. The old-style conversions
    are perfectly valid, even if the "-only" and "-or-later" versions are
    perhaps more descriptive.

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (185 commits)
    scsi: qla2xxx: move IO flush to the front of NVME rport unregistration
    scsi: qla2xxx: Fix NVME cmd and LS cmd timeout race condition
    scsi: qla2xxx: on session delete, return nvme cmd
    scsi: qla2xxx: Fix kernel crash after disconnecting NVMe devices
    scsi: megaraid_sas: Update driver version to 07.710.06.00-rc1
    scsi: megaraid_sas: Introduce various Aero performance modes
    scsi: megaraid_sas: Use high IOPS queues based on IO workload
    scsi: megaraid_sas: Set affinity for high IOPS reply queues
    scsi: megaraid_sas: Enable coalescing for high IOPS queues
    scsi: megaraid_sas: Add support for High IOPS queues
    scsi: megaraid_sas: Add support for MPI toolbox commands
    scsi: megaraid_sas: Offload Aero RAID5/6 division calculations to driver
    scsi: megaraid_sas: RAID1 PCI bandwidth limit algorithm is applicable for only Ventura
    scsi: megaraid_sas: megaraid_sas: Add check for count returned by HOST_DEVICE_LIST DCMD
    scsi: megaraid_sas: Handle sequence JBOD map failure at driver level
    scsi: megaraid_sas: Don't send FPIO to RL Bypass queue
    scsi: megaraid_sas: In probe context, retry IOC INIT once if firmware is in fault
    scsi: megaraid_sas: Release Mutex lock before OCR in case of DCMD timeout
    scsi: megaraid_sas: Call disable_irq from process IRQ poll
    scsi: megaraid_sas: Remove few debug counters from IO path
    ...

    Linus Torvalds
     

21 Jun, 2019

1 commit


19 Jun, 2019

1 commit

  • Since we are processing events synchronously now, the second call of
    sas_ex_join_wide_port() in sas_ex_discover_dev() is not needed. There will
    be no races with other works in disco workqueue. So remove the second
    sas_ex_join_wide_port().

    I did not change the return value of 'res' to error when discover failed
    because we need to continue to discover other phys if one phy discover
    failed. So let's keep that logic as before and just add a debug log to
    detect the failure. And directly return if second fanout expander attatched
    to the parent expander because it has nothing to do after the phy is
    disabled.

    Signed-off-by: Jason Yan
    Reviewed-by: John Garry
    Signed-off-by: Martin K. Petersen

    Jason Yan
     

05 Jun, 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 version 2

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

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

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531081036.435762997@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

03 Jun, 2019

1 commit

  • Pull SCSI fixes from James Bottomley:
    "Six minor fixes to device drivers and one to the multipath alua
    handler.

    The most extensive fix is the zfcp port remove prevention one, but
    it's impact is only s390"

    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
    scsi: libsas: delete sas port if expander discover failed
    scsi: libsas: only clear phy->in_shutdown after shutdown event done
    scsi: scsi_dh_alua: Fix possible null-ptr-deref
    scsi: smartpqi: properly set both the DMA mask and the coherent DMA mask
    scsi: zfcp: fix to prevent port_remove with pure auto scan LUNs (only sdevs)
    scsi: zfcp: fix missing zfcp_port reference put on -EBUSY from port_remove
    scsi: libcxgbi: add a check for NULL pointer in cxgbi_check_route()

    Linus Torvalds
     

31 May, 2019

2 commits

  • 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 version 2 of the license 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 if not write to the free
    software foundation inc 59 temple place suite 330 boston ma 02111
    1307 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

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

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Richard Fontana
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070034.021731668@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • 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 of the license 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 if not write to the free software foundation inc
    59 temple place suite 330 boston ma 02111 1307 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 1334 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

30 May, 2019

2 commits

  • The sas_port(phy->port) allocated in sas_ex_discover_expander() will not be
    deleted when the expander failed to discover. This will cause resource leak
    and a further issue of kernel BUG like below:

    [159785.843156] port-2:17:29: trying to add phy phy-2:17:29 fails: it's
    already part of another port
    [159785.852144] ------------[ cut here ]------------
    [159785.856833] kernel BUG at drivers/scsi/scsi_transport_sas.c:1086!
    [159785.863000] Internal error: Oops - BUG: 0 [#1] SMP
    [159785.867866] CPU: 39 PID: 16993 Comm: kworker/u96:2 Tainted: G
    W OE 4.19.25-vhulk1901.1.0.h111.aarch64 #1
    [159785.878458] Hardware name: Huawei Technologies Co., Ltd.
    Hi1620EVBCS/Hi1620EVBCS, BIOS Hi1620 CS B070 1P TA 03/21/2019
    [159785.889231] Workqueue: 0000:74:02.0_disco_q sas_discover_domain
    [159785.895224] pstate: 40c00009 (nZcv daif +PAN +UAO)
    [159785.900094] pc : sas_port_add_phy+0x188/0x1b8
    [159785.904524] lr : sas_port_add_phy+0x188/0x1b8
    [159785.908952] sp : ffff0001120e3b80
    [159785.912341] x29: ffff0001120e3b80 x28: 0000000000000000
    [159785.917727] x27: ffff802ade8f5400 x26: ffff0000681b7560
    [159785.923111] x25: ffff802adf11a800 x24: ffff0000680e8000
    [159785.928496] x23: ffff802ade8f5728 x22: ffff802ade8f5708
    [159785.933880] x21: ffff802adea2db40 x20: ffff802ade8f5400
    [159785.939264] x19: ffff802adea2d800 x18: 0000000000000010
    [159785.944649] x17: 00000000821bf734 x16: ffff00006714faa0
    [159785.950033] x15: ffff0000e8ab4ecf x14: 7261702079646165
    [159785.955417] x13: 726c612073277469 x12: ffff00006887b830
    [159785.960802] x11: ffff00006773eaa0 x10: 7968702079687020
    [159785.966186] x9 : 0000000000002453 x8 : 726f702072656874
    [159785.971570] x7 : 6f6e6120666f2074 x6 : ffff802bcfb21290
    [159785.976955] x5 : ffff802bcfb21290 x4 : 0000000000000000
    [159785.982339] x3 : ffff802bcfb298c8 x2 : 337752b234c2ab00
    [159785.987723] x1 : 337752b234c2ab00 x0 : 0000000000000000
    [159785.993108] Process kworker/u96:2 (pid: 16993, stack limit =
    0x0000000072dae094)
    [159786.000576] Call trace:
    [159786.003097] sas_port_add_phy+0x188/0x1b8
    [159786.007179] sas_ex_get_linkrate.isra.5+0x134/0x140
    [159786.012130] sas_ex_discover_expander+0x128/0x408
    [159786.016906] sas_ex_discover_dev+0x218/0x4c8
    [159786.021249] sas_ex_discover_devices+0x9c/0x1a8
    [159786.025852] sas_discover_root_expander+0x134/0x160
    [159786.030802] sas_discover_domain+0x1b8/0x1e8
    [159786.035148] process_one_work+0x1b4/0x3f8
    [159786.039230] worker_thread+0x54/0x470
    [159786.042967] kthread+0x134/0x138
    [159786.046269] ret_from_fork+0x10/0x18
    [159786.049918] Code: 91322300 f0004402 91178042 97fe4c9b (d4210000)
    [159786.056083] Modules linked in: hns3_enet_ut(OE) hclge(OE) hnae3(OE)
    hisi_sas_test_hw(OE) hisi_sas_test_main(OE) serdes(OE)
    [159786.067202] ---[ end trace 03622b9e2d99e196 ]---
    [159786.071893] Kernel panic - not syncing: Fatal exception
    [159786.077190] SMP: stopping secondary CPUs
    [159786.081192] Kernel Offset: disabled
    [159786.084753] CPU features: 0x2,a2a00a38

    Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver")
    Reported-by: Jian Luo
    Signed-off-by: Jason Yan
    CC: John Garry
    Signed-off-by: Martin K. Petersen

    Jason Yan
     
  • When the event queue is full of phy up and down events and reached the
    threshold, we will queue a shutdown-event, and set phy->in_shutdown so that
    we will not queue a shutdown-event again. But before the shutdown-event can
    be executed, every phy-down event will clear
    phy->in_shutdown and a new shutdown-event will be queued. The queue will
    be full of these shutdown-events.

    Fix this by only clear phy->in_shutdown in sas_phye_shutdown(), that is
    after the first shutdown-event has been executed.

    Fixes: f12486e06ae8 ("scsi: libsas: shut down the PHY if events reached the threshold")
    Signed-off-by: Jason Yan
    CC: John Garry
    CC: Johannes Thumshirn
    CC: Ewan Milne
    CC: Christoph Hellwig
    CC: Tomas Henzl
    CC: Dan Williams
    CC: Hannes Reinecke
    Reviewed-by: John Garry
    Signed-off-by: Martin K. Petersen

    Jason Yan
     

24 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this file is licensed under gplv2 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 of the license 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 if
    not write to the free software foundation inc 59 temple place suite
    330 boston ma 02111 1307 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 5 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190520071858.561902672@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

4 commits


16 Apr, 2019

6 commits

  • Currently we print expander PHY indexes in a mix of decimal and hex.

    It is more consistent and also more convenient to read decimal, so
    make this change.

    We use width of 2 for expander and 1 for root PHYs prints.

    Some lines which were needlessly spilling multiple lines are unified.

    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    John Garry
     
  • When we discover the PHY is empty in sas_rediscover_dev(), the PHY
    information (like negotiated linkrate) is not updated.

    As such, for a user examining sysfs for that PHY, they would see
    incorrect values:

    root@(none)$ cd /sys/class/sas_phy/phy-0:0:20
    root@(none)$ more negotiated_linkrate
    3.0 Gbit
    root@(none)$ echo 0 > enable
    root@(none)$ more negotiated_linkrate
    3.0 Gbit

    So fix this, simply discover the PHY again, even though we know it's empty;
    in the above example, this gives us:

    root@(none)$ more negotiated_linkrate
    Phy disabled

    We must do this after unregistering the device associated with the PHY
    (in sas_unregister_devs_sas_addr()).

    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    John Garry
     
  • According to the SAS spec, an expander device shall transmit BROADCAST
    (CHANGE) from at least one phy in each expander port other than the
    expander port that is the cause for transmitting BROADCAST (CHANGE).

    As such, for when the link is lost for a root PHY attached to an expander
    PHY, we get no broadcast event.

    This causes an issue for libsas, in that we will not revalidate the domain
    for these events.

    As a solution, for when a root PHY is formed or deformed from a root port,
    insert a broadcast event to trigger a domain revalidation.

    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    John Garry
     
  • When an expander PHY which was part of a wideport disconnects, we would see
    a log like this from sas_rediscover():

    [ 39.695554] sas: phy20 part of wide port with phy16

    Here, phy20 is the PHY that disconnected, and phy16 is the lowest indexed
    member PHY of the wideport.

    The log implies the phy20 is still part of the wideport with phy16, so is
    misleading or, at least, vague.

    Improve the logs in SAS rediscovery by removing this log and adding a log
    in sas_rediscover_dev() to tell what's really going on.

    While we're at it, also make the logs in sas_find_bcast_dev() more
    informative (and more consistent with the reset of the expander logs).

    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    John Garry
     
  • Currently for fixing the linkrate matching during discovery such that the
    linkrate of a SATA PHY does not exceed min pathway to initiator, we set the
    SATA PHY programmed min linkrate to the same value as the programmed max
    linkrate.

    This is unnecessary, and we should be able to keep the same programmed min
    linkrate if it is already lower than this new max programmed linkrate.

    This patch makes that change.

    In effect, this will not make much difference since we generally will
    negotiate a linkrate at the programmed max linkrate, and the programmed min
    linkrate will have no impact.

    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    John Garry
     
  • Many times we use 8 for SAS address length, while we already have a macro
    for this - SAS_ADDR_SIZE.

    Replace instances of this with the macro. However, don't touch the SAS
    address array sizes sas.h, as these are defined according to the SAS spec.

    Some missing whitespaces are also added, and whitespace indentation
    in sas_hash_addr() is also fixed (see sas_hash_addr()).

    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen

    John Garry
     

10 Mar, 2019

1 commit

  • Pull SCSI updates from James Bottomley:
    "This is mostly update of the usual drivers: arcmsr, qla2xxx, lpfc,
    hisi_sas, target/iscsi and target/core.

    Additionally Christoph refactored gdth as part of the dma changes. The
    major mid-layer change this time is the removal of bidi commands and
    with them the whole of the osd/exofs driver and filesystem. This is a
    major simplification for block and mq in particular"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (240 commits)
    scsi: cxgb4i: validate tcp sequence number only if chip version pf
    scsi: core: replace GFP_ATOMIC with GFP_KERNEL in scsi_scan.c
    scsi: mpt3sas: Add missing breaks in switch statements
    scsi: aacraid: Fix missing break in switch statement
    scsi: kill command serial number
    scsi: csiostor: drop serial_number usage
    scsi: mvumi: use request tag instead of serial_number
    scsi: dpt_i2o: remove serial number usage
    scsi: st: osst: Remove negative constant left-shifts
    scsi: ufs-bsg: Allow reading descriptors
    scsi: ufs: Allow reading descriptor via raw upiu
    scsi: ufs-bsg: Change the calling convention for write descriptor
    scsi: ufs: Remove unused device quirks
    Revert "scsi: ufs: disable vccq if it's not needed by UFS device"
    scsi: megaraid_sas: Remove a bunch of set but not used variables
    scsi: clean obsolete return values of eh_timed_out
    scsi: sd: Optimal I/O size should be a multiple of physical block size
    scsi: MAINTAINERS: SCSI initiator and target tweaks
    scsi: fcoe: make use of fip_mode enum complete
    ...

    Linus Torvalds
     

16 Feb, 2019

1 commit

  • The sysfs phy_identifier attribute for a sas_end_device comes from the rphy
    phy_identifier value.

    Currently this is not being set for rphys with an end device attached, so
    we see incorrect symlinks from systemd disk/by-path:

    root@localhost:~# ls -l /dev/disk/by-path/
    total 0
    lrwxrwxrwx 1 root root 9 Feb 13 12:26 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy0-lun-0 -> ../../sdb
    lrwxrwxrwx 1 root root 10 Feb 13 12:26 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy0-lun-0-part1 -> ../../sdb1
    lrwxrwxrwx 1 root root 10 Feb 13 12:26 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy0-lun-0-part2 -> ../../sdb2
    lrwxrwxrwx 1 root root 10 Feb 13 12:26 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy0-lun-0-part3 -> ../../sdc3

    Indeed, each sas_end_device phy_identifier value is 0:

    root@localhost:/# more sys/class/sas_device/end_device-0\:0\:2/phy_identifier
    0
    root@localhost:/# more sys/class/sas_device/end_device-0\:0\:10/phy_identifier
    0

    This patch fixes the discovery code to set the phy_identifier. With this,
    we now get proper symlinks:

    root@localhost:~# ls -l /dev/disk/by-path/
    total 0
    lrwxrwxrwx 1 root root 9 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy10-lun-0 -> ../../sdg
    lrwxrwxrwx 1 root root 9 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy11-lun-0 -> ../../sdh
    lrwxrwxrwx 1 root root 9 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy2-lun-0 -> ../../sda
    lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy2-lun-0-part1 -> ../../sda1
    lrwxrwxrwx 1 root root 9 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy3-lun-0 -> ../../sdb
    lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy3-lun-0-part1 -> ../../sdb1
    lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy3-lun-0-part2 -> ../../sdb2
    lrwxrwxrwx 1 root root 9 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy4-lun-0 -> ../../sdc
    lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy4-lun-0-part1 -> ../../sdc1
    lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy4-lun-0-part2 -> ../../sdc2
    lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy4-lun-0-part3 -> ../../sdc3
    lrwxrwxrwx 1 root root 9 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy5-lun-0 -> ../../sdd
    lrwxrwxrwx 1 root root 9 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy7-lun-0 -> ../../sde
    lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy7-lun-0-part1 -> ../../sde1
    lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy7-lun-0-part2 -> ../../sde2
    lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy7-lun-0-part3 -> ../../sde3
    lrwxrwxrwx 1 root root 9 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy8-lun-0 -> ../../sdf
    lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy8-lun-0-part1 -> ../../sdf1
    lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy8-lun-0-part2 -> ../../sdf2
    lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy8-lun-0-part3 -> ../../sdf3

    Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver")
    Reported-by: dann frazier
    Signed-off-by: John Garry
    Reviewed-by: Jason Yan
    Tested-by: dann frazier
    Signed-off-by: Martin K. Petersen

    John Garry
     

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