SCSI EH argument reshuffle part I
Hannes Reinecke
maintainerv2 cover SCSI EH argument reshuffle part I
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 on the scsi command has the problem that
a) we're holding a reference on that command for the entire lifetime of the error handling and
b) it leads to some 'interesting' driver implementations; some higher-level EH callback implementations go through the list of outstanding commands and try to abort this particular command only; makes one wonder what'll happen to the other commands ...
However, this patchset has the nice side-effect that we don't need to allocate an out-of-order scsi command in scsi_ioctl_reset(), but can call the function directly.
As per request from hch the patchset has been split in two parts; this is the first part which just does a general EH function cleanup without introducing any functional differences.
As usual, comments and reviews are welcome.
Changes to v1:
- Include review tags
- drop aha152x host reset instead of bus reset as suggested by hch
Hannes Reinecke (26):
scsi: fix comment in scsi_device_set_state()
mptfc: Do not call fc_block_scsi_eh() on host reset
ibmvfc: Do not call fc_block_scsi_eh() on host reset
fc_fcp: do not call fc_block_scsi_eh() from host reset
fnic: do not call host reset from command abort
uas: move eh_bus_reset_handler to eh_device_reset_handler
libsas: move bus_reset_handler() to target_reset_handler()
bfa: move bus reset to target reset
hptiop: Simplify reset handling
fdomain: move bus reset to host reset
scsi: drop bus reset for wd33c93-compatible boards
rtsx: drop bus reset function
qlogicpti: move bus reset to host reset
acornscsi: move bus reset to host reset
NCR5380: Move bus reset to host reset
qlogicfas: move bus_reset to host_reset
imm: drop duplicate bus_reset handler
ppa: drop duplicate bus_reset handler
qedf: drop bus reset handler
nsp32: drop bus reset
aha152x: drop host reset
53c700: move bus reset to host reset
bnx2fc: remove obsolete bnx2fc_eh_host_reset() definition
megaraid_mbox: drop duplicate bus reset and device reset function
visorhba: sanitze private device data allocation
eata: remove 'arg_done' from eata2x_eh_host_reset()
drivers/message/fusion/mptfc.c | 10 +- drivers/scsi/53c700.c | 23 +---- drivers/scsi/NCR5380.c | 4 +- drivers/scsi/a2091.c | 17 ---- drivers/scsi/a3000.c | 17 ---- drivers/scsi/aha152x.c | 13 +-- drivers/scsi/aic94xx/aic94xx_init.c | 2 +- drivers/scsi/arm/acornscsi.c | 11 ++- drivers/scsi/arm/cumana_1.c | 2 +- drivers/scsi/arm/oak.c | 2 +- drivers/scsi/atari_scsi.c | 6 +- drivers/scsi/bfa/bfad_im.c | 37 +++---- drivers/scsi/bnx2fc/bnx2fc.h | 1 - drivers/scsi/dmx3191d.c | 2 +- drivers/scsi/eata.c | 9 +- drivers/scsi/fdomain.c | 6 +- drivers/scsi/fdomain.h | 2 +- drivers/scsi/fnic/fnic_scsi.c | 4 - drivers/scsi/g_NCR5380.c | 4 +- drivers/scsi/gvp11.c | 18 ---- drivers/scsi/hisi_sas/hisi_sas_main.c | 2 +- drivers/scsi/hptiop.c | 11 +-- drivers/scsi/ibmvscsi/ibmvfc.c | 6 +- drivers/scsi/imm.c | 1 - drivers/scsi/isci/init.c | 2 +- drivers/scsi/libfc/fc_fcp.c | 2 - drivers/scsi/libsas/sas_scsi_host.c | 12 +-- drivers/scsi/mac_scsi.c | 4 +- drivers/scsi/megaraid/megaraid_mbox.c | 2 - drivers/scsi/mvme147.c | 16 --- drivers/scsi/mvsas/mv_init.c | 2 +- drivers/scsi/nsp32.c | 22 +---- drivers/scsi/pcmcia/fdomain_stub.c | 2 +- drivers/scsi/pcmcia/qlogic_stub.c | 4 +- drivers/scsi/pm8001/pm8001_init.c | 2 +- drivers/scsi/ppa.c | 1 - drivers/scsi/qedf/qedf_main.c | 11 --- drivers/scsi/qlogicfas.c | 2 +- drivers/scsi/qlogicfas408.c | 6 +- drivers/scsi/qlogicfas408.h | 2 +- drivers/scsi/qlogicpti.c | 5 +- drivers/scsi/scsi_lib.c | 2 +- drivers/scsi/sgiwd93.c | 15 --- drivers/scsi/sun3_scsi.c | 4 +- drivers/scsi/wd33c93.c | 2 + drivers/staging/rts5208/rtsx.c | 11 --- drivers/staging/unisys/visorhba/visorhba_main.c | 123 ++++++++++-------------- drivers/usb/storage/uas.c | 4 +- include/scsi/libsas.h | 2 +- 49 files changed, 133 insertions(+), 337 deletions(-)
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 1/26 scsi: fix comment in scsi_device_set_state()
The function returns '0' if successful; with the original comment the function doesn't have a way to indicate success ...
--- drivers/scsi/scsi_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_lib.c +1 -1
@@ -2547,7 +2547,7 @@ void scsi_exit_queue(void)* @sdev: scsi device to change the state of. * @state: state to change to. * -* Returns zero if unsuccessful or an error if the requested +* Returns zero if successful or an error if the requested * transition is illegal. */ int
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 2/26 mptfc: Do not call fc_block_scsi_eh() on host reset
In reply to Hannes ReineckeWhen 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.
--- drivers/message/fusion/mptfc.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/message/fusion/mptfc.c +1 -9
@@ -104,7 +104,6 @@static int mptfc_abort (struct scsi_cmnd *SCpnt);static int mptfc_dev_reset (struct scsi_cmnd *SCpnt);static int mptfc_bus_reset (struct scsi_cmnd *SCpnt); -static int mptfc_host_reset (struct scsi_cmnd *SCpnt);static struct scsi_host_template mptfc_driver_template = { .module =THIS_MODULE ,
@@ -123,7 +122,7 @@ .eh_abort_handler = mptfc_abort, .eh_device_reset_handler = mptfc_dev_reset, .eh_bus_reset_handler = mptfc_bus_reset, - .eh_host_reset_handler = mptfc_host_reset, + .eh_host_reset_handler = mptscsih_host_reset, .bios_param = mptscsih_bios_param, .can_queue = MPT_FC_CAN_QUEUE, .this_id = -1,
@@ -254,13 +253,6 @@mptfc_block_error_handler (SCpnt, mptscsih_bus_reset, __func__); } -static int -mptfc_host_reset (struct scsi_cmnd *SCpnt) -{ -return -mptfc_block_error_handler (SCpnt, mptscsih_host_reset, __func__); -} -static void mptfc_set_rport_loss_tmo (struct fc_rport *rport,uint32_t timeout) {
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 3/26 ibmvfc: Do not call fc_block_scsi_eh() on host reset
In reply to Hannes ReineckeWhen 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.
--- drivers/scsi/ibmvscsi/ibmvfc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/scsi/ibmvscsi/ibmvfc.c +1 -5
@@ -2528,16 +2528,12 @@ static int ibmvfc_eh_target_reset_handler(struct scsi_cmnd *cmd)**/ static int ibmvfc_eh_host_reset_handler (struct scsi_cmnd *cmd) { -int rc, block_rc; +int rc;struct ibmvfc_host *vhost =shost_priv (cmd->device->host); - block_rc =fc_block_scsi_eh (cmd);dev_err (vhost->dev,"Resetting connection due to error recovery\n" ); rc =ibmvfc_issue_fc_host_lip (vhost->host); -if (block_rc ==FAST_IO_FAIL ) -return FAST_IO_FAIL ; -return rc ?FAILED :SUCCESS ; }
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 4/26 fc_fcp: do not call fc_block_scsi_eh() from host reset
In reply to Hannes ReineckeWhen calling host reset we're resetting all ports anyway, so there is no point in waiting for the ports to become unblocked.
--- drivers/scsi/libfc/fc_fcp.c | 2 -- 1 file changed, 2 deletions(-)
drivers/scsi/libfc/fc_fcp.c +0 -2
@@ -2222,8 +2222,6 @@ int fc_eh_host_reset(struct scsi_cmnd *sc_cmd)FC_SCSI_DBG (lport,"Resetting host\n" ); -fc_block_scsi_eh (sc_cmd); -fc_lport_reset (lport); wait_tmo = jiffies +FC_HOST_RESET_TIMEOUT ; while (!fc_fcp_lport_queue_ready(lport) && time_before(jiffies,
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 5/26 fnic: do not call host reset from command abort
In reply to Hannes Reineckecommand abort already returns FAILED, which will then be escalated to a host reset. So no need to call host_reset directly.
--- drivers/scsi/fnic/fnic_scsi.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/scsi/fnic/fnic_scsi.c +0 -4
@@ -1990,10 +1990,6 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)FNIC_SCSI_DBG (KERN_DEBUG , fnic->lport->host,"Issuing Host reset due to out of order IO\n" ); -if (fnic_host_reset (sc) ==FAILED ) { -FNIC_SCSI_DBG (KERN_DEBUG , fnic->lport->host, -"fnic_host_reset failed.\n" ); - } ret =FAILED ; goto fnic_abort_cmd_end; }
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 7/26 libsas: move bus_reset_handler() to target_reset_handler()
In reply to Hannes ReineckeThe 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.
--- drivers/scsi/aic94xx/aic94xx_init.c | 2 +- drivers/scsi/hisi_sas/hisi_sas_main.c | 2 +- drivers/scsi/isci/init.c | 2 +- drivers/scsi/libsas/sas_scsi_host.c | 12 ++++++------ drivers/scsi/mvsas/mv_init.c | 2 +- drivers/scsi/pm8001/pm8001_init.c | 2 +- include/scsi/libsas.h | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-)
drivers/scsi/aic94xx/aic94xx_init.c +1 -1
@@ -70,7 +70,7 @@ .max_sectors = SCSI_DEFAULT_MAX_SECTORS, .use_clustering = ENABLE_CLUSTERING, .eh_device_reset_handler = sas_eh_device_reset_handler, - .eh_bus_reset_handler = sas_eh_bus_reset_handler, + .eh_target_reset_handler = sas_eh_target_reset_handler, .target_destroy = sas_target_destroy, .ioctl = sas_ioctl, .track_queue_depth = 1,
drivers/scsi/hisi_sas/hisi_sas_main.c +1 -1
@@ -1562,7 +1562,7 @@ void hisi_sas_phy_down(struct hisi_hba *hisi_hba, int phy_no, int rdy) .max_sectors = SCSI_DEFAULT_MAX_SECTORS, .use_clustering = ENABLE_CLUSTERING, .eh_device_reset_handler = sas_eh_device_reset_handler, - .eh_bus_reset_handler = sas_eh_bus_reset_handler, + .eh_target_reset_handler = sas_eh_target_reset_handler, .target_destroy = sas_target_destroy, .ioctl = sas_ioctl, };
drivers/scsi/isci/init.c +1 -1
@@ -166,7 +166,7 @@ struct device_attribute *isci_host_attrs[] = { .use_clustering = ENABLE_CLUSTERING, .eh_abort_handler = sas_eh_abort_handler, .eh_device_reset_handler = sas_eh_device_reset_handler, - .eh_bus_reset_handler = sas_eh_bus_reset_handler, + .eh_target_reset_handler = sas_eh_target_reset_handler, .target_destroy = sas_target_destroy, .ioctl = sas_ioctl, .shost_attrs = isci_host_attrs,
drivers/scsi/libsas/sas_scsi_host.c +6 -6
@@ -526,7 +526,7 @@ int sas_eh_device_reset_handler(struct scsi_cmnd *cmd)return FAILED ; } -int sas_eh_bus_reset_handler (struct scsi_cmnd *cmd) +int sas_eh_target_reset_handler (struct scsi_cmnd *cmd) {int res;struct Scsi_Host *host = cmd->device->host;
@@ -554,15 +554,15 @@ static int try_to_reset_cmd_device(struct scsi_cmnd *cmd)struct Scsi_Host *shost = cmd->device->host;if (!shost->hostt->eh_device_reset_handler) - goto try_bus_reset; + goto try_target_reset; res = shost->hostt->eh_device_reset_handler (cmd);if (res ==SUCCESS )return res; -try_bus_reset: -if (shost->hostt->eh_bus_reset_handler) -return shost->hostt->eh_bus_reset_handler (cmd); +try_target_reset: +if (shost->hostt->eh_target_reset_handler) +return shost->hostt->eh_target_reset_handler (cmd);return FAILED ; }
@@ -996,6 +996,6 @@ int sas_request_addr(struct Scsi_Host *shost, u8 *addr)EXPORT_SYMBOL_GPL (sas_task_abort);EXPORT_SYMBOL_GPL (sas_phy_reset);EXPORT_SYMBOL_GPL (sas_eh_device_reset_handler); -EXPORT_SYMBOL_GPL (sas_eh_bus_reset_handler); +EXPORT_SYMBOL_GPL (sas_eh_target_reset_handler);EXPORT_SYMBOL_GPL (sas_target_destroy);EXPORT_SYMBOL_GPL (sas_ioctl);
drivers/scsi/mvsas/mv_init.c +1 -1
@@ -61,7 +61,7 @@ .max_sectors = SCSI_DEFAULT_MAX_SECTORS, .use_clustering = ENABLE_CLUSTERING, .eh_device_reset_handler = sas_eh_device_reset_handler, - .eh_bus_reset_handler = sas_eh_bus_reset_handler, + .eh_target_reset_handler = sas_eh_target_reset_handler, .target_destroy = sas_target_destroy, .ioctl = sas_ioctl, .shost_attrs = mvst_host_attrs,
drivers/scsi/pm8001/pm8001_init.c +1 -1
@@ -86,7 +86,7 @@ .max_sectors = SCSI_DEFAULT_MAX_SECTORS, .use_clustering = ENABLE_CLUSTERING, .eh_device_reset_handler = sas_eh_device_reset_handler, - .eh_bus_reset_handler = sas_eh_bus_reset_handler, + .eh_target_reset_handler = sas_eh_target_reset_handler, .target_destroy = sas_target_destroy, .ioctl = sas_ioctl, .shost_attrs = pm8001_host_attrs,
include/scsi/libsas.h +1 -1
@@ -714,7 +714,7 @@ extern int sas_bios_param(struct scsi_device *,void sas_task_abort (struct sas_task *);int sas_eh_abort_handler (struct scsi_cmnd *cmd);int sas_eh_device_reset_handler (struct scsi_cmnd *cmd); -int sas_eh_bus_reset_handler (struct scsi_cmnd *cmd); +int sas_eh_target_reset_handler (struct scsi_cmnd *cmd);extern void sas_target_destroy (struct scsi_target *);extern int sas_slave_alloc (struct scsi_device *);
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 9/26 hptiop: Simplify reset handling
In reply to Hannes ReineckeThe Highpoint driver only has one reset function, and that is a host reset. So stop pretending we're doing anything else.
--- drivers/scsi/hptiop.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/scsi/hptiop.c +4 -7
@@ -1106,12 +1106,10 @@ static int hptiop_reset_hba(struct hptiop_hba *hba)static int hptiop_reset (struct scsi_cmnd *scp) { -struct Scsi_Host * host = scp->device->host; -struct hptiop_hba * hba = (struct hptiop_hba *)host->hostdata; +struct hptiop_hba * hba = (struct hptiop_hba *)scp->device->host->hostdata; -printk (KERN_WARNING "hptiop_reset(%d/%d/%d) scp=%p\n" , - scp->device->host->host_no, scp->device->channel, - scp->device->id, scp); +printk (KERN_WARNING "hptiop_reset(%d/%d/%d)\n" , + scp->device->host->host_no,-1 ,-1 );return hptiop_reset_hba (hba)?FAILED :SUCCESS ; }
@@ -1179,8 +1177,7 @@ static int hptiop_slave_config(struct scsi_device *sdev) .module = THIS_MODULE, .name = driver_name, .queuecommand = hptiop_queuecommand, - .eh_device_reset_handler = hptiop_reset, - .eh_bus_reset_handler = hptiop_reset, + .eh_host_reset_handler = hptiop_reset, .info = hptiop_info, .emulated = 0, .use_clustering = ENABLE_CLUSTERING,
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 10/26 fdomain: move bus reset to host reset
In reply to Hannes ReineckeThe bus reset function really is a host reset, so move it to eh_host_reset_handler().
--- drivers/scsi/fdomain.c | 6 +++--- drivers/scsi/fdomain.h | 2 +- drivers/scsi/pcmcia/fdomain_stub.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/fdomain.c +3 -3
@@ -933,7 +933,7 @@ struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt ) } } -fdomain_16x0_bus_reset (NULL ); +fdomain_16x0_host_reset (NULL );if (fdomain_test_loopback ()) {printk (KERN_ERR "scsi: <fdomain> Detection failed (loopback test failed at port base 0x%x)\n" , port_base);
@@ -1568,7 +1568,7 @@ static int fdomain_16x0_abort(struct scsi_cmnd *SCpnt)return SUCCESS ; } -int fdomain_16x0_bus_reset (struct scsi_cmnd *SCpnt) +int fdomain_16x0_host_reset (struct scsi_cmnd *SCpnt) {unsigned long flags;
@@ -1758,7 +1758,7 @@ struct scsi_host_template fdomain_driver_template = { .info = fdomain_16x0_info, .queuecommand = fdomain_16x0_queue, .eh_abort_handler = fdomain_16x0_abort, - .eh_bus_reset_handler = fdomain_16x0_bus_reset, + .eh_host_reset_handler = fdomain_16x0_host_reset, .bios_param = fdomain_16x0_biosparam, .release = fdomain_16x0_release, .can_queue = 1,
drivers/scsi/fdomain.h +1 -1
@@ -21,4 +21,4 @@extern struct scsi_host_template fdomain_driver_template;extern int fdomain_setup (char *str);extern struct Scsi_Host *__fdomain_16x0_detect (struct scsi_host_template *tpnt ); -extern int fdomain_16x0_bus_reset (struct scsi_cmnd *SCpnt); +extern int fdomain_16x0_host_reset (struct scsi_cmnd *SCpnt);
drivers/scsi/pcmcia/fdomain_stub.c +1 -1
@@ -173,7 +173,7 @@ static void fdomain_release(struct pcmcia_device *link)static int fdomain_resume (struct pcmcia_device *link) { -fdomain_16x0_bus_reset (NULL ); +fdomain_16x0_host_reset (NULL );return 0 ; }
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 11/26 scsi: drop bus reset for wd33c93-compatible boards
In reply to Hannes ReineckeThe 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.
--- drivers/scsi/a2091.c | 17 ----------------- drivers/scsi/a3000.c | 17 ----------------- drivers/scsi/gvp11.c | 18 ------------------ drivers/scsi/mvme147.c | 16 ---------------- drivers/scsi/sgiwd93.c | 15 --------------- drivers/scsi/wd33c93.c | 2 ++ 6 files changed, 2 insertions(+), 83 deletions(-)
drivers/scsi/a2091.c +0 -17
@@ -147,22 +147,6 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt, } } -static int a2091_bus_reset (struct scsi_cmnd *cmd) -{ -struct Scsi_Host *instance = cmd->device->host; - -/* FIXME perform bus-specific reset */ - -/* FIXME 2: kill this function, and let midlayer fall back -to the same action, calling wd33c93_host_reset() */ - -spin_lock_irq (instance->host_lock); -wd33c93_host_reset (cmd); -spin_unlock_irq (instance->host_lock); - -return SUCCESS ; -} -static struct scsi_host_template a2091_scsi_template = { .module =THIS_MODULE , .name ="Commodore A2091/A590 SCSI" ,
@@ -171,7 +155,6 @@ static int a2091_bus_reset(struct scsi_cmnd *cmd) .proc_name = "A2901", .queuecommand = wd33c93_queuecommand, .eh_abort_handler = wd33c93_abort, - .eh_bus_reset_handler = a2091_bus_reset, .eh_host_reset_handler = wd33c93_host_reset, .can_queue = CAN_QUEUE, .this_id = 7,
drivers/scsi/a3000.c +0 -17
@@ -162,22 +162,6 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt, } } -static int a3000_bus_reset (struct scsi_cmnd *cmd) -{ -struct Scsi_Host *instance = cmd->device->host; - -/* FIXME perform bus-specific reset */ - -/* FIXME 2: kill this entire function, which should -cause mid-layer to call wd33c93_host_reset anyway? */ - -spin_lock_irq (instance->host_lock); -wd33c93_host_reset (cmd); -spin_unlock_irq (instance->host_lock); - -return SUCCESS ; -} -static struct scsi_host_template amiga_a3000_scsi_template = { .module =THIS_MODULE , .name ="Amiga 3000 built-in SCSI" ,
@@ -186,7 +170,6 @@ static int a3000_bus_reset(struct scsi_cmnd *cmd) .proc_name = "A3000", .queuecommand = wd33c93_queuecommand, .eh_abort_handler = wd33c93_abort, - .eh_bus_reset_handler = a3000_bus_reset, .eh_host_reset_handler = wd33c93_host_reset, .can_queue = CAN_QUEUE, .this_id = 7,
drivers/scsi/gvp11.c +0 -18
@@ -171,23 +171,6 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt, } } -static int gvp11_bus_reset (struct scsi_cmnd *cmd) -{ -struct Scsi_Host *instance = cmd->device->host; - -/* FIXME perform bus-specific reset */ - -/* FIXME 2: shouldn't we no-op this function (return -FAILED), and fall back to host reset function, -wd33c93_host_reset ? */ - -spin_lock_irq (instance->host_lock); -wd33c93_host_reset (cmd); -spin_unlock_irq (instance->host_lock); - -return SUCCESS ; -} -static struct scsi_host_template gvp11_scsi_template = { .module =THIS_MODULE , .name ="GVP Series II SCSI" ,
@@ -196,7 +179,6 @@ static int gvp11_bus_reset(struct scsi_cmnd *cmd) .proc_name = "GVP11", .queuecommand = wd33c93_queuecommand, .eh_abort_handler = wd33c93_abort, - .eh_bus_reset_handler = gvp11_bus_reset, .eh_host_reset_handler = wd33c93_host_reset, .can_queue = CAN_QUEUE, .this_id = 7,
drivers/scsi/mvme147.c +0 -16
@@ -121,21 +121,6 @@ int mvme147_detect(struct scsi_host_template *tpnt)return 0 ; } -static int mvme147_bus_reset (struct scsi_cmnd *cmd) -{ -/* FIXME perform bus-specific reset */ - -/* FIXME 2: kill this function, and let midlayer fallback to -the same result, calling wd33c93_host_reset() */ - -spin_lock_irq (cmd->device->host->host_lock); -wd33c93_host_reset (cmd); -spin_unlock_irq (cmd->device->host->host_lock); - -return SUCCESS ; -} - -static struct scsi_host_template driver_template = { .proc_name ="MVME147" , .name ="MVME147 built-in SCSI" ,
@@ -143,7 +128,6 @@ static int mvme147_bus_reset(struct scsi_cmnd *cmd) .release = mvme147_release, .queuecommand = wd33c93_queuecommand, .eh_abort_handler = wd33c93_abort, - .eh_bus_reset_handler = mvme147_bus_reset, .eh_host_reset_handler = wd33c93_host_reset, .can_queue = CAN_QUEUE, .this_id = 7,
drivers/scsi/sgiwd93.c +0 -15
@@ -192,20 +192,6 @@ static inline void init_hpc_chain(struct ip22_hostdata *hdata) hcp->desc.pnext = hdata->dma; } -static int sgiwd93_bus_reset (struct scsi_cmnd *cmd) -{ -/* FIXME perform bus-specific reset */ - -/* FIXME 2: kill this function, and let midlayer fallback -to the same result, calling wd33c93_host_reset() */ - -spin_lock_irq (cmd->device->host->host_lock); -wd33c93_host_reset (cmd); -spin_unlock_irq (cmd->device->host->host_lock); - -return SUCCESS ; -} -/* * Kludge alert - the SCSI code calls the abort and reset method with int * arguments not with pointers. So this is going to blow up beautyfully
@@ -217,7 +203,6 @@ static int sgiwd93_bus_reset(struct scsi_cmnd *cmd) .name = "SGI WD93", .queuecommand = wd33c93_queuecommand, .eh_abort_handler = wd33c93_abort, - .eh_bus_reset_handler = sgiwd93_bus_reset, .eh_host_reset_handler = wd33c93_host_reset, .can_queue = 16, .this_id = 7,
drivers/scsi/wd33c93.c +2 -0
@@ -1578,6 +1578,7 @@int i; instance = SCpnt->device->host; +spin_lock_irq (instance->host_lock); hostdata = (struct WD33C93_hostdata *) instance->hostdata;printk ("scsi%d: reset. " , instance->host_no);
@@ -1603,6 +1604,7 @@reset_wd33c93 (instance); SCpnt->result =DID_RESET <<16 ;enable_irq (instance->irq); +spin_unlock_irq (instance->host_lock);return SUCCESS ; }
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 13/26 qlogicpti: move bus reset to host reset
In reply to Hannes ReineckeThe bus reset function really is a host reset, so move it to eh_host_reset_handler().
--- drivers/scsi/qlogicpti.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/scsi/qlogicpti.c +2 -3
@@ -1250,10 +1250,9 @@ static int qlogicpti_abort(struct scsi_cmnd *Cmnd)return return_status; } -static int qlogicpti_reset (struct scsi_cmnd *Cmnd) +static int qlogicpti_reset (struct Scsi_Host *host) {u_short param[6 ]; -struct Scsi_Host *host = Cmnd->device->host;struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;int return_status =SUCCESS ;
@@ -1283,7 +1282,7 @@ static int qlogicpti_reset(struct scsi_cmnd *Cmnd) .queuecommand = qlogicpti_queuecommand, .slave_configure = qlogicpti_slave_configure, .eh_abort_handler = qlogicpti_abort, - .eh_bus_reset_handler = qlogicpti_reset, + .eh_host_reset_handler = qlogicpti_reset, .can_queue = QLOGICPTI_REQ_QUEUE_LEN, .this_id = 7, .sg_tablesize = QLOGICPTI_MAX_SG(QLOGICPTI_REQ_QUEUE_LEN),
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 6/26 uas: move eh_bus_reset_handler to eh_device_reset_handler
In reply to Hannes ReineckeThe bus_reset handler is really a device reset, so move it to eh_device_reset_handler().
--- drivers/usb/storage/uas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/storage/uas.c +2 -2
@@ -737,7 +737,7 @@ static int uas_eh_abort_handler(struct scsi_cmnd *cmnd)return FAILED ; } -static int uas_eh_bus_reset_handler (struct scsi_cmnd *cmnd) +static int uas_eh_device_reset_handler (struct scsi_cmnd *cmnd) {struct scsi_device *sdev = cmnd->device;struct uas_dev_info *devinfo = sdev->hostdata;
@@ -848,7 +848,7 @@ static int uas_slave_configure(struct scsi_device *sdev) .slave_alloc = uas_slave_alloc, .slave_configure = uas_slave_configure, .eh_abort_handler = uas_eh_abort_handler, - .eh_bus_reset_handler = uas_eh_bus_reset_handler, + .eh_device_reset_handler = uas_eh_device_reset_handler, .this_id = -1, .sg_tablesize = SG_NONE, .skip_settle_delay = 1,
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 8/26 bfa: move bus reset to target reset
In reply to Hannes ReineckeThe 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.
--- drivers/scsi/bfa/bfad_im.c | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-)
drivers/scsi/bfa/bfad_im.c +15 -22
@@ -373,32 +373,28 @@ static void bfad_im_fc_rport_add(struct bfad_im_port_s *im_port, }/* -* Scsi_Host template entry, resets the bus and abort all commands. +* Scsi_Host template entry, resets the target and abort all commands. */ static int -bfad_im_reset_bus_handler (struct scsi_cmnd *cmnd) +bfad_im_reset_target_handler (struct scsi_cmnd *cmnd) {struct Scsi_Host *shost = cmnd->device->host; +struct scsi_target *starget =scsi_target (cmnd->device);struct bfad_im_port_s *im_port = (struct bfad_im_port_s *) shost->hostdata[0 ];struct bfad_s *bfad = im_port->bfad;struct bfad_itnim_s *itnim;unsigned long flags; -u32 i, rc, err_cnt =0 ; +u32 rc, rtn =FAILED ;DECLARE_WAIT_QUEUE_HEAD_ONSTACK (wq);enum bfi_tskim_status task_status;spin_lock_irqsave (&bfad->bfad_lock, flags); -for (i =0 ; i <MAX_FCP_TARGET ; i++) { - itnim =bfad_get_itnim (im_port, i); -if (itnim) { - cmnd->SCp.ptr = (char *)&wq; - rc =bfad_im_target_reset_send (bfad, cmnd, itnim); -if (rc !=BFA_STATUS_OK ) { - err_cnt++; -continue ; - } - + itnim =bfad_get_itnim (im_port, starget->id); +if (itnim) { + cmnd->SCp.ptr = (char *)&wq; + rc =bfad_im_target_reset_send (bfad, cmnd, itnim); +if (rc ==BFA_STATUS_OK ) {/* wait target reset to complete */ spin_unlock_irqrestore (&bfad->bfad_lock, flags); wait_event(wq, test_bit(IO_DONE_BIT,
@@ -406,20 +402,17 @@ static void bfad_im_fc_rport_add(struct bfad_im_port_s *im_port,spin_lock_irqsave (&bfad->bfad_lock, flags); task_status = cmnd->SCp.Status >>1 ; -if (task_status !=BFI_TSKIM_STS_OK ) { +if (task_status !=BFI_TSKIM_STS_OK )BFA_LOG (KERN_ERR , bfad, bfa_log_level,"target reset failure," " status: %d\n" , task_status); - err_cnt++; - } +else + rtn =SUCCESS ; } }spin_unlock_irqrestore (&bfad->bfad_lock, flags); -if (err_cnt) -return FAILED ; - -return SUCCESS ; +return rtn; }/*
@@ -816,7 +809,7 @@ struct scsi_host_template bfad_im_scsi_host_template = { .eh_timed_out = fc_eh_timed_out, .eh_abort_handler = bfad_im_abort_handler, .eh_device_reset_handler = bfad_im_reset_lun_handler, - .eh_bus_reset_handler = bfad_im_reset_bus_handler, + .eh_target_reset_handler = bfad_im_reset_target_handler, .slave_alloc = bfad_im_slave_alloc, .slave_configure = bfad_im_slave_configure,
@@ -839,7 +832,7 @@ struct scsi_host_template bfad_im_vport_template = { .eh_timed_out = fc_eh_timed_out, .eh_abort_handler = bfad_im_abort_handler, .eh_device_reset_handler = bfad_im_reset_lun_handler, - .eh_bus_reset_handler = bfad_im_reset_bus_handler, + .eh_target_reset_handler = bfad_im_reset_target_handler, .slave_alloc = bfad_im_slave_alloc, .slave_configure = bfad_im_slave_configure,
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 12/26 rtsx: drop bus reset function
In reply to Hannes ReineckeFunction is a stub, so can as well be dropped.
--- drivers/staging/rts5208/rtsx.c | 11 ----------- 1 file changed, 11 deletions(-)
drivers/staging/rts5208/rtsx.c +0 -11
@@ -205,16 +205,6 @@ static int device_reset(struct scsi_cmnd *srb)return SUCCESS ; } -/* Simulate a SCSI bus reset by resetting the device's USB port. */ -static int bus_reset (struct scsi_cmnd *srb) -{ -struct rtsx_dev *dev =host_to_rtsx (srb->device->host); - -dev_info (&dev->pci->dev,"%s called\n" , __func__); - -return SUCCESS ; -} -/* * this defines our host template, with which we'll allocate hosts */
@@ -231,7 +221,6 @@ static int bus_reset(struct scsi_cmnd *srb)/* error and abort handlers */ .eh_abort_handler = command_abort, .eh_device_reset_handler = device_reset, - .eh_bus_reset_handler = bus_reset,/* queue commands only, only one command per LUN */ .can_queue = 1,
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 14/26 acornscsi: move bus reset to host reset
In reply to Hannes ReineckeThe bus reset function is really a host reset, so move it to eh_host_reset_handler.
--- drivers/scsi/arm/acornscsi.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/scsi/arm/acornscsi.c +6 -5
@@ -2725,23 +2725,24 @@ int acornscsi_abort(struct scsi_cmnd *SCpnt)* Params : SCpnt - command causing reset * Returns : one of SCSI_RESET_ macros */ -int acornscsi_bus_reset (struct scsi_cmnd *SCpnt) +int acornscsi_host_reset (struct Scsi_Host *shpnt) { -AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; +AS_Host *host = (AS_Host *)shpnt->hostdata;struct scsi_cmnd *SCptr; host->stats.resets +=1 ;#if (DEBUG &DEBUG_RESET ) { -int asr, ssr; +int asr, ssr, devidx; asr =sbic_arm_read (host,SBIC_ASR ); ssr =sbic_arm_read (host,SBIC_SSR );printk (KERN_WARNING "acornscsi_reset: " );print_sbic_status (asr, ssr, host->scsi.phase); -acornscsi_dumplog (host, SCpnt->device->id); +for (devidx =0 ; devidx <9 ; devidx ++) { +acornscsi_dumplog (host, devidx); }#endif
@@ -2884,7 +2885,7 @@ static int acornscsi_show_info(struct seq_file *m, struct Scsi_Host *instance) .info = acornscsi_info, .queuecommand = acornscsi_queuecmd, .eh_abort_handler = acornscsi_abort, - .eh_bus_reset_handler = acornscsi_bus_reset, + .eh_host_reset_handler = acornscsi_host_reset, .can_queue = 16, .this_id = 7, .sg_tablesize = SG_ALL,
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 15/26 NCR5380: Move bus reset to host reset
In reply to Hannes ReineckeThe bus reset handler really is a host reset, so move it to eh_bus_reset_handler.
--- drivers/scsi/NCR5380.c | 4 ++-- drivers/scsi/arm/cumana_1.c | 2 +- drivers/scsi/arm/oak.c | 2 +- drivers/scsi/atari_scsi.c | 6 +++--- drivers/scsi/dmx3191d.c | 2 +- drivers/scsi/g_NCR5380.c | 4 ++-- drivers/scsi/mac_scsi.c | 4 ++-- drivers/scsi/sun3_scsi.c | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-)
drivers/scsi/NCR5380.c +2 -2
@@ -2296,13 +2296,13 @@ static int NCR5380_abort(struct scsi_cmnd *cmd)/** -* NCR5380_bus_reset - reset the SCSI bus +* NCR5380_host_reset - reset the SCSI host * @cmd: SCSI command undergoing EH * * Returns SUCCESS */ -static int NCR5380_bus_reset (struct scsi_cmnd *cmd) +static int NCR5380_host_reset (struct scsi_cmnd *cmd) {struct Scsi_Host *instance = cmd->device->host;struct NCR5380_hostdata *hostdata =shost_priv (instance);
drivers/scsi/arm/cumana_1.c +1 -1
@@ -216,7 +216,7 @@ static void cumanascsi_write(struct NCR5380_hostdata *hostdata, .info = cumanascsi_info, .queuecommand = cumanascsi_queue_command, .eh_abort_handler = NCR5380_abort, - .eh_bus_reset_handler = NCR5380_bus_reset, + .eh_host_reset_handler = NCR5380_host_reset, .can_queue = 16, .this_id = 7, .sg_tablesize = SG_ALL,
drivers/scsi/arm/oak.c +1 -1
@@ -105,7 +105,7 @@ static inline int oakscsi_pread(struct NCR5380_hostdata *hostdata, .info = oakscsi_info, .queuecommand = oakscsi_queue_command, .eh_abort_handler = NCR5380_abort, - .eh_bus_reset_handler = NCR5380_bus_reset, + .eh_host_reset_handler = NCR5380_host_reset, .can_queue = 16, .this_id = 7, .sg_tablesize = SG_ALL,
drivers/scsi/atari_scsi.c +3 -3
@@ -671,7 +671,7 @@ static void atari_scsi_falcon_reg_write(unsigned int reg, u8 value)#include "NCR5380.c" -static int atari_scsi_bus_reset (struct scsi_cmnd *cmd) +static int atari_scsi_host_reset (struct scsi_cmnd *cmd) {int rv;unsigned long flags;
@@ -688,7 +688,7 @@ static int atari_scsi_bus_reset(struct scsi_cmnd *cmd) atari_dma_orig_addr =NULL ; } - rv =NCR5380_bus_reset (cmd); + rv =NCR5380_host_reset (cmd);/* The 5380 raises its IRQ line while _RST is active but the ST DMA * "lock" has been released so this interrupt may end up handled by
@@ -711,7 +711,7 @@ static int atari_scsi_bus_reset(struct scsi_cmnd *cmd) .info = atari_scsi_info, .queuecommand = atari_scsi_queue_command, .eh_abort_handler = atari_scsi_abort, - .eh_bus_reset_handler = atari_scsi_bus_reset, + .eh_host_reset_handler = atari_scsi_host_reset, .this_id = 7, .cmd_per_lun = 2, .use_clustering = DISABLE_CLUSTERING,
drivers/scsi/dmx3191d.c +1 -1
@@ -58,7 +58,7 @@ .info = NCR5380_info, .queuecommand = NCR5380_queue_command, .eh_abort_handler = NCR5380_abort, - .eh_bus_reset_handler = NCR5380_bus_reset, + .eh_host_reset_handler = NCR5380_host_reset, .can_queue = 32, .this_id = 7, .sg_tablesize = SG_ALL,
drivers/scsi/g_NCR5380.c +2 -2
@@ -56,7 +56,7 @@#define NCR5380_intr generic_NCR5380_intr#define NCR5380_queue_command generic_NCR5380_queue_command#define NCR5380_abort generic_NCR5380_abort -#define NCR5380_bus_reset generic_NCR5380_bus_reset +#define NCR5380_host_reset generic_NCR5380_host_reset#define NCR5380_info generic_NCR5380_info#define NCR5380_io_delay (x) udelay(x)
@@ -695,7 +695,7 @@ static int generic_NCR5380_dma_residual(struct NCR5380_hostdata *hostdata) .info = generic_NCR5380_info, .queuecommand = generic_NCR5380_queue_command, .eh_abort_handler = generic_NCR5380_abort, - .eh_bus_reset_handler = generic_NCR5380_bus_reset, + .eh_host_reset_handler = generic_NCR5380_host_reset, .can_queue = 16, .this_id = 7, .sg_tablesize = SG_ALL,
drivers/scsi/mac_scsi.c +2 -2
@@ -41,7 +41,7 @@#define NCR5380_intr macscsi_intr#define NCR5380_queue_command macscsi_queue_command#define NCR5380_abort macscsi_abort -#define NCR5380_bus_reset macscsi_bus_reset +#define NCR5380_host_reset macscsi_host_reset#define NCR5380_info macscsi_info#include "NCR5380.h"
@@ -328,7 +328,7 @@ static int macscsi_dma_residual(struct NCR5380_hostdata *hostdata) .info = macscsi_info, .queuecommand = macscsi_queue_command, .eh_abort_handler = macscsi_abort, - .eh_bus_reset_handler = macscsi_bus_reset, + .eh_host_reset_handler = macscsi_host_reset, .can_queue = 16, .this_id = 7, .sg_tablesize = 1,
drivers/scsi/sun3_scsi.c +2 -2
@@ -46,7 +46,7 @@#define NCR5380_write (reg, value) out_8(hostdata->io + (reg), value)#define NCR5380_queue_command sun3scsi_queue_command -#define NCR5380_bus_reset sun3scsi_bus_reset +#define NCR5380_host_reset sun3scsi_host_reset#define NCR5380_abort sun3scsi_abort#define NCR5380_info sun3scsi_info
@@ -495,7 +495,7 @@ static int sun3scsi_dma_finish(int write_flag) .info = sun3scsi_info, .queuecommand = sun3scsi_queue_command, .eh_abort_handler = sun3scsi_abort, - .eh_bus_reset_handler = sun3scsi_bus_reset, + .eh_host_reset_handler = sun3scsi_host_reset, .can_queue = 16, .this_id = 7, .sg_tablesize = SG_NONE,
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 17/26 imm: drop duplicate bus_reset handler
In reply to Hannes Reineckehost_reset and bus_reset is the same function, so drop bus reset.
--- drivers/scsi/imm.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/imm.c +0 -1
@@ -1106,7 +1106,6 @@ static int imm_adjust_queue(struct scsi_device *device) .name = "Iomega VPI2 (imm) interface", .queuecommand = imm_queuecommand, .eh_abort_handler = imm_abort, - .eh_bus_reset_handler = imm_reset, .eh_host_reset_handler = imm_reset, .bios_param = imm_biosparam, .this_id = 7,
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 19/26 qedf: drop bus reset handler
In reply to Hannes Reineckeqedf 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.
--- drivers/scsi/qedf/qedf_main.c | 11 ----------- 1 file changed, 11 deletions(-)
drivers/scsi/qedf/qedf_main.c +0 -11
@@ -679,16 +679,6 @@ static int qedf_eh_device_reset(struct scsi_cmnd *sc_cmd)return qedf_initiate_tmf (sc_cmd,FCP_TMF_LUN_RESET ); } -static int qedf_eh_bus_reset (struct scsi_cmnd *sc_cmd) -{ -QEDF_ERR (NULL ,"BUS RESET Issued...\n" ); -/* -* Essentially a no-op but return SUCCESS to prevent -* unnecessary escalation to the host reset handler. -*/ -return SUCCESS ; -} -void qedf_wait_for_upload (struct qedf_ctx *qedf) {while (1 ) {
@@ -766,7 +756,6 @@ static int qedf_slave_configure(struct scsi_device *sdev) .eh_abort_handler = qedf_eh_abort, .eh_device_reset_handler = qedf_eh_device_reset, /* lun reset */ .eh_target_reset_handler = qedf_eh_target_reset, /* target reset */ - .eh_bus_reset_handler = qedf_eh_bus_reset, .eh_host_reset_handler = qedf_eh_host_reset, .slave_configure = qedf_slave_configure, .dma_boundary = QED_HW_DMA_BOUNDARY,
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 18/26 ppa: drop duplicate bus_reset handler
In reply to Hannes Reineckebus_reset and host_reset are the same functions, so drop bus_reset.
--- drivers/scsi/ppa.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/ppa.c +0 -1
@@ -970,7 +970,6 @@ static int ppa_adjust_queue(struct scsi_device *device) .name = "Iomega VPI0 (ppa) interface", .queuecommand = ppa_queuecommand, .eh_abort_handler = ppa_abort, - .eh_bus_reset_handler = ppa_reset, .eh_host_reset_handler = ppa_reset, .bios_param = ppa_biosparam, .this_id = -1,
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 20/26 nsp32: drop bus reset
In reply to Hannes ReineckeFrom: Hannes Reinecke <[email protected]>
bus reset is a host reset without nsp32hw_init(), and will always return SUCCESS, thus disabling the use of host reset. So drop bus reset in favour of host reset.
--- drivers/scsi/nsp32.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-)
drivers/scsi/nsp32.c +1 -21
@@ -201,7 +201,6 @@/* SCSI error handler */ static int nsp32_eh_abort (struct scsi_cmnd *); -static int nsp32_eh_bus_reset (struct scsi_cmnd *);static int nsp32_eh_host_reset (struct scsi_cmnd *);/* generate SCSI message */
@@ -276,8 +275,7 @@ .max_sectors = 128, .this_id = NSP32_HOST_SCSIID, .use_clustering = DISABLE_CLUSTERING, - .eh_abort_handler = nsp32_eh_abort, - .eh_bus_reset_handler = nsp32_eh_bus_reset, + .eh_abort_handler = nsp32_eh_abort, .eh_host_reset_handler = nsp32_eh_host_reset,/* .highmem_io = 1, */ };
@@ -2845,24 +2843,6 @@ static int nsp32_eh_abort(struct scsi_cmnd *SCpnt)return SUCCESS ; } -static int nsp32_eh_bus_reset (struct scsi_cmnd *SCpnt) -{ -nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata; -unsigned int base = SCpnt->device->host->io_port; - -spin_lock_irq (SCpnt->device->host->host_lock); - -nsp32_msg (KERN_INFO ,"Bus Reset" ); -nsp32_dbg (NSP32_DEBUG_BUSRESET ,"SCpnt=0x%x" , SCpnt); - -nsp32_write2 (base,IRQ_CONTROL ,IRQ_CONTROL_ALL_IRQ_MASK ); -nsp32_do_bus_reset (data); -nsp32_write2 (base,IRQ_CONTROL ,0 ); - -spin_unlock_irq (SCpnt->device->host->host_lock); -return SUCCESS ;/* SCSI bus reset is succeeded at any time. */ -} -static void nsp32_do_bus_reset (nsp32_hw_data *data) {unsigned int base = data->BaseAddress;
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 21/26 aha152x: drop host reset
In reply to Hannes ReineckeFrom: Hannes Reinecke <[email protected]>
The driver has both a bus and a host reset, where the host reset does a bus reset followed by an attempt to reset the chip registes to a default state.
However, as the bus reset always returned SUCCESS the host reset was never called, so the functionality of the register reset function was never validated.
Additionally, tha AIC-6260 chip has a hard reset line, which actually should be preferred for a host reset. But I haven't found a way how this can be triggered via software, so take the safe approach and drop the host reset.
--- drivers/scsi/aha152x.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
drivers/scsi/aha152x.c +3 -10
@@ -1140,6 +1140,9 @@ static void free_hard_reset_SCs(struct Scsi_Host *shpnt, Scsi_Cmnd **SCs)/* * Reset the bus * +* AIC-6260 has a hard reset (MRST signal), but apparently +* one cannot trigger it via software. So live with +* a soft reset; no-one seemed to have cared. */ static int aha152x_bus_reset_host (struct Scsi_Host *shpnt) {
@@ -1223,15 +1226,6 @@ int aha152x_host_reset_host(struct Scsi_Host *shpnt) }/* -* Reset the host (bus and controller) -* -*/ -static int aha152x_host_reset (Scsi_Cmnd *SCpnt) -{ -return aha152x_host_reset_host (SCpnt->device->host); -} - -/* * Return the "logical geometry" * */
@@ -2917,7 +2911,6 @@ static int aha152x_adjust_queue(struct scsi_device *device) .eh_abort_handler = aha152x_abort, .eh_device_reset_handler = aha152x_device_reset, .eh_bus_reset_handler = aha152x_bus_reset, - .eh_host_reset_handler = aha152x_host_reset, .bios_param = aha152x_biosparam, .can_queue = 1, .this_id = 7,
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 16/26 qlogicfas: move bus_reset to host_reset
In reply to Hannes ReineckeFrom: Hannes Reinecke <[email protected]>
The bus reset handler is really a host reset.
--- drivers/scsi/pcmcia/qlogic_stub.c | 4 ++-- drivers/scsi/qlogicfas.c | 2 +- drivers/scsi/qlogicfas408.c | 6 +++--- drivers/scsi/qlogicfas408.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)
drivers/scsi/pcmcia/qlogic_stub.c +2 -2
@@ -67,7 +67,7 @@ .info = qlogicfas408_info, .queuecommand = qlogicfas408_queuecommand, .eh_abort_handler = qlogicfas408_abort, - .eh_bus_reset_handler = qlogicfas408_bus_reset, + .eh_host_reset_handler = qlogicfas408_host_reset, .bios_param = qlogicfas408_biosparam, .can_queue = 1, .this_id = -1,
@@ -264,7 +264,7 @@ static int qlogic_resume(struct pcmcia_device *link)outb (0x04 , link->resource[0 ]->start +0xd ); }/* Ugggglllyyyy!!! */ -qlogicfas408_bus_reset (NULL ); +qlogicfas408_host_reset (NULL );return 0 ; }
drivers/scsi/qlogicfas.c +1 -1
@@ -188,7 +188,7 @@ static int qlogicfas_release(struct Scsi_Host *shost) .info = qlogicfas408_info, .queuecommand = qlogicfas408_queuecommand, .eh_abort_handler = qlogicfas408_abort, - .eh_bus_reset_handler = qlogicfas408_bus_reset, + .eh_host_reset_handler = qlogicfas408_host_reset, .bios_param = qlogicfas408_biosparam, .can_queue = 1, .this_id = -1,
drivers/scsi/qlogicfas408.c +3 -3
@@ -496,13 +496,13 @@ int qlogicfas408_abort(struct scsi_cmnd *cmd)return SUCCESS ; } -/* +/* * Reset SCSI bus * FIXME: This function is invoked with cmd = NULL directly by * the PCMCIA qlogic_stub code. This wants fixing */ -int qlogicfas408_bus_reset (struct scsi_cmnd *cmd) +int qlogicfas408_host_reset (struct scsi_cmnd *cmd) {struct qlogicfas408_priv *priv =get_priv_by_cmd (cmd);unsigned long flags;
@@ -607,7 +607,7 @@ static void __exit qlogicfas408_exit(void)EXPORT_SYMBOL (qlogicfas408_info);EXPORT_SYMBOL (qlogicfas408_queuecommand);EXPORT_SYMBOL (qlogicfas408_abort); -EXPORT_SYMBOL (qlogicfas408_bus_reset); +EXPORT_SYMBOL (qlogicfas408_host_reset);EXPORT_SYMBOL (qlogicfas408_biosparam);EXPORT_SYMBOL (qlogicfas408_ihandl);EXPORT_SYMBOL (qlogicfas408_get_chip_type);
drivers/scsi/qlogicfas408.h +1 -1
@@ -108,7 +108,7 @@ int qlogicfas408_biosparam(struct scsi_device * disk,struct block_device *dev, sector_t capacity, int ip[]);int qlogicfas408_abort (struct scsi_cmnd * cmd); -int qlogicfas408_bus_reset (struct scsi_cmnd * cmd); +extern int qlogicfas408_host_reset (struct scsi_cmnd *cmd);const char *qlogicfas408_info (struct Scsi_Host *host);int qlogicfas408_get_chip_type (int qbase,int int_type);void qlogicfas408_setup (int qbase,int id,int int_type);
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 22/26 53c700: move bus reset to host reset
In reply to Hannes Reineckebus 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.
--- drivers/scsi/53c700.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-)
drivers/scsi/53c700.c +3 -20
@@ -168,7 +168,6 @@ STATIC int NCR_700_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *); STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt); -STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt); STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt); STATIC void NCR_700_chip_setup(struct Scsi_Host *host); STATIC void NCR_700_chip_reset(struct Scsi_Host *host);
@@ -315,7 +314,6 @@ struct Scsi_Host */* Fill in the missing routines from the host template */ tpnt->queuecommand = NCR_700_queuecommand; tpnt->eh_abort_handler = NCR_700_abort; - tpnt->eh_bus_reset_handler = NCR_700_bus_reset; tpnt->eh_host_reset_handler = NCR_700_host_reset; tpnt->can_queue =NCR_700_COMMAND_SLOTS_PER_HOST ; tpnt->sg_tablesize =NCR_700_SG_SEGMENTS ;
@@ -1938,14 +1936,14 @@ STATIC DEF_SCSI_QCMD(NCR_700_queuecommand) } STATIC int -NCR_700_bus_reset (struct scsi_cmnd * SCp) +NCR_700_host_reset (struct scsi_cmnd * SCp) {DECLARE_COMPLETION_ONSTACK (complete);struct NCR_700_Host_Parameters *hostdata = (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0 ];scmd_printk (KERN_INFO , SCp, -"New error handler wants BUS reset, cmd %p\n\t" , SCp); +"New error handler wants HOST reset, cmd %p\n\t" , SCp);scsi_print_command (SCp);/* In theory, eh_complete should always be null because the
@@ -1960,6 +1958,7 @@ STATIC DEF_SCSI_QCMD(NCR_700_queuecommand) hostdata->eh_complete = &complete;NCR_700_internal_bus_reset (SCp->device->host); +NCR_700_chip_reset (SCp->device->host);spin_unlock_irq (SCp->device->host->host_lock);wait_for_completion (&complete);
@@ -1974,22 +1973,6 @@ STATIC DEF_SCSI_QCMD(NCR_700_queuecommand)return SUCCESS ; } -STATIC int -NCR_700_host_reset (struct scsi_cmnd * SCp) -{ -scmd_printk (KERN_INFO , SCp,"New error handler wants HOST reset\n\t" ); -scsi_print_command (SCp); - -spin_lock_irq (SCp->device->host->host_lock); - -NCR_700_internal_bus_reset (SCp->device->host); -NCR_700_chip_reset (SCp->device->host); - -spin_unlock_irq (SCp->device->host->host_lock); - -return SUCCESS ; -} - STATIC voidNCR_700_set_period (struct scsi_target *STp,int period) {
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 23/26 bnx2fc: remove obsolete bnx2fc_eh_host_reset() definition
In reply to Hannes ReineckeNever used anywhere.
--- drivers/scsi/bnx2fc/bnx2fc.h | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/bnx2fc/bnx2fc.h +0 -1
@@ -539,7 +539,6 @@ void bnx2fc_init_task(struct bnx2fc_cmd *io_req,void bnx2fc_add_2_sq (struct bnx2fc_rport *tgt,u16 xid);void bnx2fc_ring_doorbell (struct bnx2fc_rport *tgt);int bnx2fc_eh_abort (struct scsi_cmnd *sc_cmd); -int bnx2fc_eh_host_reset (struct scsi_cmnd *sc_cmd);int bnx2fc_eh_target_reset (struct scsi_cmnd *sc_cmd);int bnx2fc_eh_device_reset (struct scsi_cmnd *sc_cmd); void bnx2fc_rport_event_handler(struct fc_lport *lport,
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 24/26 megaraid_mbox: drop duplicate bus reset and device reset function
In reply to Hannes Reineckemegaraid_mbox only has one reset function, and that is a host reset. So drop the duplicate bus reset and device reset functions.
--- drivers/scsi/megaraid/megaraid_mbox.c | 2 -- 1 file changed, 2 deletions(-)
drivers/scsi/megaraid/megaraid_mbox.c +0 -2
@@ -341,8 +341,6 @@ static void megaraid_mbox_prepare_epthru(adapter_t *, scb_t *, .proc_name = "megaraid", .queuecommand = megaraid_queue_command, .eh_abort_handler = megaraid_abort_handler, - .eh_device_reset_handler = megaraid_reset_handler, - .eh_bus_reset_handler = megaraid_reset_handler, .eh_host_reset_handler = megaraid_reset_handler, .change_queue_depth = scsi_change_queue_depth, .use_clustering = ENABLE_CLUSTERING,
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 25/26 visorhba: sanitze private device data allocation
In reply to Hannes ReineckeThere'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.
--- drivers/staging/unisys/visorhba/visorhba_main.c | 123 ++++++++++-------------- 1 file changed, 53 insertions(+), 70 deletions(-)
drivers/staging/unisys/visorhba/visorhba_main.c +53 -70
@@ -47,8 +47,8 @@MODULE_ALIAS ("visorbus:" VISOR_VHBA_CHANNEL_UUID_STR );struct visordisk_info { +struct scsi_device *sdev;u32 valid; -u32 channel, id, lun;/* Disk Path */ atomic_t ios_threshold;atomic_t error_count;struct visordisk_info *next;
@@ -101,12 +101,6 @@ struct visorhba_devices_open {struct visorhba_devdata *devdata; }; -#define for_each_vdisk_match (iter, list, match) \ - for (iter = &list->head; iter->next; iter = iter->next) \ - if ((iter->channel == match->channel) && \ - (iter->id == match->id) && \ - (iter->lun == match->lun)) -/* * visor_thread_start - starts a thread for the device * @threadfn: Function the thread starts
@@ -296,10 +290,9 @@ static void cleanup_scsitaskmgmt_handles(struct idr *idrtable,* Returns whether the command was queued successfully or not. */ static int forward_taskmgmt_command (enum task_mgmt_types tasktype, -struct scsi_cmnd *scsicmd) +struct scsi_device *scsidev) {struct uiscmdrsp *cmdrsp; -struct scsi_device *scsidev = scsicmd->device;struct visorhba_devdata *devdata = (struct visorhba_devdata *)scsidev->host->hostdata;int notifyresult =0xffff ;
@@ -347,12 +340,6 @@ static int forward_taskmgmt_command(enum task_mgmt_types tasktype,dev_dbg (&scsidev->sdev_gendev,"visorhba: taskmgmt type=%d success; result=0x%x\n" , tasktype, notifyresult); -if (tasktype ==TASK_MGMT_ABORT_TASK ) - scsicmd->result =DID_ABORT <<16 ; -else - scsicmd->result =DID_RESET <<16 ; - - scsicmd->scsi_done (scsicmd);cleanup_scsitaskmgmt_handles (&devdata->idr, cmdrsp);return SUCCESS ;
@@ -376,17 +363,20 @@ static int visorhba_abort_handler(struct scsi_cmnd *scsicmd)/* issue TASK_MGMT_ABORT_TASK */ struct scsi_device *scsidev;struct visordisk_info *vdisk; -struct visorhba_devdata *devdata; +int rtn; scsidev = scsicmd->device; - devdata = (struct visorhba_devdata *)scsidev->host->hostdata; -for_each_vdisk_match (vdisk, devdata, scsidev) { -if (atomic_read (&vdisk->error_count) <VISORHBA_ERROR_COUNT ) -atomic_inc (&vdisk->error_count); -else -atomic_set (&vdisk->ios_threshold,IOS_ERROR_THRESHOLD ); + vdisk = scsidev->hostdata; +if (atomic_read (&vdisk->error_count) <VISORHBA_ERROR_COUNT ) +atomic_inc (&vdisk->error_count); +else +atomic_set (&vdisk->ios_threshold,IOS_ERROR_THRESHOLD ); + rtn =forward_taskmgmt_command (TASK_MGMT_ABORT_TASK , scsidev); +if (rtn ==SUCCESS ) { + scsicmd->result =DID_ABORT <<16 ; + scsicmd->scsi_done (scsicmd); } -return forward_taskmgmt_command (TASK_MGMT_ABORT_TASK , scsicmd); +return rtn; }/*
@@ -400,17 +390,20 @@ static int visorhba_device_reset_handler(struct scsi_cmnd *scsicmd)/* issue TASK_MGMT_LUN_RESET */ struct scsi_device *scsidev;struct visordisk_info *vdisk; -struct visorhba_devdata *devdata; +int rtn; scsidev = scsicmd->device; - devdata = (struct visorhba_devdata *)scsidev->host->hostdata; -for_each_vdisk_match (vdisk, devdata, scsidev) { -if (atomic_read (&vdisk->error_count) <VISORHBA_ERROR_COUNT ) -atomic_inc (&vdisk->error_count); -else -atomic_set (&vdisk->ios_threshold,IOS_ERROR_THRESHOLD ); + vdisk = scsidev->hostdata; +if (atomic_read (&vdisk->error_count) <VISORHBA_ERROR_COUNT ) +atomic_inc (&vdisk->error_count); +else +atomic_set (&vdisk->ios_threshold,IOS_ERROR_THRESHOLD ); + rtn =forward_taskmgmt_command (TASK_MGMT_LUN_RESET , scsidev); +if (rtn ==SUCCESS ) { + scsicmd->result =DID_RESET <<16 ; + scsicmd->scsi_done (scsicmd); } -return forward_taskmgmt_command (TASK_MGMT_LUN_RESET , scsicmd); +return rtn; }/*
@@ -424,17 +417,22 @@ static int visorhba_bus_reset_handler(struct scsi_cmnd *scsicmd) {struct scsi_device *scsidev;struct visordisk_info *vdisk; -struct visorhba_devdata *devdata; +int rtn; scsidev = scsicmd->device; - devdata = (struct visorhba_devdata *)scsidev->host->hostdata; -for_each_vdisk_match (vdisk, devdata, scsidev) { +shost_for_each_device (scsidev, scsidev->host) { + vdisk = scsidev->hostdata;if (atomic_read (&vdisk->error_count) <VISORHBA_ERROR_COUNT )atomic_inc (&vdisk->error_count);else atomic_set (&vdisk->ios_threshold,IOS_ERROR_THRESHOLD ); } -return forward_taskmgmt_command (TASK_MGMT_BUS_RESET , scsicmd); + rtn =forward_taskmgmt_command (TASK_MGMT_BUS_RESET , scsidev); +if (rtn ==SUCCESS ) { + scsicmd->result =DID_RESET <<16 ; + scsicmd->scsi_done (scsicmd); + } +return rtn; }/*
@@ -569,25 +567,22 @@ static int visorhba_slave_alloc(struct scsi_device *scsidev)* LLD can alloc any struct & do init if needed. */ struct visordisk_info *vdisk; -struct visordisk_info *tmpvdisk;struct visorhba_devdata *devdata;struct Scsi_Host *scsihost = (struct Scsi_Host *)scsidev->host; +if (scsidev->hostdata) +return 0 ;/* already allocated return success */ + devdata = (struct visorhba_devdata *)scsihost->hostdata;if (!devdata)return 0 ;/* even though we errored, treat as success */ -for_each_vdisk_match (vdisk, devdata, scsidev) -return 0 ;/* already allocated return success */ - - tmpvdisk =kzalloc (sizeof (*tmpvdisk),GFP_ATOMIC ); -if (!tmpvdisk) + vdisk =kzalloc (sizeof (*vdisk),GFP_ATOMIC ); +if (!vdisk)return -ENOMEM ; - tmpvdisk->channel = scsidev->channel; - tmpvdisk->id = scsidev->id; - tmpvdisk->lun = scsidev->lun; - vdisk->next = tmpvdisk; + vdisk->sdev = scsidev; + scsidev->hostdata = vdisk;return 0 ; }
@@ -603,17 +598,11 @@ static void visorhba_slave_destroy(struct scsi_device *scsidev)/* midlevel calls this after device has been quiesced and * before it is to be deleted. */ -struct visordisk_info *vdisk, *delvdisk; -struct visorhba_devdata *devdata; -struct Scsi_Host *scsihost = (struct Scsi_Host *)scsidev->host; +struct visordisk_info *vdisk; - devdata = (struct visorhba_devdata *)scsihost->hostdata; -for_each_vdisk_match (vdisk, devdata, scsidev) { - delvdisk = vdisk->next; - vdisk->next = delvdisk->next; -kfree (delvdisk); -return ; - } + vdisk = scsidev->hostdata; + scsidev->hostdata =NULL ; +kfree (vdisk); }static struct scsi_host_template visorhba_driver_template = {
@@ -787,7 +776,6 @@ static int visorhba_serverdown(struct visorhba_devdata *devdata)static void do_scsi_linuxstat (struct uiscmdrsp *cmdrsp,struct scsi_cmnd *scsicmd) { -struct visorhba_devdata *devdata;struct visordisk_info *vdisk;struct scsi_device *scsidev;
@@ -800,12 +788,10 @@ static int visorhba_serverdown(struct visorhba_devdata *devdata) (cmdrsp->scsi.addlstat == ADDL_SEL_TIMEOUT)) return;/* Okay see what our error_count is here.... */ - devdata = (struct visorhba_devdata *)scsidev->host->hostdata; -for_each_vdisk_match (vdisk, devdata, scsidev) { -if (atomic_read (&vdisk->error_count) <VISORHBA_ERROR_COUNT ) { -atomic_inc (&vdisk->error_count); -atomic_set (&vdisk->ios_threshold,IOS_ERROR_THRESHOLD ); - } + vdisk = scsidev->hostdata; +if (atomic_read (&vdisk->error_count) <VISORHBA_ERROR_COUNT ) { +atomic_inc (&vdisk->error_count); +atomic_set (&vdisk->ios_threshold,IOS_ERROR_THRESHOLD ); } }
@@ -846,7 +832,6 @@ static int set_no_disk_inquiry_result(unsigned char *buf,char *this_page_orig;int bufind =0 ;struct visordisk_info *vdisk; -struct visorhba_devdata *devdata; scsidev = scsicmd->device; if ((cmdrsp->scsi.cmnd[0] == INQUIRY) &&
@@ -883,13 +868,11 @@ static int set_no_disk_inquiry_result(unsigned char *buf, }kfree (buf); }else { - devdata = (struct visorhba_devdata *)scsidev->host->hostdata; -for_each_vdisk_match (vdisk, devdata, scsidev) { -if (atomic_read (&vdisk->ios_threshold) >0 ) { -atomic_dec (&vdisk->ios_threshold); -if (atomic_read (&vdisk->ios_threshold) ==0 ) -atomic_set (&vdisk->error_count,0 ); - } + vdisk = scsidev->hostdata; +if (atomic_read (&vdisk->ios_threshold) >0 ) { +atomic_dec (&vdisk->ios_threshold); +if (atomic_read (&vdisk->ios_threshold) ==0 ) +atomic_set (&vdisk->error_count,0 ); } } }
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH v2 26/26 eata: remove 'arg_done' from eata2x_eh_host_reset()
In reply to Hannes ReineckeJust displaying some different information; drop it.
--- drivers/scsi/eata.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/scsi/eata.c +1 -8
@@ -1899,7 +1899,6 @@ static int eata2x_eh_abort(struct scsi_cmnd *SCarg)static int eata2x_eh_host_reset (struct scsi_cmnd *SCarg) {unsigned int i, time, k, c, limit =0 ; -int arg_done =0 ;struct scsi_cmnd *SCpnt;struct Scsi_Host *shost = SCarg->device->host;struct hostdata *ha = (struct hostdata *)shost->hostdata;
@@ -1967,9 +1966,6 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg)if (SCpnt->scsi_done ==NULL )panic ("%s: reset, mbox %d, SCpnt->scsi_done == NULL.\n" , ha->board_name, i); - -if (SCpnt == SCarg) - arg_done =1 ; }if (do_dma (shost->io_port,0 ,RESET_PIO )) {
@@ -2037,10 +2033,7 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg) ha->in_reset =0 ; do_trace =0 ; -if (arg_done) -printk ("%s: reset, exit, done.\n" , ha->board_name); -else -printk ("%s: reset, exit.\n" , ha->board_name); +printk ("%s: reset, exit.\n" , ha->board_name);spin_unlock_irq (shost->host_lock);return SUCCESS ;
Signature · 1 line
1.8.5.6
Martin K. Petersen
AppliedHannes,
Quoted 2 lines
Hi all, finally here's the patchset to revamp the SCSI EH callback arguments which I promised to do (some years ago ...).
Applied to 4.14/scsi-queue. Thank you!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering