20 Jan, 2021

6 commits

  • This is the 5.10.9 stable release

    * tag 'v5.10.9': (153 commits)
    Linux 5.10.9
    netfilter: nf_nat: Fix memleak in nf_nat_init
    netfilter: conntrack: fix reading nf_conntrack_buckets
    ...

    Signed-off-by: Jason Liu

    Jason Liu
     
  • This is the 5.10.8 stable release

    * tag 'v5.10.8': (104 commits)
    Linux 5.10.8
    tools headers UAPI: Sync linux/fscrypt.h with the kernel sources
    drm/panfrost: Remove unused variables in panfrost_job_close()
    ...

    Signed-off-by: Jason Liu

    Jason Liu
     
  • This is the 5.10.7 stable release

    * tag 'v5.10.7': (144 commits)
    Linux 5.10.7
    scsi: target: Fix XCOPY NAA identifier lookup
    rtlwifi: rise completion at the last step of firmware callback
    ...

    Signed-off-by: Jason Liu

    Jason Liu
     
  • This is the 5.10.6 stable release

    * tag 'v5.10.6': (21 commits)
    Linux 5.10.6
    mwifiex: Fix possible buffer overflows in mwifiex_cmd_802_11_ad_hoc_start
    exec: Transform exec_update_mutex into a rw_semaphore
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    drivers/rtc/rtc-pcf2127.c

    Jason Liu
     
  • This is the 5.10.5 stable release

    * tag 'v5.10.5': (63 commits)
    Linux 5.10.5
    device-dax: Fix range release
    ext4: avoid s_mb_prefetch to be zero in individual scenarios
    ...

    Signed-off-by: Jason Liu

    Jason Liu
     
  • commit 1d53864c3617f5235f891ca0fbe9347c4cd35d46 upstream.

    Currently if device needs to do flush or BKOP operations, the device VCC
    power is kept during runtime-suspend period.

    However, if system suspend is happening while device is runtime-suspended,
    such power may not be disabled successfully.

    The reasons may be,

    1. If current PM level is the same as SPM level, device will keep
    runtime-suspended by ufshcd_system_suspend().

    2. Flush recheck work may not be scheduled successfully during system
    suspend period. If it can wake up the system, this is also not the
    intention of the recheck work.

    To fix this issue, simply runtime-resume the device if the flush is allowed
    during runtime suspend period. Flush capability will be disabled while
    leaving runtime suspend, and also not be allowed in system suspend period.

    Link: https://lore.kernel.org/r/20201222072905.32221-2-stanley.chu@mediatek.com
    Fixes: 51dd905bd2f6 ("scsi: ufs: Fix WriteBooster flush during runtime suspend")
    Reviewed-by: Chaotian Jing
    Reviewed-by: Can Guo
    Signed-off-by: Stanley Chu
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    Stanley Chu
     

17 Jan, 2021

2 commits

  • commit 6998ff4e21619d47ebf4f5eb4cafa65c65856221 upstream.

    Remove vport variable that is assigned but not used in
    lpfc_sli4_abts_err_handler().

    Link: https://lore.kernel.org/r/20201119203407.121913-1-james.smart@broadcom.com
    Fixes: e7dab164a9aa ("scsi: lpfc: Fix scheduling call while in softirq context in lpfc_unreg_rpi")
    Reported-by: kernel test robot
    Signed-off-by: James Smart
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    James Smart
     
  • [ Upstream commit 4c60244dc37262023d24b167e245055c06bc0b77 ]

    clang complains about a possible code path in which a variable is used
    without an initialization:

    drivers/scsi/ufs/ufshcd.c:7690:3: error: variable 'sdp' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
    BUG_ON(1);
    ^~~~~~~~~
    include/asm-generic/bug.h:63:36: note: expanded from macro 'BUG_ON'
    #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
    ^~~~~~~~~~~~~~~~~~~

    Turn the BUG_ON(1) into an unconditional BUG() that makes it clear to clang
    that this code path is never hit.

    Link: https://lore.kernel.org/r/20201203223137.1205933-1-arnd@kernel.org
    Fixes: 4f3e900b6282 ("scsi: ufs: Clear UAC for FFU and RPMB LUNs")
    Reviewed-by: Avri Altman
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Arnd Bergmann
     

13 Jan, 2021

