[PATCH 44/47] csiostor: use separate TMF command

2017-06-28 Thread Hannes Reinecke
Set one command aside as a TMF command, and use this command to send the TMF. This avoids having to rely on the passed-in scsi command when resetting the device. Signed-off-by: Hannes Reinecke --- drivers/scsi/csiostor/csio_hw.h | 2 ++ drivers/scsi/csiostor/csio_init.c | 2

[PATCH 47/47] scsi: Do not allocate scsi command in scsi_ioctl_reset()

2017-06-28 Thread Hannes Reinecke
As we now have moved the error handler functions to not rely on a scsi command we can drop the out-of-band scsi command allocation from scsi_ioctl_reset(). Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_error.c | 124 +++--- 1 file

[PATCH 40/47] aic7xxx: do not reference scsi command when resetting device

2017-06-28 Thread Hannes Reinecke
When sending a device reset we should not take a reference to the scsi command. Signed-off-by: Hannes Reinecke --- drivers/scsi/aic7xxx/aic7xxx_osm.c | 102 - 1 file changed, 54 insertions(+), 48 deletions(-) diff --git

[PATCH 37/47] aic79xx: use scsi device as argument for BUILD_SCSIID()

2017-06-28 Thread Hannes Reinecke
Signed-off-by: Hannes Reinecke --- drivers/scsi/aic7xxx/aic79xx_osm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index 0797c2f..66f9450 100644 ---

[PATCH 29/47] qedf: use fc rport as argument for qedf_initiate_tmf()

2017-06-28 Thread Hannes Reinecke
When sending a TMF we're only concerned with the rport and the LUN ID, so use struct fc_rport as argument for qedf_initiate_tmf(). Signed-off-by: Hannes Reinecke --- drivers/scsi/qedf/qedf.h | 5 +++-- drivers/scsi/qedf/qedf_io.c | 48

[PATCH 33/47] cxlflash: use dedicated reset command in send_tmf()

2017-06-28 Thread Hannes Reinecke
From: Hannes Reinecke Reduce the queue depth by 1, and use this command as a dedicated reset command send_tmf(). Signed-off-by: Hannes Reinecke --- drivers/scsi/cxlflash/common.h | 3 ++- drivers/scsi/cxlflash/main.c | 23 --- 2 files

[PATCH 28/47] qla2xxx: open-code qla2xxx_generic_reset()

2017-06-28 Thread Hannes Reinecke
Device and target reset will be using different calling sequences, so there's not point in trying to combine both. Signed-off-by: Hannes Reinecke --- drivers/scsi/qla2xxx/qla_os.c | 106 -- 1 file changed, 71 insertions(+), 35 deletions(-)

[PATCH 42/47] xen-scsifront: call scsifront_action_handler() with a NULL command argument

2017-06-28 Thread Hannes Reinecke
For device reset we shouldn't rely on the scsi command, so allow scsifront_action_handler() to be called with a NULL command argument. Signed-off-by: Hannes Reinecke --- drivers/scsi/xen-scsifront.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff

[PATCH 45/47] snic: use dedicated device reset command

2017-06-28 Thread Hannes Reinecke
Use a dedicated command to send a device reset instead of relying on using the command which triggered the device failure. Signed-off-by: Hannes Reinecke --- drivers/scsi/snic/snic_scsi.c | 52 --- 1 file changed, 24 insertions(+), 28

[PATCH 20/47] scsi: Use Scsi_Host and channel number as argument for eh_bus_reset_handler()

2017-06-28 Thread Hannes Reinecke
The bus reset should not depend on any command, but rather only use the SCSI Host and the channel/bus number as argument. Signed-off-by: Hannes Reinecke --- Documentation/scsi/scsi_eh.txt | 2 +- Documentation/scsi/scsi_mid_low_api.txt | 5 ++--

[PATCH 26/47] lpfc: use rport as argument for lpfc_send_taskmgmt()

2017-06-28 Thread Hannes Reinecke
Instead of passing in a scsi device we should be using the rport; we already have the target and lun id as parameters, so there's no need to pass the scsi device, too. Signed-off-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_scsi.c | 12 ++-- 1 file changed, 6

[PATCH 25/47] ibmvfc: open-code reset loop for target reset

2017-06-28 Thread Hannes Reinecke
From: Hannes Reinecke For target reset we need a device to send the target reset to, so open-code the loop in target reset to send the target reset TMF to the correct device. Signed-off-by: Hannes Reinecke --- drivers/scsi/ibmvscsi/ibmvfc.c | 39

[PATCH 38/47] aic7xxx: use scsi device as argument for BUILD_SCSIID()

2017-06-28 Thread Hannes Reinecke
Signed-off-by: Hannes Reinecke --- drivers/scsi/aic7xxx/aic7xxx_osm.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index 5f9d2ae..72f3007 100644 ---

[PATCH 18/47] mptfc: open-code mptfc_block_error_handler() for bus reset

2017-06-28 Thread Hannes Reinecke
When calling bus_reset we have potentially several ports to be reset, so this patch open-codes the existing mptfc_block_error_handler() to wait for all ports attached to this bus. Signed-off-by: Hannes Reinecke --- drivers/message/fusion/mptfc.c | 17 ++--- 1 file

[PATCH 39/47] aic79xx: do not reference scsi command when resetting device

2017-06-28 Thread Hannes Reinecke
When sending a device reset we should not take a reference to the scsi command. Signed-off-by: Hannes Reinecke --- drivers/scsi/aic7xxx/aic79xx_osm.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c

[PATCH 22/47] bnx2fc: Do not rely on a scsi command when issueing lun or target reset

2017-06-28 Thread Hannes Reinecke
When a LUN or target reset is issued we should not rely on a scsi command to be present; this isn't very reliable and is going away with the next patch anyway. Signed-off-by: Hannes Reinecke --- drivers/scsi/bnx2fc/bnx2fc.h | 1 + drivers/scsi/bnx2fc/bnx2fc_hwi.c | 14

[PATCH 41/47] xen-scsifront: add scsi device as argument to scsifront_do_request()

2017-06-28 Thread Hannes Reinecke
Add scsi device as argument to scsifront_do_request() so that it will be possible to call it with a NULL command pointer. Signed-off-by: Hannes Reinecke --- drivers/scsi/xen-scsifront.c | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff

[PATCH 36/47] a1000u2w: do not rely on the command for inia100_device_reset()

2017-06-28 Thread Hannes Reinecke
Use the scsi device as argument to orc_device_reset() instead of relying on the passed in scsi command. Signed-off-by: Hannes Reinecke --- drivers/scsi/a100u2w.c | 43 +++ 1 file changed, 11 insertions(+), 32 deletions(-) diff --git

[PATCH 31/47] bfa: Do not use scsi command to signal TMF status

2017-06-28 Thread Hannes Reinecke
The bfa driver hijacks the scsi command to signal the TMF status, which will no longer work if the TMF handler will be converted. So rework TMF handling to not use a scsi command but rather add new TMF fields to the per-device structure. Signed-off-by: Hannes Reinecke ---

[PATCH 32/47] scsi: Use scsi_target as argument for eh_target_reset_handler()

2017-06-28 Thread Hannes Reinecke
The target reset function should only depend on the scsi target, not the scsi command. Signed-off-by: Hannes Reinecke --- drivers/message/fusion/mptsas.c | 10 +- drivers/message/fusion/mptscsih.c | 27 +++-- drivers/message/fusion/mptscsih.h

[PATCH 35/47] fnic: use dedicated device reset command

2017-06-28 Thread Hannes Reinecke
Use a dedicated command to send a device reset instead of relying on using the command which triggered the device failure. Signed-off-by: Hannes Reinecke --- drivers/scsi/fnic/fnic_main.c | 2 ++ drivers/scsi/fnic/fnic_scsi.c | 78 +-- 2

[PATCH 23/47] zfcp: do not rely on scsi command for debugging message

2017-06-28 Thread Hannes Reinecke
When generating debugging messages the code should not rely on a scsi command to be present. Signed-off-by: Hannes Reinecke --- drivers/s390/scsi/zfcp_dbf.c | 28 ++-- drivers/s390/scsi/zfcp_dbf.h | 10 +++--- drivers/s390/scsi/zfcp_ext.h | 4 ++--

