Commit Graph

6386 Commits

Author SHA1 Message Date
Bart Van Assche
32aefe4307 qla2x00t-32gbit: Fix-up for r8552
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8553 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:45:48 +00:00
Bart Van Assche
a2cefa63a9 qla2x00t-32gbit: Inline the qla2x00_fcport_event_handler() function
Instead of calling qla2x00_fcport_event_handler() and letting the switch
statement inside that function decide which other function to call, call
the latter function directly. Remove the event member from the event_arg
structure because it is no longer needed. Remove the
qla_handle_els_plogi_done() function because it is never called.

[ commit 897def2004213636ffe2e9ee6a75660c5b53b03d upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8552 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:38:32 +00:00
Bart Van Assche
446ae45661 qla2x00t-32gbit: Report invalid mailbox status codes
It is easy to mix up the QLA_* and the MBS_* status codes. Complain loudly
if that happens.

[ commit 724361921f65a40ae5b80641dc1e92c0ff314d89 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8551 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:37:55 +00:00
Bart Van Assche
cddc0c892d qla2x00t-32gbit: Remove superfluous sts_entry_* casts
The C language supports implicit casting of void pointers to non-void
pointers. Remove explicit sts_entry_* casts that are not necessary.

[ commit 1a20719e074ada3e6d06ee065afd527779a6793b upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8550 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:37:29 +00:00
Bart Van Assche
f5a2e51016 qla2x00t-32gbit: Let the compiler check the type of the SCSI command context pointer
Split srb_cmd.ctx into two pointers such that the compiler can check the
type of that pointer.

[ commit 5ec9f9040f61dfd0412a53fa2fc1e321727a5a61 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8549 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:36:49 +00:00
Bart Van Assche
72cc459a40 qla2x00t-32gbit: Complain if sp->done() is not called from the completion path
Not calling sp->done() from the command completion path is a severe bug.
Hence complain loudly if that happens.

[ commit 88263208dd23327b56fbd7c2858c389c1153b366 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8548 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:36:13 +00:00
Bart Van Assche
1f88b95c15 qla2x00t-32gbit: Introduce qla2xxx_get_next_handle()
This patch reduces code duplication.
    
[ commit bcc856574356df2eb5eb2d4491e7205339e55728 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8547 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:35:42 +00:00
Bart Van Assche
bc7f5b55fb qla2x00t-32gbit: Fix a race condition between aborting and completing a SCSI command
Instead of allocating a struct srb dynamically from inside .queuecommand(),
set qla2xxx_driver_template.cmd_size such that struct scsi_cmnd and struct
srb are contiguous. Do not call QLA_QPAIR_MARK_BUSY() /
QLA_QPAIR_MARK_NOT_BUSY() for SRBs associated with SCSI commands. That is
safe because scsi_remove_host() is called before queue pairs are deleted
and scsi_remove_host() waits for all outstanding SCSI commands to finish.

[ commit 85cffefa09e448906a6f0bc20f422d75a18675bd upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8546 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:34:53 +00:00
Bart Van Assche
7d3e856e61 qla2x00t-32gbit: Introduce the function qla2xxx_init_sp()
This patch does not change any functionality but makes the next patch
easier to read.

[ commit bdb61b9b944d1e5b7cee5a9fe21014363c55b811 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8545 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:34:07 +00:00
Bart Van Assche
41d4d6316b qla2x00t-32gbit: Enable type checking for the SRB free and done callback functions
Since all pointers passed to the srb_t.done() and srb_t.free() functions
have type srb_t, change the type of the first argument of these functions
from void * into struct srb *. This allows the compiler to verify the
argument types for these functions. This patch does not change any
functionality.

[ commit 6c18a43e3c82b0b67531a1cdec7ba31540fe6424 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8544 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:33:13 +00:00
Bart Van Assche
dc61adfa3a qla2x00t-32gbit: Use be_id_t etc. in more code
[ commit df95f39ae76474d922d9be9c0260dc263c451b09 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8543 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:31:44 +00:00
Bart Van Assche
790661121f qla2x00t-32gbit: Use strlcpy() instead of strncpy()
[ commit cc74049f35e8 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8542 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:25:18 +00:00
Bart Van Assche
6ee78e839e qla2x00t-32gbit: Suppress a recently introduced kernel warning
Fixes: 6ab417a5ef ("qla2x00t-32gbit: Always check the qla2x00_wait_for_hba_online() return value").



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8541 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:20:58 +00:00
Bart Van Assche
0ff3d58d02 qla2x00t-32gbit: Use tabs instead of spaces for indentation
This patch only modifies whitespace.

[ commit 0184793df2e860534380a66aa76b8807e71188c2 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8540 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:14:43 +00:00
Bart Van Assche
12ca81c338 qla2x00t-32gbit: Fix up a misapplied patch
Not sure why 'patch' misapplied a patch ...


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8539 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:09:18 +00:00
Bart Van Assche
9bfb9931ee qla2x00t-32gbit: Really fix qla2xxx_eh_abort()
I'm not sure how this happened but the patch that was intended to fix abort
handling was incomplete. This patch fixes that patch as follows:

 - If aborting the SCSI command failed, wait until the SCSI command
   completes.

 - Return SUCCESS instead of FAILED if an abort attempt races with SCSI
   command completion.

 - Since qla2xxx_eh_abort() increments the sp reference count by calling
   sp_get(), decrement the sp reference count before returning.

Fixes: 1b4ae64d8da6 ("qla2xxx: Fix a race condition between aborting and completing a SCSI command")

[ commit 8dd9593cc07ad7d999bef81b06789ef873a94881 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8538 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:04:12 +00:00
Bart Van Assche
5499f34f22 qla2x00t-32gbit: Make qla2x00_abort_srb() again decrease the sp reference count
Since qla2x00_abort_srb() starts with increasing the reference count of
@sp, decrease that same reference count before returning.

[ commit d2d2b5a5741d317bed1fa38211f1f3b142d8cf7a upstram ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8537 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:59:09 +00:00
Bart Van Assche
5c7951c8d9 qla2x00t-32gbit: Update driver version to 10.01.00.18-k
[ commit 4d0b32b853f52760bf70288f2751d2ca86581352 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8536 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:58:24 +00:00
Bart Van Assche
aa2356632e qla2x00t-32gbit: Allow NVMe IO to resume with short cable pull
Current driver report dev_loss_tmo to 0 for NVMe devices with short cable
pull.  This causes NVMe controller to be freed along with NVMe namespace.
The side affect is IO would stop.  By not setting dev_loss_tmo to 0, NVMe
namespace would stay until cable is plugged back in.  This allows IO to
resume afterward.

[ commit 03cc44bf682af289d6536eb911e928b415bd0e1f upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8535 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:57:50 +00:00
Bart Van Assche
21dc61fb60 qla2x00t-32gbit: Use common update-firmware-options routine for ISP27xx+
Leverage the generic routine, qla24xx_update_fw_options(), for the
configuration of firmware options for ISP27xx/ISP28xx.

[ commit a36f1443e6fc738c1bcfc4be80d6f1609163c614 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8534 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:55:29 +00:00
Bart Van Assche
89d0b88f67 qla2x00t-32gbit: Fix NVMe port discovery after a short device port loss
The following sequence of event leads to NVME port disappearing:

    - device port shut
    - nvme_fc_unregister_remoteport
    - device port online
    - remote port delete completes
    - relogin is scheduled
    - "post gidpn" message appears due to rscn generation # mismatch

In short, if a device comes back online sooner than an unregister
completion, a mismatch in rscn generation number occurs, which is not
handled correctly during device relogin. Fix this by starting with a redo
of GNL.

When ql2xextended_error_logging is enabled, the re-plugged device's
discovery stops with the following messages printed:

 --8<--
qla2xxx [0000:41:00.0]-480d:3: Relogin scheduled.
qla2xxx [0000:41:00.0]-4800:3: DPC handler sleeping.
qla2xxx [0000:41:00.0]-2902:3: qla24xx_handle_relogin_event 21:00:00:24:ff:17:9e:91 DS 0 LS 7 P 0 del 2 cnfl
   (null) rscn 1|2 login 1|2 fl 1
qla2xxx [0000:41:00.0]-28e9:3: qla24xx_handle_relogin_event 1666 21:00:00:24:ff:17:9e:91 post gidpn
qla2xxx [0000:41:00.0]-480e:3: Relogin end.
 --8<--

[ commit 9e744591ef1b8df27c25c68dac858dada8688f77 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8533 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:54:46 +00:00
Bart Van Assche
b29d9e15c4 qla2x00t-32gbit: Correct error handling during initialization failures
Current code misses or fails to account for proper recovery during early
initialization failures:

 - Properly unwind allocations during probe() failures.

 - Protect against non-initialization memory allocations during
   unwinding.

 - Propagate error status during HW initialization.

 - Release SCSI host reference when memory allocations fail.

[ commit 26a77799195f4ff105f877042012c7fb355b3da1 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8532 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:52:23 +00:00
Bart Van Assche
3991bf033b qla2x00t-32gbit: Retry fabric Scan on IOCB queue full
when fabric scan thread encounters IOCB Q Full, schedule a delayed work to
retry fabric scan.

[ commit f0cecc1eec0c24e790a4daac71858f1f14e6f7b5 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8531 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:51:03 +00:00
Bart Van Assche
4107c7164f qla2x00t-32gbit: Fix premature timer expiration
For any qla2xxx async command, the SRB buffer is used to send it. In
setting up the SRB buffer, the timer for this command is started before all
memory allocation has finished.  Under low memory pressure, memory alloc
can go to sleep and not wake up before the timer expires. Once timer has
expired, the timer thread will access uninitialize fields resulting into
NULL pointer crash.

This patch fixes this crash by moving the start of timer after everything
is setup.

backtrace shows following

PID: 3720   TASK: ffff996928401040  CPU: 0   COMMAND: "qla2xxx_1_dpc"
0 [ffff99652751b698] __schedule at ffffffff965676c7
1 [ffff99652751b728] schedule at ffffffff96567bc9
2 [ffff99652751b738] schedule_timeout at ffffffff965655e8
3 [ffff99652751b7e0] io_schedule_timeout at ffffffff9656726d
4 [ffff99652751b810] congestion_wait at ffffffff95fd8d12
5 [ffff99652751b870] isolate_migratepages_range at ffffffff95fddaf3
6 [ffff99652751b930] compact_zone at ffffffff95fdde96
7 [ffff99652751b980] compact_zone_order at ffffffff95fde0bc
8 [ffff99652751ba20] try_to_compact_pages at ffffffff95fde481
9 [ffff99652751ba80] __alloc_pages_direct_compact at ffffffff9655cc31
10 [ffff99652751bae0] __alloc_pages_slowpath at ffffffff9655d101
11 [ffff99652751bbd0] __alloc_pages_nodemask at ffffffff95fc0e95
12 [ffff99652751bc80] dma_generic_alloc_coherent at ffffffff95e3217f
13 [ffff99652751bcc8] x86_swiotlb_alloc_coherent at ffffffff95e6b7a1
14 [ffff99652751bcf8] qla2x00_rft_id at ffffffffc055b5e0 [qla2xxx]
15 [ffff99652751bd50] qla2x00_loop_resync at ffffffffc0533e71 [qla2xxx]
16 [ffff99652751be68] qla2x00_do_dpc at ffffffffc05210ca [qla2xxx]

PID: 0      TASK: ffffffff96a18480  CPU: 0   COMMAND: "swapper/0"
 0 [ffff99652fc03ae0] machine_kexec at ffffffff95e63674
 1 [ffff99652fc03b40] __crash_kexec at ffffffff95f1ce12
 2 [ffff99652fc03c10] crash_kexec at ffffffff95f1cf00
 3 [ffff99652fc03c28] oops_end at ffffffff9656c758
 4 [ffff99652fc03c50] no_context at ffffffff9655aa7e
 5 [ffff99652fc03ca0] __bad_area_nosemaphore at ffffffff9655ab15
 6 [ffff99652fc03cf0] bad_area_nosemaphore at ffffffff9655ac86
 7 [ffff99652fc03d00] __do_page_fault at ffffffff9656f6b0
 8 [ffff99652fc03d70] do_page_fault at ffffffff9656f915
 9 [ffff99652fc03da0] page_fault at ffffffff9656b758
    [exception RIP: unknown or invalid address]
    RIP: 0000000000000000  RSP: ffff99652fc03e50  RFLAGS: 00010202
    RAX: 0000000000000000  RBX: ffff99652b79a600  RCX: ffff99652b79a760
    RDX: ffff99652b79a600  RSI: ffffffffc0525ad0  RDI: ffff99652b79a600
    RBP: ffff99652fc03e60   R8: ffffffff96a18a18   R9: ffffffff96ee3c00
    R10: 0000000000000002  R11: ffff99652fc03de8  R12: ffff99652b79a760
    R13: 0000000000000100  R14: ffffffffc0525ad0  R15: ffff99652b79a600
    ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
10 [ffff99652fc03e50] qla2x00_sp_timeout at ffffffffc0525af8 [qla2xxx]
11 [ffff99652fc03e68] call_timer_fn at ffffffff95ea7f58
12 [ffff99652fc03ea0] run_timer_softirq at ffffffff95eaa3bd
13 [ffff99652fc03f18] __do_softirq at ffffffff95ea0f05
14 [ffff99652fc03f88] call_softirq at ffffffff9657832c
15 [ffff99652fc03fa0] do_softirq at ffffffff95e2e675
16 [ffff99652fc03fc0] irq_exit at ffffffff95ea1285
17 [ffff99652fc03fd8] smp_apic_timer_interrupt at ffffffff965796c8
18 [ffff99652fc03ff0] apic_timer_interrupt at ffffffff96575df2

[ commit 3a4b6cc7332130ac5cbf3b505d8cddf0aa2ea745 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8530 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:50:09 +00:00
Bart Van Assche
9bb911c130 qla2x00t-32gbit: Fix Relogin to prevent modifying scan_state flag
Relogin fails to move forward due to scan_state flag indicating device is
not there. Before relogin process, Session delete process accidently
modified the scan_state flag.

[ commit 8b5292bcfcacf15182a77a973a98d310e76fd58b upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8529 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:47:58 +00:00
Bart Van Assche
591d4d7319 qla2x00t-32gbit: Reject EH_{abort|device_reset|target_request}
Reject eh_{abort|device_reset|target_reset} when rport is being torn down
or chip is down.

[ commit 7f4374e67b3046c9628cf0ab93a117704a38e95d upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8528 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:42:45 +00:00
Bart Van Assche
7c020b4dbd qla2x00t-32gbit: Skip FW dump on LOOP initialization error
Firmware dump captured during LOOP Init error does not yield any
significant information.  This patch removes call to trigger firmware dump
collection during Loop Initialization.

[ commit 5e5402c147083786db2238302e25c44b7a7dc5e9 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8527 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:42:11 +00:00
Bart Van Assche
e57539b76b qla2x00t-32gbit: Use Correct index for Q-Pair array
For target mode, the default number of Q-Pairs allowed to use is 2. If the
number of Q-Pairs allocated is lower than the default Q-Pairs, then lower
value should be the set as default.

[ commit 178235f43ea142cf0f07dba67657494fcec21254 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8526 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:41:37 +00:00
Bart Van Assche
92c488d37f qla2x00t-32gbit: Fix abort timeout race condition
If an abort times out, the Abort IOCB completion and Abort timer can race
against each other. This patch provides unique error code for timer path to
allow proper cleanup.

[ commit 0c6df59061b23c7a951836d23977be34e896d3da upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8525 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:40:40 +00:00
Bart Van Assche
5c1d76e9f3 qla2x00t-32gbit: Fix different size DMA Alloc/Unmap
Fix the following complaint:

qla2xxx 0000:05:00.0: DMA-API: device driver frees DMA memory
    with different size [device address=0x00000006198b0000] [map size=32784 bytes]
    [unmap size=8208 bytes]
RIP: 0010:check_unmap+0x7a2/0x1750
Call Trace:
 debug_dma_free_coherent+0x1b5/0x2d5
 dma_free_attrs+0x7f/0x140
 qla24xx_sp_unmap+0x1e2/0x610 [qla2xxx]
 qla24xx_async_gnnft_done+0x9c6/0x17d0 [qla2xxx]
 qla2x00_do_work+0x514/0x2200 [qla2xxx]

[ commit d376dbda187317d06d3a2d495b43a7983e4a3250 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8524 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:39:35 +00:00
Bart Van Assche
566fb0424f qla2x00t-32gbit: Fix DMA unmap leak
With debug kernel we see following wanings indicating memory leak.

[28809.523959] WARNING: CPU: 3 PID: 6790 at lib/dma-debug.c:978
dma_debug_device_change+0x166/0x1d0
[28809.523964] pci 0000:0c:00.6: DMA-API: device driver has pending DMA
allocations while released from device [count=5]
[28809.523964] One of leaked entries details: [device
address=0x00000002aefe4000] [size=8208 bytes] [mapped with DMA_BIDIRECTIONAL]
[mapped as coherent]

Fix this by unmapping DMA memory.

[ commit 5d328de64d89400dcf9911125844d8adc0db697f upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8523 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:37:24 +00:00
Bart Van Assche
a2c285efaf qla2x00t-32gbit: Replace vmalloc + memset with vzalloc
Use vzalloc instead of using vmalloc to allocate memory and then zeroing it
with memset.  This simplifies the code.

[ commit 56cc8fae5f7e9f38cb367754c52491ba1645d1bf upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8522 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:36:09 +00:00
Bart Van Assche
b4b1569ed0 qla2x00t-32gbit: Remove unnecessary null check
A null check before dma_pool_destroy is redundant, so remove it. This is
detected by coccinelle.

[ commit 0b3b6fe299c471e44ed8713b7a602882626e693f upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8521 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:33:38 +00:00
Bart Van Assche
6f6114a7c0 qla2x00t-32gbit: Revert r8322
Since r8322 was the result of an incorrect application of an upstream patch,
revert it.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8520 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:26:01 +00:00
Bart Van Assche
6ab30263a4 qla2x00t-32gbit: Minimize diff with upstream
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8519 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 01:21:41 +00:00
Bart Van Assche
398d41e753 scst: Revert "Increase tgt_dev_cmd_count by one" (r8465)
Because of the previous patch, r8465 is no longer necessary.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8518 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-23 03:44:52 +00:00
Bart Van Assche
92c6e461f0 scst: Revert "scst: Free removed LUNs asynchronously" (r8478)
r8478 was not necessary to fix the reported problem. Additionally, it
introduced a new problem, namely that detach_tgt was not called if the
associated device was deleted after the LUN was deleted and before it
was freed.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8517 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-23 03:43:33 +00:00
Bart Van Assche
4aa7817dbb scst_copy_mgr: Avoid that device deletion sporadically causes a hang
Avoid that deleting a device concurrently with scst_cm_init_inq_finish()
causes command processing to hang.

Reported-by: valera <valer4ik@users.sourceforge.net>
Fixes: 0bb6de9471 ("scst_vdisk: Avoid that LUN refresh triggers a general protection fault" / r7101)


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8515 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-21 21:34:04 +00:00
Bart Van Assche
456359e129 scst_copy_mgr: Reduce code duplication
This patch does not change the behavior of the copy manager.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8514 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-21 21:33:16 +00:00
Bart Van Assche
e9c16240df scst: Improve several source code comments
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8513 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-21 21:32:05 +00:00
Bart Van Assche
f16c5d1b2e scst: Rework scst_prepare_request_sense()
This patch makes the implementation of scst_prepare_request_sense() consistent
with the other code that submits internal commands.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8512 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-21 21:31:31 +00:00
Bart Van Assche
dd52454052 scst: Introduce struct scst_icmd_priv
This patch does not change any functionality but improves source code
readability.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8511 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-21 21:30:39 +00:00
Bart Van Assche
740f3a6e63 scst: Make device deletion again synchronous
Some scripts that use the SCST sysfs interface depend on filp_close()
having been called before device deletion via the sysfs interface
finishes. Hence make device deletion again synchronous.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8510 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-19 02:59:18 +00:00
Bart Van Assche
377e720b26 scst: Add a trailing newline when showing the cpu_mask sysfs parameter
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8509 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-19 02:58:22 +00:00
Bart Van Assche
9a4b39b604 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8508 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-16 13:53:37 +00:00
Bart Van Assche
59c9780344 ChangeLog: Describe SCST 3.4 changes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8507 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-16 03:19:28 +00:00
Bart Van Assche
cd1a47f85e scst, copy manager: Skip updating if auto CM assignment is disabled
Reported-by: James McCarthy <mccarthy1029@gmail.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8504 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-14 23:14:11 +00:00
Bart Van Assche
f2b226ee39 scst, copy manager: Only submit INQUIRY if LUN lookup succeeded
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8503 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-14 23:10:53 +00:00
Bart Van Assche
c6e8013f48 scst: Only free a device after all associated commands and LUNs have finished
Merge scst_free_device() and scst_finally_free_device() into a single
function. Increase dev->refcnt when registering a device or virtual
device. Kill and decrease dev->refcnt when unregistering a device or
virtual device. These changes ensure that a scst_free_device() is
only called after all users (commands and tgt_devs) have stopped
accessing the SCST device.

Fixes: 3f2d50b589 ("scst: Do not suspend command processing when deleting a device"; r8067)



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8501 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-12 01:41:26 +00:00
Bart Van Assche
4e5548c409 scst: Verify dev_exec_cmd_list protection at runtime
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8500 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-12 01:39:37 +00:00