Commit Graph

6826 Commits

Author SHA1 Message Date
Bart Van Assche
985a661701 qla2xxx: check UNLOADING before posting async work
qlt_free_session_done() tries to post async PRLO / LOGO, and waits for the
completion of these async commands. If UNLOADING is set, this is doomed to
timeout, because the async logout command will never complete.

The only way to avoid waiting pointlessly is to fail posting these commands
in the first place if the driver is in UNLOADING state.  In general,
posting any command should be avoided when the driver is UNLOADING.

With this patch, "rmmod qla2xxx" completes without noticeable delay.

Link: https://lore.kernel.org/r/20200421204621.19228-3-mwilck@suse.com
Fixes: 45235022da99 ("scsi: qla2xxx: Fix driver unload by shutting down chip")
Acked-by: Arun Easi <aeasi@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 5a263892d7d0b4fe351363f8d1a14c6a75955475 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9019 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-13 17:40:19 +00:00
Bart Van Assche
a44749aa37 scsi: qla2xxx: set UNLOADING before waiting for session deletion
The purpose of the UNLOADING flag is to avoid port login procedures to
continue when a controller is in the process of shutting down.  It makes
sense to set this flag before starting session teardown.

Furthermore, use atomic test_and_set_bit() to avoid the shutdown being run
multiple times in parallel. In qla2x00_disable_board_on_pci_error(), the
test for UNLOADING is postponed until after the check for an already
disabled PCI board.

Link: https://lore.kernel.org/r/20200421204621.19228-2-mwilck@suse.com
Fixes: 45235022da99 ("scsi: qla2xxx: Fix driver unload by shutting down chip")
Reviewed-by: Arun Easi <aeasi@marvell.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit 856e152a3c08bf7987cbd41900741d83d9cddc8e upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9018 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-13 17:39:48 +00:00
Bart Van Assche
36714f6759 qla2x00t-32gbit: Fix several compiler warnings
Fix the following compiler warnings:

drivers/scsi/qla2xxx/qla_dbg.c:2542:7: warning: The scope of the variable 'pbuf' can be reduced. [variableScope]
drivers/scsi/qla2xxx/qla_init.c:3615:6: warning: Variable 'rc' is assigned a value that is never used. [unreadVariable]
drivers/scsi/qla2xxx/qla_isr.c:81:11-29: WARNING: dma_alloc_coherent use in rsp_els already zeroes out memory, so memset is not needed
drivers/scsi/qla2xxx/qla_mbx.c:4889:15-33: WARNING: dma_alloc_coherent use in els_cmd_map already zeroes out memory, so memset is not needed

[mkp: added newline after variable declaration]

Link: https://lore.kernel.org/r/20200403084018.30766-2-njavali@marvell.com
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit bb46737ec09e9a072424bf46def2977c5b6b925d upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9017 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-13 17:38:05 +00:00
Bart Van Assche
5ddb45d914 Simplify the top-level Makefile
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9015 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-13 16:57:19 +00:00
Bart Van Assche
87bde8ab0e fcst/README: Update this README file
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9014 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-13 16:22:00 +00:00
Bart Van Assche
f875ebe281 README.md: Add a reference to INSTALL.md
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9013 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-13 16:13:15 +00:00
Bart Van Assche
3b13091cd5 Convert the README file to the markdown syntax such that it looks better on the github website
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9012 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-13 16:12:02 +00:00
Bart Van Assche
d5bc1e31f8 Add instructions for building and installing SCST
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9011 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-13 16:04:01 +00:00
Bart Van Assche
c91dbe8c60 scst: Fix the ARM build
When compiling SCST for an ARM CPU then do_div() checks whether its first
argument has type u64. Make sure that this is the case.

See also https://github.com/bvanassche/scst/issues/23.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9006 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-10 02:37:18 +00:00
Bart Van Assche
5500096a2b scst_local: Remove CONFIG_SCST_LOCAL_DIRECT_PROCESSING
Simplify the scst_local driver by always using thread context for passing
commands to SCST.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9005 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-07 00:28:10 +00:00
Bart Van Assche
bb1b1ba162 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9004 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-06 22:56:29 +00:00
Bart Van Assche
3b4ba67d8b scripts: Rework the approach for building older kernels with a recent gcc
Instead of setting KCFLAGS, modify include/linux/compiler-gcc.h.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9003 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-06 17:09:44 +00:00
Bart Van Assche
c51cf132e1 iscsi-scst: Add network namespace support
This patch makes it possible to run the SCST iSCSI target software inside
a Docker container that uses another network namespace than the default.
    
See also https://github.com/bvanassche/scst/issues/24 .


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9002 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-06 16:27:41 +00:00
Bart Van Assche
c647d76ef2 Fix compiler warnings triggered by building against the musl C library
See also https://github.com/bvanassche/scst/issues/23.

Reported-by: Lucian Cristian lucian.cristian@gmail.com


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9001 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 04:52:50 +00:00
Bart Van Assche
9be61ba538 Move KBUILD_EXTRA_SYMBOLS definitions into the kernel Makefiles
$(KBUILD_EXTRA_SYMBOLS) is not only used at compile time but also at link
time. Move the $(KBUILD_EXTRA_SYMBOLS) definitions such that it is
available both at compile time and at link time.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9000 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 02:15:47 +00:00
Bart Van Assche
80ac4d2810 Use $(src) instead of $(KBUILD_EXTMOD)
While $(src) is always defined, $(KBUILD_EXTMOD) is only defined when
building code as an external module.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8999 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 02:12:09 +00:00
Bart Van Assche
f7fe23928f Change $(MODULE_SYMVERS) into Module.symvers
Or in other words, drop support for kernel versions before 2.6.18.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8998 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 02:11:16 +00:00
Bart Van Assche
6c785d14b9 usr/fileio/fileio: Fix align_alloc()
User space code must not use PAGE_SIZE but must use sysconf(_SC_PAGESIZE)
instead to obtain the page size.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8997 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 02:09:31 +00:00
Bart Van Assche
e05b550817 scst/include/backport.h: Improve the FC_PORTSPEED_64GBIT backport
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8996 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 02:06:05 +00:00
Bart Van Assche
5aeb06e3a8 scst/include/backport.h: Improve the cpu_to_be32_array() backport
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8995 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 02:05:35 +00:00
Bart Van Assche
7e12731282 scst/include/backport.h: Improve the MIN_NICE backport
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8994 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 02:04:44 +00:00
Bart Van Assche
08ab4d2e36 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8993 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-31 21:45:47 +00:00
Bart Van Assche
fda71c077d Include <poll.h> instead of <sys/poll.h>
According to the Single Unix Specification, the poll() function has been
declared in the <poll.h> header file. This makes the SCST code compatible
with the musl C library. See also https://en.wikipedia.org/wiki/Musl. See
also https://github.com/bvanassche/scst/issues/23.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8992 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-31 03:41:17 +00:00
Bart Van Assche
1adaafdab1 qla2x00t-32gbit: Unbreak the 32-bit build
Note: this is not an attempt to port this driver to 32-bit systems.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8991 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-31 03:29:53 +00:00
Bart Van Assche
c6ff35fdee qla2x00t: Fix a 32-bit compiler warning
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8990 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-31 03:29:06 +00:00
Bart Van Assche
4458868846 scst_user: Fix a 32-bit compiler warning
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8989 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-31 03:28:33 +00:00
Vladislav Bolkhovitin
e25650f872 web: users page updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8988 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-29 07:34:24 +00:00
Vladislav Bolkhovitin
66316e323d www: Update copyright footer
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8987 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-28 19:10:11 +00:00
Bart Van Assche
630573ed19 scripts/generate-kernel-patch: Parse the kernel version properly
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8986 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-26 20:14:20 +00:00
Bart Van Assche
3612dfb616 scst: Remove an unused macro
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8985 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-26 18:24:32 +00:00
Bart Van Assche
4b9e849cef scst: Adjust indentation to keep checkpatch happy
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8984 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-26 18:18:30 +00:00
Bart Van Assche
ac0de9d485 ib_srpt: Limit the number of scatter/gather elements in RDMA READs to max_sge_rd
Additionally, declare the max_sge_delta parameter obsolete.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8983 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-25 18:19:45 +00:00
Bart Van Assche
52497bb8b6 ib_srpt: Introduce a new local variable in srpt_map_sg_to_ib_sge()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8982 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-25 18:18:02 +00:00
Bart Van Assche
af498fafdd nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8981 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-25 18:17:22 +00:00
Bart Van Assche
51dc30f27b ib_srpt: Fix the build for kernel versions before v5.3
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8980 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-24 15:57:29 +00:00
Bart Van Assche
6077ad2b7b scst/include/backport.h: Backport the MIN_NICE definition
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8979 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 23:48:56 +00:00
Bart Van Assche
67fad5fb7b ib_srpt: Backport the max_sge_delta calculation to kernel versions < v4.17
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8978 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 23:48:31 +00:00
Bart Van Assche
f4eaed79d1 scripts/generate-kernel-patch: Fix the kernel version passed to specialize-patch
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8977 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 23:46:03 +00:00
Bart Van Assche
a88046be97 qla2xxx: Minimize diffs with upstream
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8976 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 22:53:52 +00:00
Bart Van Assche
ac5f86c035 qla2xxx: Fix a NULL pointer dereference in an error path
[ commit 17c5f65db629a3bd95ac8eb960940b6fbb39a310 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8975 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 22:52:09 +00:00
Bart Van Assche
bac6ce6350 qla2xxx: Fix endianness annotations in source files
[ commit 7ffa5b939751b6638e4a99518775c8503fbb46be upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8974 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 22:23:17 +00:00
Bart Van Assche
3e86d771e0 qla2xxx: Fix endianness annotations in header files
Annotate members of FC protocol and firmware dump data structures as big
endian. Annotate members of RISC control structures as little endian.
Annotate mailbox registers as little endian. Annotate the mb[] arrays as
CPU-endian because communication of the mb[] values with the hardware
happens through the readw() and writew() functions. readw() converts from
__le16 to u16 and writew() converts from u16 to __le16. Annotate 'handles'
as CPU-endian because for the firmware these are opaque values.

[ commit 21038b0900d1b8728ec77d9286d7b0b57ca7b585 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8973 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 22:20:52 +00:00
Bart Van Assche
e2e106d53c qla2xxx: Use make_handle() instead of open-coding it
[ commit 2a4b684ab0aa2a8f8efede77ca1525042c2c0e01 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8972 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 22:20:22 +00:00
Bart Van Assche
80041b881e qla2xxx: Cast explicitly to uint16_t / uint32_t
Casting a pointer to void * and relying on an implicit cast from void *
to uint16_t or uint32_t suppresses sparse warnings about endianness. Hence
cast explicitly to uint16_t and uint32_t. Additionally, remove superfluous
void * casts.

[ commit ab053c09ee2066a2fe62a755f1e64dbc8eddc17c upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8971 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 22:19:55 +00:00
Bart Van Assche
6e9f52f1d4 qla2xxx: Change {RD,WRT}_REG_*() function names from upper case into lower case
This was suggested by Daniel Wagner.

[ commit 04474d3a1c968119e7214c312b273dee01258cad upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8970 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 22:19:28 +00:00
Bart Van Assche
76ab4d5949 qla2xxx: Use register names instead of register offsets
[ commit c3888416221849ed46fd35413c7a1d00ee291cbe upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8969 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 22:18:44 +00:00
Bart Van Assche
807e5ec091 qla2xxx: Fix the code that reads from mailbox registers
Make the MMIO accessors strongly typed such that the compiler checks
whether the accessor function is used that matches the register width. Fix
those MMIO accesses where another number of bits was read or written than
the size of the register.

[ commit 37139da1b097e06841d40a6055db64c78755aea9 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8968 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 22:16:57 +00:00
Bart Van Assche
641a56ec5b qla2xxx: Change two hardcoded constants into offsetof() / sizeof() expressions
[ commit e544b720ef3191cdb6d3ea2915f82973d6372bca upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8967 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 22:15:33 +00:00
Bart Van Assche
55bcb91c24 qla2xxx: Increase the size of struct qla_fcp_prio_cfg to FCP_PRIO_CFG_SIZE
[ commit d9ab5f1f05fc147682d4fd1f1f1c5af00b766e33 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8966 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 22:15:03 +00:00
Bart Van Assche
e792922328 qla2xxx: Make a gap in struct qla2xxx_offld_chain explicit
[ commit 66f86367771507c88a970644d13646f6b57e82e5 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8965 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 22:14:18 +00:00