Commit Graph

6916 Commits

Author SHA1 Message Date
Bart Van Assche
b2b56e6eca qla2x00t-32gbit: Keep initiator ports after RSCN
The driver performs SCR (state change registration) in all modes including
pure target mode.

For each RSCN, scan_needed flag is set in qla2x00_handle_rscn() for the
port mentioned in the RSCN and fabric rescan is scheduled. During the
rescan, GNN_FT handler, qla24xx_async_gnnft_done() deletes session of the
port that caused the RSCN.

In target mode, the session deletion has an impact on ATIO handler,
qlt_24xx_atio_pkt(). Target responds with SAM STATUS BUSY to I/O incoming
from the deleted session. qlt_handle_cmd_for_atio() and
qlt_handle_task_mgmt() return -EFAULT if they are not able to find session
of the command/TMF, and that results in invocation of qlt_send_busy():

  qlt_24xx_atio_pkt_all_vps: qla_target(0): type 6 ox_id 0014
  qla_target(0): Unable to send command to target, sending BUSY status

Such response causes command timeout on the initiator. Error handler thread
on the initiator will be spawned to abort the commands:

  scsi 23:0:0:0: tag#0 abort scheduled
  scsi 23:0:0:0: tag#0 aborting command
  qla2xxx [0000:af:00.0]-188c:23: Entered qla24xx_abort_command.
  qla2xxx [0000:af:00.0]-801c:23: Abort command issued nexus=23:0:0 -- 0 2003.

Command abort is rejected by target and fails (2003), error handler then
tries to perform DEVICE RESET and TARGET RESET but they're also doomed to
fail because TMFs are ignored for the deleted sessions.

Then initiator makes BUS RESET that resets the link via
qla2x00_full_login_lip(). BUS RESET succeeds and brings initiator port up,
SAN switch detects that and sends RSCN to the target port and it fails
again the same way as described above. It never goes out of the loop.

The change breaks the RSCN loop by keeping initiator sessions mentioned in
RSCN payload in all modes, including dual and pure target mode.

Link: https://lore.kernel.org/r/20200605144435.27023-1-r.bolshakov@yadro.com
Fixes: 2037ce49d30a ("scsi: qla2xxx: Fix stale session")
Cc: Quinn Tran <qutran@marvell.com>
Cc: Arun Easi <aeasi@marvell.com>
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Daniel Wagner <dwagner@suse.de>
Cc: Himanshu Madhani <himanshu.madhani@oracle.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: stable@vger.kernel.org # v5.4+
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Shyam Sundar <ssundar@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

See also upstream commit 632f24f09d5b7c8a2f94932c3391ca957ae76cc4.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9125 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-29 15:20:49 +00:00
Bart Van Assche
0a2748f657 qla2x00t-32gbit: Set NVMe status code for failed NVMe FCP request
The qla2xxx driver knows when request was processed successfully or
not. But it always sets the NVMe status code to 0/NVME_SC_SUCCESS. The
upper layer needs to figure out from the rcv_rsplen and transferred_length
variables if the request was transferred successfully. This is not always
possible, e.g. when the request data length is 0, the transferred_length is
also set 0 which is interpreted as success in nvme_fc_fcpio_done(). Let's
inform the upper layer (nvme_fc_fcpio_done()) when something went wrong.

nvme_fc_fcpio_done() maps all non-NVME_SC_SUCCESS status codes to
NVME_SC_HOST_PATH_ERROR. There isn't any benefit to map the QLA status code
to the NVMe status code. Therefore, use NVME_SC_INTERNAL to indicate an
error which aligns it with the lpfc driver.

Link: https://lore.kernel.org/r/20200604100745.89250-1-dwagner@suse.de
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

See also upstream commit ef2e3ec520a8c20661ca4e7d17a5c7110d3a7828.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9124 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-29 15:19:56 +00:00
Bart Van Assche
be6191fb92 debian: make scst-dkms provide scst
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9123 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-29 03:17:06 +00:00
Bart Van Assche
15033c44c6 scst: Fix the RHEL 6 / 7 kernel_write() backport
This patch unbreaks persistent reservation support.

Fixes: 94018a42e3 ("scst: Use kernel_{read,write}() instead of scst_{read,write}()")
Reported-by: Gleb Chesnokov <Chesnokov.G@raidix.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9121 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-28 04:16:28 +00:00
Bart Van Assche
d333ce8232 Restore the on_alua_state_change_*() callback functions
Apparently the bind_alua_state functionality is being used. Hence restore
the on_alua_state_change_*() callback functions. The changes compared to
the previous implementation are:
* Only invoke the on_alua_state_change_*() callback functions if the state
  of a local target port group is being modified.
