Skip to content
Permalink
James-Smart/lp…
Switch branches/tags

Commits on Aug 13, 2021

  1. lpfc: Copyright updates for 14.0.0.1 patches

    Update copyrights to 2021 for files modified in the 14.0.0.1 patch set.
    
    Co-developed-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    jsmart-gh authored and intel-lab-lkp committed Aug 13, 2021
  2. lpfc: Update lpfc version to 14.0.0.1

    Update lpfc version to 14.0.0.1
    
    Co-developed-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    jsmart-gh authored and intel-lab-lkp committed Aug 13, 2021
  3. lpfc: Add bsg support for retrieving adapter cmf data

    This patch adds a bsg ioctl to allow user applications to retrieve the
    adapter congestion management framework buffer.
    
    Co-developed-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    jsmart-gh authored and intel-lab-lkp committed Aug 13, 2021
  4. lpfc: Add cmf_info sysfs entry

    This patch allows abbreviated cm framework status information to be
    obtained via sysfs.
    
    Co-developed-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    jsmart-gh authored and intel-lab-lkp committed Aug 13, 2021
  5. lpfc: Add debugfs support for cm framework buffers

    This patch adds support via debugfs to report the cm statistics, cm
    enablement, and rx monitor information.
    
    Co-developed-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    jsmart-gh authored and intel-lab-lkp committed Aug 13, 2021
  6. lpfc: Add support for maintaining the cm statistics buffer

    This patch adds the logic to move the congestion management and event
    information into the cmd statistics buffer maintained for the adapter.
    The update includes rolling up values for the last minute, hour, and
    day information.
    
    Co-developed-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    jsmart-gh authored and intel-lab-lkp committed Aug 13, 2021
  7. lpfc: Add rx monitoring statistics

    The driver provides overwatch of the cm behavior by maintaining a set
    of rx io statistics. This information is also used in later updating
    of the cm statistics buffer.
    
    Co-developed-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    jsmart-gh authored and intel-lab-lkp committed Aug 13, 2021
  8. lpfc: Add support for the CM framework

    This patch completes the enablement of the cm framework feature in the
    adapter.
    
    The patch performs the following:
    - Detects the presence of the congestion management framework feature
    
    When the cm framework is present:
    - Issues the SET_FEATURE command to enable the feature
    - Registers the cm statistics buffer with the adapter
    - Reads the cm enablement buffer to determine the cm framework state
      for cm management.
    
    When cm management is enabled:
    - Monitors all FPIN and congestion signalling events, incrementing
      counters.
    - Regularly syncs with the adapter to communicate congestion events and
      to receive an rx request limit.
    - Monitors requests for rx data and ensures that no more than the
      adapter prescribed limit is issued on the link. If the limit is
      exceeded, scsi and/or nvme traffic is temporarily suspended.
    - Maintains the minute, hourly, daily statistics buffer.
    - Monitors for congestion enablement change events, causing a reread of
      the enablement buffer and acting on any change in enablement.
    
    And
    - Adds teardown logic, including buffer deregistration, on adapter
      detachment or reset.
    
    Co-developed-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    jsmart-gh authored and intel-lab-lkp committed Aug 13, 2021
  9. lpfc: add cmfsync WQE support

    When congestion mgmt is enabled, cmf has the driver regularly issue
    a command to synchronize reporting of congestion mgmt events such as
    fpin and signal delivery.
    
    This patch adds the definition of the CMF_SYNC WQE and its CQE fields
    as well as support for issuing the command. The patch also adds the
    few remaining cmf-related SLI additions, such as feature definition for
    enablement of CMF and notifications to the driver if the cm enablement
    mode changes.
    
    Co-developed-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    jsmart-gh authored and intel-lab-lkp committed Aug 13, 2021
  10. lpfc: Add support for cm enablement buffer

    As part of the cmf framework, the firmware maintains a table with
    congestion related state information, specifically whether enabled and
    if enabled, whether monitoring or actively managing congestion.
    
    Add definition of the table and add support to read the table from the
    adapter and determine if it is enabled. In support of this, the
    READ_OBJECT mailbox command definition is added to the driver.
    
    Co-developed-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    jsmart-gh authored and intel-lab-lkp committed Aug 13, 2021
  11. lpfc: Add cm statistics buffer support

    The cmf framework requires the driver to maintain a cm statistics table,
    accessible inband, of congestion related statistics that are reported
    per minute, rolled up to per hour, and rolled up again per day. Several
    days worth may be maintained.  The table is registered with the adapter
    when the MIB feature is enabled.
    
    Add definition of the table and add support to register the table
    with the adapter. Includes definition and initialization of event counters
    that are later added to the statistics table.
    
    Co-developed-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    jsmart-gh authored and intel-lab-lkp committed Aug 13, 2021
  12. lpfc: Add EDC ELS support

    When congestion management is enabled, issue EDC ELS to register
    congestion signaling capabilities with the fabric. The response handling
    will process the fabric parameters and set the reporting parameters.
    
    Similarly, add support for receiving an EDC request from the fabric
    generating a corresponding response.
    
    Implement handlers for congestion signals from the fabric and maintain
    statistics for them.
    
    Co-developed-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    jsmart-gh authored and intel-lab-lkp committed Aug 13, 2021
  13. lpfc: Expand FPIN and RDF receive logging

    Expand FPIN logging:
    - Display Attached Port Names for Link Integrity and Peer Congestion
      events
    - Log Delivery, Peer Congestion, and Congestion events
    - Sanity check FPIN descriptor lengths when processing FPIN descriptors.
    
    Log RDF events when congestion logging is enabled
    
    Co-developed-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    jsmart-gh authored and intel-lab-lkp committed Aug 13, 2021
  14. lpfc: Add MIB feature enablement support

    MIB support is currently limited to detecting support in the adapter
    and ensuring FDMI support is enabled if present.  For the new framework
    MIB support also requires active enablement of support via the
    SET_FEATURES command with the firmware.
    
    Rework the MIB detection and enablement for the following:
    - Move detection away from the get_sli4_parameters routine, and into the
      hba_setup path. get_sli4_parameters is only called once at attachment
      while hba_setup is called as part of any sli port reset path. This
      ensures detection after fw download.
    - Update SET_FEATURES mbx command for the MIB enablement feature and
      add support for the feature.
    - Create the cmf_setup routine to encapsulate the detection of MIB
      support and perform the enablement of the MIB support feature.
    
    Co-developed-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    jsmart-gh authored and intel-lab-lkp committed Aug 13, 2021
  15. lpfc: Add SET_HOST_DATA mbox cmd to pass date/time info to firmware

    Implement the SET_HOST_DATA mbox command to set date / time during
    initialization.  It is used by the firmware for various purposes
    including congestion management and firmware dumps.
    
    Co-developed-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: Justin Tee <justin.tee@broadcom.com>
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    jsmart-gh authored and intel-lab-lkp committed Aug 13, 2021
  16. fc: Add EDC ELS definition

    Add Exchange Diagnostic Capabilities (EDC) ELS definition and
    the following capability descriptors:
      Link Fault Capability Descriptor
      Congestion Signaling Capability Descriptor
    
    Definition taken from FC-LS-5 r5.01
    
    Signed-off-by: James Smart <jsmart2021@gmail.com>
    jsmart-gh authored and intel-lab-lkp committed Aug 13, 2021

