Re: [PATCH 18/24] st: return error code in st_scsi_execute()

2019-10-22 Thread Bart Van Assche
On 2019-10-21 23:28, Hannes Reinecke wrote: > On 10/21/19 6:41 PM, Bart Van Assche wrote: >> On 10/21/19 2:53 AM, Hannes Reinecke wrote: >>> We should return the actual error code in st_scsi_execute(), >>> avoiding the need to use DRIVER_ERROR. >>>

Re: [PATCH 19/24] scsi_ioctl: return error code when blk_map_user() fails

2019-10-21 Thread Bart Van Assche
q, disk, rq, 0); Since sg_scsi_ioctl() is used to implement SCSI_IOCTL_SEND_COMMAND, does this patch change the ABI between user space and kernel in a backwards-incompatible way? Thanks, Bart.

Re: [PATCH 18/24] st: return error code in st_scsi_execute()

2019-10-21 Thread Bart Van Assche
. Is it perhaps because the caller compares the st_scsi_execute() return value with zero and doesn't use the return value in any other way that it is fine to return an integer error code instead of a SCSI status? Thanks, Bart.

Re: [PATCH 11/24] advansys: kill driver_defined status byte accessors

2019-10-21 Thread Bart Van Assche
Same comment here: did you really want to delete the code that sets DRIVER_SENSE? Thanks, Bart.

Re: [PATCH] scsi: sd: fix uninit access of sshdr

2019-10-20 Thread Bart Van Assche
ent about DRIVER_SENSE also apply to this patch? Thanks, Bart.

Re: [PATCH v3] scsi: core: fix uninit-value access of variable sshdr

2019-10-16 Thread Bart Van Assche
+ err = -EIO; > + goto out; > + } > + > switch (sshdr->sense_key) { > case UNIT_ATTENTION: > SDev->changed = 1; Shouldn't this be a separate patch? Thanks, Bart.

Re: [PATCH] scsi: core: try to get module before removing devcie

2019-10-16 Thread Bart Van Assche
ntribute the test case to the blktests project. Anyway: Reviewed-by: Bart Van Assche

Re: [PATCH] scsi: core: fix uninit-value access of variable sshdr

2019-10-11 Thread Bart Van Assche
callers but not for all callers of scsi_execute(). How about changing the comment into something like the following: "Zero-initialize sshdr for those callers that check the *sshdr contents even if no sense data is available"? Thanks, Bart.

Re: [PATCH] scsi: core: fix uninit-value access of variable sshdr

2019-10-11 Thread Bart Van Assche
On 10/10/19 8:07 PM, zhengbin (A) wrote: Besides, scsi_sense_hdr is just 8 bytes, memset it to 0 will not affect performance That's true ... Bart.

Re: [PATCH] scsi: core: fix uninit-value access of variable sshdr

2019-10-10 Thread Bart Van Assche
__scsi_execute() is the best approach. I'm wondering whether the sr driver should be fixed instead of modifying __scsi_execute(). Thanks, Bart.

[PATCH] ch: Make it again possible to open a ch device two or more times

2019-10-09 Thread Bart Van Assche
Cc: Fixes: 085e56766f74 ("scsi: ch: add refcounting") Signed-off-by: Bart Van Assche --- drivers/scsi/ch.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 5f8153c37f77..76751d6c7f0d 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c @@

Re: [PATCH] scsi_dh_alua: handle RTPG sense code correctly during state transitions

2019-10-09 Thread Bart Van Assche
ly and don't need to evaluate the RTPG data (which we won't have anyway). Reviewed-by: Bart Van Assche

Re: [PATCH V4 1/2] scsi: core: avoid host-wide host_busy counter for scsi_mq

2019-10-09 Thread Bart Van Assche
On 10/9/19 2:32 AM, Ming Lei wrote: Cc: Bart Van Assche As one can see in the .mailmap file in the kernel tree I use my @acm.org email address for kernel contributions. The above email address is no longer valid since I left WDC more than a year ago. Otherwise this patch looks fine to me

Re: [RFC PATCH V4 2/2] scsi: core: don't limit per-LUN queue depth for SSD

2019-10-09 Thread Bart Van Assche
up())? Have you considered to enable/disable busy tracking per LUN depending on whether or not sdev->queue_depth < shost->can_queue? The megaraid and mpt3sas drivers read sdev->device_busy directly. Is the current version of this patch compatible with these drivers? Thanks, Bart.

Re: [PATCH V2] scsi: core: avoid host-wide host_busy counter for scsi_mq

2019-10-07 Thread Bart Van Assche
unsigned long flags; > > rcu_read_lock(); > - atomic_dec(&shost->host_busy); > + clear_bit(SCMD_STATE_INFLIGHT, &cmd->state); If a new state variable would be introduced for SCSI commands, would it be possible to use non-atomic operations to set and clear SCMD_STATE_INFLIGHT? In other words, are any of the functions that modify this bit ever called concurrently? Thanks, Bart.

Re: [PATCH v2] fixup "qla2xxx: Optimize NPIV tear down process"

2019-10-03 Thread Bart Van Assche
nown problems are fixed in your tree. > > v2: check loop condition only once (Bart van Assche) > > Commit message follows: > > Fix two issues with the previously submitted patch > "qla2xxx: Optimize NPIV tear down process": a missing negation > in a wait_eve

Re: [PATCH v3] scsi_debug: randomize command duration option

2019-10-02 Thread Bart Van Assche
> 0" check useful? I don't think that sysfs ever passes count == 0 to store callback functions. Thanks, Bart.

Re: [PATCH V3] scsi: save/restore command resid for error handling

2019-10-02 Thread Bart Van Assche
in scsi_eh_prep_cmnd() after saving the original command value in struct scsi_eh_save. Reviewed-by: Bart Van Assche

Re: [PATCH] fixup "qla2xxx: Optimize NPIV tear down process"

2019-10-02 Thread Bart Van Assche
On 10/2/19 8:25 AM, Martin Wilck wrote: > On Wed, 2019-10-02 at 08:17 -0700, Bart Van Assche wrote: >> >> Both loops check the loop termination condition twice. Has it been >> considered to write these loops such that the loop termination >> condition >> is

Re: [PATCH] fixup "qla2xxx: Optimize NPIV tear down process"

2019-10-02 Thread Bart Van Assche
> - for (i = 0; i < 10; i++) > + for (i = 0; !test_fcport_count(vha) && i < 10; i++) > wait_event_timeout(vha->fcport_waitQ, test_fcport_count(vha), > HZ); Hi Martin, Both loops check the loop termination condition twice. Has it been considered to write these loops such that the loop termination condition is only tested once, e.g. using the following pattern? for (i = 0; i < 10; i++) if (wait_event_timeout(...) > 0) break; Thanks, Bart.

Re: [PATCH v2 02/14] qla2xxx: Fix unbound sleep in fcport delete path.

2019-09-30 Thread Bart Van Assche
c, vha, 0xf087, Hi Himanshu, Is qla2x00_async_iocb_timeout() called if no response is received for a LOGO request? If so, has it been considered to modify that function instead of qlt_free_session_done()? Thanks, Bart.

Re: [PATCH v2] scsi_debug: randomize command duration option + %p

2019-09-30 Thread Bart Van Assche
s @ %p\n", dif_size, dif_storep); + pr_err("dif_storep %u bytes @ %pK\n", dif_size, dif_storep); if (dif_storep == NULL) { pr_err("out of mem. (DIX)\n"); Is it useful to print the kernel pointer 'dif_storep'? Thanks, Bart.

Re: [PATCH v2] scsi: Add sysfs attributes for VPD pages 0h and 89h

2019-09-26 Thread Bart Van Assche
On 2019-09-26 09:22, Ryan Attard wrote: > Add sysfs attributes for the ATA information page and > Supported VPD Pages page. Reviewed-by: Bart Van Assche

Re: [PATCH] scsi: Add sysfs attributes for VPD pages 0h and 89h

2019-09-26 Thread Bart Van Assche
d related variables? Otherwise this patch looks fine to me. Thanks, Bart.

Re: [PATCH v3 1/3] scsi: core: allow auto suspend override by low-level driver

2019-09-16 Thread Bart Van Assche
sable depth for disk events */ The "_on" part in the variable name "rpm_autosuspend_on" is probably redundant and the comment could have been more elaborate. Anyway: Reviewed-by: Bart Van Assche

