Commit Graph

6173 Commits

Author SHA1 Message Date
Bart Van Assche
ca68c9e2dd qla2x00t-32gbit: Unbreak the build against kernel versions <= 4.5
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8324 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-02 15:05:58 +00:00
Bart Van Assche
38adb4f457 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8323 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-02 14:57:34 +00:00
Bart Van Assche
f19f8e80a1 qla2xxx-32gbit: Cleanup redundant qla2x00_abort_all_cmds during unload
This patch removes redundant qla2x00_abort_all_cmds() during driver unload.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8322 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-02 03:36:18 +00:00
Bart Van Assche
8759ca2caa qla2xxx-32gbit: Set remote port devloss timeout to 0
This patch sets remote_port_devloss value to 0. This indicates to FC-NVMe
transport that driver is unloading and transport should not retry.

Fixes: e476fe8af5ff ("scsi: qla2xxx: Fix unload when NVMe devices are configured")



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8321 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-02 03:35:17 +00:00
Bart Van Assche
4fda446112 qla2xxx-32gbit: Remove two superfluous casts
Casting a void pointer into another pointer before assigning the pointer to
a variable is not useful. Hence remove such casts.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8320 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-02 03:22:58 +00:00
Bart Van Assche
dbc253a314 qla2xxx-32gbit: Remove qla_tgt_cmd.data_work and qla_tgt_cmd.data_work_free
The 'data_work' and 'data_work_free' member variables are set but never
used. Hence remove both member variables. See also commit 6bcbb3174caa
("qla2xxx: Fix incorrect tcm_qla2xxx_free_cmd use during TMR ABORT (v2)").


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8319 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-02 03:22:24 +00:00
Bart Van Assche
c383def6ab qla2xxx-32gbit: Fix formatting of pointer types
Improve source code readability by following the Linux kernel coding style
for pointer types. This patch only changes whitespace.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8318 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-02 03:20:14 +00:00
Bart Van Assche
abbd6b024f qla2xxx-32gbit: Leave a blank line after declarations
This patch improves readability of the qla2xxx source code.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8317 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-02 03:19:40 +00:00
Bart Van Assche
5850564555 qla2xxx-32gbit: Use tabs to indent code
Most but not all code in the qla2xxx driver uses tabs for indentation.
Make the qla2xxx code easier to read by using tabs consistently for
indentation. This patch improves conformance with the Linux kernel coding
style.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8316 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-02 03:18:32 +00:00
Bart Van Assche
66736ef516 qla2xxx: Reduce the number of forward declarations
Move the SCSI host template definition after the definition of the
functions that it references. Remove the forward declarations that became
unnecessary by that change. This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8315 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-02 03:12:58 +00:00
Bart Van Assche
db909e68ec qla2x00t-32gbit: Insert spaces where required
Improve source code readability by inserting spaces where these are
required according to the coding standard. This patch only inserts
whitespace and does not make any other changes.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8314 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-02 03:05:59 +00:00
Bart Van Assche
ff892731e1 qla2x00t-32gbit: display FC-NVMe port roles
Currently the FC-NVMe driver is leverating the SCSI FC transport class to
access the remote ports. Which means that all FC-NVMe remote ports will be
visible to the fc transport layer, but due to missing definitions the port
roles will always be 'unknown'.  This patch adds the missing definitions to
the fc transport class to that the port roles are correctly displayed.

