Commit Graph

7785 Commits

Author SHA1 Message Date
Bart Van Assche
c0804fe6a8 Merge branch 'svn-trunk' 2020-06-21 09:28:11 -07:00
Bart Van Assche
a79655c1eb scst/include/backport.h: Improve kobj_ns_grab_current() backport
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9032 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-21 16:28:01 +00:00
Bart Van Assche
f8ea030ee1 scst/include/backport.h: Backport more percpu_ref functionality
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9031 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-21 16:27:28 +00:00
Bart Van Assche
7ecad01e71 scst, percpu_ref backport: For older kernels, use atomic instead of atomic_long
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9030 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-21 16:27:05 +00:00
Bart Van Assche
a15b910b02 Merge branch 'svn-trunk' 2020-06-21 09:08:55 -07:00
Bart Van Assche
bfbc3ac6e7 scripts/specialize-patch: Improve RHEL / CentOS support
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9029 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-21 16:08:48 +00:00
Bart Van Assche
09d4e1e443 scripts/kernel-functions: Improve gcc 10 support
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9028 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-21 16:08:22 +00:00
Bart Van Assche
8174bad3da scripts/kernel-functions: Make it possible to build older kernels with gcc 10
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9027 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-21 16:07:16 +00:00
Bart Van Assche
ff9406cbd8 Merge branch 'svn-trunk' 2020-06-16 18:36:04 -07:00
Bart Van Assche
f7b704ee99 scst, iscsi-scst: Port to RHEL / CentOS 8.2
Apparently the Linux kernel v4.20 iov_iter_kvec() function has been
backported to RHEL / CentOS 8.2. This patch fixes the following kernel
warning:

WARNING: CPU: 26 PID: 21141 at lib/iov_iter.c:1083 iov_iter_kvec+0x25/0x30
Call Trace:
 fileio_exec_async+0x216/0x3a0 [scst_vdisk]
 fileio_exec_write+0x3b9/0x450 [scst_vdisk]
 vdev_do_job+0x34/0xc0 [scst_vdisk]
 scst_do_real_exec+0x54/0x100 [scst]
 scst_exec_check_blocking+0xbb/0x210 [scst]
 scst_process_active_cmd+0x64d/0x1550 [scst]
 scst_cmd_thread+0x170/0x5a0 [scst]
 kthread+0x112/0x130
 ret_from_fork+0x35/0x40

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


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9026 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-17 01:35:53 +00:00
Bart Van Assche
39735956c7 nightly build: Add RHEL / CentOS 8.2 kernel
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9025 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-17 01:33:18 +00:00
Bart Van Assche
4682647ae5 Merge branch 'svn-trunk' 2020-06-16 10:39:45 -07:00
Bart Van Assche
de023fe1fe scst/include/backport.h: Fix the build against CentOS 8.2
See also https://github.com/bvanassche/scst/issues/25.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9024 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-16 17:39:35 +00:00
Bart Van Assche
6327055e26 INSTALL.md: Remove trailing whitespace
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9023 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-16 17:39:09 +00:00
Bart Van Assche
145e878b1f Merge branch 'svn-trunk' 2020-06-13 10:45:43 -07:00
Bart Van Assche
3a957d352a qla2xxx: Do not log message when reading port speed via sysfs
Calling ql_log() inside qla2x00_port_speed_show() is causing messages to be
output to the console for no particularly good reason.  The sysfs read
routine should just return the information to userspace.  The only reason
to log a message is when the port speed actually changes, and this already
occurs elsewhere.

Link: https://lore.kernel.org/r/20200504175416.15417-1-emilne@redhat.com
Fixes: 4910b524ac9e ("scsi: qla2xxx: Add support for setting port speed")
Cc: <stable@vger.kernel.org> # v5.1+
Reviewed-by: Lee Duncan <lduncan@suse.com>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

[ commit fb9024b0646939e59d8a0b6799b317070619795a upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9022 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-13 17:42:10 +00:00
Bart Van Assche
703b35fcbe qla2xxx: Delete all sessions before unregister local nvme port
Delete all sessions before unregistering local nvme port.  This allows nvme
layer to decrement all active rport count down to zero.  Once the count is
down to zero, nvme would call qla to continue with the npiv port deletion.

PID: 27448  TASK: ffff9e34b777c1c0  CPU: 0   COMMAND: "qaucli"
 0 [ffff9e25e84abbd8] __schedule at ffffffff977858ca
 1 [ffff9e25e84abc68] schedule at ffffffff97785d79
 2 [ffff9e25e84abc78] schedule_timeout at ffffffff97783881
 3 [ffff9e25e84abd28] wait_for_completion at ffffffff9778612d
 4 [ffff9e25e84abd88] qla_nvme_delete at ffffffffc0e3024e [qla2xxx]
 5 [ffff9e25e84abda8] qla24xx_vport_delete at ffffffffc0e024b9 [qla2xxx]
 6 [ffff9e25e84abdf0] fc_vport_terminate at ffffffffc011c247 [scsi_transport_fc]
 7 [ffff9e25e84abe28] store_fc_host_vport_delete at ffffffffc011cd94 [scsi_transport_fc]
 8 [ffff9e25e84abe70] dev_attr_store at ffffffff974b376b
 9 [ffff9e25e84abe80] sysfs_kf_write at ffffffff972d9a92
10 [ffff9e25e84abe90] kernfs_fop_write at ffffffff972d907b
11 [ffff9e25e84abec8] vfs_write at ffffffff9724c790
12 [ffff9e25e84abf08] sys_write at ffffffff9724d55f
13 [ffff9e25e84abf50] system_call_fastpath at ffffffff97792ed2
    RIP: 00007fc0bd81a6fd  RSP: 00007ffff78d9648  RFLAGS: 00010202
    RAX: 0000000000000001  RBX: 0000000000000022  RCX: 00007ffff78d96e0
    RDX: 0000000000000022  RSI: 00007ffff78d94e0  RDI: 0000000000000008
    RBP: 00007ffff78d9440   R8: 0000000000000000   R9: 00007fc0bd48b2cd
    R10: 0000000000000017  R11: 0000000000000293  R12: 0000000000000000
    R13: 00005624e4dac840  R14: 00005624e4da9a10  R15: 0000000000000000
    ORIG_RAX: 0000000000000001  CS: 0033  SS: 002b

Link: https://lore.kernel.org/r/20200331104015.24868-4-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
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 c48f849d3f7a4ec1025105f446e29d395c4dcc2f upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9021 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-13 17:41:34 +00:00
Bart Van Assche
6bbee1b222 qla2xxx: Fix hang when issuing nvme disconnect-all in NPIV
In NPIV environment, a NPIV host may use a queue pair created by base host
or other NPIVs, so the check for a queue pair created by this NPIV is not
correct, and can cause an abort to fail, which in turn means the NVME
command not returned.  This leads to hang in nvme_fc layer in
nvme_fc_delete_association() which waits for all I/Os to be returned, which
is seen as hang in the application.

Link: https://lore.kernel.org/r/20200331104015.24868-3-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.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>

[ commit 45a76264c26fd8cfd0c9746196892d9b7e2657ee upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9020 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-13 17:40:49 +00:00
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
637f41385f Merge branch 'svn-trunk' 2020-06-13 09:57:26 -07: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
47eba9d2ea Merge branch 'svn-trunk' 2020-06-13 09:22:05 -07: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
2d55b8a2f5 Merge branch 'svn-trunk' 2020-06-13 09:12:06 -07: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
854d34f3f2 Merge branch 'svn-trunk' 2020-06-13 09:04:05 -07: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
21d79e0870 Merge branch 'svn-trunk' 2020-06-09 19:37:27 -07: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
09d2799d91 Merge branch 'svn-trunk' 2020-06-06 17:28:19 -07: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
ee5378eb98 Merge branch 'svn-trunk' 2020-06-06 15:56:48 -07: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
588a91b5af Merge branch 'svn-trunk' 2020-06-06 09:27:57 -07: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
7a99c7a6fe Merge branch 'svn-trunk' 2020-05-31 21:53:56 -07: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
be0b5172d2 Merge branch 'svn-trunk' 2020-05-31 19:15:58 -07: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