Re: [PATCH v2 3/3] scsi: ufs-mediatek: enable auto suspend capability

2019-09-12 Thread Bart Van Assche
ufs_mtk_set_caps() function. Introducing single line functions like is done in this patch doesn't improve readability. Thanks, Bart.

Re: [PATCH v2 1/3] scsi: core: allow auto suspend override by low-level driver

2019-09-12 Thread Bart Van Assche
ly occurs in struct scsi_device then LLD authors are forced to introduce a slave_configure function. Introducing such a function can be avoided if the default autosuspend delay can be specified in the host template. Bart.

Re: [PATCH 0/4] scsi: qla2xxx: Bug fixes

2019-09-11 Thread Bart Van Assche
t a perceived session freeze on the initiators. Hi Roman, Has this patch series been prepared against Linus' master branch, against Martin's 5.3/scsi-fixes or against Martin's 5.4/scsi-queue branch? I'm asking this because some patches in this series look similar to patches that are already present in the 5.4/scsi-queue branch. Thanks, Bart.

Re: [PATCH v2 1/2] scsi: target/tcm_loop: ignore already deleted scsi device

2019-08-20 Thread Bart Van Assche
the reported issue? Thanks, Bart.

Re: [PATCH v2 1/2] scsi: target/tcm_loop: ignore already deleted scsi device

2019-08-20 Thread Bart Van Assche
the reference leak present in the current code. Have you considered to modify tcm_loop_port_link() such that it saves the pointer returned by scsi_add_device() and to use that pointer in tcm_loop_port_unlink()? Bart.

[PATCH] qla2xxx: Fix a recently introduced kernel warning

2019-08-19 Thread Bart Van Assche
) qla24xx_process_response_queue+0x7d8/0xbd0 [qla2xxx] qla25xx_free_rsp_que+0x1a0/0x220 [qla2xxx] process_one_work+0x25c/0x520 worker_thread+0x8c/0x5e0 kthread+0x154/0x1a0 ret_from_kernel_thread+0x5c/0x7c Cc: Himanshu Madhani Cc: Abdul Haleem Reported-and-tested-by: Abdul Haleem Signed-off-by: Bart

Re: [PATCH v4] SCSI: fix queue cleanup race before scsi_requeue_run_queue is done

2019-08-16 Thread Bart Van Assche
fset 17 lines). Hunk #2 FAILED at 618. 1 out of 2 hunks FAILED -- saving rejects to file drivers/scsi/scsi_lib.c.rej (Stripping trailing CRs from patch; use --binary to disable.) patching file drivers/scsi/scsi_sysfs.c Hunk #1 succeeded at 1392 (offset -18 lines). Bart.

Re: [PATCH v4] SCSI: fix queue cleanup race before scsi_requeue_run_queue is done

2019-08-15 Thread Bart Van Assche
On 8/14/19 6:50 PM, zhengbin (A) wrote: ping Sending a "ping" after 46 hours is way too soon and only causes irritation. What would help though is more information about how this patch has been tested. Does it e.g. survive the srp tests in blktests? Thanks, Bart.

Re: [PATCH] scsi: qla2xxx: replace snprintf with strscpy

2019-08-14 Thread Bart Van Assche
; /* offset 20/14h */ u8 vendor_pn[SFF_PART_NAME_LEN];/* part number */ So I think that using SFF_PART_NAME_LEN+1 as length limit is wrong. Himanshu, do you perhaps know whether or not the vendor_name and vendor_pn arrays should be '\0'-terminated in struct sff_8247_a0? Thanks, Bart.

Re: [PATCH v2 46/58] qla2xxx: Make qlt_handle_abts_completion() more robust

2019-08-12 Thread Bart Van Assche
On 8/12/19 1:52 PM, Roman Bolshakov wrote: On Thu, Aug 08, 2019 at 08:02:07PM -0700, Bart Van Assche wrote: Avoid that this function crashes if mcmd == NULL. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_target.c | 2 +- 1 file changed, 1 insertion(+), 1

Re: [PATCH v3] SCSI: fix queue cleanup race before scsi_requeue_run_queue is done