Upstream commit: a6a6d0589ac4 ("scsi: scsi_transport_fc: nvme: display FC-NVMe port roles").



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8313 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-02 01:23:37 +00:00
Bart Van Assche
0384506862 qla2x00t-32gbit/qla_init.c: Minimize diffs with upstream
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8312 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-02 00:52:23 +00:00
Bart Van Assche
94a78fcc94 qla2x00t-32gbit/qla_gbl.h: Minimize diffs with upstream
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8311 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-02 00:50:02 +00:00
Bart Van Assche
f9b50fa1e3 qla2x00t-32gbit/qla_isr.c: Fix a sparse complaint
Avoid that the 'sparse' static checker complains that the ha->msix_entries[]
array can be accessed outside its bounds. 


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8310 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-02 00:01:08 +00:00
Bart Van Assche
478ee96c23 qla2x00t-32gbit/qla_iocb.c: Minimize diffs with upstream
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8309 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 23:58:31 +00:00
Bart Van Assche
47f648c88f qla2x00t-32gbit/qla_init.c: Minimize diffs with upstream
Move a few function definitions to minimize the diffs with the code in
the upstream Linux kernel.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8308 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 23:52:05 +00:00
Bart Van Assche
ab1210a555 qla2x00t-32gbit/qla_gs.c: Improve conformance with the Linux kernel coding style
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8307 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 23:46:12 +00:00
Bart Van Assche
c6b032a4c9 qla2xxx-32gbit: Move qla2x00_set_fcport_state() from a .h into a .c file
The qla2x00_set_fcport_state() function is not in the hot path so move its
definition from a .h into a .c file.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8306 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 23:44:06 +00:00
Bart Van Assche
9ba763d4c9 qla2xxx-32gbit: Move the port_state_str[] definition from a .h to a .c file
Reduce the size of the qla2xxx kernel module by moving an array definition
from a .h into a .c file.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8305 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 23:39:21 +00:00
Bart Van Assche
7fecd3b8eb qla2x00t-32gbit/qla_attr: Use whitespace according to the Linux kernel coding style
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8304 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 23:33:56 +00:00
Bart Van Assche
d51104193e qla2xxx-32gbit: Avoid that qlt_send_resp_ctio() corrupts memory
The "(&ctio->u.status1.sense_data)[i]" where i >= 0 expressions in
qlt_send_resp_ctio() are probably typos and should have been
"(&ctio->u.status1.sense_data[4 * i])" instead. Instead of only fixing
these typos, modify the code for storing sense data such that it becomes
easy to read. This patch fixes a Coverity complaint about accessing an
array outside its bounds.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8303 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 23:20:21 +00:00
Bart Van Assche
1ef60963cc qla2xxx-32gbit: Complain loudly about reference count underflow
A reference count underflow is a severe bug. Hence complain loudly if a
reference count underflow happens.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8302 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 23:19:24 +00:00
Bart Van Assche
f227304e06 qla2xxx-32gbit: Use __le64 instead of uint32_t[2] for sending DMA addresses to firmware
This patch makes the code easier to read and more compact.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8301 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 23:17:12 +00:00
Bart Van Assche
eebffe2501 qla2xxx-32gbit: Introduce the dsd32 and dsd64 data structures
Introduce two structures for the (DMA address, length) combination instead
of using separate structure members for the DMA address and length. This
patch fixes several Coverity complaints about 'cur_dsd' being used to write
outside the bounds of structure members.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8300 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 23:16:12 +00:00
Bart Van Assche
4617ce2b50 qla2x00t-32gbit: Check the size of firmware data structures at compile time
Since the next patch will modify several firmware data structures, add
compile time checks that verify that these structures have the correct
size.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8299 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 23:01:38 +00:00
Bart Van Assche
b3b35716cf qla2x00t-32gbit: Move a chunk of code
Move two if-statements from where the 'patch' command dropped them to
where these should be. See also r8296.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8298 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 22:59:06 +00:00
Bart Van Assche
a9b07e561b qla2xxx-32gbit: Simplify qlt_send_term_imm_notif()
All qlt_send_term_imm_notif() callers pass '1' as second argument to this
function. Hence remove the (broken) code that depends on that second
argument having another value. Add a pr_debug() statement that prints rc to
avoid that the compiler would complain that rc has been set but is not
used.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8297 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 22:41:38 +00:00
Bart Van Assche
a013fe2845 qla2xxx-32gbit: Fix use-after-free issues in qla2xxx_qpair_sp_free_dma()
The current order for freeing memory is as follows:
- struct crc_context itself.
- struct crc_context member pointers.
    
Change the freeing order into the following:
- struct crc_context member pointers.
- struct crc_context itself.

