aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi/be_main.c
diff options
context:
space:
mode:
authorJohn Soni Jose <sony.john-n@emulex.com>2012-10-19 19:15:51 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-11-26 23:59:42 -0500
commit7a15800357e382b095b5dcb8edf79c3b2c8317e4 (patch)
treed9d6ab86b14a5e16a443504cc39d1742047a0fa1 /drivers/scsi/be2iscsi/be_main.c
parente175defea7b2019613765fee63afcca354e0041d (diff)
[SCSI] be2iscsi: Fix Unrecoverable Error Detection
Driver periodically checks adapter state,is up fine or not. Based on the value updates the internal structures of driver. Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/be2iscsi/be_main.c')
-rw-r--r--drivers/scsi/be2iscsi/be_main.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 73a29b2c18ba..48d37dded8f1 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -4717,6 +4717,8 @@ static void beiscsi_quiesce(struct beiscsi_hba *phba)
4717 phba->ctrl.mbox_mem_alloced.size, 4717 phba->ctrl.mbox_mem_alloced.size,
4718 phba->ctrl.mbox_mem_alloced.va, 4718 phba->ctrl.mbox_mem_alloced.va,
4719 phba->ctrl.mbox_mem_alloced.dma); 4719 phba->ctrl.mbox_mem_alloced.dma);
4720
4721 cancel_delayed_work_sync(&phba->beiscsi_hw_check_task);
4720} 4722}
4721 4723
4722static void beiscsi_remove(struct pci_dev *pcidev) 4724static void beiscsi_remove(struct pci_dev *pcidev)
@@ -4769,6 +4771,25 @@ static void beiscsi_msix_enable(struct beiscsi_hba *phba)
4769 return; 4771 return;
4770} 4772}
4771 4773
4774/*
4775 * beiscsi_hw_health_check()- Check adapter health
4776 * @work: work item to check HW health
4777 *
4778 * Check if adapter in an unrecoverable state or not.
4779 **/
4780static void
4781beiscsi_hw_health_check(struct work_struct *work)
4782{
4783 struct beiscsi_hba *phba =
4784 container_of(work, struct beiscsi_hba,
4785 beiscsi_hw_check_task.work);
4786
4787 beiscsi_ue_detect(phba);
4788
4789 schedule_delayed_work(&phba->beiscsi_hw_check_task,
4790 msecs_to_jiffies(1000));
4791}
4792
4772static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev, 4793static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev,
4773 const struct pci_device_id *id) 4794 const struct pci_device_id *id)
4774{ 4795{
@@ -4892,6 +4913,8 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev,
4892 goto free_twq; 4913 goto free_twq;
4893 } 4914 }
4894 4915
4916 INIT_DELAYED_WORK(&phba->beiscsi_hw_check_task,
4917 beiscsi_hw_health_check);
4895 4918
4896 phwi_ctrlr = phba->phwi_ctrlr; 4919 phwi_ctrlr = phba->phwi_ctrlr;
4897 phwi_context = phwi_ctrlr->phwi_ctxt; 4920 phwi_context = phwi_ctrlr->phwi_ctxt;
@@ -4941,6 +4964,9 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev,
4941 "iSCSI boot info.\n"); 4964 "iSCSI boot info.\n");
4942 4965
4943 beiscsi_create_def_ifaces(phba); 4966 beiscsi_create_def_ifaces(phba);
4967 schedule_delayed_work(&phba->beiscsi_hw_check_task,
4968 msecs_to_jiffies(1000));
4969
4944 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT, 4970 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT,
4945 "\n\n\n BM_%d : SUCCESS - DRIVER LOADED\n\n\n"); 4971 "\n\n\n BM_%d : SUCCESS - DRIVER LOADED\n\n\n");
4946 return 0; 4972 return 0;