sort out the ->eh_timed_out mess
Subsystems (25)
We originally only supported the methods in the transport_template, which led to problems with drivers needing it and having to fake up a template. Then we added it to the host to avoid that issue, but because the transport template takes precedence we still have various placed that need to hack around it.
This series removes the transport_template instance and switches everyone to use the host method, similar to how we supply generic helpers elsewhere.
In addition it removes a bit of cruft in the same area.
PATCH 1/4 mvumi: remove fake transport template
These days we can specify an eh_timed_out handler in the host_template, so don't have a transport_template defintion just for it.
--- drivers/scsi/mvumi.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/scsi/mvumi.c +1 -5
@@ -2225,15 +2225,12 @@ static struct scsi_host_template mvumi_template = { .name = "Marvell Storage Controller", .slave_configure = mvumi_slave_configure, .queuecommand = mvumi_queue_command, + .eh_timed_out = mvumi_timed_out, .eh_host_reset_handler = mvumi_host_reset, .bios_param = mvumi_bios_param, .this_id = -1, }; -static struct scsi_transport_template mvumi_transport_template = { - .eh_timed_out = mvumi_timed_out, -}; -static int mvumi_cfg_hw_reg (struct mvumi_hba *mhba) {void *base =NULL ;
@@ -2451,7 +2448,6 @@ static int mvumi_io_attach(struct mvumi_hba *mhba) host->cmd_per_lun = (mhba->max_io -1 ) ? (mhba->max_io -1 ) :1 ; host->max_id = mhba->max_target_id; host->max_cmd_len =MAX_COMMAND_SIZE ; - host->transportt = &mvumi_transport_template; ret =scsi_add_host (host, &mhba->pdev->dev);if (ret) {
Signature · 1 line
2.1.4
PATCH 2/4 libsas: remove sas_scsi_timed_out
In reply to Christoph HellwigEH_NOT_HANDLED is the default case if no eh_timed_out method is provided, so there is no need to supply it.
--- drivers/scsi/libsas/sas_init.c | 1 - drivers/scsi/libsas/sas_internal.h | 2 -- drivers/scsi/libsas/sas_scsi_host.c | 7 ------- 3 files changed, 10 deletions(-)
drivers/scsi/libsas/sas_init.c +0 -1
@@ -560,7 +560,6 @@ sas_domain_attach_transport(struct sas_domain_function_template *dft) i =to_sas_internal (stt); i->dft = dft; stt->create_work_queue =1 ; - stt->eh_timed_out = sas_scsi_timed_out; stt->eh_strategy_handler = sas_scsi_recover_host;return stt;
drivers/scsi/libsas/sas_internal.h +0 -2
@@ -64,8 +64,6 @@ void sas_unregister_phys(struct sas_ha_struct *sas_ha);int sas_register_ports (struct sas_ha_struct *sas_ha);void sas_unregister_ports (struct sas_ha_struct *sas_ha); -enum blk_eh_timer_return sas_scsi_timed_out (struct scsi_cmnd *); -int sas_init_events (struct sas_ha_struct *sas_ha);void sas_disable_revalidation (struct sas_ha_struct *ha);void sas_enable_revalidation (struct sas_ha_struct *ha);
drivers/scsi/libsas/sas_scsi_host.c +0 -7
@@ -803,13 +803,6 @@ void sas_scsi_recover_host(struct Scsi_Host *shost) shost->host_failed, tries); } -enum blk_eh_timer_return sas_scsi_timed_out (struct scsi_cmnd *cmd) -{ -scmd_dbg (cmd,"command %p timed out\n" , cmd); - -return BLK_EH_NOT_HANDLED ; -} -int sas_ioctl (struct scsi_device *sdev,int cmd,void __user *arg) {struct domain_device *dev =sdev_to_domain_dev (sdev);
Signature · 1 line
2.1.4
PATCH 3/4 scsi: remove eh_timed_out methods in the transport template
In reply to Christoph HellwigInstead 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.
--- drivers/ata/libata-eh.c | 1 + drivers/ata/libata-transport.c | 1 - drivers/ata/libata.h | 1 - drivers/infiniband/ulp/iser/iscsi_iser.c | 1 + drivers/infiniband/ulp/srp/ib_srp.c | 1 + drivers/message/fusion/mptfc.c | 1 + drivers/message/fusion/mptsas.c | 2 +- drivers/s390/scsi/zfcp_scsi.c | 1 + drivers/scsi/be2iscsi/be_main.c | 1 + drivers/scsi/bfa/bfad_im.c | 2 ++ drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 1 + drivers/scsi/bnx2i/bnx2i_iscsi.c | 1 + drivers/scsi/csiostor/csio_scsi.c | 2 ++ drivers/scsi/cxgbi/cxgb3i/cxgb3i.c | 1 + drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | 1 + drivers/scsi/fcoe/fcoe.c | 1 + drivers/scsi/fnic/fnic_main.c | 1 + drivers/scsi/ibmvscsi/ibmvfc.c | 1 + drivers/scsi/ibmvscsi/ibmvscsi.c | 1 + drivers/scsi/iscsi_tcp.c | 1 + drivers/scsi/libiscsi.c | 5 ++--- drivers/scsi/lpfc/lpfc_scsi.c | 2 ++ drivers/scsi/qedi/qedi_iscsi.c | 1 + drivers/scsi/qla2xxx/qla_os.c | 1 + drivers/scsi/scsi_error.c | 4 +--- drivers/scsi/scsi_transport_fc.c | 9 ++++----- drivers/scsi/scsi_transport_srp.c | 5 ++--- drivers/scsi/storvsc_drv.c | 5 ----- include/linux/libata.h | 2 ++ include/scsi/libiscsi.h | 1 + include/scsi/scsi_transport.h | 11 ----------- include/scsi/scsi_transport_fc.h | 1 + include/scsi/scsi_transport_srp.h | 1 + 33 files changed, 38 insertions(+), 33 deletions(-)
drivers/ata/libata-eh.c +1 -0
@@ -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) {
drivers/ata/libata-transport.c +0 -1
@@ -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 ];
drivers/ata/libata.h +0 -1
@@ -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);
drivers/infiniband/ulp/iser/iscsi_iser.c +1 -0
@@ -994,6 +994,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,
drivers/infiniband/ulp/srp/ib_srp.c +1 -0
@@ -2869,6 +2869,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,
drivers/message/fusion/mptfc.c +1 -0
@@ -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,
drivers/message/fusion/mptsas.c +1 -1
@@ -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" );
drivers/s390/scsi/zfcp_scsi.c +1 -0
@@ -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,
drivers/scsi/be2iscsi/be_main.c +1 -0
@@ -395,6 +395,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,
drivers/scsi/bfa/bfad_im.c +2 -0
@@ -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,
drivers/scsi/bnx2fc/bnx2fc_fcoe.c +1 -0
@@ -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 */
drivers/scsi/bnx2i/bnx2i_iscsi.c +1 -0
@@ -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,
drivers/scsi/csiostor/csio_scsi.c +2 -0
@@ -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,
drivers/scsi/cxgbi/cxgb3i/cxgb3i.c +1 -0
@@ -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,
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c +1 -0
@@ -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,
drivers/scsi/fcoe/fcoe.c +1 -0
@@ -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,
drivers/scsi/fnic/fnic_main.c +1 -0
@@ -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,
drivers/scsi/ibmvscsi/ibmvfc.c +1 -0
@@ -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,
drivers/scsi/ibmvscsi/ibmvscsi.c +1 -0
@@ -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,
drivers/scsi/iscsi_tcp.c +1 -0
@@ -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,
drivers/scsi/libiscsi.c +2 -3
@@ -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 @@ static enum blk_eh_timer_return iscsi_eh_cmd_timed_out(struct scsi_cmnd *sc) "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);
drivers/scsi/lpfc/lpfc_scsi.c +2 -0
@@ -5923,6 +5923,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,
@@ -5949,6 +5950,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,
drivers/scsi/qedi/qedi_iscsi.c +1 -0
@@ -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,
drivers/scsi/qla2xxx/qla_os.c +1 -0
@@ -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,
drivers/scsi/scsi_error.c +1 -3
@@ -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 ) {
drivers/scsi/scsi_transport_fc.c +4 -5
@@ -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 */
drivers/scsi/scsi_transport_srp.c +2 -3
@@ -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;
drivers/scsi/storvsc_drv.c +0 -5
@@ -1774,11 +1774,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);
include/linux/libata.h +2 -0
@@ -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
include/scsi/libiscsi.h +1 -0
@@ -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.
include/scsi/scsi_transport.h +0 -11
@@ -58,17 +58,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. */
include/scsi/scsi_transport_fc.h +1 -0
@@ -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) {
include/scsi/scsi_transport_srp.h +1 -0
@@ -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
Signature · 1 line
2.1.4
PATCH 4/4 scsi: remove tsk_mgmt_response and it_nexus_response transport methods
In reply to Christoph HellwigThey are never called and just dispatch to methods of the same names in the FC and SRP transport classes that are never implemented.
--- drivers/scsi/scsi_transport_fc.c | 17 ----------------- drivers/scsi/scsi_transport_srp.c | 16 ---------------- include/scsi/scsi_transport.h | 12 ------------ include/scsi/scsi_transport_srp.h | 7 ------- 4 files changed, 52 deletions(-)
drivers/scsi/scsi_transport_fc.c +0 -17
@@ -2160,19 +2160,6 @@ fc_user_scan(struct Scsi_Host *shost, uint channel, uint id, u64 lun)return 0 ; } -static int fc_tsk_mgmt_response (struct Scsi_Host *shost,u64 nexus,u64 tm_id, -int result) -{ -struct fc_internal *i =to_fc_internal (shost->transportt); -return i->f->tsk_mgmt_response (shost, nexus, tm_id, result); -} - -static int fc_it_nexus_response (struct Scsi_Host *shost,u64 nexus,int result) -{ -struct fc_internal *i =to_fc_internal (shost->transportt); -return i->f->it_nexus_response (shost, nexus, result); -} -struct scsi_transport_template *fc_attach_transport (struct fc_function_template *ft) {
@@ -2214,10 +2201,6 @@ fc_attach_transport(struct fc_function_template *ft) i->t.user_scan = fc_user_scan; -/* target-mode drivers' functions */ - i->t.tsk_mgmt_response = fc_tsk_mgmt_response; - i->t.it_nexus_response = fc_it_nexus_response; -/* * Setup SCSI Target Attributes. */
drivers/scsi/scsi_transport_srp.c +0 -16
@@ -794,19 +794,6 @@ void srp_stop_rport_timers(struct srp_rport *rport) }EXPORT_SYMBOL_GPL (srp_stop_rport_timers); -static int srp_tsk_mgmt_response (struct Scsi_Host *shost,u64 nexus,u64 tm_id, -int result) -{ -struct srp_internal *i =to_srp_internal (shost->transportt); -return i->f->tsk_mgmt_response (shost, nexus, tm_id, result); -} - -static int srp_it_nexus_response (struct Scsi_Host *shost,u64 nexus,int result) -{ -struct srp_internal *i =to_srp_internal (shost->transportt); -return i->f->it_nexus_response (shost, nexus, result); -} -/** * srp_attach_transport - instantiate SRP transport template * @ft: SRP transport class function template
@@ -821,9 +808,6 @@ srp_attach_transport(struct srp_function_template *ft)if (!i)return NULL ; - i->t.tsk_mgmt_response = srp_tsk_mgmt_response; - i->t.it_nexus_response = srp_it_nexus_response; - i->t.host_size =sizeof (struct srp_host_attrs ); i->t.host_attrs.ac.attrs = &i->host_attrs[0 ]; i->t.host_attrs.ac.class = &srp_host_class.class;
include/scsi/scsi_transport.h +0 -12
@@ -56,18 +56,6 @@ struct scsi_transport_template {* Allows a transport to override the default error handler. */ void (* eh_strategy_handler)(struct Scsi_Host *); - -/* -* Used as callback for the completion of i_t_nexus request -* for target drivers. -*/ -int (* it_nexus_response)(struct Scsi_Host *,u64 ,int ); - -/* -* Used as callback for the completion of task management -* request for target drivers. -*/ -int (* tsk_mgmt_response)(struct Scsi_Host *,u64 ,u64 ,int ); };#define transport_class_to_shost (tc) \
include/scsi/scsi_transport_srp.h +0 -7
@@ -88,10 +88,6 @@ struct srp_rport {* @terminate_rport_io: Callback function for terminating all outstanding I/O * requests for an rport. * @rport_delete: Callback function that deletes an rport. -* -* Fields that are only relevant for SRP target drivers: -* @tsk_mgmt_response: Callback function for sending a task management response. -* @it_nexus_response: Callback function for processing an IT nexus response. */ struct srp_function_template {/* for initiator drivers */
@@ -103,9 +99,6 @@ struct srp_function_template {int (*reconnect)(struct srp_rport *rport);void (*terminate_rport_io)(struct srp_rport *rport);void (*rport_delete)(struct srp_rport *rport); -/* for target drivers */ -int (* tsk_mgmt_response)(struct Scsi_Host *,u64 ,u64 ,int ); -int (* it_nexus_response)(struct Scsi_Host *,u64 ,int ); }; extern struct scsi_transport_template *
Signature · 1 line
2.1.4
Re: [PATCH 1/4] mvumi: remove fake transport template
In reply to Christoph HellwigQuoted 8 lines · Christoph Hellwig
These days we can specify an
eh_timed_outhandler in thehost_template, so don't have atransport_templatedefintion just for it.Signed-off-by Christoph Hellwig <[email protected]>--- drivers/scsi/mvumi.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Teamlead Storage & Networking [email protected] +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)
Re: [PATCH 2/4] libsas: remove sas_scsi_timed_out
In reply to Christoph HellwigQuoted 10 lines · Christoph Hellwig
EH_NOT_HANDLEDis the default case if noeh_timed_outmethod is provided, so there is no need to supply it.Signed-off-by Christoph Hellwig <[email protected]>--- drivers/scsi/libsas/sas_init.c | 1 - drivers/scsi/libsas/sas_internal.h | 2 -- drivers/scsi/libsas/sas_scsi_host.c | 7 ------- 3 files changed, 10 deletions(-)
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Teamlead Storage & Networking [email protected] +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)
Re: [PATCH 3/4] scsi: remove eh_timed_out methods in the transport template
In reply to Christoph HellwigQuoted 8 lines · Christoph Hellwig
Instead define the timeout behavior purely based on the
host_templateeh_timed_outmethod 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 <[email protected]>---
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Teamlead Storage & Networking [email protected] +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)
Re: [PATCH 4/4] scsi: remove tsk_mgmt_response and it_nexus_response transport methods
In reply to Christoph HellwigQuoted 11 lines · Christoph Hellwig
They are never called and just dispatch to methods of the same names in the FC and SRP transport classes that are never implemented.
Signed-off-by Christoph Hellwig <[email protected]>--- drivers/scsi/scsi_transport_fc.c | 17 ----------------- drivers/scsi/scsi_transport_srp.c | 16 ---------------- include/scsi/scsi_transport.h | 12 ------------ include/scsi/scsi_transport_srp.h | 7 ------- 4 files changed, 52 deletions(-)
These are actually left-overs from the original target mode implementation from Tomo.
So yes, they can go now.
Cheers,
Hannes
Signature · 5 lines
Dr. Hannes Reinecke Teamlead Storage & Networking [email protected] +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)
Quoted 11 lines · Christoph Hellwig
We originally only supported the methods in the
transport_template, which led to problems with drivers needing it and having to fake up a template. Then we added it to the host to avoid that issue, but because the transport template takes precedence we still have various placed that need to hack around it.This series removes the
transport_templateinstance and switches everyone to use the host method, similar to how we supply generic helpers elsewhere.In addition it removes a bit of cruft in the same area.
Hello Christoph,
Patches 1, 2 and 4 of this series are a real improvement in my opinion. However, I'm not sure whether patch 3 is the best way to avoid that drivers have to re-override the transport template timeout handler. Have you considered to modify the SCSI EH such that the host timeout handler has priority over the transport timeout handler? I think that would result in a much smaller patch 3/4.
Thanks,
Bart.
Re: [PATCH 3/4] scsi: remove eh_timed_out methods in the transport template
In reply to Christoph HellwigQuoted 7 lines · Christoph Hellwig
Instead define the timeout behavior purely based on the
host_templateeh_timed_outmethod 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 <[email protected]>
Quoted 6 lines · Bart Van Assche
Patches 1, 2 and 4 of this series are a real improvement in my opinion. However, I'm not sure whether patch 3 is the best way to avoid that drivers have to re-override the transport template timeout handler. Have you considered to modify the SCSI EH such that the host timeout handler has priority over the transport timeout handler? I think that would result in a much smaller patch 3/4.
It's not too much of a difference in patch size, and I think it's the cleaner model to only have the method once.
However if there is a consensus against this version I can respin a patch that just changes the precendence.
Martin K. Petersen
AppliedQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Christoph" == Christoph Hellwig <[email protected]> writes:
Christoph> We originally only supported the methods in the Christoph> transport_template, which led to problems with drivers Christoph> needing it and having to fake up a template. Then we added Christoph> it to the host to avoid that issue, but because the transport Christoph> template takes precedence we still have various placed that Christoph> need to hack around it.
Christoph> This series removes the transport_template instance and Christoph> switches everyone to use the host method, similar to how we Christoph> supply generic helpers elsewhere.
Christoph> In addition it removes a bit of cruft in the same area.
Applied to 4.11/scsi-queue.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering