From f57d08d130ddc17432a19b22ea1be40a02f577d9 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Thu, 17 Jun 2004 23:58:05 -0500 Subject: [PATCH] SCSI Flexible timout intfrastructure The object of this infrastructure is to give HBAs early warning that error handling is about to happen and also provide them with the opportunity to do something about it. It introduces the extra template callback: eh_timed_out() which scsi_times_out() will call if it is populated to notify the LLD that an outstanding command took a timeout. There are three possible returns: EH_HANDLED: I've fixed the problem, please complete the command for me (as soon as the timer fires, scsi_done will do nothing, so the timer itself will call a special version of scsi_done that doesn't check the timer). EH_NOT_HANDLED: Invoke error recovery as normal EH_RESET_TIMER: The command will complete, reset the timer to its original value and start it ticking again. Signed-off-by: James Bottomley Based on work by Christoph Hellwig and Luben Tuikov --- include/scsi/scsi_host.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include') diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index abba7b4194b7..3b72d68b0954 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -30,6 +30,12 @@ struct scsi_transport_template; #define DISABLE_CLUSTERING 0 #define ENABLE_CLUSTERING 1 +enum scsi_eh_timer_return { + EH_NOT_HANDLED, + EH_HANDLED, + EH_RESET_TIMER, +}; + struct scsi_host_template { struct module *module; @@ -125,6 +131,20 @@ struct scsi_host_template { int (* eh_bus_reset_handler)(struct scsi_cmnd *); int (* eh_host_reset_handler)(struct scsi_cmnd *); + /* + * This is an optional routine to notify the host that the scsi + * timer just fired. The returns tell the timer routine what to + * do about this: + * + * 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 + * + * Status: OPTIONAL + */ + enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *); + /* * Old EH handlers, no longer used. Make them warn the user of old * drivers by using a wrong type -- cgit v1.2.3