Re: [PATCH 02/24] scsi: add scsi_{get,put}_reserved_cmd()

2019-05-29 Thread Ming Lei
On Wed, May 29, 2019 at 03:28:39PM +0200, Hannes Reinecke wrote: > Add helper functions to retrieve SCSI commands from the reserved > tag pool. > > Signed-off-by: Hannes Reinecke > --- > include/scsi/scsi_tcq.h | 22 ++ > 1 file changed, 22 insertions(+) > > diff --git a/inc

RE: SCSI adapter: how to freeze and thaw I/O on hibernation?

2019-05-29 Thread Dexuan Cui
> From: Ming Lei > Sent: Wednesday, May 29, 2019 7:57 PM > On Thu, May 23, 2019 at 11:18 AM Dexuan Cui wrote: > > ... > > I checked some PCI HBA drivers, and they use scsi_block_requests(), but > > as I described above, I don't know how setting a flag can prevent another > > CPU from submitting I

Re: [EXT] Re: [PATCH] qla2xxx: remove double assignment in qla2x00_update_fcport

2019-05-29 Thread Himanshu Madhani
On 5/29/19, 7:28 PM, "Martin K. Petersen" wrote: External Email -- Himanshu? > Remove double assignment in qla2x00_update_fcport(). > > Signed-off-by: Enzo Matsumiya > --- > dri

Re: SCSI adapter: how to freeze and thaw I/O on hibernation?

2019-05-29 Thread Ming Lei
On Thu, May 23, 2019 at 11:18 AM Dexuan Cui wrote: > > Hi, > I'm adding code to enable the hv_storvsc driver (drivers/scsi/storvsc_drv.c) > for hibernation (ACPI S5). I know how to save/restore the state of the virtual > Hyper-V SCSI adapter, but I don't know how to prevent the higher layer SCSI >

Re: [PATCH V2 5/5] blk-mq: Wait for for hctx inflight requests on CPU unplug

2019-05-29 Thread Ming Lei
On Wed, May 29, 2019 at 05:10:38PM +0100, John Garry wrote: > > > > > > > And we should be careful to handle the multiple reply queue case, given > > > the queue > > > shouldn't be stopped or quieseced because other reply queues are still > > > active. > > > > > > The new CPUHP state for blk-m

Re: [PATCH] qla2xxx: remove double assignment in qla2x00_update_fcport

2019-05-29 Thread Martin K. Petersen
Himanshu? > Remove double assignment in qla2x00_update_fcport(). > > Signed-off-by: Enzo Matsumiya > --- > drivers/scsi/qla2xxx/qla_init.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/scsi/qla2xxx/qla_init.c > b/drivers/scsi/qla2xxx/qla_init.c > index 0c700b140ce7..18078e215

Re: [PATCH v5 0/3] scsi: ufs: Add error handling of Auto-Hibernate

2019-05-29 Thread Martin K. Petersen
Stanley, > Currently auto-hibernate is activated if host supports auto-hibern8 > capability. However error-handling is not implemented, which makes the > feature somewhat risky. Applied to 5.3/scsi-queue, thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH 0/2] zfcp fixes for v5.2-rcX

2019-05-29 Thread Martin K. Petersen
Steffen, > here are 2 zfcp bugfixes for v5.2-rcX. Applied to 5.2/scsi-fixes. Thank you! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH] scsi: libcxgbi: add a check for NULL pointer in cxgbi_check_route()

2019-05-29 Thread Martin K. Petersen
Varun, > ip_dev_find() can return NULL so add a check for NULL pointer. Applied to 5.2/scsi-fixes. Thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH net-next] cxgb4/libcxgb/cxgb4i/cxgbit: enable eDRAM page pods for iSCSI

2019-05-29 Thread Martin K. Petersen
Varun, > Page pods are used for direct data placement, this patch enables eDRAM > page pods if firmware supports this feature. No objections to the SCSI bits. > @@ -394,6 +398,26 @@ int cxgbi_ppm_init(void **ppm_pp, struct net_device > *ndev, > unsigned int pool_index_max = 0; > u

Re: [PATCH 00/21] lpfc: Update lpfc to revision 12.2.0.3

2019-05-29 Thread Martin K. Petersen
James, > Update lpfc to revision 12.2.0.3 Applied to 5.3/scsi-queue, thanks! -- Martin K. Petersen Oracle Linux Engineering

Re: [PATCH v2 08/10] mpt3sas: Enable interrupt coalescing on high iops

2019-05-29 Thread Martin K. Petersen
Suganath, > This configuration should reset during driver unload or shutdown to > the default settings. For this driver takes copy of default ioc page 1 > and copy backs the default or unmodified ioc page1 during unload and > shutdown. so that on next driver load (e.g. if older version driver is

Re: [PATCH v2 06/10] mpt3sas:save msix index and use same while posting RD

2019-05-29 Thread Martin K. Petersen
Suganath, > +static u8 > +_base_set_and_get_msix_index(struct MPT3SAS_ADAPTER *ioc, u16 smid) > +{ > + struct scsiio_tracker *st; > + > + st = (smid < ioc->hi_priority_smid) ? > + (_get_st_from_smid(ioc, smid)) : (NULL); Please make this an if statement for clarity. > + > +

Re: [PATCH 00/20] qla2xxx Patches

2019-05-29 Thread Himanshu Madhani
Hi Bart, Thanks for the series. We will provide ACK after these patches have gone through our internal testing. Thanks, Himanshu > On May 29, 2019, at 1:28 PM, Bart Van Assche wrote: > > Hi Martin, > > This patch series is the result of code review, inspection of the Coverity > output and a

[PATCH 14/20] qla2xxx: Simplify qlt_lport_dump()

2019-05-29 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 Cc: Giridhar Malavali Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_target.c | 18 +++--- 1 file changed, 3 insertions(+), 15 delet

[PATCH 20/20] qla2xxx: Fix qla24xx_abort_sp_done()

2019-05-29 Thread Bart Van Assche
Avoid that the complete() and sp->free() calls are ignored if aborting a command times out. Reported-by: Shen Qiyu Cc: Himanshu Madhani Cc: Giridhar Malavali Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_init.c | 24 ++-- 1 file changed, 10 insertions(+), 14

[PATCH 17/20] qla2xxx: Remove two superfluous tests

2019-05-29 Thread Bart Van Assche
Since qlt_remove_target() only calls qlt_release() if vha->vha_tgt.qla_tgt != NULL, checking that pointer inside qlt_release() is not necessary. This patch avoids that Coverity reports the following: CID 188348 (#1 of 1): Dereference after null check (FORWARD_NULL) var_deref_model: Passing null po

[PATCH 15/20] qla2xxx: Introduce qla2x00_els_dcmd2_free()

2019-05-29 Thread Bart Van Assche
Reduce code duplication by introducing a function that frees the memory used for PLOGIN. Cc: Himanshu Madhani Cc: Giridhar Malavali 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 +---

[PATCH 12/20] qla2xxx: Improve Linux kernel coding style conformance

2019-05-29 Thread Bart Van Assche
Insert a space where required, surround complex expressions in macros with parentheses, do not use line continuations when not necessary and do not explicitly initialize static variables to zero. Cc: Himanshu Madhani Cc: Giridhar Malavali Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx

[PATCH 13/20] qla2xxx: Remove two superfluous if-tests

2019-05-29 Thread Bart Van Assche
This patch avoids that Coverity reports the following: Null-checking sp->u.iocb_cmd.u.ctarg.rsp suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Cc: Himanshu Madhani Cc: Giridhar Malavali Signed-off-by: Bart Van Assche --- drivers/scsi/qla2

[PATCH 18/20] qla2xxx: Fix session lookup in qlt_abort_work()

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

[PATCH 11/20] qla2xxx: Reduce the number of casts in GID list code

2019-05-29 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 Cc: Giridhar Malavali Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_dfs.c| 9 +++-- drivers/scsi/qla2xxx/qla_init.c | 18 --

[PATCH 19/20] qla2xxx: Introduce the be_id_t and le_id_t data types for FC src/dst IDs

2019-05-29 Thread Bart Van Assche
Introduce the be_id_t and le_id_t data types for Fibre Channel source and destination ID formats supported by the firmware instead of using an uint8_t[3] array. Introduce functions for converting from and to the port_id_t data types. This patch does not change the behavior of the qla2xxx driver but

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

2019-05-29 Thread Bart Van Assche
Checking a pointer after it has been dereferenced is not useful. This was detected by Coverity. Cc: Himanshu Madhani Cc: Giridhar Malavali 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

[PATCH 03/20] qla2xxx: Remove an include directive from qla_mr.c

2019-05-29 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 Cc: Giridhar Malavali 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/

[PATCH 09/20] qla2xxx: Change data_dsd into an array

2019-05-29 Thread Bart Van Assche
This patch avoids that Coverity complains about using a scalar as an array. Cc: Himanshu Madhani Cc: Giridhar Malavali 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 ++-- 3 files

[PATCH 04/20] qla2xxx: Remove a forward declaration

2019-05-29 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 Cc: Giridhar Malavali Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_target.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/qla2xxx

[PATCH 08/20] qla2xxx: Declare qla_tgt_cmd.cdb const

2019-05-29 Thread Bart Van Assche
Make it clear that the CDB is not modified after processing of a SCSI command has started. Cc: Himanshu Madhani Cc: Giridhar Malavali 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/ql

[PATCH 10/20] qla2xxx: Verify locking assumptions at runtime

2019-05-29 Thread Bart Van Assche
Cc: Himanshu Madhani Cc: Giridhar Malavali 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/qla2xxx/qla_target.c index c3a371d84595..d516337f5979 100644 --- a/driver

[PATCH 07/20] qla2xxx: Reduce the scope of three local variables in qla2xxx_queuecommand()

2019-05-29 Thread Bart Van Assche
This patch makes it clear that the tag, hwq and qpair variables are only needed for the mq path. Cc: Himanshu Madhani Cc: Giridhar Malavali 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/q

[PATCH 00/20] qla2xxx Patches

2019-05-29 Thread Bart Van Assche
Hi Martin, This patch series is the result of code review, inspection of the Coverity output and actual testing. The first two patches in this series are intended for the current release cycle (kernel v5.2) and the other 18 patches are intended for the kernel v5.3 merge window. Please consider the

[PATCH 05/20] qla2xxx: Declare the fourth ql_dump_buffer() argument const

2019-05-29 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 Cc: Giridhar Malavali Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_dbg.c | 3 ++- drivers/scsi/qla2xxx/qla_gbl.h | 2 +-

[PATCH 02/20] qla2xxx: Really fix abort handling

2019-05-29 Thread Bart Van Assche
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 comma

[PATCH 01/20] qla2xxx: Include the header file from qla_dsd.h

2019-05-29 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 Cc: Giridhar Malavali Fixes: 15b7a68c1d03 ("scsi: qla2xxx: Introduce the dsd32 and dsd64 data structures") # v5.2-rc1. Signed-off-by: Bart Van Assche --- dr

[PATCH 06/20] qla2xxx: Change the return type of qla2x00_update_ms_fdmi_iocb() into void

2019-05-29 Thread Bart Van Assche
Make this change because the value returned by this function is not used. Cc: Himanshu Madhani Cc: Giridhar Malavali Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_gs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/s

Re: [PATCH 11/24] scsi: add scsi_host_get_reserved_cmd()

2019-05-29 Thread Bart Van Assche
On 5/29/19 10:38 AM, Hannes Reinecke wrote: On 5/29/19 5:19 PM, Bart Van Assche wrote: On 5/29/19 6:28 AM, Hannes Reinecke wrote: +    rq = blk_mq_alloc_request(shost->reserved_cmd_q, +  REQ_OP_DRV_OUT | REQ_NOWAIT, +  BLK_MQ_REQ_RESERVED); Is your purpose to a

Re: [PATCH 11/24] scsi: add scsi_host_get_reserved_cmd()

2019-05-29 Thread Hannes Reinecke
On 5/29/19 5:19 PM, Bart Van Assche wrote: On 5/29/19 6:28 AM, Hannes Reinecke wrote: +    rq = blk_mq_alloc_request(shost->reserved_cmd_q, +  REQ_OP_DRV_OUT | REQ_NOWAIT, +  BLK_MQ_REQ_RESERVED); Is your purpose to avoid that blk_mq_alloc_request() waits? If so

Re: [PATCH 05/24] scsi: add scsi_cmd_from_priv()

2019-05-29 Thread Hannes Reinecke
On 5/29/19 5:14 PM, Bart Van Assche wrote: On 5/29/19 6:28 AM, Hannes Reinecke wrote: Add a command to retrieve the scsi_cmnd structure from the driver     ^^^     function? private allocation data. Sure. Cheers, Hannes -- Dr. Hannes ReineckeTeamlead Storage & Netw

Re: [PATCH 02/24] scsi: add scsi_{get,put}_reserved_cmd()

2019-05-29 Thread Hannes Reinecke
On 5/29/19 5:12 PM, Bart Van Assche wrote: On 5/29/19 6:28 AM, Hannes Reinecke wrote: +    rq = blk_mq_alloc_request(sdev->request_queue, +  REQ_OP_SCSI_OUT | REQ_NOWAIT, +  BLK_MQ_REQ_RESERVED); This looks wrong to me. To avoid that blk_mq_alloc_request() waits

[PATCH 2/3] megaraid_sas: use octal permissions instead of constants

2019-05-29 Thread Tomas Henzl
Checkpatch emits a warning when using symbolic permissions. Use octal permissions instead. No functional change. Signed-off-by: Tomas Henzl --- drivers/scsi/megaraid/megaraid_sas_base.c | 20 ++-- drivers/scsi/megaraid/megaraid_sas_fp.c | 2 +- 2 files changed, 11 insertions(+

[PATCH 3/3] megaraid_sas: use DEVICE_ATTR_{RO, RW}

2019-05-29 Thread Tomas Henzl
Use existing macros. No functional change. Signed-off-by: Tomas Henzl --- drivers/scsi/megaraid/megaraid_sas_base.c | 44 ++- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c

[PATCH 0/3] megaraid_sas:

2019-05-29 Thread Tomas Henzl
Just few small changes, octal numbers instead of constants etc.

[PATCH 1/3] megaraid_sas: make max_sectors visible in sys

2019-05-29 Thread Tomas Henzl
Support is easier with all driver parameters visible in sysfs. Signed-off-by: Tomas Henzl --- drivers/scsi/megaraid/megaraid_sas_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index

Re: [PATCH 11/24] scsi: add scsi_host_get_reserved_cmd()

2019-05-29 Thread Bart Van Assche
On 5/29/19 6:28 AM, Hannes Reinecke wrote: + rq = blk_mq_alloc_request(shost->reserved_cmd_q, + REQ_OP_DRV_OUT | REQ_NOWAIT, + BLK_MQ_REQ_RESERVED); Is your purpose to avoid that blk_mq_alloc_request() waits? If so, why do y

Re: [PATCH 05/24] scsi: add scsi_cmd_from_priv()

2019-05-29 Thread Bart Van Assche
On 5/29/19 6:28 AM, Hannes Reinecke wrote: Add a command to retrieve the scsi_cmnd structure from the driver ^^^ function? private allocation data.

Re: [PATCH 02/24] scsi: add scsi_{get,put}_reserved_cmd()

2019-05-29 Thread Bart Van Assche
On 5/29/19 6:28 AM, Hannes Reinecke wrote: + rq = blk_mq_alloc_request(sdev->request_queue, + REQ_OP_SCSI_OUT | REQ_NOWAIT, + BLK_MQ_REQ_RESERVED); This looks wrong to me. To avoid that blk_mq_alloc_request() waits I think i

[PATCH RFC 00/24] scsi: enable reserved commands for LLDDs

2019-05-29 Thread Hannes Reinecke
Hi all, quite some drivers use internal commands for various purposes, most commonly sending TMFs or querying the HBA status. While these commands use the same submission mechanism than normal I/O commands, they will not be counted as outstanding commands, requiring those drivers to implement thei

[PATCH 08/24] fnic: use reserved commands

2019-05-29 Thread Hannes Reinecke
From: Hannes Reinecke Remove hack to get tag for the reset command by using reserved commands. Signed-off-by: Hannes Reinecke --- drivers/scsi/fnic/fnic_scsi.c | 376 +++--- 1 file changed, 171 insertions(+), 205 deletions(-) diff --git a/drivers/scsi/fnic/

[PATCH 06/24] virtio_scsi: use reserved commands for TMF

2019-05-29 Thread Hannes Reinecke
Set two commands aside for TMF, and use reserved commands to issue TMFs. With that we can drop the TMF memory pool. Signed-off-by: Hannes Reinecke --- drivers/scsi/virtio_scsi.c | 100 - 1 file changed, 36 insertions(+), 64 deletions(-) diff --git a/d

[PATCH 16/24] snic: use reserved commands

2019-05-29 Thread Hannes Reinecke
From: Hannes Reinecke Use a reserved command for host and device reset. Signed-off-by: Hannes Reinecke --- drivers/scsi/snic/snic.h | 2 +- drivers/scsi/snic/snic_main.c | 3 ++ drivers/scsi/snic/snic_scsi.c | 96 +++ 3 files changed, 55 insertion

[PATCH 01/24] block: disable elevator for reserved tags

2019-05-29 Thread Hannes Reinecke
Reserved requests are internal to the driver and we wouldn't know if and how they should be merged. So disable the elevator for reserved tags. Signed-off-by: Hannes Reinecke --- block/blk-mq.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/block/blk-mq.c b/block/blk

[PATCH 22/24] aacraid: use scsi_host_tagset_busy_iter() to traverse outstanding commands

2019-05-29 Thread Hannes Reinecke
Instead of walking the array of potential commands and trying to figure out which one might be pending the driver should be using scsi_host_tagset_busy_iter() to traverse all outstanding commands. Signed-off-by: Hannes Reinecke --- drivers/scsi/aacraid/commsup.c | 49 ++- drivers/scsi/a

[PATCH 04/24] csiostor: use reserved command for LUN reset

2019-05-29 Thread Hannes Reinecke
When issuing a LUN reset we should be using a reserved command to avoid overwriting the original command. Signed-off-by: Hannes Reinecke --- drivers/scsi/csiostor/csio_init.c | 3 ++- drivers/scsi/csiostor/csio_scsi.c | 48 +++ 2 files changed, 31 insertions(

[PATCH 07/24] scsi: add host tagset busy iterator

2019-05-29 Thread Hannes Reinecke
Add an iterator scsi_host_tagset_busy_iter() to easily traverse all busy commands. No locking is done here; this need to be ensured by the caller. Signed-off-by: Hannes Reinecke --- drivers/scsi/hosts.c | 27 +++ include/scsi/scsi_host.h | 5 + 2 files changed, 3

[PATCH 21/24] aacraid: replace cmd_list with scsi_host_tagset_busy_iter()

2019-05-29 Thread Hannes Reinecke
From: Hannes Reinecke As we're now using a common pool for handlng requests we can use scsi_host_tagset_iter() to traverse commands and can drop the legacy cmd_list usage. Signed-off-by: Hannes Reinecke --- drivers/scsi/aacraid/aachba.c | 125 ++-- drivers

[PATCH 02/24] scsi: add scsi_{get,put}_reserved_cmd()

2019-05-29 Thread Hannes Reinecke
Add helper functions to retrieve SCSI commands from the reserved tag pool. Signed-off-by: Hannes Reinecke --- include/scsi/scsi_tcq.h | 22 ++ 1 file changed, 22 insertions(+) diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h index 6053d46e794e..227f3bd4e974 100

[PATCH 17/24] snic: use tagset iter for traversing commands

2019-05-29 Thread Hannes Reinecke
From: Hannes Reinecke Use the tagset iter to traverse active commands during device and hba reset. Signed-off-by: Hannes Reinecke --- drivers/scsi/snic/snic_scsi.c | 406 -- 1 file changed, 194 insertions(+), 212 deletions(-) diff --git a/drivers/scsi/s

[PATCH 03/24] scsi: add 'nr_reserved_cmds' field to the SCSI host template

2019-05-29 Thread Hannes Reinecke
From: Hannes Reinecke Add a new field 'nr_reserved_cmds' to the SCSI host template to instruct the block layer to set aside a tag space for reserved commands. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 1 + include/scsi/scsi_host.h | 6 ++ 2 files changed, 7 insertions(+

[PATCH 20/24] aacraid: use private commands

2019-05-29 Thread Hannes Reinecke
From: Hannes Reinecke Use private commands to allocate internal commands. Signed-off-by: Hannes Reinecke --- drivers/scsi/aacraid/aacraid.h | 6 -- drivers/scsi/aacraid/commsup.c | 47 +++--- drivers/scsi/aacraid/linit.c | 3 +++ 3 files changed, 24

[PATCH 18/24] scsi: Implement scsi_is_reserved_cmd()

2019-05-29 Thread Hannes Reinecke
Add function to check if a SCSI command originates from the reserved command pool. Signed-off-by: Hannes Reinecke --- block/blk-mq.c | 13 + include/linux/blk-mq.h | 2 ++ include/scsi/scsi_tcq.h | 10 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git

[PATCH 09/24] fnic: use scsi_host_tagset_busy_iter() to traverse commands

2019-05-29 Thread Hannes Reinecke
From: Hannes Reinecke Use scsi_host_tagset_busy_iter() to traverse commands instead of hand-crafted routine walking the tagspace. Signed-off-by: Hannes Reinecke --- drivers/scsi/fnic/fnic_scsi.c | 540 +- 1 file changed, 220 insertions(+), 320 deletions(

[PATCH 05/24] scsi: add scsi_cmd_from_priv()

2019-05-29 Thread Hannes Reinecke
Add a command to retrieve the scsi_cmnd structure from the driver private allocation data. Signed-off-by: Hannes Reinecke --- include/scsi/scsi_cmnd.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 76ed5e4acd38..318f1e729

[PATCH 11/24] scsi: add scsi_host_get_reserved_cmd()

2019-05-29 Thread Hannes Reinecke
Implement a function to allocate a SCSI command from the reserved tag pool using the host-wide reserved command queue. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 21 + include/scsi/scsi_cmnd.h | 1 + 2 files changed, 22 insertions(+) diff --git a/drivers/

[PATCH 15/24] hpsa: drop refcount field from CommandList

2019-05-29 Thread Hannes Reinecke
Field is not unused, so drop it. Signed-off-by: Hannes Reinecke --- drivers/scsi/hpsa.c | 12 ++-- drivers/scsi/hpsa_cmd.h | 1 - 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 2c34cfe3fdea..38380bf72669 100644 --- a/d

[PATCH 19/24] aacraid: move scsi_add_host()

2019-05-29 Thread Hannes Reinecke
Move the call to scsi_add_host() so that the Scsi_Host structure is initialized before any I/O is sent. Signed-off-by: Hannes Reinecke --- drivers/scsi/aacraid/linit.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/aacraid/linit.c b/drivers/sc

[PATCH 10/24] scsi: allocate separate queue for reserved commands

2019-05-29 Thread Hannes Reinecke
From: Hannes Reinecke Allocate a separate 'reserved_cmd_q' for sending reserved commands. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 15 ++- include/scsi/scsi_host.h | 4 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_lib.c

[PATCH 12/24] hpsa: move hpsa_hba_inquiry after scsi_add_host()

2019-05-29 Thread Hannes Reinecke
Move hpsa_hba_inquiry to after scsi_add_host() so that the host is fully initialized. Signed-off-by: Hannes Reinecke --- drivers/scsi/hpsa.c | 37 +++-- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index

[PATCH 13/24] hpsa: use reserved commands

2019-05-29 Thread Hannes Reinecke
From: Hannes Reinecke Enable the use of reserved commands, and drop the hand-crafted command allocation. Signed-off-by: Hannes Reinecke --- drivers/scsi/hpsa.c | 144 drivers/scsi/hpsa.h | 1 - 2 files changed, 44 insertions(+), 101 deleti

[PATCH 23/24] dpt_i2o: drop cmd_list usage

2019-05-29 Thread Hannes Reinecke
From: Hannes Reinecke Now each command has a unique tag, so we can drop the legacy 'cmd_list' usage and rely on the tag to identify the command. Signed-off-by: Hannes Reinecke --- drivers/scsi/dpt_i2o.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git

[PATCH 14/24] hpsa: use blk_mq_tagset_busy_iter() to traverse outstanding commands

2019-05-29 Thread Hannes Reinecke
Replace all hand-crafted command iterations with blk_mq_tagset_busy_iter(). Signed-off-by: Hannes Reinecke --- drivers/scsi/hpsa.c | 117 ++-- 1 file changed, 67 insertions(+), 50 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c

[PATCH 24/24] scsi: drop scsi command list

2019-05-29 Thread Hannes Reinecke
From: Hannes Reinecke No users left, kill it. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi.c| 1 - drivers/scsi/scsi_lib.c| 32 drivers/scsi/scsi_scan.c | 1 - include/scsi/scsi_cmnd.h | 1 - include/scsi/scsi_device.h | 1 - include

[PATCH] scsi: smartpqi: unlock on error in pqi_submit_raid_request_synchronous()

2019-05-29 Thread Dan Carpenter
We need to drop the "ctrl_info->sync_request_sem" lock before returning. Fixes: 6c223761eb54 ("smartpqi: initial commit of Microsemi smartpqi driver") Signed-off-by: Dan Carpenter --- drivers/scsi/smartpqi/smartpqi_init.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/