summaryrefslogtreecommitdiff
path: root/drivers/scsi/be2iscsi/be_main.h
diff options
context:
space:
mode:
authorJitendra Bhivare <jitendra.bhivare@broadcom.com>2016-08-19 15:20:18 +0530
committerMartin K. Petersen <martin.petersen@oracle.com>2016-08-23 22:42:44 -0400
commitd1d5ca887c0ee60ec6c6e42db0c1073155a09d32 (patch)
treec0c8d6ebf44cf776fb5beb5c351068e8ae6890bf /drivers/scsi/be2iscsi/be_main.h
parentf79929deb56e1b8053c36adf7ee8d34b39e673a8 (diff)
scsi: be2iscsi: Add TPE recovery feature
After UE is detected, check for recoverable error by reading SLIPORT SEMAPHORE register. If transient parity error i.e. 0xExxx then schedule recovery work on driver wq. FLag this error to prevent any transactions for the duration of ue2rp to restart polling. After that, if FW becomes ready then recover port. Wake up processes in wq before going offline. Wait for process to execute before cleaning up. Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/be2iscsi/be_main.h')
-rw-r--r--drivers/scsi/be2iscsi/be_main.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h
index 4cdb34c3de5d..1fd6c1868366 100644
--- a/drivers/scsi/be2iscsi/be_main.h
+++ b/drivers/scsi/be2iscsi/be_main.h
@@ -393,7 +393,7 @@ struct beiscsi_hba {
} fw_config;
unsigned long state;
-#define BEISCSI_HBA_RUNNING 0
+#define BEISCSI_HBA_ONLINE 0
#define BEISCSI_HBA_LINK_UP 1
#define BEISCSI_HBA_BOOT_FOUND 2
#define BEISCSI_HBA_BOOT_WORK 3
@@ -417,6 +417,7 @@ struct beiscsi_hba {
/* check for UE every 1000ms */
#define BEISCSI_UE_DETECT_INTERVAL 1000
u32 ue2rp;
+ struct delayed_work recover_port;
bool mac_addr_set;
u8 mac_address[ETH_ALEN];
@@ -455,6 +456,9 @@ struct beiscsi_hba {
};
#define beiscsi_hba_in_error(phba) ((phba)->state & BEISCSI_HBA_IN_ERR)
+#define beiscsi_hba_is_online(phba) \
+ (!beiscsi_hba_in_error((phba)) && \
+ test_bit(BEISCSI_HBA_ONLINE, &phba->state))
struct beiscsi_session {
struct pci_pool *bhs_pool;