scsi: remove eh_timed_out methods in the transport template
authorChristoph Hellwig <hch@lst.de>
Mon, 30 Jan 2017 12:18:58 +0000 (13:18 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 7 Feb 2017 00:10:03 +0000 (19:10 -0500)
Instead define the timeout behavior purely based on the host_template
eh_timed_out method and wire up the existing transport implementations
in the host templates.  This also clears up the confusion that the
transport template method overrides the host template one, so some
drivers have to re-override the transport template one.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
33 files changed:
drivers/ata/libata-eh.c
drivers/ata/libata-transport.c
drivers/ata/libata.h
drivers/infiniband/ulp/iser/iscsi_iser.c
drivers/infiniband/ulp/srp/ib_srp.c
drivers/message/fusion/mptfc.c
drivers/message/fusion/mptsas.c
drivers/s390/scsi/zfcp_scsi.c
drivers/scsi/be2iscsi/be_main.c
drivers/scsi/bfa/bfad_im.c
drivers/scsi/bnx2fc/bnx2fc_fcoe.c
drivers/scsi/bnx2i/bnx2i_iscsi.c
drivers/scsi/csiostor/csio_scsi.c
drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
drivers/scsi/fcoe/fcoe.c
drivers/scsi/fnic/fnic_main.c
drivers/scsi/ibmvscsi/ibmvfc.c
drivers/scsi/ibmvscsi/ibmvscsi.c
drivers/scsi/iscsi_tcp.c
drivers/scsi/libiscsi.c
drivers/scsi/lpfc/lpfc_scsi.c
drivers/scsi/qedi/qedi_iscsi.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/scsi_error.c
drivers/scsi/scsi_transport_fc.c
drivers/scsi/scsi_transport_srp.c
drivers/scsi/storvsc_drv.c
include/linux/libata.h
include/scsi/libiscsi.h
include/scsi/scsi_transport.h
include/scsi/scsi_transport_fc.h
include/scsi/scsi_transport_srp.h

index 0e1ec37070d19b641ed37d9a75c216197c0fc557..50ee10db160f2bb3bebfbed5fb502d74157344a8 100644 (file)
@@ -549,6 +549,7 @@ enum blk_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd)
        DPRINTK("EXIT, ret=%d\n", ret);
        return ret;
 }
+EXPORT_SYMBOL(ata_scsi_timed_out);
 
 static void ata_eh_unload(struct ata_port *ap)
 {
index 7ef16c08505879127a3b433979119455e17d1ff4..46698232e6bff069293200a5da842e196a4a0730 100644 (file)
@@ -716,7 +716,6 @@ struct scsi_transport_template *ata_attach_transport(void)
                return NULL;
 
        i->t.eh_strategy_handler        = ata_scsi_error;
-       i->t.eh_timed_out               = ata_scsi_timed_out;
        i->t.user_scan                  = ata_scsi_user_scan;
 
        i->t.host_attrs.ac.attrs = &i->port_attrs[0];
index 8f3a5596dd676b95ee6bf6500d1e8be560b3c73c..06d479d1f30293e787b4909297a0ce2835a9318f 100644 (file)
@@ -159,7 +159,6 @@ extern unsigned long ata_internal_cmd_timeout(struct ata_device *dev, u8 cmd);
 extern void ata_internal_cmd_timed_out(struct ata_device *dev, u8 cmd);
 extern void ata_eh_acquire(struct ata_port *ap);
 extern void ata_eh_release(struct ata_port *ap);
-extern enum blk_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd);
 extern void ata_scsi_error(struct Scsi_Host *host);
 extern void ata_eh_fastdrain_timerfn(unsigned long arg);
 extern void ata_qc_schedule_eh(struct ata_queued_cmd *qc);