8 commits

  • [ Upstream commit 4f3e900b628226011a5f71c19e53b175c014eb58 ]

    In order to conduct FFU or RPMB operations, UFS needs to clear UNIT
    ATTENTION condition. Clear it explicitly so that we get no failures during
    initialization.

    Link: https://lore.kernel.org/r/20201117165839.1643377-4-jaegeuk@kernel.org
    Signed-off-by: Jaegeuk Kim
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Jaegeuk Kim
     
  • [ Upstream commit e6044f714b256259df9611ff49af433e5411c5c8 ]

    Instead of submitting all SCSI commands submitted with scsi_execute() to a
    SCSI device if rpm_status != RPM_ACTIVE, only submit RQF_PM (power
    management requests) if rpm_status != RPM_ACTIVE. This patch makes the SCSI
    core handle the runtime power management status (rpm_status) as it should
    be handled.

    Link: https://lore.kernel.org/r/20201209052951.16136-7-bvanassche@acm.org
    Cc: Can Guo
    Cc: Stanley Chu
    Cc: Alan Stern
    Cc: Ming Lei
    Cc: Rafael J. Wysocki
    Cc: Martin Kepplinger
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Jens Axboe
    Reviewed-by: Can Guo
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Bart Van Assche
     
  • [ Upstream commit cfefd9f8240a7b9fdd96fcd54cb029870b6d8d88 ]

    Disable runtime power management during domain validation. Since a later
    patch removes RQF_PREEMPT, set RQF_PM for domain validation commands such
    that these are executed in the quiesced SCSI device state.

    Link: https://lore.kernel.org/r/20201209052951.16136-6-bvanassche@acm.org
    Cc: Alan Stern
    Cc: James Bottomley
    Cc: Woody Suwalski
    Cc: Can Guo
    Cc: Stanley Chu
    Cc: Ming Lei
    Cc: Rafael J. Wysocki
    Cc: Stan Johnson
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Jens Axboe
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Bart Van Assche
     
  • [ Upstream commit dd78bdb6f810bdcb173b42379af558c676c8e0aa ]

    Enable runtime PM auto-suspend by default for Intel host controllers.

    Link: https://lore.kernel.org/r/20201207083120.26732-5-adrian.hunter@intel.com
    Signed-off-by: Adrian Hunter
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Adrian Hunter
     
  • [ Upstream commit 044d5bda7117891d6d0d56f2f807b7b11e120abd ]

    Intel controllers can end up in an unrecoverable state after a hibernate
    exit error unless a full reset and restore is done before anything else.
    Force that to happen.

    Link: https://lore.kernel.org/r/20201207083120.26732-4-adrian.hunter@intel.com
    Signed-off-by: Adrian Hunter
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Adrian Hunter
     
  • [ Upstream commit af423534d2de86cd0db729a5ac41f056ca8717de ]

    The expectation for suspend-to-disk is that devices will be powered-off, so
    the UFS device should be put in PowerDown mode. If spm_lvl is not 5, then
    that will not happen. Change the pm callbacks to force spm_lvl 5 for
    suspend-to-disk poweroff.

    Link: https://lore.kernel.org/r/20201207083120.26732-3-adrian.hunter@intel.com
    Signed-off-by: Adrian Hunter
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Adrian Hunter
     
  • [ Upstream commit c763729a10e538d997744317cf4a1c4f25266066 ]

    Currently, ufshcd-pci is the only UFS driver with support for
    suspend-to-disk PM callbacks (i.e. freeze/thaw/restore/poweroff). These
    callbacks are set by the macro SET_SYSTEM_SLEEP_PM_OPS to the same
    functions as system suspend/resume. That will work with spm_lvl 5 because
    spm_lvl 5 will result in a full restore for the ->restore() callback. In
    the absence of a full restore, the host controller registers will have
    values set up by the restore kernel (the kernel that boots and loads the
    restore image) which are not necessarily the same. However it turns out,
    the only registers that sometimes need restore are the base address
    registers. This has gone un-noticed because, depending on IOMMU settings,
    the kernel can end up allocating the same addresses every time.

    For Intel controllers, an spm_lvl other than 5 can be used, so to support
    S4 (suspend-to-disk) with spm_lvl other than 5, restore the base address
    registers.

    Link: https://lore.kernel.org/r/20201207083120.26732-2-adrian.hunter@intel.com
    Signed-off-by: Adrian Hunter
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Adrian Hunter
     
  • [ Upstream commit 1fa0570002e3f66db9b58c32c60de4183b857a19 ]

    Change dev_err() print message from "dme-reset" to "dme_enable" in function
    ufshcd_dme_enable().

    Link: https://lore.kernel.org/r/20201207190137.6858-3-huobean@gmail.com
    Acked-by: Alim Akhtar
    Acked-by: Avri Altman
    Signed-off-by: Bean Huo
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Bean Huo
     