2019-08-12 Thread Bart Van Assche
bool ret' variable really necessary? Additionally, have you taken a look at the cancel_work_sync(&sdev->requeue_work) call in __scsi_remove_device()? Shouldn't the queue refcount be dropped if that cancel call cancels queued work? Thanks, Bart.

Re: [PATCH] SCSI: fix queue cleanup race before scsi_requeue_run_queue is done

2019-08-09 Thread Bart Van Assche
!list_empty(&sdev->host->starved_list)) > kblockd_schedule_work(&sdev->requeue_work); > - else > + else { > blk_mq_run_hw_queues(q, true); > + percpu_ref_put(&q->q_usage_counter); > + } > > - percpu_ref_put(&q->q_usage_counter); > return false; > } Can kblockd_schedule_work() return 0? If so, should percpu_ref_put() be called in that case? Bart.

[PATCH v2 54/58] qla2xxx: Inline the qla2x00_fcport_event_handler() function

2019-08-08 Thread Bart Van Assche
() function because it is never called. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_def.h | 17 - drivers/scsi/qla2xxx/qla_gbl.h | 6 +- drivers/scsi/qla2xxx/qla_gs.c | 15 ++-- drivers/scsi/qla2xxx/qla_init.c | 131

[PATCH v2 55/58] qla2xxx: Introduce qla2x00_els_dcmd2_free()

2019-08-08 Thread Bart Van Assche
This patch reduces code duplication. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_def.h | 2 +- drivers/scsi/qla2xxx/qla_gbl.h | 2 ++ drivers/scsi/qla2xxx/qla_gs.c | 12 +- drivers/scsi/qla2xxx/qla_iocb.c | 40

[PATCH v2 58/58] qla2xxx: Fix a NULL pointer dereference

2019-08-08 Thread Bart Van Assche
E N2N handling into state machine") # v4.19. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_iocb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 7021fbeb6d23..e9

[PATCH v2 56/58] qla2xxx: Remove two superfluous if-tests

2019-08-08 Thread Bart Van Assche
mailbox interface") # v4.16. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_gs.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index

[PATCH v2 57/58] qla2xxx: Simplify qla24xx_async_abort_cmd()

2019-08-08 Thread Bart Van Assche
Make the code easier to read by converting 'goto' statements into 'return' statements. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_init.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/

[PATCH v2 53/58] qla2xxx: Report invalid mailbox status codes

2019-08-08 Thread Bart Van Assche
It is easy to mix up the QLA_* and the MBS_* status codes. Complain loudly if that happens. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_def.h | 5 + drivers/scsi/qla2xxx/qla_init.c | 9 + 2 files changed, 14 insertions(+) diff --git a/drivers

[PATCH v2 32/58] qla2xxx: Declare fourth qla2x00_set_model_info() argument const

2019-08-08 Thread Bart Van Assche
Make it clear to humans and also to the compiler that the string passed as fourth argument is not modified. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_gbl.h | 4 ++-- drivers/scsi/qla2xxx/qla_init.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions

[PATCH v2 51/58] qla2xxx: Let the compiler check the type of the SCSI command context pointer

2019-08-08 Thread Bart Van Assche
Split srb_cmd.ctx into two pointers such that the compiler can check the type of that pointer. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_def.h | 4 ++-- drivers/scsi/qla2xxx/qla_iocb.c | 20 +--- drivers/scsi/qla2xxx/qla_nx.c | 2

[PATCH v2 48/58] qla2xxx: Introduce qla2xxx_get_next_handle()

2019-08-08 Thread Bart Van Assche
This patch reduces code duplication. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_gbl.h | 1 + drivers/scsi/qla2xxx/qla_iocb.c | 128 +--- drivers/scsi/qla2xxx/qla_mr.c | 13 +--- drivers/scsi/qla2xxx/qla_nvme.c | 14

[PATCH v2 22/58] qla2xxx: Use strlcpy() instead of strncpy()

2019-08-08 Thread Bart Van Assche
This patch fixes several gcc complaints about string truncation. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_mr.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi

[PATCH v2 30/58] qla2xxx: Suppress multiple Coverity complaint about out-of-bounds accesses

2019-08-08 Thread Bart Van Assche
This patch does not change any functionality. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_gs.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 5ec3c2b96f3f

[PATCH v2 38/58] qla2xxx: Change the return type of qla24xx_read_flash_data()

2019-08-08 Thread Bart Van Assche
This change makes it easier to detect qla24xx_read_flash_data() failures and also to handle such failures. This change does not modify the behavior of the driver since all callers ignore the qla24xx_read_flash_data() return value. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers

[PATCH v2 47/58] qla2xxx: Modify NVMe include directives

2019-08-08 Thread Bart Van Assche
Since struct sg_table is used in nvme-fc-driver.h, include from that header file. Since no definitions or declarations from are used in the qla_nvme.h header file, do not include from that header file. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_nvme.h

[PATCH v2 44/58] qla2xxx: Introduce the function qla2xxx_init_sp()

2019-08-08 Thread Bart Van Assche
This patch does not change any functionality but makes the next patch easier to read. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_inline.h | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/scsi

[PATCH v2 28/58] qla2xxx: Remove unreachable code from qla83xx_idc_lock()

2019-08-08 Thread Bart Van Assche
This was detected by Coverity. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_os.c | 17 - 1 file changed, 17 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 37e24987c852..2ba06a84c501 100644 --- a

[PATCH v2 37/58] qla2xxx: Introduce the be_id_t and le_id_t data types for FC src/dst IDs

2019-08-08 Thread Bart Van Assche
but improves source code readability and also allows the compiler to verify the endianness of Fibre Channel IDs. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_def.h | 71 ++-- drivers/scsi/qla2xxx/qla_gs.c | 62 -- drivers/scsi

[PATCH v2 31/58] qla2xxx: Always check the qla2x00_wait_for_hba_online() return value

2019-08-08 Thread Bart Van Assche
This patch fixes several Coverity complaints about not always checking the qla2x00_wait_for_hba_online() return value. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_attr.c | 3 ++- drivers/scsi/qla2xxx/qla_target.c | 7 +-- 2 files changed, 7 insertions

[PATCH v2 34/58] qla2xxx: Check the PCI info string output buffer size

2019-08-08 Thread Bart Van Assche
Pass the output buffer size to the code that generates a PCI info string and check the output buffer size while generating a PCI info string. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_attr.c | 3 +- drivers/scsi/qla2xxx/qla_def.h | 2 +- drivers/scsi

[PATCH v2 26/58] qla2xxx: Simplify a debug statement

2019-08-08 Thread Bart Van Assche
Read the FC port state once instead of twice. This patch fixes the following Coverity complaint: Unchecked return value (CHECKED_RETURN) check_return: Calling atomic_read without checking return value (as is done elsewhere 80 out of 92 times). Cc: Himanshu Madhani Signed-off-by: Bart Van Assche

[PATCH v2 27/58] qla2xxx: Fix qla24xx_process_bidir_cmd()

2019-08-08 Thread Bart Van Assche
be equal to 0. dead_error_condition: The condition req_data_len != rsp_data_len cannot be true. Cc: Himanshu Madhani Fixes: a9b6f722f62d ("[SCSI] qla2xxx: Implementation of bidirectional.") # v3.7. Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_bsg.c | 11 +-- 1 fi

[PATCH v2 50/58] qla2xxx: Complain if sp->done() is not called from the completion path

2019-08-08 Thread Bart Van Assche
Not calling sp->done() from the command completion path is a severe bug. Hence complain loudly if that happens. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_init.c | 4 drivers/scsi/qla2xxx/qla_isr.c | 4 drivers/scsi/qla2xxx/qla_mr.c

[PATCH v2 29/58] qla2xxx: Suppress a Coveritiy complaint about integer overflow

2019-08-08 Thread Bart Van Assche
expects an expression of type uint64_t (64 bits, unsigned). Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_nx2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_nx2.c b/drivers/scsi/qla2xxx/qla_nx2.c index

[PATCH v2 49/58] qla2xxx: Make sure that aborted commands are freed

2019-08-08 Thread Bart Van Assche
n issue between qla2xxx and TCM") # v4.5. Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_target.c | 13 - drivers/scsi/qla2xxx/tcm_qla2xxx.c | 4 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xx

[PATCH v2 39/58] qla2xxx: Check secondary image if reading the primary image fails

2019-08-08 Thread Bart Van Assche
This patch fixes several Coverity complaints about reading data that has not been initialized. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_init.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b

[PATCH v2 52/58] qla2xxx: Remove superfluous sts_entry_* casts

2019-08-08 Thread Bart Van Assche
The C language supports implicit casting of void pointers to non-void pointers. Remove explicit sts_entry_* casts that are not necessary. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_isr.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions

[PATCH v2 40/58] qla2xxx: Make it explicit that ELS pass-through IOCBs use little endian

2019-08-08 Thread Bart Van Assche
According to the firmware documentation the firmware expects all ELS pass-through IOCB parameters in little endian format. Make this explicit. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_fw.h | 8 drivers/scsi/qla2xxx/qla_iocb.c | 7 --- 2

[PATCH v2 45/58] qla2xxx: Fix a race condition between aborting and completing a SCSI command

2019-08-08 Thread Bart Van Assche
scsi_remove_host() is called before queue pairs are deleted and scsi_remove_host() waits for all outstanding SCSI commands to finish. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_def.h | 1 - drivers/scsi/qla2xxx/qla_os.c | 45

[PATCH v2 13/58] qla2xxx: Verify locking assumptions at runtime

2019-08-08 Thread Bart Van Assche
Make sure that locking assumptions are verified at runtime if kernel debugging is enabled. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_target.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi

[PATCH v2 36/58] qla2xxx: Complain if a soft reset fails

2019-08-08 Thread Bart Van Assche
Failure of a soft reset is a severe failure. Hence report such failures. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_tmpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_tmpl.c b/drivers/scsi/qla2xxx/qla_tmpl.c

[PATCH v2 20/58] qla2xxx: Report the firmware status code if a mailbox command fails

2019-08-08 Thread Bart Van Assche
It is helpful when debugging this driver to have the firmware status code available if a mailbox command fails. Hence report that firmware status code. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_mbx.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion

[PATCH v2 46/58] qla2xxx: Make qlt_handle_abts_completion() more robust

2019-08-08 Thread Bart Van Assche
Avoid that this function crashes if mcmd == NULL. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index

[PATCH v2 08/58] qla2xxx: Declare the fourth ql_dump_buffer() argument const

2019-08-08 Thread Bart Van Assche
This patch makes it clear to humans and also to the compiler that ql_dump_buffer() does not modify the memory the @buf argument points at. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_dbg.c | 3 ++- drivers/scsi/qla2xxx/qla_gbl.h | 2 +- 2 files changed, 3

[PATCH v2 41/58] qla2xxx: Set the responder mode if appropriate for ELS pass-through IOCBs

2019-08-08 Thread Bart Van Assche
According to the firmware documentation responder mode must be set for ELS pass-through IOCBs if a response is expected. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_iocb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi

[PATCH v2 09/58] qla2xxx: Change the return type of qla2x00_update_ms_fdmi_iocb() into void

2019-08-08 Thread Bart Van Assche
The value returned by this function is not used. Hence change the return type of this function into 'void' and remove the return statement. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_gs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)

[PATCH v2 19/58] qla2xxx: Fix session lookup in qlt_abort_work()

2019-08-08 Thread Bart Van Assche
Pass the correct session ID to find_sess_by_s_id() instead of passing an uninitialized variable. Cc: Himanshu Madhani Fixes: 2d70c103fd2a ("[SCSI] qla2xxx: Add LLD target-mode infrastructure for >= 24xx series") # v3.5. Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla

[PATCH v2 25/58] qla2xxx: Remove dead code

2019-08-08 Thread Bart Van Assche
Since sess == NULL before 'goto out_term2' is executed, the code under 'if (sess)' cannot be reached. Hence remove that code. This was detected by Coverity. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_target.c | 3 --- 1 file changed,

[PATCH v2 18/58] qla2xxx: Simplify qla24xx_abort_sp_done()

2019-08-08 Thread Bart Van Assche
Instead of explicitly checking whether a timeout has occurred, ignore the del_timer() return value. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_init.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/qla2xxx

[PATCH v2 07/58] qla2xxx: Remove a superfluous forward declaration

2019-08-08 Thread Bart Van Assche
Since qlt_make_local_sess() is defined before it is called, remove the forward declaration of that function. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_target.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b