Detected by Coverity.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8296 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 22:40:58 +00:00
Bart Van Assche
b4a3564f34 qla2xxx-32gbit: Avoid that qla2x00_mem_free() crashes if called twice
Clear each pointer after having freed memory such that it becomes safe to
call qla2x00_mem_free() twice.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8295 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 22:40:15 +00:00
Bart Van Assche
e83ea77222 qla2xxx-32gbit: Make qla2x00_mem_free() easier to verify
Instead of clearing all freed pointers at the end of qla2x00_mem_free(),
clear freed pointers immediately after having freed the memory these
pointers point at.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8294 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 22:39:39 +00:00
Bart Van Assche
bfeb9ad911 qla2xxx-32gbit: Increase the size of the mailbox arrays from 4 to 8
This patch avoids that Coverity complains that qla2x00_async_event() writes
outside the bounds of the mb[] arrays (MBA_IDC_AEN case).


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8293 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 22:38:41 +00:00
Bart Van Assche
6697b57398 qla2xxx-32gbit: Avoid that Coverity complains about dereferencing a NULL rport pointer
Since Coverity cannot know that rport != NULL in qla2xxx_queuecommand() and
since there is code in that function that dereferences the rport pointer,
modify qla2xxx_queuecommand() such that it fails SCSI commands if rport ==
NULL.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8292 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 22:37:52 +00:00
Bart Van Assche
ff552bdfa7 qla2xxx-32gbit: Remove the fcport test from qla_nvme_abort_work()
Testing whether a pointer is not NULL after it has been dereferenced is not
useful. Hence remove the if (fcport) test. This was detected by Coverity.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8291 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 22:37:22 +00:00
Bart Van Assche
d5a19f6c1c qla2xxx-32gbit: Uninline qla2x00_init_timer()
Since qla2x00_init_timer() is not used for I/O commands there is no need to
inline this function. Hence uninline this function.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8290 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 22:34:07 +00:00
Bart Van Assche
ae6d50582f qla2xxx-32gbit: Move qla2x00_is_reserved_id() from qla_inline.h into qla_init.c
The previous patch moved all qla2x00_is_reserved_id() callers into
qla_init.c. Hence also move the qla2x00_is_reserved_id() definition into
qla_init.c.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8289 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 22:29:36 +00:00
Bart Van Assche
993f07b74f qla2xxx-32gbit: Move qla2x00_clear_loop_id() from qla_inline.h into qla_init.c
Since qla2x00_clear_loop_id() is not in the hot path, uninline it.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8288 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 22:29:02 +00:00
Bart Van Assche
0e50ffda1a qla2xxx-32gbit: Remove a set-but-not-used variable
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8287 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 22:28:18 +00:00
Bart Van Assche
f76b3147ab qla2xxx-32gbit: Declare qla2x00_find_new_loop_id() static
Since all qla2x00_find_new_loop_id() calls occur in the same source file as
the definition of this function, move that function to just before its
first caller and declare it static. Convert the header above this function
into kernel-doc format.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8286 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 22:26:16 +00:00
Bart Van Assche
58b24c2734 qla2xxx-32gbit: Move qla2x00_set_reserved_loop_ids() definition
Since qla2x00_set_reserved_loop_ids() only has a single caller, move it
into the source file from where it is called.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8285 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 22:25:26 +00:00
Bart Van Assche
bc06224388 qla2xxx-32gbit: Update a source code comments
Change one occurrence of "*(" into "()". Fix the reference to
qla_tgt_handle_cmd_for_atio(): there has never been a function with
that name.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8284 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-01 22:23:47 +00:00
Bart Van Assche
15bc114ea6 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8277 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-04-27 14:52:21 +00:00
Bart Van Assche
dd2f349de4 qla2x00t-32gbit, target: Do not submit the NEXUS LOSS task management function when freeing a session
Submitting the NEXUS LOSS task management function is not required when
freeing an SCST session.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8276 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-04-24 01:45:46 +00:00
Bart Van Assche
dca2301b6a qla2x00t-32gbit: Fix qla24xx_abort_sp_done()
Avoid that the complete() and sp->free() calls are ignored if aborting
a command times out.

Reported-by: Shen Qiyu <shenqiyu@hotmail.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8275 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-04-24 01:44:26 +00:00
Bart Van Assche
b8b7736187 qla2xxx-32gbit: Silence Sucessful ELS IOCB message
ELS IOCB done message should be moved to verbose logging
to prevent confusion about the error case v/s sucessful
submission case.

Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8274 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-04-24 01:37:38 +00:00
Bart Van Assche
70a4e33a7f qla2xxx-32gbit: Fix device staying in blocked state
From: Quinn Tran <qtran@marvell.com>

This patch fixes issue reported by some of the customers,
who discovered that after cable pull scenario the devices
disappear and path seems to remain in blocked state. Once
the device reappears, driver does not seem to update path
to online. This issue appears because of the defer flag
creating race condition where the same session reappears.
This patch fixes this issue by indicating SCSI-ML of device
lost when qlt_free_session_done() is called from qlt_unreg_sess().

Fixes: "qla2xxx: Improve RSCN handling in driver"
Signed-off-by: Quinn Tran <qtran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8273 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-04-24 01:36:44 +00:00
Bart Van Assche
33f2f4a064 Makefiles: Only read the build_mode file if building inside the SCST tree
This patch avoids that the build_mode file is read when applying the
generate-kernel-patch output to the kernel tree and when building the
kernel tree.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8272 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-04-23 17:11:26 +00:00
Bart Van Assche
74354ff7f0 scst: Fix the build against Ubuntu kernel 4.15.0
Reported-by: Tomohiro Kusumi


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8271 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-04-23 01:00:43 +00:00
Bart Van Assche
9c19181cca nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8270 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-04-22 03:52:03 +00:00
Bart Van Assche
9b37ec66b4 usr/fileio/common.c: Fix a compiler warning
Avoid that the compiler complains that the assert() expression compares a
signed with an unsigned integer.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8269 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-04-21 19:13:35 +00:00