[PATCH 34/47] aha152x: look for stuck command when resetting device

2017-06-28 Thread Hannes Reinecke
From: Hannes Reinecke The LLDD needs a command to send the reset with, so look at the list of outstanding commands to get one. Signed-off-by: Hannes Reinecke --- drivers/scsi/aha152x.c | 24 ++-- 1 file changed, 14 insertions(+), 10

[PATCH 16/47] mptfc: simplify mpt_fc_block_error_handler()

2017-06-28 Thread Hannes Reinecke
Instead of passing the a function we can as well return a status and call the function directly afterwards. Signed-off-by: Hannes Reinecke --- drivers/message/fusion/mptfc.c | 83 +++--- 1 file changed, 54 insertions(+), 29 deletions(-) diff

[PATCH 24/47] zfcp: use scsi device as argument for zfcp_task_mgmt_function()

2017-06-28 Thread Hannes Reinecke
zfcp_task_mgmt_function() is only used for lun and device reset, so it should be using the scsi device as an argument, not the scsi command. Signed-off-by: Hannes Reinecke --- drivers/s390/scsi/zfcp_ext.h | 2 +- drivers/s390/scsi/zfcp_fc.h | 9 +

[PATCH 15/47] scsi_transport_fc: Use fc_rport as argument for fc_block_scsi_eh

2017-06-28 Thread Hannes Reinecke
fc_block_scsi_eh() works on a remote port, so we should be using that as an argument, and not the scsi command. Signed-off-by: Hannes Reinecke --- drivers/s390/scsi/zfcp_scsi.c | 6 -- drivers/scsi/bnx2fc/bnx2fc_io.c | 4 ++-- drivers/scsi/csiostor/csio_scsi.c | 4

[PATCH 12/47] qla1280: separate out host reset function from qla1280_error_action()

2017-06-28 Thread Hannes Reinecke
There's not much in common between host reset and all other error handlers, so use a separate function here. Signed-off-by: Hannes Reinecke --- drivers/scsi/qla1280.c | 40 +--- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git

[PATCH 30/47] sym53c8xx_2: rework reset handling

2017-06-28 Thread Hannes Reinecke
Split off the combined abort and device reset handling into distinct functions. And the current device reset handler really is a target reset, so rename it. Signed-off-by: Hannes Reinecke --- drivers/scsi/sym53c8xx_2/sym_glue.c | 82 + 1 file

[PATCH 14/47] scsi: Use Scsi_Host as argument for eh_host_reset_handler

2017-06-28 Thread Hannes Reinecke
Issuing a host reset should not rely on any commands. So use Scsi_Host as argument for eh_host_reset_handler. Signed-off-by: Hannes Reinecke --- Documentation/scsi/scsi_eh.txt | 2 +- Documentation/scsi/scsi_mid_low_api.txt | 4 +--

[PATCH 21/47] libiscsi: use cls_session as argument for target and session reset

2017-06-28 Thread Hannes Reinecke
iscsi_eh_target_reset() and iscsi_eh_session_reset() only depend on the cls_session, so use that as an argument. Signed-off-by: Hannes Reinecke --- drivers/scsi/be2iscsi/be_main.c | 10 +- drivers/scsi/libiscsi.c | 21 + include/scsi/libiscsi.h

[PATCH 27/47] lpfc: use rport as argument for lpfc_chk_tgt_mapped()

2017-06-28 Thread Hannes Reinecke
We only need the rport structure for lpfc_chk_tgt_mapped(). Signed-off-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_scsi.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_scsi.c

[PATCH 10/47] ips: Do not try to abort command from host reset

2017-06-28 Thread Hannes Reinecke
The code for aborting an outstanding command is a copy of the functionality from command abort. As we already have called this function once we reach host reset there's no point in trying to do so again. Signed-off-by: Hannes Reinecke --- drivers/scsi/ips.c | 17 -

[PATCH 00/47] SCSI EH argument reshuffle part II

2017-06-28 Thread Hannes Reinecke
Hi all, finally here's the patchset to revamp the SCSI EH callback arguments which I promised to do (some years ago ...). The overall idea is to match the scope of the eh_XXX callbacks with the appropriate argument, eg eh_device_reset_handler() should have a scsi device as argument etc. Relying

[PATCH 17/47] mptfusion: correct definitions for mptscsih_dev_reset()

2017-06-28 Thread Hannes Reinecke
From: Hannes Reinecke mptscsih_dev_reset() is _not_ a device reset, but rather a target reset. Nevertheless it's being used for either purpose. This patch is adding a correct implementation for mptscsih_dev_reset(), and renames the original function to mptscsih_target_reset.

[PATCH 13/47] megaraid: pass in NULL scb for host reset

2017-06-28 Thread Hannes Reinecke
When calling a host reset we shouldn't rely on the command triggering the reset, so allow megaraid_abort_and_reset() to be called with a NULL scb. And drop the pointless 'bus_reset' and 'target_reset' handlers, which just call the same function as host_reset. Signed-off-by: Hannes Reinecke

[PATCH 11/47] snic: reserve tag for TMF

2017-06-28 Thread Hannes Reinecke
Rather than re-using the failed command the snic driver should reserve one command for TMFs. Signed-off-by: Hannes Reinecke --- drivers/scsi/snic/snic.h | 3 ++- drivers/scsi/snic/snic_main.c | 3 +++ drivers/scsi/snic/snic_scsi.c | 51

[PATCH 08/47] sym53c8xx_2: split off bus reset from host reset

2017-06-28 Thread Hannes Reinecke
The current handler does both, bus reset and host reset. So split them off into two distinct functions. Signed-off-by: Hannes Reinecke --- drivers/scsi/sym53c8xx_2/sym_glue.c | 107 ++-- 1 file changed, 66 insertions(+), 41 deletions(-) diff --git

[PATCH 01/47] aacraid: split off functions to generate reset FIB

2017-06-28 Thread Hannes Reinecke
Split off reset FIB generation into separate functions. Signed-off-by: Hannes Reinecke --- drivers/scsi/aacraid/linit.c | 83 ++-- 1 file changed, 50 insertions(+), 33 deletions(-) diff --git a/drivers/scsi/aacraid/linit.c

[PATCH 19/47] pmcraid: Select device in pmcraid_eh_bus_reset_handler()

2017-06-28 Thread Hannes Reinecke
The reset code requires a device to be selected, but we shouldn't rely on the command to provide a device for us. So select the first device on the bus when sending down a bus reset. Signed-off-by: Hannes Reinecke --- drivers/scsi/pmcraid.c | 46

[PATCH 07/47] aacraid: complete all commands during bus reset

2017-06-28 Thread Hannes Reinecke
When issuing a bus reset we should complete all commands, not just the command triggering the reset. Signed-off-by: Hannes Reinecke --- drivers/scsi/aacraid/linit.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git

[PATCH 05/47] aacraid: enable sending of TMFs from aac_hba_send()

2017-06-28 Thread Hannes Reinecke
aac_hba_send() will return FAILED for any non-SCSI command requests, failing any TMFs. This patch updates the check to allow TMFs. Signed-off-by: Hannes Reinecke --- drivers/scsi/aacraid/commsup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 04/47] aacraid: use aac_tmf_callback for reset fib

2017-06-28 Thread Hannes Reinecke
When sending a reset fib we shouldn't rely on the scsi command, but rather set the TMF status in the map_info->reset_state variable. That allows us to send a TMF independent on a scsi command. Signed-off-by: Hannes Reinecke --- drivers/scsi/aacraid/linit.c | 96

[PATCH 03/47] aacraid: split off device, target, and bus reset

2017-06-28 Thread Hannes Reinecke
Split off device, target, and bus reset functionality into individual functions. Signed-off-by: Hannes Reinecke --- drivers/scsi/aacraid/linit.c | 141 +++ 1 file changed, 102 insertions(+), 39 deletions(-) diff --git

[PATCH 06/47] aacraid: add fib flag to mark scsi command callback

2017-06-28 Thread Hannes Reinecke
To correctly identify which fib has a scsi command callback this patch implements a flag FIB_CONTEXT_FLAG_SCSI_CMD. Signed-off-by: Hannes Reinecke --- drivers/scsi/aacraid/aacraid.h | 1 + drivers/scsi/aacraid/commsup.c | 1 + 2 files changed, 2 insertions(+) diff --git

[PATCH 02/47] aacraid: split off host reset

2017-06-28 Thread Hannes Reinecke
Split off the host reset parts of aac_eh_reset() into a separate host reset function. Signed-off-by: Hannes Reinecke --- drivers/scsi/aacraid/linit.c | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git

[PATCH 02/28] mptfc: Do not call fc_block_scsi_eh() on host reset

2017-06-28 Thread Hannes Reinecke
When we're resetting the host any remote port states will be reset anyway, so it's pointless to wait for dev_loss_tmo during host reset. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/message/fusion/mptfc.c | 10 +- 1 file changed,

[PATCH 18/28] ppa: drop duplicate bus_reset handler

2017-06-28 Thread Hannes Reinecke
bus_reset and host_reset are the same functions, so drop bus_reset. Signed-off-by: Hannes Reinecke --- drivers/scsi/ppa.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c index f6ad579..7be5823 100644 --- a/drivers/scsi/ppa.c +++

[PATCH 20/28] nsp32: drop bus reset

2017-06-28 Thread Hannes Reinecke
From: Hannes Reinecke bus reset is essentially identical to host reset, and will always return SUCCESS, thus disabling the use of host reset. So drop bus reset in favour of host reset. Signed-off-by: Hannes Reinecke --- drivers/scsi/nsp32.c | 22

[PATCH 25/28] lpfc: drop lpfc_no_handler and lpfc_bus_reset_handler()

2017-06-28 Thread Hannes Reinecke
lpfc_bus_reset_handler() is really just a loop calling lpfc_target_reset_handler() over all targets, which is what the error handler will be doing anyway. And lpfc_no_handler() will return FAILED, just like SCSI EH does if no handler is present. So drop both. Signed-off-by: Hannes Reinecke

[PATCH 14/28] acornscsi: move bus reset to host reset

2017-06-28 Thread Hannes Reinecke
The bus reset function is really a host reset, so move it to eh_host_reset_handler. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/scsi/arm/acornscsi.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git

[PATCH 27/28] eata: remove 'arg_done' from eata2x_eh_host_reset()

2017-06-28 Thread Hannes Reinecke
Just displaying some different information; drop it. Signed-off-by: Hannes Reinecke --- drivers/scsi/eata.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c index 227dd2c..6501c33 100644 ---

[PATCH 26/28] visorhba: sanitze private device data allocation

2017-06-28 Thread Hannes Reinecke
There's no need to keep the private data for a device in a separate list; better to store it in ->hostdata and do away with the additional list. Signed-off-by: Hannes Reinecke Cc: David Kershner --- drivers/staging/unisys/visorhba/visorhba_main.c | 123

[PATCH 11/28] scsi: drop bus reset for wd33c93-compatible boards

2017-06-28 Thread Hannes Reinecke
The bus reset function is just a wrapper calling host reset under the host lock. So move taking of the host lock into the host reset function and drop bus reset. Signed-off-by: Hannes Reinecke --- drivers/scsi/a2091.c | 17 - drivers/scsi/a3000.c | 17

[PATCH 19/28] qedf: drop bus reset handler

2017-06-28 Thread Hannes Reinecke
qedf has a host reset handler, but as the bus reset handler is a stub always returning SUCCESS the host reset is never invoked. So drop the bus reset handler. Signed-off-by: Hannes Reinecke Cc: Chad Dupuis --- drivers/scsi/qedf/qedf_main.c | 11

[PATCH 23/28] bnx2fc: remove obsolete bnx2fc_eh_host_reset() definition

2017-06-28 Thread Hannes Reinecke
Never used anywhere. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/scsi/bnx2fc/bnx2fc.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h index 7e007e1..901a316 100644 ---

[PATCH 24/28] megaraid_mbox: drop duplicate bus reset and device reset function

2017-06-28 Thread Hannes Reinecke
megaraid_mbox only has one reset function, and that is a host reset. So drop the duplicate bus reset and device reset functions. Signed-off-by: Hannes Reinecke --- drivers/scsi/megaraid/megaraid_mbox.c | 2 -- 1 file changed, 2 deletions(-) diff --git

[PATCH 04/28] fc_fcp: do not call fc_block_scsi_eh() from host reset

2017-06-28 Thread Hannes Reinecke
When calling host reset we're resetting all ports anyway, so there is no point in waiting for the ports to become unblocked. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/scsi/libfc/fc_fcp.c | 2 -- 1 file changed, 2 deletions(-) diff

[PATCH 00/28] SCSI EH argument reshuffle part I

2017-06-28 Thread Hannes Reinecke
Hi all, finally here's the patchset to revamp the SCSI EH callback arguments which I promised to do (some years ago ...). The overall idea is to match the scope of the eh_XXX callbacks with the appropriate argument, eg eh_device_reset_handler() should have a scsi device as argument etc. Relying

[PATCH 15/28] NCR5380: Move bus reset to host reset

2017-06-28 Thread Hannes Reinecke
The bus reset handler really is a host reset, so move it to eh_bus_reset_handler. Signed-off-by: Hannes Reinecke Acked-by: Finn Thain --- drivers/scsi/NCR5380.c | 4 ++-- drivers/scsi/arm/cumana_1.c | 2 +- drivers/scsi/arm/oak.c | 2 +-

[PATCH 22/28] 53c700: move bus reset to host reset

2017-06-28 Thread Hannes Reinecke
bus reset always returns SUCCESS, meaning host reset was never tested. At the same time the only difference to the HBA is a missing call to NCR_700_chip_reset(). So add the missing call to bus reset, drop host reset, and move bus reset to host reset. Signed-off-by: Hannes Reinecke

[PATCH 03/28] ibmvfc: Do not call fc_block_scsi_eh() on host reset

2017-06-28 Thread Hannes Reinecke
When we're resetting the host any remote port states will be reset anyway, so it's pointless to wait for dev_loss_tmo during host reset. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/scsi/ibmvscsi/ibmvfc.c | 6 +- 1 file changed, 1

[PATCH 16/28] qlogicfas: move bus_reset to host_reset

2017-06-28 Thread Hannes Reinecke
From: Hannes Reinecke The bus reset handler is really a host reset. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/scsi/pcmcia/qlogic_stub.c | 4 ++-- drivers/scsi/qlogicfas.c | 2 +- drivers/scsi/qlogicfas408.c

[PATCH 06/28] uas: move eh_bus_reset_handler to eh_device_reset_handler

2017-06-28 Thread Hannes Reinecke
The bus_reset handler is really a device reset, so move it to eh_device_reset_handler(). Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/usb/storage/uas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 05/28] fnic: do not call host reset from command abort

2017-06-28 Thread Hannes Reinecke
command abort already returns FAILED, which will then be escalated to a host reset. So no need to call host_reset directly. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/scsi/fnic/fnic_scsi.c | 4 1 file changed, 4 deletions(-) diff

[PATCH 17/28] imm: drop duplicate bus_reset handler

2017-06-28 Thread Hannes Reinecke
host_reset and bus_reset is the same function, so drop bus reset. Signed-off-by: Hannes Reinecke --- drivers/scsi/imm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c index 9164ce12..87c9419 100644 --- a/drivers/scsi/imm.c +++

[PATCH 12/28] rtsx: drop bus reset function

2017-06-28 Thread Hannes Reinecke
Function is a stub, so can as well be dropped. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/staging/rts5208/rtsx.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/staging/rts5208/rtsx.c

[PATCH 10/28] fdomain: move bus reset to host reset

2017-06-28 Thread Hannes Reinecke
The bus reset function really is a host reset, so move it to eh_host_reset_handler(). Signed-off-by: Hannes Reinecke --- drivers/scsi/fdomain.c | 6 +++--- drivers/scsi/fdomain.h | 2 +- drivers/scsi/pcmcia/fdomain_stub.c | 2 +- 3 files changed, 5

[PATCH 08/28] bfa: move bus reset to target reset

2017-06-28 Thread Hannes Reinecke
The bus reset handler is just calling target reset on all targets, which is exactly what SCSI EH will be doing anyway. So move the bus reset function to target reset and drop the loop. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig ---

[PATCH 07/28] libsas: move bus_reset_handler() to target_reset_handler()

2017-06-28 Thread Hannes Reinecke
The bus reset handler is calling I_T Nexus reset, which logically is a target reset as it need to specify both the initiator and the target. So move it to target reset. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig ---

[PATCH 21/28] aha152x: drop bus reset

2017-06-28 Thread Hannes Reinecke
From: Hannes Reinecke The bus reset function is a subset of host reset, but will always return SUCCESS. But as the host reset also invokes a reset for all ports there is a possibility that the bus reset will not be able to fully reset the HBA, leading to a blocked system. So drop

[PATCH 09/28] hptiop: Simplify reset handling

2017-06-28 Thread Hannes Reinecke
The Highpoint driver only has one reset function, and that is a host reset. So stop pretending we're doing anything else. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/scsi/hptiop.c | 11 --- 1 file changed, 4 insertions(+), 7

[PATCH 01/28] scsi: fix comment in scsi_device_set_state()

2017-06-28 Thread Hannes Reinecke
The function returns '0' if successful; with the original comment the function doesn't have a way to indicate success ... Signed-off-by: Hannes Reinecke Reviewed-by: Bart van Assche --- drivers/scsi/scsi_lib.c | 2 +- 1 file changed, 1 insertion(+), 1

Re: [PATCH RESEND] scsi: Add STARGET_CREATED_REMOVE state to scsi_target_state

2017-06-28 Thread Johannes Thumshirn
On Tue, Jun 27, 2017 at 02:55:58PM -0400, Ewan Milne wrote: > From: "Ewan D. Milne" > > The addition of the STARGET_REMOVE state had the side effect of > introducing a race condition that can cause a crash. > > scsi_target_reap_ref_release() checks the starget->state to > see

[PATCH 4/5] target: user: Fix sense data handling

2017-06-28 Thread Damien Le Moal
If the user request handler completed the request with a CHECK CONDITION status, tcmu_handle_completion() copies the command entry sense data into the session request structure sense data. However, the sense data length indicated by the field scsi_sense_length is not set and equal to 0, resulting

[PATCH 3/5] target: pscsi: Fix sense data handling

2017-06-28 Thread Damien Le Moal
On completion of a request sent to the target backstore device, pscsi_req_done() calls target_complete_cmd() which in turn will execute pscsi_transport_complete(). In case of a failed request, this last function will copy the target request sense data to the initiator side request sense data.

[PATCH 0/5] target: Zoned block device support and bug fixes

2017-06-28 Thread Damien Le Moal
This series introduce zoned block device support for the pscsi backstore and also fixes several problems with sense data handling for failed requests. The first patch is only a cleanup, so not really necessary but nice to have I think. Patch 2 and 3 introduce support for host managed zoned block

[PATCH 2/5] target: pscsi: Introduce TYPE_ZBC support

2017-06-28 Thread Damien Le Moal
TYPE_ZBC host managed zoned block devices are also block devices despite the non-standard device type (14h). Handle them similarly to regular TYPE_DISK devices. Signed-off-by: Damien Le Moal --- drivers/target/target_core_pscsi.c | 17 +++-- 1 file changed, 11

[PATCH 1/5] target: Use macro for WRITE_VERIFY_xx operation codes

2017-06-28 Thread Damien Le Moal
Add WRITE_VERIFY_32 definition to scsi prototypes and use this macro definition isntead of the hard coded value. Same for the already defined WRITE_VERIFY_16 command code. Signed-off-by: Damien Le Moal --- drivers/target/target_core_device.c | 4 ++--

[PATCH 5/5] target: core: Fix failed command sense data handling

2017-06-28 Thread Damien Le Moal
For a target device without a transport->transport_complete method defined (e.g. target_core_user), target_complete_cmd() will always result in a failed command completion being processed through target failure completion work even when the command failure comes from the target processing and has

<    1   2