Commit 4d4d1ef8 authored by John Soni Jose's avatar John Soni Jose Committed by James Bottomley

[SCSI] be2iscsi: Issue an function level reset when driver is loaded

Signed-off-by: default avatarJohn Soni Jose <sony.john-n@emulex.com>
Signed-off-by: default avatarJayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 5cac7596
...@@ -47,8 +47,6 @@ ...@@ -47,8 +47,6 @@
static unsigned int be_iopoll_budget = 10; static unsigned int be_iopoll_budget = 10;
static unsigned int be_max_phys_size = 64; static unsigned int be_max_phys_size = 64;
static unsigned int enable_msix = 1; static unsigned int enable_msix = 1;
static unsigned int gcrashmode = 0;
static unsigned int num_hba = 0;
MODULE_DEVICE_TABLE(pci, beiscsi_pci_id_table); MODULE_DEVICE_TABLE(pci, beiscsi_pci_id_table);
MODULE_DESCRIPTION(DRV_DESC " " BUILD_STR); MODULE_DESCRIPTION(DRV_DESC " " BUILD_STR);
...@@ -4446,14 +4444,18 @@ void beiscsi_hba_attrs_init(struct beiscsi_hba *phba) ...@@ -4446,14 +4444,18 @@ void beiscsi_hba_attrs_init(struct beiscsi_hba *phba)
beiscsi_log_enable_init(phba, beiscsi_log_enable); beiscsi_log_enable_init(phba, beiscsi_log_enable);
} }
/*
* beiscsi_quiesce()- Cleanup Driver resources
* @phba: Instance Priv structure
*
* Free the OS and HW resources held by the driver
**/
static void beiscsi_quiesce(struct beiscsi_hba *phba) static void beiscsi_quiesce(struct beiscsi_hba *phba)
{ {
struct hwi_controller *phwi_ctrlr; struct hwi_controller *phwi_ctrlr;
struct hwi_context_memory *phwi_context; struct hwi_context_memory *phwi_context;
struct be_eq_obj *pbe_eq; struct be_eq_obj *pbe_eq;
unsigned int i, msix_vec; unsigned int i, msix_vec;
u8 *real_offset = 0;
u32 value = 0;
phwi_ctrlr = phba->phwi_ctrlr; phwi_ctrlr = phba->phwi_ctrlr;
phwi_context = phwi_ctrlr->phwi_ctxt; phwi_context = phwi_ctrlr->phwi_ctxt;
...@@ -4477,14 +4479,7 @@ static void beiscsi_quiesce(struct beiscsi_hba *phba) ...@@ -4477,14 +4479,7 @@ static void beiscsi_quiesce(struct beiscsi_hba *phba)
beiscsi_clean_port(phba); beiscsi_clean_port(phba);
beiscsi_free_mem(phba); beiscsi_free_mem(phba);
real_offset = (u8 *)phba->csr_va + MPU_EP_SEMAPHORE;
value = readl((void *)real_offset);
if (value & 0x00010000) {
value &= 0xfffeffff;
writel(value, (void *)real_offset);
}
beiscsi_unmap_pci_function(phba); beiscsi_unmap_pci_function(phba);
pci_free_consistent(phba->pcidev, pci_free_consistent(phba->pcidev,
phba->ctrl.mbox_mem_alloced.size, phba->ctrl.mbox_mem_alloced.size,
...@@ -4550,8 +4545,6 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev, ...@@ -4550,8 +4545,6 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev,
struct hwi_context_memory *phwi_context; struct hwi_context_memory *phwi_context;
struct be_eq_obj *pbe_eq; struct be_eq_obj *pbe_eq;
int ret, i; int ret, i;
u8 *real_offset = 0;
u32 value = 0;
ret = beiscsi_enable_pci(pcidev); ret = beiscsi_enable_pci(pcidev);
if (ret < 0) { if (ret < 0) {
...@@ -4606,31 +4599,18 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev, ...@@ -4606,31 +4599,18 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev,
goto hba_free; goto hba_free;
} }
if (!num_hba) { ret = beiscsi_cmd_reset_function(phba);
real_offset = (u8 *)phba->csr_va + MPU_EP_SEMAPHORE; if (ret) {
value = readl((void *)real_offset); beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
if (value & 0x00010000) { "BM_%d : Reset Failed. Aborting Crashdump\n");
gcrashmode++; goto hba_free;
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, }
"BM_%d : Loading Driver in crashdump mode\n"); ret = be_chk_reset_complete(phba);
ret = beiscsi_cmd_reset_function(phba); if (ret) {
if (ret) { beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, "BM_%d : Failed to get out of reset."
"BM_%d : Reset Failed. Aborting Crashdump\n"); "Aborting Crashdump\n");
goto hba_free; goto hba_free;
}
ret = be_chk_reset_complete(phba);
if (ret) {
beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
"BM_%d : Failed to get out of reset."
"Aborting Crashdump\n");
goto hba_free;
}
} else {
value |= 0x00010000;
writel(value, (void *)real_offset);
num_hba++;
}
} }
spin_lock_init(&phba->io_sgl_lock); spin_lock_init(&phba->io_sgl_lock);
...@@ -4718,15 +4698,6 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev, ...@@ -4718,15 +4698,6 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev,
beiscsi_clean_port(phba); beiscsi_clean_port(phba);
beiscsi_free_mem(phba); beiscsi_free_mem(phba);
free_port: free_port:
real_offset = (u8 *)phba->csr_va + MPU_EP_SEMAPHORE;
value = readl((void *)real_offset);
if (value & 0x00010000) {
value &= 0xfffeffff;
writel(value, (void *)real_offset);
}
pci_free_consistent(phba->pcidev, pci_free_consistent(phba->pcidev,
phba->ctrl.mbox_mem_alloced.size, phba->ctrl.mbox_mem_alloced.size,
phba->ctrl.mbox_mem_alloced.va, phba->ctrl.mbox_mem_alloced.va,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment