Commit Graph

8869 Commits

Author SHA1 Message Date
Gleb Chesnokov
7576d5e326 qla2x00t-32gbit: Fix erroneous link down
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 ]
2023-03-12 13:24:07 +03:00
Gleb Chesnokov
0972c1f7cc qla2x00t-32gbit: Remove unintended flag clearing
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 ]
2023-03-12 13:24:07 +03:00
Gleb Chesnokov
3913eb8f37 qla2x00t-32gbit: Fix stalled login
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 ]
2023-03-12 13:24:07 +03:00
Gleb Chesnokov
d36ec295a0 qla2x00t-32gbit: Fix exchange oversubscription for management commands
Add resource checking for management (non-I/O) commands.

Fixes: 89c72f4245a8 ("scsi: qla2xxx: Add IOCB resource tracking")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 5f63a163ed2f upstream ]
2023-03-12 13:24:07 +03:00
Gleb Chesnokov
150184a2d7 qla2x00t-32gbit: Fix exchange oversubscription
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 ]
2023-03-12 13:24:07 +03:00
Gleb Chesnokov
edfef84e1f qla2x00t-32gbit: Fix DMA-API call trace on NVMe LS requests
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 ]
2023-03-12 13:24:07 +03:00
Gleb Chesnokov
61f39b3915 qla2x00t-32gbit: Fix link failure in NPIV environment
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 ]
2023-03-12 13:24:07 +03:00
Gleb Chesnokov
dabc4a4e78 qla2x00t-32gbit: Check if port is online before sending ELS
CT Ping and ELS cmds fail for NVMe targets.  Check if port is online before
sending ELS instead of sending login.

Cc: stable@vger.kernel.org
Signed-off-by: Shreyas Deodhar <sdeodhar@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 0c227dc22ca1 upstream ]
2023-03-12 13:24:07 +03:00
Brian Meagher
527fed012f scst_vdisk: Add lb_per_pb_exp attribute
Add lb_per_pb_exp attribute to allow control of whether READ CAPACITY 16 returns
non-zero LOGICAL BLOCKS PER PHYSICAL BLOCK EXPONENT.
2023-03-09 12:59:11 +03:00
Gleb Chesnokov
906b1c8368 qla2x00t-32gbit: Port to Linux kernel v6.3
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()")
2023-03-06 20:30:43 +03:00
Gleb Chesnokov
c9476f104c scst: Port to Linux kernel v6.3
Support for the following scsi core changes in the Linux kernel v6.3:
- d0949565811f ("scsi: core: Add struct for args to execution functions")
2023-03-06 13:35:11 +03:00
Gleb Chesnokov
1cf04b01a5 scst_lib: Port to Linux kernel v6.3
Support for the following fs changes in the Linux kernel v6.3:
- abf08576afe3 ("fs: port vfs_*() helpers to struct mnt_idmap")
2023-03-06 13:35:11 +03:00
Gleb Chesnokov
83ff524b6c nightly build: Update kernel versions 2023-02-21 10:32:41 +03:00
Gleb Chesnokov
8068b10cac scst/include/backport.h: Fix the CentOS / RHEL 7.[012345] builds
See also PR https://github.com/SCST-project/scst/pull/132.
2023-02-19 17:01:38 +03:00
Brian Meagher
00f31004ab scst_sysfs: Add support for cluster_name
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.
2023-02-14 10:12:15 +03:00
Gleb Chesnokov
250c9cd76a scst: Fix a version string mismatch
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
2023-02-12 17:44:32 +03:00
Gleb Chesnokov
e76e3261a1 scst_lib: Fix bio_kmalloc usage for RHEL 9.1
See also commit 87340a8427 ("scst_lib: Fix bio_kmalloc usage to match
change in Linux kernel v5.19").
2023-01-30 19:29:36 +03:00
Gleb Chesnokov
a86e5c55ea Makefile, scst: Add revision to SCST version macro
Add SCST revision to SCST_VERSION_STRING macro. This might be useful
for issues reporting/investigation.
2023-01-29 16:31:20 +03:00
Brian Meagher
87340a8427 scst_lib: Fix bio_kmalloc usage to match change in Linux kernel v5.19
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.
2023-01-28 14:52:48 +03:00
Brian Meagher
d401702aba scst_lib: Fix sense data regression for pass-through commands.
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.
2023-01-27 11:48:05 +03:00
Gleb Chesnokov
ae6c0bf914 scst_disk: Fix use of uninitialized variable
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")
2023-01-20 10:48:47 +03:00
Brian Meagher
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.
2023-01-20 10:12:58 +03:00
Samy Mahmoudi
fbe5316fc7 scst/README: Correct description of 'opt_trans_len'
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.
2023-01-20 10:09:26 +03:00
Gleb Chesnokov
8e8670d43b qla2x00t-32gbit: Use better sense data for transport error
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>
2023-01-13 17:06:32 +03:00
Gleb Chesnokov
0bfb746e52 qla2x00t-32gbit: Fix LUN parsing for ABORT_TASK_SET
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>
2023-01-13 17:06:32 +03:00
Gleb Chesnokov
3ba2549ac4 github: Update actions/checkout to v3
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
2023-01-13 16:52:07 +03:00
Gleb Chesnokov
a7665a4535 Makefile: Delete the source code archive after building the scst-dkms-rpm packages 2023-01-10 13:52:51 +03:00
Gleb Chesnokov
7b0a2f8e69 Makefile, scstadmin/Makefile: Use git sha1 as the SCST revision
git sha1 is a more convenient way to generate a revision than the number
of commits. Also, remove svn repository support.
2023-01-10 13:52:51 +03:00
Gleb Chesnokov
3d1dd5c90a Makefile, scst[-dkms].spec.in: Add support for PKG_BUILD_MODE
See also commit 95c9bdc0f7 ("pass through `DEBUG_MODE_LEVEL` to
`dpkg` make target").
2023-01-10 13:52:51 +03:00
Gleb Chesnokov
baa8a58833 Makefile, debian: Rename the DEBUG_MODE_LEVEL variable into PKG_BUILD_MODE
The latter name reflects better the role of this variable.
2023-01-10 13:52:51 +03:00
S.Katyshev
95c9bdc0f7 pass through DEBUG_MODE_LEVEL to dpkg make target
It's quite strange but we can't run `make dpkg` with other
debug mode level.
2023-01-09 13:05:45 +03:00
Gleb Chesnokov
23252a4e42 qla2x00t-32gbit: Fix crash when I/O abort times out
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 ]
2023-01-09 12:50:34 +03:00
Gleb Chesnokov
590ad2f0b9 scst_lib, scst_vdisk: Port to Linux kernel v6.2
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.
2023-01-09 12:48:57 +03:00
Brian Meagher
cbc8d5ee9b scst/include/backport.h: Do not set rq->end_io to NULL
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 ]
2023-01-05 20:37:27 +03:00
Gleb Chesnokov
01c489c05f github: Update the version of SCST for the Coverity action 2022-12-28 17:08:44 +03:00
Gleb Chesnokov
e48a3003f9 github: Update stable branch version for the Mailing list action 2022-12-28 17:08:44 +03:00
Gleb Chesnokov
b78582f34d Bump the version number to 3.8.0-pre
These changes have been generated by running the following command:

$ scripts/update-version 3 8 0 -pre
2022-12-28 17:08:44 +03:00
Gleb Chesnokov
24e8b1d388 nightly build: Update kernel versions v3.7 2022-12-27 16:47:20 +03:00
Gleb Chesnokov
40de8ce2b7 www: Update the links of the top level items "Main" and "News"
We moved to GitHub a year ago, so replace the SourceForge URLs with
the actual GitHub URLs.
2022-12-27 16:47:20 +03:00
Gleb Chesnokov
b91a5d5d54 www: Update the version number from 3.6 to 3.7
Additionally, change the link to the github tags page into a link to the
github releases page.
2022-12-27 16:47:20 +03:00
Gleb Chesnokov
1ef10b852d Bump the version number to 3.7.0
These changes have been generated by running the following command:

$ scripts/update-version 3 7 0
2022-12-27 16:47:20 +03:00
Gleb Chesnokov
247c26d2c8 scst/ChangeLog: Summarize the changes for the upcoming 3.7 release 2022-12-27 16:47:20 +03:00
Gleb Chesnokov
7dc56a07bf scst: Backport the PTR_ERR_OR_ZERO() function
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")
2022-12-27 16:23:46 +03:00
Gleb Chesnokov
ee6312ac5a scst_vdisk, qla2x00t-32gbit: Use PTR_ERR_OR_ZERO instead of IS_ERR and PTR_ERR
This patch doesn't change any functionality.
2022-12-21 15:04:05 +03:00
Gleb Chesnokov
64fb79629b scst_targ: Fix error handling in scst_mgmt_cmd_exec()
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.
2022-12-19 12:10:04 +03:00
Gleb Chesnokov
5dbe691552 qla2x00t: Fix use of uninitialized struct field
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.
2022-12-19 12:10:04 +03:00
Gleb Chesnokov
e8b300ef2a usr/fileio/common.c: Fix use of uninitialized struct field
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.
2022-12-19 12:10:04 +03:00
Gleb Chesnokov
8cd13de7f8 qla2x00t-32gbit: Initialize vha->unknown_atio_[list, work] for NPIV hosts
Initialization of vha->unknown_atio_list and vha->unknown_atio_work only
happens for base_vha in qlt_probe_one_stage1(). But there is no
initialization for NPIV hosts that are created in qla24xx_vport_create().

This causes a crash when trying to access these NPIV host fields.

Fix this by adding initialization to qla_vport_create().

Signed-off-by: Gleb Chesnokov <gleb.chesnokov@scst.dev>
Link: https://lore.kernel.org/r/376c89a2-a9ac-bcf9-bf0f-dfe89a02fd4b@scst.dev
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 95da5e58172c upstream ]

Fixes: https://github.com/SCST-project/scst/issues/56
2022-12-15 16:51:38 +03:00
Gleb Chesnokov
753ea9e778 qla2x00t-32gbit: Remove duplicate of vha->iocb_work initialization
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 ]
2022-12-15 16:51:38 +03:00
Gleb Chesnokov
ba8a969f80 qla2x00t-32gbit: Remove unused variable 'found_devs'
Variable 'found_devs' is just being incremented and it's never used
anywhere else. Remove it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20221101104733.30363-1-colin.i.king@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit e137b81d30e7 upstream ]
2022-12-15 16:51:38 +03:00