[PATCH v2 43/58] qla2xxx: Enable type checking for the SRB free and done callback functions

2019-08-08 Thread Bart Van Assche
. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_bsg.c| 8 ++- drivers/scsi/qla2xxx/qla_def.h| 14 +-- drivers/scsi/qla2xxx/qla_gbl.h| 14 +-- drivers/scsi/qla2xxx/qla_gs.c | 21 ++-- drivers/scsi/qla2xxx

[PATCH v2 24/58] qla2xxx: Complain if parsing the version string fails

2019-08-08 Thread Bart Van Assche
This patch fixes a Coverity complaint about not checking the sscanf() return value. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_tmpl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_tmpl.c b/drivers/scsi

[PATCH v2 16/58] qla2xxx: Remove a superfluous pointer check

2019-08-08 Thread Bart Van Assche
Checking a pointer after it has been dereferenced is not useful. This was detected by Coverity. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers

[PATCH v2 23/58] qla2xxx: Complain if a mailbox command times out

2019-08-08 Thread Bart Van Assche
This patch fixes the following Coverity complaint: Unchecked return value (CHECKED_RETURN) check_return: Calling wait_for_completion_timeout without checking return value (as is done elsewhere 14 out of 17 times). Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx

[PATCH v2 42/58] qla2xxx: Rework key encoding in qlt_find_host_by_d_id()

2019-08-08 Thread Bart Van Assche
Use the same approach for encoding the destination ID as the approach used by qlt_update_vp_map(). Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_target.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx

[PATCH v2 33/58] qla2xxx: Complain if waiting for pending commands times out

2019-08-08 Thread Bart Van Assche
ailed. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_init.c | 3 ++- drivers/scsi/qla2xxx/qla_nx.c | 4 +++- drivers/scsi/qla2xxx/qla_os.c | 7 +-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/sc

[PATCH v2 35/58] qla2xxx: Use memcpy() and strlcpy() instead of strcpy() and strncpy()

2019-08-08 Thread Bart Van Assche
This patch makes the string manipulation code easier to verify. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_init.c | 18 ++ drivers/scsi/qla2xxx/qla_mr.c | 6 -- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers

[PATCH v2 15/58] qla2xxx: Simplify qlt_lport_dump()

2019-08-08 Thread Bart Van Assche
Simplify the implementation of this function by using the %phC format specifier instead of using explicit for-loops. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_target.c | 18 +++--- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a

[PATCH v2 21/58] qla2xxx: Do not corrupt vha->plogi_ack_list

2019-08-08 Thread Bart Van Assche
Delete the PLOGIN ACK data structure from the vha->plogi_ack_list before freeing that data structure to avoid that that list gets corrupted. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_os.c | 8 ++-- drivers/scsi/qla2xxx/qla_target.c | 4 +++-

[PATCH v2 11/58] qla2xxx: Declare qla_tgt_cmd.cdb const

2019-08-08 Thread Bart Van Assche
Make it clear that the CDB is not modified after processing of a SCSI command has started. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_target.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers

[PATCH v2 14/58] qla2xxx: Reduce the number of casts in GID list code

2019-08-08 Thread Bart Van Assche
This patch makes the code that parses the GID list easier to read without changing the behavior of the code. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_dfs.c| 9 +++-- drivers/scsi/qla2xxx/qla_init.c | 18 -- drivers/scsi/qla2xxx

[PATCH v2 12/58] qla2xxx: Change data_dsd into an array

2019-08-08 Thread Bart Van Assche
This patch does not change any functionality but fixes a Coverity complaint about using a scalar as an array. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_def.h| 4 ++-- drivers/scsi/qla2xxx/qla_iocb.c | 4 ++-- drivers/scsi/qla2xxx/qla_target.c | 4

[PATCH v2 17/58] qla2xxx: Remove two superfluous tests

2019-08-08 Thread Bart Van Assche
ull pointer &vha->vha_tgt.qla_tgt->tgt_list_entry to list_del, which dereferences it. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_target.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b

[PATCH v2 10/58] qla2xxx: Reduce the scope of three local variables in qla2xxx_queuecommand()

2019-08-08 Thread Bart Van Assche
This patch makes it clear that the tag, hwq and qpair variables are only used in the mq path. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_os.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers

[PATCH v2 02/58] qla2xxx: Really fix qla2xxx_eh_abort()

2019-08-08 Thread Bart Van Assche
SCSI command completion. - Since qla2xxx_eh_abort() increments the sp reference count by calling sp_get(), decrement the sp reference count before returning. Cc: Himanshu Madhani Fixes: 219d27d7147e ("scsi: qla2xxx: Fix race conditions in the code for aborting SCSI commands") Signed-o

[PATCH v2 03/58] qla2xxx: Improve Linux kernel coding style conformance

2019-08-08 Thread Bart Van Assche
Insert a space where required, surround complex expressions in macros with parentheses, use the UL suffix instead of the (unsigned long) cast, do not use line continuations when not necessary and do not explicitly initialize static variables to zero. Cc: Himanshu Madhani Signed-off-by: Bart Van

[PATCH v2 01/58] qla2xxx: Make qla2x00_abort_srb() again decrease the sp reference count

2019-08-08 Thread Bart Van Assche
Since qla2x00_abort_srb() starts with increasing the reference count of @sp, decrease that same reference count before returning. Cc: Himanshu Madhani Fixes: 219d27d7147e ("scsi: qla2xxx: Fix race conditions in the code for aborting SCSI commands") # v5.2. Signed-off-by: Bart

[PATCH v2 00/58] qla2xxx patches for kernel v5.4

2019-08-08 Thread Bart Van Assche
. Thanks, Bart. Changes compared to v1: - Included a regression fix for qla2xxx_eh_abort() in the second patch of this series (the fix Himanshu mentioned in his e-mail). - Moved a WARN_ON_ONCE() statement from a later patch to the second patch in this series. - Dropped one patch that renames a

[PATCH v2 04/58] qla2xxx: Use tabs instead of spaces for indentation

2019-08-08 Thread Bart Van Assche
This patch only modifies whitespace. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_gs.c | 78 +-- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c

[PATCH v2 05/58] qla2xxx: Include the header file from qla_dsd.h

2019-08-08 Thread Bart Van Assche
Since the put_unaligned_*() macros are used in this header file, include the header file that defines these macros. Cc: Himanshu Madhani Fixes: 15b7a68c1d03 ("scsi: qla2xxx: Introduce the dsd32 and dsd64 data structures") # v5.2-rc1. Signed-off-by: Bart Van Assche --- drivers/sc

[PATCH v2 06/58] qla2xxx: Remove an include directive from qla_mr.c

2019-08-08 Thread Bart Van Assche
There is no bsg code in the qla_mr.c source file. Hence do not include the header file from qla_mr.c. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_mr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx

Re: [PATCH 0/2] scsi: core: regression fixes for request batching

2019-08-07 Thread Bart Van Assche
uld have preferred if such a new feature had used its own new copy scsi_mq_ops_batching instead of changing the use case and semantics of the existing scsi_mq_ops, because this would likely cause less regressions for all the other users not using the new feature. For both patches: Reviewed-by: B

[PATCH v2 2/3] Complain if scsi_target_block() fails

2019-08-01 Thread Bart Van Assche
If scsi_target_block() fails that can break the code that calls this function. Hence complain loudly if scsi_target_block() fails. Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Ming Lei Signed-off-by: Bart Van Assche --- drivers/scsi/scsi_lib.c | 7 ++- 1 file

[PATCH v2 0/3] SCSI core patches for kernel v5.4

2019-08-01 Thread Bart Van Assche
Hi Martin, The patches in this series address SCSI device blocking and unblocking and fix a boot failure. Please consider these patches for kernel version v5.4. Thanks, Bart. Changes compared to v1: - As requested by James, dropped the patch that changes the return type of scsi_target_block

[PATCH v2 3/3] Reduce memory required for SCSI logging

2019-08-01 Thread Bart Van Assche
("scsi: Implement per-cpu logging buffer") # v4.0. Reported-by: Jan Palus Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Ming Lei Cc: Jan Palus Signed-off-by: Bart Van Assche --- drivers/scsi/scsi_logging.c | 48 +++-- in

  1   2   3   4   5   6   7   8   9   10   >