* Report information about ALUA callback activity with PRINT_INFO() instead
  of TRACE_MGMT_DBG().

This patch reverts commit 29548a4ad7 ("scst: Remove the
on_alua_state_change_*() callback functions").


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9120 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-10 00:31:42 +00:00
Bart Van Assche
e0c63c52e7 scst: Introduce the function __scst_tgt_set_state()
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9119 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-10 00:29:09 +00:00
Bart Van Assche
6616eb6cf7 scst_copy_mgr: Suppress a Coverity taint complaint
Suppress the following (false positive) Coverity complaint:

    CID 361193:  Insecure data handling  (TAINTED_SCALAR)
    Passing tainted variable "sense_len" to a tainted sink.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9118 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-09 00:42:32 +00:00
Bart Van Assche
41b4e25644 qla2x00t-32gbit: Always check the return value of qla24xx_get_isp_stats()
This patch fixes the following Coverity warning:

    CID 361199 (#1 of 1): Unchecked return value (CHECKED_RETURN)
    3. check_return: Calling qla24xx_get_isp_stats without checking return
    value (as is done elsewhere 4 out of 5 times).


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9117 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-09 00:41:51 +00:00
Bart Van Assche
31dbbf3274 usr/fileio: Suppress a Coverity complaint about 'page_size'
Suppress the following Coverity complaint:

    CID 361202:  Error handling issues  (NEGATIVE_RETURNS)
    "page_size" is passed to a parameter that cannot be negative.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9116 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-09 00:41:14 +00:00
Bart Van Assche
6138af9193 scst_pres: Fix a potential buffer overflow in tid_secure()
This was detected by Coverity.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9115 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-09 00:40:40 +00:00
Bart Van Assche
534f63f47b scst_pres: Use {get,put}_unaligned_be64() instead of {get,put}_unaligned_be()
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9114 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-09 00:37:56 +00:00
Bart Van Assche
754f932d5d scst: Revert r9108
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9109 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-08 15:22:23 +00:00
Bart Van Assche
048ddfc638 scst_lib: Fix two lockdep_assert_held() statements
Fixes: 628f3939bc ("scst: Rework SCSI pass-through support for kernel versions >= 2.6.30") # r5979.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9108 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-08 15:17:09 +00:00
Bart Van Assche
e05aab1c70 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9106 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-03 03:48:51 +00:00
Bart Van Assche
f397c9558c Fix scst-dkms-rpm build for EL mainline kernels
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9105 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-03 03:39:01 +00:00
Bart Van Assche
f0214a59bb Fix rpm build for EL mainline kernels
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9104 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-03 03:38:01 +00:00
Bart Van Assche
2bafc3bd51 scst: Fix three potential integer overflows
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9103 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-03 03:29:33 +00:00
Bart Van Assche
0aed574e88 scripts/generate-kernel-patch: Make this script appropriate for the trunk and 3.4.x branches
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9098 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-03 02:56:37 +00:00
Bart Van Assche
c973152d8d qla2x00t, qla2x00t-32gbit: Remove unused code
This was detected by the clang compiler.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9096 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-02 22:55:54 +00:00
Bart Van Assche
c22a2d11b1 iscsi-scst: Fix the CONFIG_IPV6=n build
See also https://github.com/bvanassche/scst/issues/23.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9095 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-02 22:54:39 +00:00
Bart Van Assche
b1331f9a90 qla2x00t-32gbit: Fix the RHEL / CentOS 8.2 build
This patch has been tested against kernel version 4.18.0-193.14.2.el8_2.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9094 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-02 21:54:29 +00:00
Bart Van Assche
3fd6a8c93c nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9093 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-02 21:53:42 +00:00
Bart Van Assche
ca607d88dd qla2x00t-32gbit: Change two fxdisc_entry_fx00 members from a scalar into an array
This patch does not change any functionality but suppresses a Coverity
warning.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9092 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-02 21:53:19 +00:00
Bart Van Assche
757b42c2ba qla2x00t: Fix two buffer overflows
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9091 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-02 21:22:13 +00:00
Bart Van Assche
1b5e2eb482 isert-scst: Fail login if max_sge is too small
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9090 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-02 21:21:38 +00:00
Bart Van Assche
ecea60a694 Make it possible to build SCST with clang
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9089 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-02 21:19:24 +00:00
Bart Van Assche
454c3fb81f Fix the qla2x00t-32gbit build on CentOS 8.2
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9087 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-29 01:59:10 +00:00
Bart Van Assche
93c7dae589 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9086 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-26 23:53:39 +00:00
Bart Van Assche
86d602973b iscsi-scst: Make this kernel module again independent of (M)OFED
This patch reverts f58c8248dd ("iscst-scst: Fix the OFED build"). This
patch partially reverts bd3355500a ("iscsi-scst, srpt: Rename the
PRE_CFLAGS variable into CONFTEST_FLAGS").


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9085 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-26 23:52:40 +00:00
Bart Van Assche
ebb024ff68 scst/include/backport.h: Backport qla2x00t-32gbit to older kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9084 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-26 23:51:54 +00:00
Bart Van Assche
f58c8248dd iscst-scst: Fix the OFED build
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9083 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-26 03:34:55 +00:00
Bart Van Assche
bd3355500a iscsi-scst, srpt: Rename the PRE_CFLAGS variable into CONFTEST_FLAGS
The latter name reflects better the role of this variable. Remove the
CPPFLAGS assignment from srpt/src/Kbuild because it is not useful.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9082 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-26 03:34:35 +00:00
Bart Van Assche
214628043e qla2x00t: Remove a useless assignment
This was detected by the clang compiler.

Fixes: c006b05884 ("Update of the initiator driver to one from kernel 2.6.26. Sorry, the prior kernels not supported anymore, but backport patches are welcome.") # r473.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9081 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-26 03:33:03 +00:00
Bart Van Assche
93c2711530 iscsi-scst, srpt: Modify the message that reports which kernel headers are used
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9080 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-26 03:31:02 +00:00
Bart Van Assche
7cfc811542 Rename srpt/src/Makefile into srpt/src/Kbuild
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9079 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-26 02:58:29 +00:00
Bart Van Assche
856bd8c1a1 configure tests: Rename Makefiles into Kbuild
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9078 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-26 02:52:51 +00:00
Bart Van Assche
2029062924 iscsi-scst, ib_srpt: Add a MODULE_LICENSE() to the configure tests
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9077 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-26 00:53:52 +00:00
Bart Van Assche
203d427368 iscsi-scst/kernel/isert-scst/Kbuild: Revert r9075 because it triggers duplicate symbol warnings on x86
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9076 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-26 00:49:48 +00:00
Bart Van Assche
770ffb6553 qla2x00t-32gbit: Address a set of sparse warnings
Fix the following sparse warnings:

drivers/scsi/qla2xxx/qla_isr.c:881:23: warning: restricted __le16 degrades to integer
drivers/scsi/qla2xxx/qla_isr.c:881:23: warning: cast to restricted __le16

Link: https://lore.kernel.org/r/20200715043358.21668-1-njavali@marvell.com
Signed-off-by: Shyam Sundar <ssundar@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

See also commit 58101f1504ad9b36e34533ec1fb01a8de80aa6d6 upstream.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9075 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-25 14:47:24 +00:00
Bart Van Assche
7b375842e9 qla2x00t-32gbit: Fix two recently introduced build errors
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9074 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-25 14:45:27 +00:00
Bart Van Assche
4f36320d77 ib_srpt, iscsi-scst: Add the configure tests necessary for building against kernel v5.8
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9073 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-25 14:42:04 +00:00
Bart Van Assche
e675bc7b0a qla2x00t-32gbit: SAN congestion management implementation
* Firmware Initialization with SCM enabled based on NVRAM setting and
  firmware support (About Firmware).

* Enable PUREX and add support for fabric performance impact
  notification (FPIN) handling.

* Allocate a default PUREX item for each vha to handle memory allocation
  failures in ISR.

Link: https://lore.kernel.org/r/20200630102229.29660-3-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Shyam Sundar <ssundar@marvell.com>
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

See also commit 9f2475fe7406b8ef5f97099c4980021344872d9f upstream.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9072 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-25 14:37:22 +00:00
Bart Van Assche
786c8d6fd3 qla2x00t-32gbit: Change in PUREX to handle FPIN ELS requests
SAN Congestion Management generates ELS pkts whose size can vary and be >
64 bytes. Change the PUREX handling code to support non-standard ELS pkt
size.

Link: https://lore.kernel.org/r/20200630102229.29660-2-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Shyam Sundar <ssundar@marvell.com>
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

See also commit 62e9dd177732843ae6c5b9d2ed61e7c9538fa276 upstream.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9071 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-25 14:35:24 +00:00
Bart Van Assche
977661eb0e qla2x00t-32gbit: Introduce a function for computing the debug message prefix
Instead of repeating the code for generating a debug message prefix six
times, introduce a function for computing the debug message prefix.

Link: https://lore.kernel.org/r/20200629225454.22863-10-bvanassche@acm.org
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Himanshu Madhani <himanshu.madhani@oracle.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

See also upstream commit e7019c95c40daf8e8a9fa1d5f36eabce2eb8ef6b.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9070 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-25 14:29:24 +00:00
Bart Van Assche
38ed627b73 qla2x00t-32gbit: Make qla2x00_restart_isp() easier to read
Instead of using complicated control flow to only have one return statement
at the end of qla2x00_restart_isp(), return an error status as soon as it
is known that this function will fail.

Link: https://lore.kernel.org/r/20200629225454.22863-9-bvanassche@acm.org
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Himanshu Madhani <himanshu.madhani@oracle.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

See also commit f85a299f5ec55c82403cd2bc4aeaaedebfcf5ef6 upstream.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9069 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-25 14:22:07 +00:00
Bart Van Assche
b7f0ee3cde qla2x00t-32gbit: Fix a Coverity complaint in qla2100_fw_dump()
'cnt' can exceed the size of the risc_ram[] array. Prevent that Coverity
complains by rewriting an address calculation expression. This patch fixes
the following Coverity complaint:

CID 337803 (#1 of 1): Out-of-bounds read (OVERRUN)
109. overrun-local: Overrunning array of 122880 bytes at byte offset 122880
by dereferencing pointer &fw->risc_ram[cnt].

Link: https://lore.kernel.org/r/20200629225454.22863-8-bvanassche@acm.org
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Himanshu Madhani <himanshu.madhani@oracle.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

See also commit 57fec9f24e580d8fe4219ee89572f49758e62c75 upstream.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9068 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-25 14:21:25 +00:00
Bart Van Assche
41d7c4e1fd qla2x00t-32gbit: Make __qla2x00_alloc_iocbs() initialize 32 bits of request_t.handle
The request_t 'handle' member is 32-bits wide, hence use wrt_reg_dword().
Change the cast in the wrt_reg_byte() call to make it clear that a regular
pointer is casted to an __iomem pointer.

Note: 'pkt' points to I/O memory for the qlafx00 adapter family and to
coherent memory for all other adapter families.

This patch fixes the following Coverity complaint:

CID 358864 (#1 of 1): Reliance on integer endianness (INCOMPATIBLE_CAST)
incompatible_cast: Pointer &pkt->handle points to an object whose effective
type is unsigned int (32 bits, unsigned) but is dereferenced as a narrower
unsigned short (16 bits, unsigned). This may lead to unexpected results
depending on machine endianness.

Link: https://lore.kernel.org/r/20200629225454.22863-7-bvanassche@acm.org
Fixes: 8ae6d9c7eb10 ("[SCSI] qla2xxx: Enhancements to support ISPFx00.")
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Himanshu Madhani <himanshu.madhani@oracle.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

See also commit f8f12bda53eae87ca2dea42b36d19e48c9851b9f upstream.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9067 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-25 14:20:47 +00:00
Bart Van Assche
82ae3e17f4 qla2x00t-32gbit: Remove a superfluous cast
Remove an unnecessary cast because it prevents the compiler to perform type
checking.
    
Link: https://lore.kernel.org/r/20200629225454.22863-6-bvanassche@acm.org
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Himanshu Madhani <himanshu.madhani@oracle.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Shyam Sundar <ssundar@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

See also commit 9bb013584a5ea18dfae89e33ded130cae08eb135 upstream.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9066 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-25 14:19:55 +00:00
Bart Van Assche
6c298568e9 qla2x00t-32gbit: Initialize 'n' before using it
The following code:
   
	qla82xx_rom_fast_read(ha, 0, &n)

only initializes 'n' if it succeeds. Since 'n' may be reported in a debug
message even if no ROM reads succeeded, initialize 'n' to zero.

This patch fixes the following sparse warning:

qla_nx.c:1218: qla82xx_pinit_from_rom() error: uninitialized symbol 'n'.

Link: https://lore.kernel.org/r/20200629225454.22863-5-bvanassche@acm.org
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Himanshu Madhani <himanshu.madhani@oracle.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Shyam Sundar <ssundar@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

See also commit 67668b5b13c7ba12f212d4b9067e54354ce5360b upstream.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9065 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-25 14:19:14 +00:00
Bart Van Assche
247d6d88b6 qla2x00t-32gbit: Make qla82xx_flash_wait_write_finish() easier to read
Return early instead of having a single return statement at the end of this
function. This patch fixes the following sparse warning:
    
qla_nx.c:1018: qla82xx_flash_wait_write_finish() error: uninitialized symbol 'val'.
    
Link: https://lore.kernel.org/r/20200629225454.22863-4-bvanassche@acm.org
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Himanshu Madhani <himanshu.madhani@oracle.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

See also commit 2f91a0a03c2da5140994d7b3d53469d07df9943c upstream.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9064 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-25 14:18:32 +00:00