Commits on Aug 10, 2021

  1. Merge branch 'misc' into for-next

    James Bottomley authored and James Bottomley committed Aug 10, 2021
  2. Merge branch 'fixes' into for-next

    James Bottomley authored and James Bottomley committed Aug 10, 2021
  3. scsi: mpt3sas: Fix incorrectly assigned error return and check

    Currently the call to _base_static_config_pages() is assigning the error
    return to variable 'rc' but checking the error return in error 'r'. Fix
    this by assigning the error return to variable 'r' instead of 'rc'.
    
    Link: https://lore.kernel.org/r/20210804134940.114011-1-colin.king@canonical.com
    Fixes: 19a622c ("scsi: mpt3sas: Handle firmware faults during first half of IOC init")
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Addresses-Coverity: ("Unused value")
    Colin Ian King authored and martinkpetersen committed Aug 10, 2021
  4. scsi: storvsc: Log TEST_UNIT_READY errors as warnings

    Commit 08f7654 ("scsi: storvsc: Update error logging") added more
    robust logging of errors, particularly those reported as Hyper-V
    errors. But this change produces extra logging noise in that
    TEST_UNIT_READY may report errors during the normal course of detecting
    device adds and removes.
    
    Fix this by logging TEST_UNIT_READY errors as warnings, so that log lines
    are produced only if the storvsc log level is changed to WARN level on the
    kernel boot line.
    
    Link: https://lore.kernel.org/r/1628269970-87876-1-git-send-email-mikelley@microsoft.com
    Fixes: 08f7654 ("scsi: storvsc: Update error logging")
    Signed-off-by: Michael Kelley <mikelley@microsoft.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    kelleymh authored and martinkpetersen committed Aug 10, 2021
  5. scsi: lpfc: Move initialization of phba->poll_list earlier to avoid c…

    …rash
    
    The phba->poll_list is traversed in case of an error in
    lpfc_sli4_hba_setup(), so it must be initialized earlier in case the error
    path is taken.
    
    [  490.030738] lpfc 0000:65:00.0: 0:1413 Failed to init iocb list.
    [  490.036661] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
    [  490.044485] PGD 0 P4D 0
    [  490.047027] Oops: 0000 [#1] SMP PTI
    [  490.050518] CPU: 0 PID: 7 Comm: kworker/0:1 Kdump: loaded Tainted: G          I      --------- -  - 4.18.
    [  490.060511] Hardware name: Dell Inc. PowerEdge R440/0WKGTH, BIOS 1.4.8 05/22/2018
    [  490.067994] Workqueue: events work_for_cpu_fn
    [  490.072371] RIP: 0010:lpfc_sli4_cleanup_poll_list+0x20/0xb0 [lpfc]
    [  490.078546] Code: cf e9 04 f7 fe ff 0f 1f 40 00 0f 1f 44 00 00 41 57 49 89 ff 41 56 41 55 41 54 4d 8d a79
    [  490.097291] RSP: 0018:ffffbd1a463dbcc8 EFLAGS: 00010246
    [  490.102518] RAX: 0000000000008200 RBX: ffff945cdb8c0000 RCX: 0000000000000000
    [  490.109649] RDX: 0000000000018200 RSI: ffff9468d0e16818 RDI: 0000000000000000
    [  490.116783] RBP: ffff945cdb8c1740 R08: 00000000000015c5 R09: 0000000000000042
    [  490.123915] R10: 0000000000000000 R11: ffffbd1a463dbab0 R12: ffff945cdb8c25c0
    [  490.131049] R13: 00000000fffffff4 R14: 0000000000001800 R15: ffff945cdb8c0000
    [  490.138182] FS:  0000000000000000(0000) GS:ffff9468d0e00000(0000) knlGS:0000000000000000
    [  490.146267] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [  490.152013] CR2: 0000000000000000 CR3: 000000042ca10002 CR4: 00000000007706f0
    [  490.159146] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [  490.166277] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    [  490.173409] PKRU: 55555554
    [  490.176123] Call Trace:
    [  490.178598]  lpfc_sli4_queue_destroy+0x7f/0x3c0 [lpfc]
    [  490.183745]  lpfc_sli4_hba_setup+0x1bc7/0x23e0 [lpfc]
    [  490.188797]  ? kernfs_activate+0x63/0x80
    [  490.192721]  ? kernfs_add_one+0xe7/0x130
    [  490.196647]  ? __kernfs_create_file+0x80/0xb0
    [  490.201020]  ? lpfc_pci_probe_one_s4.isra.48+0x46f/0x9e0 [lpfc]
    [  490.206944]  lpfc_pci_probe_one_s4.isra.48+0x46f/0x9e0 [lpfc]
    [  490.212697]  lpfc_pci_probe_one+0x179/0xb70 [lpfc]
    [  490.217492]  local_pci_probe+0x41/0x90
    [  490.221246]  work_for_cpu_fn+0x16/0x20
    [  490.224994]  process_one_work+0x1a7/0x360
    [  490.229009]  ? create_worker+0x1a0/0x1a0
    [  490.232933]  worker_thread+0x1cf/0x390
    [  490.236687]  ? create_worker+0x1a0/0x1a0
    [  490.240612]  kthread+0x116/0x130
    [  490.243846]  ? kthread_flush_work_fn+0x10/0x10
    [  490.248293]  ret_from_fork+0x35/0x40
    [  490.251869] Modules linked in: lpfc(+) xt_CHECKSUM ipt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4i
    [  490.332609] CR2: 0000000000000000
    
    Link: https://lore.kernel.org/r/20210809150947.18104-1-emilne@redhat.com
    Fixes: 93a4d6f ("scsi: lpfc: Add registration for CPU Offline/Online events")
    Cc: stable@vger.kernel.org
    Reviewed-by: James Smart <jsmart2021@gmail.com>
    Signed-off-by: Ewan D. Milne <emilne@redhat.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Ewan D. Milne authored and martinkpetersen committed Aug 10, 2021

Commits on Aug 7, 2021

  1. Merge branch 'misc' into for-next

    James Bottomley authored and James Bottomley committed Aug 7, 2021

Commits on Aug 6, 2021

  1. scsi: ufs: core: Add lu_enable sysfs node

    We need to check whether HPB is enabled on a given LU from the userspace
    tool. Add lu_enable sysfs node.
    
    Link: https://lore.kernel.org/r/20210804182128.458356-3-huobean@gmail.com
    Tested-by: Avri Altman <avri.altman@wdc.com>
    Reviewed-by: Avri Altman <avri.altman@wdc.com>
    Signed-off-by: Bean Huo <beanhuo@micron.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    beanhuo authored and martinkpetersen committed Aug 6, 2021
  2. scsi: ufs: core: Add L2P entry swap quirk for Micron UFS

    For Micron UFS devices the L2P entry need to be byteswapped before sending
    an HPB READ command to the UFS device. Add the quirk
    UFS_DEVICE_QUIRK_SWAP_L2P_ENTRY_FOR_HPB_READ to address this.
    
    Link: https://lore.kernel.org/r/20210804182128.458356-2-huobean@gmail.com
    Reviewed-by: Avri Altman <avri.altman@wdc.com>
    Signed-off-by: Bean Huo <beanhuo@micron.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    beanhuo authored and martinkpetersen committed Aug 6, 2021
  3. scsi: ufs: core: Remove redundant call in ufshcd_add_command_trace()

    ufshcd_add_cmd_upiu_trace() will be called later anyway. Simplify code by
    moving if-statement.
    
    Link: https://lore.kernel.org/r/20210802180803.100033-1-huobean@gmail.com
    Reviewed-by: Avri Altman <avri.altman@wdc.com>
    Signed-off-by: Bean Huo <beanhuo@micron.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    beanhuo authored and martinkpetersen committed Aug 6, 2021
  4. scsi: qla2xxx: Remove redundant initialization of variable num_cnt

    The variable num_cnt is being initialized with a value that is never read,
    it is being updated later on. The assignment is redundant and can be
    removed.
    
    Link: https://lore.kernel.org/r/20210804131344.112635-1-colin.king@canonical.com
    Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Addresses-Coverity: ("Unused value")
    Colin Ian King authored and martinkpetersen committed Aug 6, 2021
  5. scsi: qla2xxx: Fix use after free in debug code

    The sp->free(sp); call frees "sp" and then the debug code dereferences
    it on the next line.  Swap the order.
    
    Link: https://lore.kernel.org/r/20210803155625.GA22735@kili
    Fixes: 84318a9 ("scsi: qla2xxx: edif: Add send, receive, and accept for auth_els")
    Reviewed-by: Ewan D. Milne <emilne@redhat.com>
    Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    error27 authored and martinkpetersen committed Aug 6, 2021

Commits on Aug 3, 2021

  1. scsi: target: core: Drop unnecessary se_cmd ASC/ASCQ members

    These members are only used for ALUA sense detail propagation, which can
    just as easily be done via sense_reason_t.
    
    Link: https://lore.kernel.org/r/20210728115353.2396-4-ddiss@suse.de
    Reviewed-by: Mike Christie <michael.christie@oracle.com>
    Signed-off-by: David Disseldorp <ddiss@suse.de>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    ddiss authored and martinkpetersen committed Aug 3, 2021
  2. scsi: target: sbp: Drop incorrect ASC/ASCQ usage

    The se_cmd scsi_asc and scsi_ascq members are only used for tracking ALUA
    SCSI sense detail between target_core_alua and translate_sense_reason(), so
    they're effectively always zero here.
    
    Link: https://lore.kernel.org/r/20210728115353.2396-3-ddiss@suse.de
    Cc: Chris Boot <bootc@bootc.net>
    Reviewed-by: Mike Christie <michael.christie@oracle.com>
    Signed-off-by: David Disseldorp <ddiss@suse.de>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    ddiss authored and martinkpetersen committed Aug 3, 2021
  3. scsi: target: core: Avoid using lun_tg_pt_gp after unlock

    core_alua_state_lba_dependent() currently uses lun->lun_tg_pt_gp without
    holding the lun_tg_pt_gp_lock. The lock is taken in the caller, so obtain
    the needed tg_pt_gp_id there instead.
    
    Link: https://lore.kernel.org/r/20210728115353.2396-2-ddiss@suse.de
    Cc: Hannes Reinecke <hare@suse.de>
    Reviewed-by: Mike Christie <michael.christie@oracle.com>
    Signed-off-by: David Disseldorp <ddiss@suse.de>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    ddiss authored and martinkpetersen committed Aug 3, 2021
  4. scsi: target: tcmu: Add new feature KEEP_BUF

    When running command pipelining for WRITE direction commands (e.g. tape
    device write), userspace sends cmd completion to cmd ring before processing
    write data. In that case userspace has to copy data before sending
    completion, because cmd completion also implicitly releases the data buffer
    in data area.
    
    The new feature KEEP_BUF allows userspace to optionally keep the buffer
    after completion by setting new bit TCMU_UFLAG_KEEP_BUF in
    tcmu_cmd_entry_hdr->uflags. In that case buffer has to be released
    explicitly by writing the cmd_id to new action item free_kept_buf.
    
    All kept buffers are released during reset_ring and if userspace closes uio
    device (tcmu_release).
    
    Link: https://lore.kernel.org/r/20210713175021.20103-1-bostroesser@gmail.com
    Reviewed-by: Mike Christie <michael.christie@oracle.com>
    Signed-off-by: Bodo Stroesser <bostroesser@gmail.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    bostroesser authored and martinkpetersen committed Aug 3, 2021
  5. scsi: ufs: Add fault injection support

    Make it easier to test the UFS error handler and abort handler.
    
    Link: https://lore.kernel.org/r/20210722033439.26550-19-bvanassche@acm.org
    Acked-by: Bean Huo <beanhuo@micron.com>
    Signed-off-by: Bart Van Assche <bvanassche@acm.org>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    bvanassche authored and martinkpetersen committed Aug 3, 2021
  6. scsi: ufs: Retry aborted SCSI commands instead of completing these su…

    …ccessfully
    
    Neither SAM nor the UFS standard require that the UFS controller fills in
    the completion status of commands that have been aborted (LUN RESET aborts
    pending commands). Hence do not rely on the completion status provided by
    the UFS controller for aborted commands but instead ask the SCSI core to
    retry SCSI commands that have been aborted.
    
    Link: https://lore.kernel.org/r/20210722033439.26550-18-bvanassche@acm.org
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Stanley Chu <stanley.chu@mediatek.com>
    Cc: Can Guo <cang@codeaurora.org>
    Cc: Asutosh Das <asutoshd@codeaurora.org>
    Cc: Avri Altman <avri.altman@wdc.com>
    Reviewed-by: Bean Huo <beanhuo@micron.com>
    Signed-off-by: Bart Van Assche <bvanassche@acm.org>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    bvanassche authored and martinkpetersen committed Aug 3, 2021
  7. scsi: ufs: Synchronize SCSI and UFS error handling

    Use the SCSI error handler instead of a custom error handling strategy.
    This change reduces the number of potential races in the UFS drivers since
    the UFS error handler and the SCSI error handler no longer run
    concurrently.
    
    Link: https://lore.kernel.org/r/20210722033439.26550-17-bvanassche@acm.org
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Stanley Chu <stanley.chu@mediatek.com>
    Cc: Can Guo <cang@codeaurora.org>
    Cc: Asutosh Das <asutoshd@codeaurora.org>
    Cc: Avri Altman <avri.altman@wdc.com>
    Tested-by: Bean Huo <beanhuo@micron.com>
    Reviewed-by: Bean Huo <beanhuo@micron.com>
    Signed-off-by: Bart Van Assche <bvanassche@acm.org>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    bvanassche authored and martinkpetersen committed Aug 3, 2021
  8. scsi: ufs: Request sense data asynchronously

    Clearing a unit attention synchronously from inside the UFS error handler
    may trigger the following deadlock:
    
     - ufshcd_err_handler() calls ufshcd_err_handling_unprepare() and the
       latter function calls ufshcd_clear_ua_wluns().
    
     - ufshcd_clear_ua_wluns() submits a REQUEST SENSE command and that command
       activates the SCSI error handler.
    
     - The SCSI error handler calls ufshcd_host_reset_and_restore().
    
     - ufshcd_host_reset_and_restore() executes the following code:
       ufshcd_schedule_eh_work(hba); flush_work(&hba->eh_work);
    
    This sequence results in a deadlock (circular wait). Fix this by requesting
    sense data asynchronously.
    
    Link: https://lore.kernel.org/r/20210722033439.26550-16-bvanassche@acm.org
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Stanley Chu <stanley.chu@mediatek.com>
    Cc: Can Guo <cang@codeaurora.org>
    Cc: Asutosh Das <asutoshd@codeaurora.org>
    Cc: Avri Altman <avri.altman@wdc.com>
    Reviewed-by: Bean Huo <beanhuo@micron.com>
    Signed-off-by: Bart Van Assche <bvanassche@acm.org>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    bvanassche authored and martinkpetersen committed Aug 3, 2021
Older