09 Jan, 2021

2 commits

  • [ Upstream commit bd14bf0e4a084514aa62d24d2109e0f09a93822f ]

    UFS 3.1 specification mentions that the WriteBooster flags listed below
    will be set to their default values, i.e. disabled, after power cycle or
    any type of reset event. Thus we need to reset the flag variables kept in
    struct hba to align with the device status and ensure that
    WriteBooster-related functions are configured properly after device reset.

    Without this fix, WriteBooster will not be enabled successfully after by
    ufshcd_wb_ctrl() after device reset because hba->wb_enabled remains true.

    Flags required to be reset to default values:

    - fWriteBoosterEn: hba->wb_enabled

    - fWriteBoosterBufferFlushEn: hba->wb_buf_flush_enabled

    - fWriteBoosterBufferFlushDuringHibernate: No variable mapped

    Link: https://lore.kernel.org/r/20201208135635.15326-2-stanley.chu@mediatek.com
    Fixes: 3d17b9b5ab11 ("scsi: ufs: Add write booster feature support")
    Reviewed-by: Bean Huo
    Signed-off-by: Stanley Chu
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Stanley Chu
     
  • [ Upstream commit 151f1b664ffbb847c7fbbce5a5b8580f1b9b1d98 ]

    It is simpler for drivers to provide a ->device_reset() callback
    irrespective of whether the GPIO, or firmware interface necessary to do the
    reset, is discovered during probe.

    Change ->device_reset() to return an error code. Drivers that provide the
    callback, but do not do the reset operation should return -EOPNOTSUPP.

    Link: https://lore.kernel.org/r/20201103141403.2142-3-adrian.hunter@intel.com
    Reviewed-by: Asutosh Das
    Reviewed-by: Stanley Chu
    Reviewed-by: Bean huo
    Reviewed-by: Can Guo
    Signed-off-by: Adrian Hunter
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Adrian Hunter
     

06 Jan, 2021

1 commit

  • commit cb5253198f10a4cd79b7523c581e6173c7d49ddb upstream.

    SCSI_CXGB4_ISCSI selects CHELSIO_T4. The latter depends on TLS || TLS=n, so
    since 'select' does not check dependencies of the selected symbol,
    SCSI_CXGB4_ISCSI should also depend on TLS || TLS=n.

    This prevents the following kconfig warning and restricts SCSI_CXGB4_ISCSI
    to 'm' whenever TLS=m.

    WARNING: unmet direct dependencies detected for CHELSIO_T4
    Depends on [m]: NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_CHELSIO [=y] && PCI [=y] && (IPV6 [=y] || IPV6 [=y]=n) && (TLS [=m] || TLS [=m]=n)
    Selected by [y]:
    - SCSI_CXGB4_ISCSI [=y] && SCSI_LOWLEVEL [=y] && SCSI [=y] && PCI [=y] && INET [=y] && (IPV6 [=y] || IPV6 [=y]=n) && ETHERNET [=y]

    Link: https://lore.kernel.org/r/20201208220505.24488-1-rdunlap@infradead.org
    Fixes: 7b36b6e03b0d ("[SCSI] cxgb4i v5: iscsi driver")
    Cc: Karen Xie
    Cc: linux-scsi@vger.kernel.org
    Cc: "James E.J. Bottomley"
    Cc: "Martin K. Petersen"
    Signed-off-by: Randy Dunlap
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     

04 Jan, 2021

2 commits

  • This is the 5.10.4 stable release

    * tag 'v5.10.4': (717 commits)
    Linux 5.10.4
    x86/CPU/AMD: Save AMD NodeId as cpu_die_id
    drm/edid: fix objtool warning in drm_cvt_modes()
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    drivers/gpu/drm/imx/dcss/dcss-plane.c
    drivers/media/i2c/ov5640.c

    Jason Liu
     
  • This is the 5.10.3 stable release

    * tag 'v5.10.3': (41 commits)
    Linux 5.10.3
    md: fix a warning caused by a race between concurrent md_ioctl()s
    nl80211: validate key indexes for cfg80211_registered_device
    ...

    Signed-off-by: Jason Liu

    Jason Liu
     

30 Dec, 2020

