If after an adapter reset the appearance of link is not recovered, the
devices are not rediscovered. This is result of a race condition between
adapter reset (abort_isp) and the topology scan. During adapter reset, the
ABORT_ISP_ACTIVE flag is set. Topology scan usually occurred after adapter
reset. In this case, the topology scan came earlier than usual where it
ran into problem due to ABORT_ISP_ACTIVE flag was still set.
kernel: qla2xxx [0000:13:00.0]-1005:1: Cmd 0x6a aborted with timeout since ISP Abort is pending
kernel: qla2xxx [0000:13:00.0]-28a0:1: MBX_GET_PORT_NAME failed, No FL Port.
kernel: qla2xxx [0000:13:00.0]-286b:1: qla2x00_configure_loop: exiting normally. local port wwpn 51402ec0123d9a80 id 012300)
kernel: qla2xxx [0000:13:00.0]-8017:1: ADAPTER RESET SUCCEEDED nexus=1:0:15.
Allow adapter reset to complete before any scan can start.
Cc: stable@vger.kernel.org
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 3fbc74feb642 upstream ]
FCF_ASYNC_SENT flag is used in session management. This flag is cleared in
task management path by accident. Remove unintended flag clearing.
Fixes: 388a49959ee4 ("scsi: qla2xxx: Fix panic from use after free in qla2x00_async_tm_cmd")
Cc: stable@vger.kernel.org
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 7e8a936a2d0f upstream ]
If a login failed due to low FW resources, the session can stall and will
not be connected. Reset session state to allow relogin logic to redrive
the connection.
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 40f5b1b9a4af upstream ]
In large environment, it is possible to experience command timeout and
escalation of path recovery. Currently the driver does not track the number
of exchanges/commands sent to FW. If there is a delay for commands at the
head of the queue, then this will create back pressure for commands at the
back of the queue.
Check for exchange availability before command submission.
Fixes: 89c72f4245a8 ("scsi: qla2xxx: Add IOCB resource tracking")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 41e5afe51f75 upstream ]
The following message and call trace was seen with debug kernels:
DMA-API: qla2xxx 0000:41:00.0: device driver failed to check map
error [device address=0x00000002a3ff38d8] [size=1024 bytes] [mapped as
single]
WARNING: CPU: 0 PID: 2930 at kernel/dma/debug.c:1017
check_unmap+0xf42/0x1990
Call Trace:
debug_dma_unmap_page+0xc9/0x100
qla_nvme_ls_unmap+0x141/0x210 [qla2xxx]
Remove DMA mapping from the driver altogether, as it is already done by FC
layer. This prevents the warning.
Fixes: c85ab7d9e27a ("scsi: qla2xxx: Fix missed DMA unmap for NVMe ls requests")
Cc: stable@vger.kernel.org
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit c75e6aef5039 upstream ]
User experienced symptoms of adapter failure in NPIV environment. NPIV
hosts were allowed to trigger chip reset back to back due to NPIV link
state being slow to come online.
Fix link failure in NPIV environment by removing NPIV host from directly
being able to perform chip reset.
kernel: qla2xxx [0000:04:00.1]-6009:261: Loop down - aborting ISP.
kernel: qla2xxx [0000:04:00.1]-6009:262: Loop down - aborting ISP.
kernel: qla2xxx [0000:04:00.1]-6009:281: Loop down - aborting ISP.
kernel: qla2xxx [0000:04:00.1]-6009:285: Loop down - aborting ISP
Fixes: 0d6e61bc6a4f ("[SCSI] qla2xxx: Correct various NPIV issues.")
Cc: stable@vger.kernel.org
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit b1ae65c082f7 upstream ]
Support for the following fc changes in the Linux kernel v6.3:
- 64fd2ba977b1 ("scsi: scsi_transport_fc: Add an additional flag to fc_host_fpin_rcv()")
When dlm_new_lockspace is called with a NULL cluster_name the
kernel will emit an error message "dlm cluster name '%s' is being
used without an application provided cluster name".
Therefore, provide a mechanism to set a cluster_name and use it
when calling dlm_new_lockspace.
Make the SCST_VERSION_STRING macro revision-independent, because it
causes a version string mismatch for SCST-dependent modules where the
revision is not exported.
Fixes: a86e5c55ea ("Makefile, scst: Add revision to SCST version macro")
Fixes: https://github.com/SCST-project/scst/issues/130
In kernel commit 066ff571011d ("block: turn bio_kmalloc into a simple kmalloc
wrapper"), the order of arguments to bio_kmalloc changed, as did its semantics.
In kernel commit 772c8f6f3bbd ("Merge tag 'for-4.11/linus-merge-signed' * of
git://git.kernel.dk/linux-block") both scsi_init_rq and scsi_init_request
(later renamed to scsi_mq_init_request in e7008ff5c61a) initialize the
scsi_request sense buffer, so we don't need to (nor should) provide our own.
This patch fixes the following Coverity complaint:
CID 307352 (#1 of 1): Uninitialized pointer read (UNINIT)
uninit_use_in_call: Using uninitialized value arg when calling
kfree.
Fixes: 7ba5b11f0a ("scst_disk: Add cluster SCSI sync state mode
support to dev_disk")
Extend the cluster mode support that was first introduced in 9d61dc4b to
include dev_disk. This will facilitate the situation where the underlying
disk is another SCST target.
Add the cluster_mode control to the sysfs subtree for the dev_disk to permit
entering or exiting cluster mode.
In disk_attach issue a INQUIRY (Unit Serial Number VPD) to obtain the serial
number of the underlying disk. This is used when entering or exiting
cluster mode as the cl_dev_id parameter, which ultimately is used as part of
the DLM lockspace.
1. Correct a sentence where 'optimal transfer length' should read 'block size'.
2. Use '4194304' instead of '4 MB' when referring to a value of the parameter.
After a transport error, return "aborted command" sense data rather than
"medium error / write error" (which is more appropriate for a problem
writing to the disk / tape / physical medium).
Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
When processing ABORT_TASK_SET, qla2xxx_scst passes the wrong LUN to
SCST, resulting in errors like:
sqatgt(7/0): Received task management cmd: lun=29, type=2, tag=0
sqatgt(7/0) ABORT_TS received.
[161]: scst: TM fn ABORT_TASK_SET/1 (mcmd 00000000d42b66dd, initiator c0:50:76:0b:e9:52:00:a2, target 21:00:00:24:ff:82:96:a5)
[10400]: scst: ***ERROR***: Corresponding device for LUN 7424 not found
(where 29 is the correct LUN and 7424 is bogus)
Fix by making LUN parsing for ABORT_TASK_SET the same as all the other
TMR cases.
Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
This patch should fix the following github warning:
Node.js 12 actions are deprecated. Please update the following
actions to use Node.js 16: actions/checkout@v2
While performing CPU hotplug, a crash with the following stack was seen:
Call Trace:
qla24xx_process_response_queue+0x42a/0x970 [qla2xxx]
qla2x00_start_nvme_mq+0x3a2/0x4b0 [qla2xxx]
qla_nvme_post_cmd+0x166/0x240 [qla2xxx]
nvme_fc_start_fcp_op.part.0+0x119/0x2e0 [nvme_fc]
blk_mq_dispatch_rq_list+0x17b/0x610
__blk_mq_sched_dispatch_requests+0xb0/0x140
blk_mq_sched_dispatch_requests+0x30/0x60
__blk_mq_run_hw_queue+0x35/0x90
__blk_mq_delay_run_hw_queue+0x161/0x180
blk_execute_rq+0xbe/0x160
__nvme_submit_sync_cmd+0x16f/0x220 [nvme_core]
nvmf_connect_admin_queue+0x11a/0x170 [nvme_fabrics]
nvme_fc_create_association.cold+0x50/0x3dc [nvme_fc]
nvme_fc_connect_ctrl_work+0x19/0x30 [nvme_fc]
process_one_work+0x1e8/0x3c0
On abort timeout, completion was called without checking if the I/O was
already completed.
Verify that I/O and abort request are indeed outstanding before attempting
completion.
Fixes: 71c80b75ce8f ("scsi: qla2xxx: Do command completion on abort timeout")
Reported-by: Marco Patalano <mpatalan@redhat.com>
Tested-by: Marco Patalano <mpatalan@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20221129092634.15347-1-njavali@marvell.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 68ad83188d78 upstream ]
bio_set_op_attrs has been removed, replace it with a direct
assignment of the flags to bio->bi_opf.
See also commit c34b7ac65087 ("block: remove bio_set_op_attrs") # v6.2.
Fix a regression introduced during d989aa91f3 ("scst_lib: Port to
Linux kernel v5.19") that breaks dev_disk operation.
The kernel function blk_execute_rq_nowait will set rq->end_io to the
done parameter, so pass in the existing rq->end_io rather than NULL
to prevent zeroing it.
Fixes: d989aa91f3 ("scst_lib: Port to Linux kernel v5.19")
[ glebchesn: added patch description ]
Unbreak the build for the previous commit against kernel versions
before v3.12.
Fixes: ee6312ac5a ("scst_vdisk, qla2x00t-32gbit: Use PTR_ERR_OR_ZERO
instead of IS_ERR and PTR_ERR")
scst_clear_aca_mcmd() can only return an error if
scst_set_mcmd_next_state() fails. In this case, the mcmd->state will be
SCST_MCMD_STATE_WAITING_AFFECTED_CMDS_DONE or
SCST_MCMD_STATE_WAITING_AFFECTED_CMDS_FINISH. Thus, a secondary call of
scst_set_mcmd_next_state() will match the default branch of the switch
statement, resulting in a crash.
Therefore, fix the error handling for scst_clear_aca_mcmd() to avoid
this case.
This patch fixes the following Coverity complaint:
CID 271592 (#1 of 1): Unused value (UNUSED_VALUE)
returned_value: Assigning value from scst_clear_aca_mcmd(mcmd) to
res here, but that stored value is overwritten before it can be
used.
This patch fixes the following Coverity complaint:
CID 271580 (#2 of 2): Uninitialized scalar variable (UNINIT)
uninit_use_in_call: Using uninitialized value mcp->tov when calling
ql_dbg.
This patch fixes the following Coverity complaint:
CID 275308 (#1-2 of 2): Uninitialized scalar variable (UNINIT)
uninit_use_in_call: Using uninitialized value
multi.multi_cmd.replies_done when calling fprintf.
Commit 9b3e0f4d4147 ("scsi: qla2xxx: Move work element processing out of
DPC thread") introduced the initialization of vha->iocb_work in
qla2x00_create_host() function.
This initialization is also called from qla2x00_probe_one() function, just
after qla2x00_create_host().
Hence remove this duplicate call since it has already been called before.
Signed-off-by: Gleb Chesnokov <gleb.chesnokov@scst.dev>
Link: https://lore.kernel.org/r/822b3823-f344-67d6-30f1-16e31cf68eed@scst.dev
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 3620e174d260 upstream ]