summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fnic/fnic.h
diff options
context:
space:
mode:
authorHiral Patel <hiralpat@cisco.com>2013-02-12 17:01:00 -0800
committerJames Bottomley <JBottomley@Parallels.com>2013-02-22 17:30:19 +0000
commita0bf1ca27b644c1c4b1f0ea2d81f99471b2549e8 (patch)
treec18497413ffc28dd7c56a1c8c56113d9e078fac7 /drivers/scsi/fnic/fnic.h
parentcfe16d5da88896fc78d008c96d639cf9c90850a0 (diff)
downloadop-kernel-dev-a0bf1ca27b644c1c4b1f0ea2d81f99471b2549e8.zip
op-kernel-dev-a0bf1ca27b644c1c4b1f0ea2d81f99471b2549e8.tar.gz
[SCSI] fnic: fnic driver may hit BUG_ON on device reset
The issue was observed when LUN Reset is issued through IOCTL or sg_reset utility. fnic driver issues LUN RESET to firmware. On successful completion of device reset, driver cleans up all the pending IOs that were issued prior to device reset. These pending IOs are expected to be in ABTS_PENDING state. This works fine, when the device reset operation resulted from midlayer, but not when device reset was triggered from IOCTL path as the pending IOs were not in ABTS_PENDING state. execution path hits panic if the pending IO is not in ABTS_PENDING state. Changes: The fix replaces BUG_ON check in fnic_clean_pending_aborts() with marking pending IOs as ABTS_PENDING if they were not in ABTS_PENDING state and skips if they were already in ABTS_PENDING state. An extra check is added to validate the abort status of the commands after a delay of 2 * E_D_TOV using a helper function. The helper function returns 1 if it finds any pending IO in ABTS_PENDING state, belong to the LUN on which device reset was issued else 0. With this, device reset operation returns success only if the helper funciton returns 0, otherwise it returns failure. Other changes: - Removed code in fnic_clean_pending_aborts() that returns failure if it finds io_req NULL, instead of returning failure added code to continue with next io - Added device reset flags for debugging in fnic_terminate_rport_io, fnic_rport_exch_reset, and fnic_clean_pending_aborts Signed-off-by: Narsimhulu Musini <nmusini@cisco.com> Signed-off-by: Hiral Patel <hiralpat@cisco.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/fnic/fnic.h')
-rw-r--r--drivers/scsi/fnic/fnic.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/fnic/fnic.h b/drivers/scsi/fnic/fnic.h
index 63b35c8..b8e6644 100644
--- a/drivers/scsi/fnic/fnic.h
+++ b/drivers/scsi/fnic/fnic.h
@@ -303,6 +303,8 @@ const char *fnic_state_to_str(unsigned int state);
void fnic_log_q_error(struct fnic *fnic);
void fnic_handle_link_event(struct fnic *fnic);
+int fnic_is_abts_pending(struct fnic *, struct scsi_cmnd *);
+
static inline int
fnic_chk_state_flags_locked(struct fnic *fnic, unsigned long st_flags)
{
OpenPOWER on IntegriCloud