index 9104e6b8cac9f7b66322d7ebc573ab6a32fa525a..86fed1956d7deec54769a66d49a58b451109b18b 100644 (file)
@@ -997,6 +997,7 @@ static struct scsi_host_template iscsi_iser_sht = {
        .change_queue_depth     = scsi_change_queue_depth,
        .sg_tablesize           = ISCSI_ISER_DEF_SG_TABLESIZE,
        .cmd_per_lun            = ISER_DEF_CMD_PER_LUN,
+       .eh_timed_out           = iscsi_eh_cmd_timed_out,
        .eh_abort_handler       = iscsi_eh_abort,
        .eh_device_reset_handler= iscsi_eh_device_reset,
        .eh_target_reset_handler = iscsi_eh_recover_target,
index 8ddc071231931157ec459a6db4a0947d7b05f539..7866cb0a8f00581bb872fc7a077421fa8d66964c 100644 (file)
@@ -2864,6 +2864,7 @@ static struct scsi_host_template srp_template = {
        .info                           = srp_target_info,
        .queuecommand                   = srp_queuecommand,
        .change_queue_depth             = srp_change_queue_depth,
+       .eh_timed_out                   = srp_timed_out,
        .eh_abort_handler               = srp_abort,
        .eh_device_reset_handler        = srp_reset_device,
        .eh_host_reset_handler          = srp_reset_host,
index add6a3a6ef0de994ebf5405dd1c426e6eb1f294e..98eafae785762ea73329f1f794784bc0e1ecbc64 100644 (file)
@@ -119,6 +119,7 @@ static struct scsi_host_template mptfc_driver_template = {
        .target_destroy                 = mptfc_target_destroy,
        .slave_destroy                  = mptscsih_slave_destroy,
        .change_queue_depth             = mptscsih_change_queue_depth,
+       .eh_timed_out                   = fc_eh_timed_out,
        .eh_abort_handler               = mptfc_abort,
        .eh_device_reset_handler        = mptfc_dev_reset,
        .eh_bus_reset_handler           = mptfc_bus_reset,
index 7ee1667acde44b69fd309e5fe9835ed679bd6791..4ce333643943f652daf7bc5a5f22d4f5d31b512f 100644 (file)
@@ -1983,6 +1983,7 @@ static struct scsi_host_template mptsas_driver_template = {
        .target_destroy                 = mptsas_target_destroy,
        .slave_destroy                  = mptscsih_slave_destroy,
        .change_queue_depth             = mptscsih_change_queue_depth,
+       .eh_timed_out                   = mptsas_eh_timed_out,
        .eh_abort_handler               = mptscsih_abort,
        .eh_device_reset_handler        = mptscsih_dev_reset,
        .eh_host_reset_handler          = mptscsih_host_reset,
@@ -5398,7 +5399,6 @@ mptsas_init(void)
            sas_attach_transport(&mptsas_transport_functions);
        if (!mptsas_transport_template)
                return -ENODEV;
-       mptsas_transport_template->eh_timed_out = mptsas_eh_timed_out;
 
        mptsasDoneCtx = mpt_register(mptscsih_io_done, MPTSAS_DRIVER,
            "mptscsih_io_done");
index 07ffdbb5107f732082e88c94b0362b845e7e17d6..0678cf714c0ee6060eb10e80c3a7c05f6a21f1d2 100644 (file)
@@ -330,6 +330,7 @@ static struct scsi_host_template zfcp_scsi_host_template = {
        .module                  = THIS_MODULE,
        .name                    = "zfcp",
        .queuecommand            = zfcp_scsi_queuecommand,
+       .eh_timed_out            = fc_eh_timed_out,
        .eh_abort_handler        = zfcp_scsi_eh_abort_handler,
        .eh_device_reset_handler = zfcp_scsi_eh_device_reset_handler,
        .eh_target_reset_handler = zfcp_scsi_eh_target_reset_handler,
index c9b9daa910911474f8f36543d6ddcb1c25dd30ff..32b2713cec936ed45c2ce12fe1aa6aa3e02e26b3 100644 (file)
@@ -389,6 +389,7 @@ static struct scsi_host_template beiscsi_sht = {
        .change_queue_depth = scsi_change_queue_depth,
        .slave_configure = beiscsi_slave_configure,
        .target_alloc = iscsi_target_alloc,
+       .eh_timed_out = iscsi_eh_cmd_timed_out,
        .eh_abort_handler = beiscsi_eh_abort,
        .eh_device_reset_handler = beiscsi_eh_device_reset,
        .eh_target_reset_handler = iscsi_eh_session_reset,
index 02d806012fa12c26530d61513d82b7dce932e8e9..7eb0eef18fddfe8fed96f8d7a058146b2c85def3 100644 (file)
@@ -813,6 +813,7 @@ struct scsi_host_template bfad_im_scsi_host_template = {
        .name = BFAD_DRIVER_NAME,
        .info = bfad_im_info,
        .queuecommand = bfad_im_queuecommand,
+       .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,
@@ -835,6 +836,7 @@ struct scsi_host_template bfad_im_vport_template = {
        .name = BFAD_DRIVER_NAME,
        .info = bfad_im_info,
        .queuecommand = bfad_im_queuecommand,
+       .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,
index c639d5a02656abf9678f1ef358c4166e5db04a66..b1e39f985ec9dbf9e72d4a6b47f65185f7220470 100644 (file)
@@ -2947,6 +2947,7 @@ static struct scsi_host_template bnx2fc_shost_template = {
        .module                 = THIS_MODULE,
        .name                   = "QLogic Offload FCoE Initiator",
        .queuecommand           = bnx2fc_queuecommand,
+       .eh_timed_out           = fc_eh_timed_out,
        .eh_abort_handler       = bnx2fc_eh_abort,        /* abts */
        .eh_device_reset_handler = bnx2fc_eh_device_reset, /* lun reset */
        .eh_target_reset_handler = bnx2fc_eh_target_reset, /* tgt reset */
index 133901fd3e35f2b02194481c3a93f7b9b1097c1c..f32a66f89d25b44bd235ca80003040d594020045 100644 (file)
@@ -2259,6 +2259,7 @@ static struct scsi_host_template bnx2i_host_template = {
        .name                   = "QLogic Offload iSCSI Initiator",
        .proc_name              = "bnx2i",
        .queuecommand           = iscsi_queuecommand,
+       .eh_timed_out           = iscsi_eh_cmd_timed_out,
        .eh_abort_handler       = iscsi_eh_abort,
        .eh_device_reset_handler = iscsi_eh_device_reset,
        .eh_target_reset_handler = iscsi_eh_recover_target,
index 89a52b941ea8d6b9a5b7fe7aff11e31f77f72957..a1ff75f1384f4e96e3c6e8456a78513659533135 100644 (file)
@@ -2270,6 +2270,7 @@ struct scsi_host_template csio_fcoe_shost_template = {
        .name                   = CSIO_DRV_DESC,
        .proc_name              = KBUILD_MODNAME,
        .queuecommand           = csio_queuecommand,
+       .eh_timed_out           = fc_eh_timed_out,
        .eh_abort_handler       = csio_eh_abort_handler,
        .eh_device_reset_handler = csio_eh_lun_reset_handler,
        .slave_alloc            = csio_slave_alloc,
@@ -2289,6 +2290,7 @@ struct scsi_host_template csio_fcoe_shost_vport_template = {
        .name                   = CSIO_DRV_DESC,
        .proc_name              = KBUILD_MODNAME,
        .queuecommand           = csio_queuecommand,
+       .eh_timed_out           = fc_eh_timed_out,
        .eh_abort_handler       = csio_eh_abort_handler,
        .eh_device_reset_handler = csio_eh_lun_reset_handler,
        .slave_alloc            = csio_slave_alloc,
index 33e83464e091e7508b2bfeede75ff97b2ababf09..1880eb6c68f73ca2168975d1e7514b8c1ea943ef 100644 (file)
@@ -90,6 +90,7 @@ static struct scsi_host_template cxgb3i_host_template = {
        .sg_tablesize   = SG_ALL,
        .max_sectors    = 0xFFFF,
        .cmd_per_lun    = ISCSI_DEF_CMD_PER_LUN,
+       .eh_timed_out   = iscsi_eh_cmd_timed_out,
        .eh_abort_handler = iscsi_eh_abort,
        .eh_device_reset_handler = iscsi_eh_device_reset,
        .eh_target_reset_handler = iscsi_eh_recover_target,
index 9a2fdc305cf2a9a0c7b4f4fabae4191bb9f12ad1..3fb3f5708ff706d4cf7c7ec07250642b081e3a09 100644 (file)
@@ -103,6 +103,7 @@ static struct scsi_host_template cxgb4i_host_template = {
        .sg_tablesize   = SG_ALL,
        .max_sectors    = 0xFFFF,
        .cmd_per_lun    = ISCSI_DEF_CMD_PER_LUN,
+       .eh_timed_out   = iscsi_eh_cmd_timed_out,
        .eh_abort_handler = iscsi_eh_abort,
        .eh_device_reset_handler = iscsi_eh_device_reset,
        .eh_target_reset_handler = iscsi_eh_recover_target,
index 59150cad03532e1e1ee15ad0d8fcdf35229d07c3..86af57f7c11aa8356accd41ee71b44cc221582ef 100644 (file)
@@ -277,6 +277,7 @@ static struct scsi_host_template fcoe_shost_template = {
        .name = "FCoE Driver",
        .proc_name = FCOE_NAME,
        .queuecommand = fc_queuecommand,
+       .eh_timed_out = fc_eh_timed_out,
        .eh_abort_handler = fc_eh_abort,
        .eh_device_reset_handler = fc_eh_device_reset,
        .eh_host_reset_handler = fc_eh_host_reset,
index 58ce9020d69c5882eebfa46f3ec685fb7b63fef6..ba58b7953263af4d211ccce6abebca907d7b802c 100644 (file)
@@ -106,6 +106,7 @@ static struct scsi_host_template fnic_host_template = {
        .module = THIS_MODULE,
        .name = DRV_NAME,
        .queuecommand = fnic_queuecommand,
+       .eh_timed_out = fc_eh_timed_out,
        .eh_abort_handler = fnic_abort_cmd,
        .eh_device_reset_handler = fnic_device_reset,
        .eh_host_reset_handler = fnic_host_reset,
index 78b72c28a55df36eaf3f03babde02dfe13598e05..2c92dabb55f6fff07e6a58d48870cc639ec677f7 100644 (file)
@@ -3090,6 +3090,7 @@ static struct scsi_host_template driver_template = {
        .name = "IBM POWER Virtual FC Adapter",
        .proc_name = IBMVFC_NAME,
        .queuecommand = ibmvfc_queuecommand,
+       .eh_timed_out = fc_eh_timed_out,
        .eh_abort_handler = ibmvfc_eh_abort_handler,
        .eh_device_reset_handler = ibmvfc_eh_device_reset_handler,
        .eh_target_reset_handler = ibmvfc_eh_target_reset_handler,
index 50cd01165e355b092fb954d2399f42798d5e3e00..1deb0a9f14a66dcb9f95cd40e0289b32bfee7370 100644 (file)
@@ -2072,6 +2072,7 @@ static struct scsi_host_template driver_template = {
        .name = "IBM POWER Virtual SCSI Adapter " IBMVSCSI_VERSION,
        .proc_name = "ibmvscsi",
        .queuecommand = ibmvscsi_queuecommand,
+       .eh_timed_out = srp_timed_out,
        .eh_abort_handler = ibmvscsi_eh_abort_handler,
        .eh_device_reset_handler = ibmvscsi_eh_device_reset_handler,
        .eh_host_reset_handler = ibmvscsi_eh_host_reset_handler,
index ace4f1f41b8e0bf196e7330cfd3f51d3eadbfc2a..4228aba1f654e10b6d18bf32153a1a0825ce6dc2 100644 (file)
@@ -967,6 +967,7 @@ static struct scsi_host_template iscsi_sw_tcp_sht = {
        .sg_tablesize           = 4096,
        .max_sectors            = 0xFFFF,
        .cmd_per_lun            = ISCSI_DEF_CMD_PER_LUN,
+       .eh_timed_out           = iscsi_eh_cmd_timed_out,
        .eh_abort_handler       = iscsi_eh_abort,
        .eh_device_reset_handler= iscsi_eh_device_reset,
        .eh_target_reset_handler = iscsi_eh_recover_target,
index f9b6fba689ffb41c6806cdabeb80debe38e25189..834d1212b6d506d37c10d35105e4c5808690f377 100644 (file)
@@ -1930,7 +1930,7 @@ static int iscsi_has_ping_timed_out(struct iscsi_conn *conn)
                return 0;
 }
 
-static enum blk_eh_timer_return iscsi_eh_cmd_timed_out(struct scsi_cmnd *sc)
+enum blk_eh_timer_return iscsi_eh_cmd_timed_out(struct scsi_cmnd *sc)
 {
        enum blk_eh_timer_return rc = BLK_EH_NOT_HANDLED;
        struct iscsi_task *task = NULL, *running_task;
@@ -2063,6 +2063,7 @@ done:
                     "timer reset" : "nh");
        return rc;
 }
+EXPORT_SYMBOL_GPL(iscsi_eh_cmd_timed_out);
 
 static void iscsi_check_transport_timeouts(unsigned long data)
 {
@@ -2585,8 +2586,6 @@ int iscsi_host_add(struct Scsi_Host *shost, struct device *pdev)
        if (!shost->cmd_per_lun)
                shost->cmd_per_lun = ISCSI_DEF_CMD_PER_LUN;
 
-       if (!shost->transportt->eh_timed_out)
-               shost->transportt->eh_timed_out = iscsi_eh_cmd_timed_out;
        return scsi_add_host(shost, pdev);
 }
 EXPORT_SYMBOL_GPL(iscsi_host_add);
index 19d349fc889f785ebb307290370c5c3becf5da6b..1180a22beb435c83f6923d977f10c3ceaa2b4a40 100644 (file)
@@ -5929,6 +5929,7 @@ struct scsi_host_template lpfc_template = {
        .proc_name              = LPFC_DRIVER_NAME,
        .info                   = lpfc_info,
        .queuecommand           = lpfc_queuecommand,
+       .eh_timed_out           = fc_eh_timed_out,
        .eh_abort_handler       = lpfc_abort_handler,
        .eh_device_reset_handler = lpfc_device_reset_handler,
        .eh_target_reset_handler = lpfc_target_reset_handler,
@@ -5955,6 +5956,7 @@ struct scsi_host_template lpfc_vport_template = {
        .proc_name              = LPFC_DRIVER_NAME,
        .info                   = lpfc_info,
        .queuecommand           = lpfc_queuecommand,
+       .eh_timed_out           = fc_eh_timed_out,
        .eh_abort_handler       = lpfc_abort_handler,
        .eh_device_reset_handler = lpfc_device_reset_handler,
        .eh_target_reset_handler = lpfc_target_reset_handler,
index d6a205433b66b6d2da39cbdbe99691d89afa2705..8b25f0a1eb8c81384bba19a810ba0d772f5f8d85 100644 (file)
@@ -48,6 +48,7 @@ struct scsi_host_template qedi_host_template = {
        .name = "QLogic QEDI 25/40/100Gb iSCSI Initiator Driver",
        .proc_name = QEDI_MODULE_NAME,
        .queuecommand = iscsi_queuecommand,
+       .eh_timed_out = iscsi_eh_cmd_timed_out,
        .eh_abort_handler = iscsi_eh_abort,
        .eh_device_reset_handler = iscsi_eh_device_reset,
        .eh_target_reset_handler = iscsi_eh_recover_target,
index 8521cfe302e9e3e72c7aaf1a4753ca75f953b972..c5a9d6c295a0b488101410fa053c4b2d6db71233 100644 (file)
@@ -262,6 +262,7 @@ struct scsi_host_template qla2xxx_driver_template = {
        .name                   = QLA2XXX_DRIVER_NAME,
        .queuecommand           = qla2xxx_queuecommand,
 
+       .eh_timed_out           = fc_eh_timed_out,
        .eh_abort_handler       = qla2xxx_eh_abort,
        .eh_device_reset_handler = qla2xxx_eh_device_reset,
        .eh_target_reset_handler = qla2xxx_eh_target_reset,
index 996e134d79faaf37674731e03a8de1360194d011..9d7bfbb02389eacd9af033ae3ebe8591a4ee0dee 100644 (file)
@@ -279,9 +279,7 @@ enum blk_eh_timer_return scsi_times_out(struct request *req)
        if (host->eh_deadline != -1 && !host->last_reset)
                host->last_reset = jiffies;
 
-       if (host->transportt->eh_timed_out)
-               rtn = host->transportt->eh_timed_out(scmd);
-       else if (host->hostt->eh_timed_out)
+       if (host->hostt->eh_timed_out)
                rtn = host->hostt->eh_timed_out(scmd);
 
        if (rtn == BLK_EH_NOT_HANDLED) {
index 03577bde6ac56b91e92f8e631d98907a19dfb273..9a6ea6fccb06ddd6dfacc167c082b88083aedad7 100644 (file)
@@ -2055,7 +2055,7 @@ static int fc_vport_match(struct attribute_container *cont,
 
 
 /**
- * fc_timed_out - FC Transport I/O timeout intercept handler
+ * fc_eh_timed_out - FC Transport I/O timeout intercept handler
  * @scmd:      The SCSI command which timed out
  *
  * This routine protects against error handlers getting invoked while a
@@ -2076,8 +2076,8 @@ static int fc_vport_match(struct attribute_container *cont,
  * Notes:
  *     This routine assumes no locks are held on entry.
  */
-static enum blk_eh_timer_return
-fc_timed_out(struct scsi_cmnd *scmd)
+enum blk_eh_timer_return
+fc_eh_timed_out(struct scsi_cmnd *scmd)
 {
        struct fc_rport *rport = starget_to_rport(scsi_target(scmd->device));
 
@@ -2086,6 +2086,7 @@ fc_timed_out(struct scsi_cmnd *scmd)
 
        return BLK_EH_NOT_HANDLED;
 }
+EXPORT_SYMBOL(fc_eh_timed_out);
 
 /*
  * Called by fc_user_scan to locate an rport on the shost that
@@ -2211,8 +2212,6 @@ fc_attach_transport(struct fc_function_template *ft)
        /* Transport uses the shost workq for scsi scanning */
        i->t.create_work_queue = 1;
 
-       i->t.eh_timed_out = fc_timed_out;
-
        i->t.user_scan = fc_user_scan;
 
        /* target-mode drivers' functions */
index b87a78673f6501be8e14f0dc28c97e244fa372ef..75b57a1855b074c2bc574ca3bcb5c2213783ad68 100644 (file)
@@ -591,7 +591,7 @@ EXPORT_SYMBOL(srp_reconnect_rport);
  * Note: This function is called from soft-IRQ context and with the request
  * queue lock held.
  */
-static enum blk_eh_timer_return srp_timed_out(struct scsi_cmnd *scmd)
+enum blk_eh_timer_return srp_timed_out(struct scsi_cmnd *scmd)
 {
        struct scsi_device *sdev = scmd->device;
        struct Scsi_Host *shost = sdev->host;
@@ -603,6 +603,7 @@ static enum blk_eh_timer_return srp_timed_out(struct scsi_cmnd *scmd)
                i->f->reset_timer_if_blocked && scsi_device_blocked(sdev) ?
                BLK_EH_RESET_TIMER : BLK_EH_NOT_HANDLED;
 }
+EXPORT_SYMBOL(srp_timed_out);
 
 static void srp_rport_release(struct device *dev)
 {
@@ -820,8 +821,6 @@ srp_attach_transport(struct srp_function_template *ft)
        if (!i)
                return NULL;
 
-       i->t.eh_timed_out = srp_timed_out;
-
        i->t.tsk_mgmt_response = srp_tsk_mgmt_response;
        i->t.it_nexus_response = srp_it_nexus_response;
 
index ceadf6b4ebc12062709e175c2ecc52a96de4d67f..585e54f6512cdd773342a7a040a203045ea65f26 100644 (file)
@@ -1899,11 +1899,6 @@ static int __init storvsc_drv_init(void)
        fc_transport_template = fc_attach_transport(&fc_transport_functions);
        if (!fc_transport_template)
                return -ENODEV;
-
-       /*
-        * Install Hyper-V specific timeout handler.
-        */
-       fc_transport_template->eh_timed_out = storvsc_eh_timed_out;
 #endif
 
        ret = vmbus_driver_register(&storvsc_drv);
index c170be548b7f1626c7c3a3eb27acd083ee54a5e7..46e18c0619c6a10cc45fb1f7ee219f5d0ee059fc 100644 (file)
@@ -1130,6 +1130,7 @@ extern int ata_sas_port_start(struct ata_port *ap);
 extern void ata_sas_port_stop(struct ata_port *ap);
 extern int ata_sas_slave_configure(struct scsi_device *, struct ata_port *);
 extern int ata_sas_queuecmd(struct scsi_cmnd *cmd, struct ata_port *ap);
+extern enum blk_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd);
 extern int sata_scr_valid(struct ata_link *link);
 extern int sata_scr_read(struct ata_link *link, int reg, u32 *val);
 extern int sata_scr_write(struct ata_link *link, int reg, u32 val);
@@ -1355,6 +1356,7 @@ extern struct device_attribute *ata_common_sdev_attrs[];
        .proc_name              = drv_name,                     \
        .slave_configure        = ata_scsi_slave_config,        \
        .slave_destroy          = ata_scsi_slave_destroy,       \
+       .eh_timed_out           = ata_scsi_timed_out,           \
        .bios_param             = ata_std_bios_param,           \
        .unlock_native_capacity = ata_scsi_unlock_native_capacity, \
        .sdev_attrs             = ata_common_sdev_attrs
index 4d1c46aac3319de315239dc1e1908c3204a8ad20..b0e275de6dec0d2be9adf09810e889c89d7ad06c 100644 (file)
@@ -383,6 +383,7 @@ extern int iscsi_eh_recover_target(struct scsi_cmnd *sc);
 extern int iscsi_eh_session_reset(struct scsi_cmnd *sc);
 extern int iscsi_eh_device_reset(struct scsi_cmnd *sc);
 extern int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc);
+extern enum blk_eh_timer_return iscsi_eh_cmd_timed_out(struct scsi_cmnd *sc);
 
 /*
  * iSCSI host helpers.
index 81292392adbcdf9142de2a97a83b14b44f335cfe..6c3bb9f3dc0f50d2c6a48ef5f7751ee0dc118431 100644 (file)
@@ -57,17 +57,6 @@ struct scsi_transport_template {
         */
        void (* eh_strategy_handler)(struct Scsi_Host *);
 
-       /*
-        * This is an optional routine that allows the transport to become
-        * involved when a scsi io timer fires. The return value tells the
-        * timer routine how to finish the io timeout handling:
-        * EH_HANDLED:          I fixed the error, please complete the command
-        * EH_RESET_TIMER:      I need more time, reset the timer and
-        *                      begin counting again
-        * EH_NOT_HANDLED       Begin normal error recovery
-        */
-       enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd *);
-
        /*
         * Used as callback for the completion of i_t_nexus request
         * for target drivers.
index 924c8e614b451684ae0f4623cf9921d7274800fc..b21b8aa58c4d6b8890592754bab2439db5769188 100644 (file)
@@ -808,6 +808,7 @@ struct fc_vport *fc_vport_create(struct Scsi_Host *shost, int channel,
                struct fc_vport_identifiers *);
 int fc_vport_terminate(struct fc_vport *vport);
 int fc_block_scsi_eh(struct scsi_cmnd *cmnd);
+enum blk_eh_timer_return fc_eh_timed_out(struct scsi_cmnd *scmd);
 
 static inline struct Scsi_Host *fc_bsg_to_shost(struct bsg_job *job)
 {
index d40d3ef25707bd7979a36d9e6e094a394d9f915e..20d96797edc58e362af2e069f4abf59d554711c1 100644 (file)
@@ -124,6 +124,7 @@ extern int srp_reconnect_rport(struct srp_rport *rport);
 extern void srp_start_tl_fail_timers(struct srp_rport *rport);
 extern void srp_remove_host(struct Scsi_Host *);
 extern void srp_stop_rport_timers(struct srp_rport *rport);
+enum blk_eh_timer_return srp_timed_out(struct scsi_cmnd *scmd);
 
 /**
  * srp_chkready() - evaluate the transport layer state before I/O