16 commits

  • commit e5785d3ec32f5f44dd88cd7b398e496742630469 upstream.

    Commit 9816ef6ecbc1 ("scsi: lpfc: Use after free in lpfc_rq_buf_free()")
    was made to correct a use after free condition in lpfc_rq_buf_free().
    Unfortunately, a subsequent patch cut on a tree without the fix
    inadvertently reverted the fix.

    Put the fix back: Move the freeing of the rqb_entry to after the print
    function that references it.

    Link: https://lore.kernel.org/r/20201020202719.54726-4-james.smart@broadcom.com
    Fixes: 411de511c694 ("scsi: lpfc: Fix RQ empty firmware trap")
    Cc: # v4.17+
    Signed-off-by: James Smart
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    James Smart
     
  • commit e7dab164a9aa457f89d4528452bdfc3e15ac98b6 upstream.

    The following call trace was seen during HBA reset testing:

    BUG: scheduling while atomic: swapper/2/0/0x10000100
    ...
    Call Trace:
    dump_stack+0x19/0x1b
    __schedule_bug+0x64/0x72
    __schedule+0x782/0x840
    __cond_resched+0x26/0x30
    _cond_resched+0x3a/0x50
    mempool_alloc+0xa0/0x170
    lpfc_unreg_rpi+0x151/0x630 [lpfc]
    lpfc_sli_abts_recover_port+0x171/0x190 [lpfc]
    lpfc_sli4_abts_err_handler+0xb2/0x1f0 [lpfc]
    lpfc_sli4_io_xri_aborted+0x256/0x300 [lpfc]
    lpfc_sli4_sp_handle_abort_xri_wcqe.isra.51+0xa3/0x190 [lpfc]
    lpfc_sli4_fp_handle_cqe+0x89/0x4d0 [lpfc]
    __lpfc_sli4_process_cq+0xdb/0x2e0 [lpfc]
    __lpfc_sli4_hba_process_cq+0x41/0x100 [lpfc]
    lpfc_cq_poll_hdler+0x1a/0x30 [lpfc]
    irq_poll_softirq+0xc7/0x100
    __do_softirq+0xf5/0x280
    call_softirq+0x1c/0x30
    do_softirq+0x65/0xa0
    irq_exit+0x105/0x110
    do_IRQ+0x56/0xf0
    common_interrupt+0x16a/0x16a

    With the conversion to blk_io_poll for better interrupt latency in normal
    cases, it introduced this code path, executed when I/O aborts or logouts
    are seen, which attempts to allocate memory for a mailbox command to be
    issued. The allocation is GFP_KERNEL, thus it could attempt to sleep.

    Fix by creating a work element that performs the event handling for the
    remote port. This will have the mailbox commands and other items performed
    in the work element, not the irq. A much better method as the "irq" routine
    does not stall while performing all this deep handling code.

    Ensure that allocation failures are handled and send LOGO on failure.

    Additionally, enlarge the mailbox memory pool to reduce the possibility of
    additional allocation in this path.

    Link: https://lore.kernel.org/r/20201020202719.54726-3-james.smart@broadcom.com
    Fixes: 317aeb83c92b ("scsi: lpfc: Add blk_io_poll support for latency improvment")
    Cc: # v5.9+
    Co-developed-by: Dick Kennedy
    Signed-off-by: Dick Kennedy
    Signed-off-by: James Smart
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    James Smart
     
  • commit 62e3a931db60daf94fdb3159d685a5bc6ad4d0cf upstream.

    The following calltrace was seen:

    BUG: sleeping function called from invalid context at mm/slab.h:494
    ...
    Call Trace:
    dump_stack+0x9a/0xf0
    ___might_sleep.cold.63+0x13d/0x178
    slab_pre_alloc_hook+0x6a/0x90
    kmem_cache_alloc_trace+0x3a/0x2d0
    lpfc_sli4_nvmet_alloc+0x4c/0x280 [lpfc]
    lpfc_post_rq_buffer+0x2e7/0xa60 [lpfc]
    lpfc_sli4_hba_setup+0x6b4c/0xa4b0 [lpfc]
    lpfc_pci_probe_one_s4.isra.15+0x14f8/0x2280 [lpfc]
    lpfc_pci_probe_one+0x260/0x2880 [lpfc]
    local_pci_probe+0xd4/0x180
    work_for_cpu_fn+0x51/0xa0
    process_one_work+0x8f0/0x17b0
    worker_thread+0x536/0xb50
    kthread+0x30c/0x3d0
    ret_from_fork+0x3a/0x50

    A prior patch introduced a spin_lock_irqsave(hbalock) in the
    lpfc_post_rq_buffer() routine. Call trace is seen as the hbalock is held
    with interrupts disabled during a GFP_KERNEL allocation in
    lpfc_sli4_nvmet_alloc().

    Fix by reordering locking so that hbalock not held when calling
    sli4_nvmet_alloc() (aka rqb_buf_list()).

    Link: https://lore.kernel.org/r/20201020202719.54726-2-james.smart@broadcom.com
    Fixes: 411de511c694 ("scsi: lpfc: Fix RQ empty firmware trap")
    Cc: # v4.17+
    Co-developed-by: Dick Kennedy
    Signed-off-by: Dick Kennedy
    Signed-off-by: James Smart
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    James Smart
     
  • commit 8de309e7299a00b3045fb274f82b326f356404f0 upstream.

    Crash stack:
    [576544.715489] Unable to handle kernel paging request for data at address 0xd00000000f970000
    [576544.715497] Faulting instruction address: 0xd00000000f880f64
    [576544.715503] Oops: Kernel access of bad area, sig: 11 [#1]
    [576544.715506] SMP NR_CPUS=2048 NUMA pSeries
    :
    [576544.715703] NIP [d00000000f880f64] .qla27xx_fwdt_template_valid+0x94/0x100 [qla2xxx]
    [576544.715722] LR [d00000000f7952dc] .qla24xx_load_risc_flash+0x2fc/0x590 [qla2xxx]
    [576544.715726] Call Trace:
    [576544.715731] [c0000004d0ffb000] [c0000006fe02c350] 0xc0000006fe02c350 (unreliable)
    [576544.715750] [c0000004d0ffb080] [d00000000f7952dc] .qla24xx_load_risc_flash+0x2fc/0x590 [qla2xxx]
    [576544.715770] [c0000004d0ffb170] [d00000000f7aa034] .qla81xx_load_risc+0x84/0x1a0 [qla2xxx]
    [576544.715789] [c0000004d0ffb210] [d00000000f79f7c8] .qla2x00_setup_chip+0xc8/0x910 [qla2xxx]
    [576544.715808] [c0000004d0ffb300] [d00000000f7a631c] .qla2x00_initialize_adapter+0x4dc/0xb00 [qla2xxx]
    [576544.715826] [c0000004d0ffb3e0] [d00000000f78ce28] .qla2x00_probe_one+0xf08/0x2200 [qla2xxx]

    Link: https://lore.kernel.org/r/20201202132312.19966-8-njavali@marvell.com
    Fixes: f73cb695d3ec ("[SCSI] qla2xxx: Add support for ISP2071.")
    Cc: stable@vger.kernel.org
    Reviewed-by: Himanshu Madhani
    Signed-off-by: Arun Easi
    Signed-off-by: Nilesh Javali
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    Arun Easi
     
  • [ Upstream commit 07a5f69248e3486e387c40af64793466371c7d91 ]

    FC-NVMe target discovery failed when initiator wwpn < target wwpn in an N2N
    (Direct Attach) config, where the driver was stuck on FCP PRLI mode and
    failed to retry with NVMe PRLI.

    Link: https://lore.kernel.org/r/20201202132312.19966-10-njavali@marvell.com
    Fixes: 84ed362ac40c ("scsi: qla2xxx: Dual FCP-NVMe target port support”)
    Fixes: 983f127603fa ("scsi: qla2xxx: Retry PLOGI on FC-NVMe PRLI failure”)
    Signed-off-by: Quinn Tran
    Signed-off-by: Nilesh Javali
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Quinn Tran
     
  • [ Upstream commit 8a78dd6ed1af06bfa7b4ade81328ff7ea11b6947 ]

    Some fields are not correctly byte swapped causing failure during
    initialization. As probe() returns failure, HBAs will not be claimed when
    this happens.

    qla2xxx [0007:01:00.0]-ffff:3: Secure Flash Update in FW: Supported
    qla2xxx [0007:01:00.0]-ffff:3: SCM in FW: Supported
    qla2xxx [0007:01:00.0]-00d2:3: Init Firmware **** FAILED ****.
    qla2xxx [0007:01:00.0]-00d6:3: Failed to initialize adapter - Adapter flags 2.
    qla2xxx 0007:01:00.1: enabling device (0140 -> 0142)
    qla2xxx [0007:01:00.1]-011c: : MSI-X vector count: 128.
    qla2xxx [0007:01:00.1]-001d: : Found an ISP2289 irq 18 iobase 0xd000080080004000.
    qla2xxx 0007:01:00.1: Using 64-bit direct DMA at offset 800000000000000
    BUG: Bad page state in process insmod pfn:67118 page:f00000000168bd40
    count:-1 mapcount:0 mapping: (null) index:0x0
    page flags: 0x3ffff800000000() page dumped because: nonzero _count
    Modules linked in: qla2xxx(OE+) nvme_fc nvme_fabrics
    nvme_core scsi_transport_fc scsi_tgt nls_utf8 isofs ip6t_rpfilter
    ipt_REJECT nf_reject_ipv4 ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set
    nfnetlink ebtable_nat ebtable_broute bridge stp llc ip6table_nat
    nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle
    ip6table_security ip6table_raw iptable_nat nf_conntrack_ipv4
    nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle
    iptable_security iptable_raw ebtable_filter ebtables ip6table_filter
    ip6_tables iptable_filter nx_crypto ses enclosure scsi_transport_sas
    pseries_rng sg ip_tables xfs libcrc32c sr_mod cdrom sd_mod crc_t10dif
    crct10dif_generic crct10dif_common usb_storage ipr libata tg3 ptp
    pps_core dm_mirror dm_region_hash dm_log dm_mod
    CPU: 32 PID: 8560 Comm: insmod Kdump: loaded Tainted: G
    OE ------------ 3.10.0-957.el7.ppc64 #1
    Call Trace:
    [c0000006dd7caa70] [c00000000001cca8] .show_stack+0x88/0x330 (unreliable)
    [c0000006dd7cab30] [c000000000ac3d88] .dump_stack+0x28/0x3c
    [c0000006dd7caba0] [c00000000029e48c] .bad_page+0x15c/0x1c0
    [c0000006dd7cac40] [c00000000029f938] .get_page_from_freelist+0x11e8/0x1ea0
    [c0000006dd7caf40] [c0000000002a1d30] .__alloc_pages_nodemask+0x1c0/0xc70
    [c0000006dd7cb140] [c00000000002ba0c] .__dma_direct_alloc_coherent+0x8c/0x170
    [c0000006dd7cb1e0] [d000000010a94688] .qla2x00_mem_alloc+0x10f8/0x1370 [qla2xxx]
    [c0000006dd7cb2d0] [d000000010a9c790] .qla2x00_probe_one+0xb60/0x22e0 [qla2xxx]
    [c0000006dd7cb540] [c0000000005de764] .pci_device_probe+0x204/0x300
    [c0000006dd7cb600] [c0000000006ca61c] .driver_probe_device+0x2cc/0x6f0
    [c0000006dd7cb6b0] [c0000000006cabec] .__driver_attach+0x10c/0x110
    [c0000006dd7cb740] [c0000000006c5f04] .bus_for_each_dev+0x94/0x100
    [c0000006dd7cb7e0] [c0000000006c94f4] .driver_attach+0x34/0x50
    [c0000006dd7cb860] [c0000000006c8f58] .bus_add_driver+0x298/0x3b0
    [c0000006dd7cb900] [c0000000006cb6e0] .driver_register+0xb0/0x1a0
    [c0000006dd7cb980] [c0000000005dc474] .__pci_register_driver+0xc4/0xf0
    [c0000006dd7cba10] [d000000010b94e20] .qla2x00_module_init+0x2a8/0x328 [qla2xxx]
    [c0000006dd7cbaa0] [c00000000000c130] .do_one_initcall+0x130/0x2e0
    [c0000006dd7cbb50] [c0000000001b2e8c] .load_module+0x1afc/0x2340
    [c0000006dd7cbd40] [c0000000001b3920] .SyS_finit_module+0xd0/0x130
    [c0000006dd7cbe30] [c00000000000a284] system_call+0x38/0xfc

    Link: https://lore.kernel.org/r/20201202132312.19966-9-njavali@marvell.com
    Fixes: 9f2475fe7406 ("scsi: qla2xxx: SAN congestion management implementation")
    Fixes: cf3c54fb49a4 ("scsi: qla2xxx: Add SLER and PI control support”)
    Reviewed-by: Himanshu Madhani
    Signed-off-by: Arun Easi
    Signed-off-by: Nilesh Javali
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Arun Easi
     
  • [ Upstream commit d4fc94fe65578738ded138e9fce043db6bfc3241 ]

    Return a negative error code from the error handling case instead of 0 as
    done elsewhere in this function.

    Link: https://lore.kernel.org/r/1607068060-31203-1-git-send-email-zhangchangzhong@huawei.com
    Fixes: 5df6d737dd4b ("[SCSI] fnic: Add new Cisco PCI-Express FCoE HBA")
    Reported-by: Hulk Robot
    Reviewed-by: Karan Tilak Kumar
    Signed-off-by: Zhang Changzhong
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Zhang Changzhong
     
  • [ Upstream commit 6dc1c7ab6f047f45b62986ffebc5324e86ed5f5a ]

    kfree(conn) is called inside put_device(&conn->dev) which could lead to
    use-after-free. In addition, device_unregister() should be used here rather
    than put_deviceO().

    Link: https://lore.kernel.org/r/20201120074852.31658-1-miaoqinglang@huawei.com
    Fixes: f3c893e3dbb5 ("scsi: iscsi: Fail session and connection on transport registration failure")
    Reported-by: Hulk Robot
    Reviewed-by: Mike Christie
    Signed-off-by: Qinglang Miao
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Qinglang Miao
     
  • [ Upstream commit 97031ccffa4f62728602bfea8439dd045cd3aeb2 ]

    The driver did not return an error in the case where
    pm8001_configure_phy_settings() failed.

    Use rc to store the return value of pm8001_configure_phy_settings().

    Link: https://lore.kernel.org/r/20201205115551.2079471-1-zhangqilong3@huawei.com
    Fixes: 279094079a44 ("[SCSI] pm80xx: Phy settings support for motherboard controller.")
    Acked-by: Jack Wang
    Signed-off-by: Zhang Qilong
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Zhang Qilong
     
  • [ Upstream commit 62eebd5247c4e4ce08826ad5995cf4dd7ce919dd ]

    Add the missing destroy_workqueue() before return from __qedi_probe in the
    error handling case when fails to create workqueue qedi->offload_thread.

    Link: https://lore.kernel.org/r/20201109091518.55941-1-miaoqinglang@huawei.com
    Fixes: ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.")
    Reviewed-by: Mike Christie
    Signed-off-by: Qinglang Miao
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Qinglang Miao
     
  • [ Upstream commit 4ba9e516573e60c471c01bb369144651f6f8d50b ]

    hw_event_sas_phy_up() is used in hardirq/softirq context:

    pm8001_interrupt_handler_msix() || pm8001_interrupt_handler_intx() || pm8001_tasklet
    => PM8001_CHIP_DISP->isr() = pm80xx_chip_isr()
    => process_oq() [spin_lock_irqsave(&pm8001_ha->lock,)]
    => process_one_iomb()
    => mpi_hw_event()
    => hw_event_sas_phy_up()
    => msleep(200)

    Revert the msleep() back to an mdelay() to avoid sleeping in atomic
    context.

    Link: https://lore.kernel.org/r/20201126132952.2287996-2-bigeasy@linutronix.de
    Fixes: 4daf1ef3c681 ("scsi: pm80xx: Convert 'long' mdelay to msleep")
    Cc: Vikram Auradkar
    Cc: Jack Wang
    Acked-by: Jack Wang
    Signed-off-by: Ahmed S. Darwish
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Ahmed S. Darwish
     
  • [ Upstream commit 2ebde94f2ea4cffd812ece2f318c2f4922239b1d ]

    Fix some rollbacks in function hisi_sas_v3_probe() and
    interrupt_init_v3_hw().

    Link: https://lore.kernel.org/r/1606207594-196362-3-git-send-email-john.garry@huawei.com
    Fixes: 8d98416a55eb ("scsi: hisi_sas: Switch v3 hw to MQ")
    Signed-off-by: Xiang Chen
    Signed-off-by: John Garry
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Xiang Chen
     
  • [ Upstream commit 8eb456be75af7e5a7ac0cd223eaa198cf7ee2ac1 ]

    The following call stack prevents clk_gating at every I/O completion. We
    can remove the condition, ufshcd_any_tag_in_use(), since clkgating_work
    will check it again.

    ufshcd_complete_requests(struct ufs_hba *hba)
    ufshcd_transfer_req_compl()
    __ufshcd_transfer_req_compl()
    __ufshcd_release(hba)
    if (ufshcd_any_tag_in_use() == 1)
    return;
    ufshcd_tmc_handler(hba);
    blk_mq_tagset_busy_iter();

    Note that this still requires work to deal with a potential race condition
    when user sets clkgating.delay_ms to very small value. That can cause
    preventing clkgating by the check of ufshcd_any_tag_in_use() in gate_work.

    Link: https://lore.kernel.org/r/20201117165839.1643377-7-jaegeuk@kernel.org
    Fixes: 7252a3603015 ("scsi: ufs: Avoid busy-waiting by eliminating tag conflicts")
    Reviewed-by: Asutosh Das
    Reviewed-by: Can Guo
    Signed-off-by: Jaegeuk Kim
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Jaegeuk Kim
     
  • [ Upstream commit fd62de114f8c9df098dcd43b5d83c5714176dd12 ]

    Once UFS is gated with CLKS_OFF, it should not call REQ_CLKS_OFF
    again. This can lead to hibern8_enter failure.

    Link: https://lore.kernel.org/r/20201117165839.1643377-2-jaegeuk@kernel.org
    Reviewed-by: Can Guo
    Signed-off-by: Jaegeuk Kim
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Jaegeuk Kim
     
  • [ Upstream commit 2e4209b3806cda9b89c30fd5e7bfecb7044ec78b ]

    The current implementation of scsi_vpd_lun_id() uses the designator length
    as an implicit measure of priority. This works most of the time, but not
    always. For example, some Hitachi storage arrays return this in VPD 0x83:

    VPD INQUIRY: Device Identification page
    Designation descriptor number 1, descriptor length: 24
    designator_type: T10 vendor identification, code_set: ASCII
    associated with the Addressed logical unit
    vendor id: HITACHI
    vendor specific: 5030C3502025
    Designation descriptor number 2, descriptor length: 6
    designator_type: vendor specific [0x0], code_set: Binary
    associated with the Target port
    vendor specific: 08 03
    Designation descriptor number 3, descriptor length: 20
    designator_type: NAA, code_set: Binary
    associated with the Addressed logical unit
    NAA 6, IEEE Company_id: 0x60e8
    Vendor Specific Identifier: 0x7c35000
    Vendor Specific Identifier Extension: 0x30c35000002025
    [0x60060e8007c350000030c35000002025]

    The current code would use the first descriptor because it's longer than
    the NAA descriptor. But this is wrong, the kernel is supposed to prefer NAA
    descriptors over T10 vendor ID. Designator length should only be used to
    compare designators of the same type.

    This patch addresses the issue by separating designator priority and
    length.

    Link: https://lore.kernel.org/r/20201029170846.14786-1-mwilck@suse.com
    Fixes: 9983bed3907c ("scsi: Add scsi_vpd_lun_id()")
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Martin Wilck
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Martin Wilck
     
  • [ Upstream commit 077054215a7f787e389a807ece8a39247abbbc1e ]

    The use of compat_alloc_user_space() can be easily replaced by handling
    compat arguments in the regular handler, and this will make it work for
    big-endian kernels as well, which at the moment get an invalid indirect
    pointer argument.

    Calling aac_ioctl() instead of aac_compat_do_ioctl() means the compat and
    native code paths behave the same way again, which they stopped when the
    adapter health check was added only in the native function.

    Link: https://lore.kernel.org/r/20201030164450.1253641-1-arnd@kernel.org
    Fixes: 572ee53a9bad ("scsi: aacraid: check adapter health")
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Arnd Bergmann
     

26 Dec, 2020

1 commit

  • commit 381d34e376e3d9d27730fda8a0e870600e6c8196 upstream.

    It sounds unwise to let user space pass an unchecked 32-bit offset into a
    kernel structure in an ioctl. This is an unsigned variable, so checking the
    upper bound for the size of the structure it points into is sufficient to
    avoid data corruption, but as the pointer might also be unaligned, it has
    to be written carefully as well.

    While I stumbled over this problem by reading the code, I did not continue
    checking the function for further problems like it.

    Link: https://lore.kernel.org/r/20201030164450.1253641-2-arnd@kernel.org
    Fixes: c4a3e0a529ab ("[SCSI] MegaRAID SAS RAID: new driver")
    Cc: # v2.6.15+
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     

14 Dec, 2020

2 commits

  • Fix build issue caused by 6eb045e092 ("scsi: core: avoid host-wide
    host_busy counter for scsi_mq")

    Signed-off-by: Li Yang

    Li Yang
     
  • errata:
    When a read command returns less data than specified in the PRDs (for
    example, there are two PRDs for this command, but the device returns a
    number of bytes which is less than in the first PRD), the second PRD of
    this command is not read out of the PRD FIFO, causing the next command
    to use this PRD erroneously.

    workaround
    - forces sg_tablesize = 1
    - modified the sg_io function in block/scsi_ioctl.c to use a 64k buffer
    allocated with dma_alloc_coherent during the probe in ahci_imx
    - In order to fix the scsi/sata hang, when CD_ROM and HDD are
    accessed simultaneously after the workaround is applied.
    Do not go to sleep in scsi_eh_handler, when there is host failed.

    Signed-off-by: Richard Zhu

    Richard Zhu