diff options
Diffstat (limited to 'drivers/scsi/be2iscsi/be_main.c')
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 67a7e3f7bae6..1a22125f5202 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c | |||
@@ -41,6 +41,8 @@ | |||
41 | static unsigned int be_iopoll_budget = 10; | 41 | static unsigned int be_iopoll_budget = 10; |
42 | static unsigned int be_max_phys_size = 64; | 42 | static unsigned int be_max_phys_size = 64; |
43 | static unsigned int enable_msix = 1; | 43 | static unsigned int enable_msix = 1; |
44 | static unsigned int gcrashmode = 0; | ||
45 | static unsigned int num_hba = 0; | ||
44 | 46 | ||
45 | MODULE_DEVICE_TABLE(pci, beiscsi_pci_id_table); | 47 | MODULE_DEVICE_TABLE(pci, beiscsi_pci_id_table); |
46 | MODULE_DESCRIPTION(DRV_DESC " " BUILD_STR); | 48 | MODULE_DESCRIPTION(DRV_DESC " " BUILD_STR); |
@@ -3731,6 +3733,8 @@ static void beiscsi_remove(struct pci_dev *pcidev) | |||
3731 | struct hwi_context_memory *phwi_context; | 3733 | struct hwi_context_memory *phwi_context; |
3732 | struct be_eq_obj *pbe_eq; | 3734 | struct be_eq_obj *pbe_eq; |
3733 | unsigned int i, msix_vec; | 3735 | unsigned int i, msix_vec; |
3736 | u8 *real_offset = 0; | ||
3737 | u32 value = 0; | ||
3734 | 3738 | ||
3735 | phba = (struct beiscsi_hba *)pci_get_drvdata(pcidev); | 3739 | phba = (struct beiscsi_hba *)pci_get_drvdata(pcidev); |
3736 | if (!phba) { | 3740 | if (!phba) { |
@@ -3759,6 +3763,14 @@ static void beiscsi_remove(struct pci_dev *pcidev) | |||
3759 | 3763 | ||
3760 | beiscsi_clean_port(phba); | 3764 | beiscsi_clean_port(phba); |
3761 | beiscsi_free_mem(phba); | 3765 | beiscsi_free_mem(phba); |
3766 | real_offset = (u8 *)phba->csr_va + MPU_EP_SEMAPHORE; | ||
3767 | |||
3768 | value = readl((void *)real_offset); | ||
3769 | |||
3770 | if (value & 0x00010000) { | ||
3771 | value &= 0xfffeffff; | ||
3772 | writel(value, (void *)real_offset); | ||
3773 | } | ||
3762 | beiscsi_unmap_pci_function(phba); | 3774 | beiscsi_unmap_pci_function(phba); |
3763 | pci_free_consistent(phba->pcidev, | 3775 | pci_free_consistent(phba->pcidev, |
3764 | phba->ctrl.mbox_mem_alloced.size, | 3776 | phba->ctrl.mbox_mem_alloced.size, |
@@ -3792,6 +3804,8 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev, | |||
3792 | struct hwi_context_memory *phwi_context; | 3804 | struct hwi_context_memory *phwi_context; |
3793 | struct be_eq_obj *pbe_eq; | 3805 | struct be_eq_obj *pbe_eq; |
3794 | int ret, num_cpus, i; | 3806 | int ret, num_cpus, i; |
3807 | u8 *real_offset = 0; | ||
3808 | u32 value = 0; | ||
3795 | 3809 | ||
3796 | ret = beiscsi_enable_pci(pcidev); | 3810 | ret = beiscsi_enable_pci(pcidev); |
3797 | if (ret < 0) { | 3811 | if (ret < 0) { |
@@ -3837,6 +3851,33 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev, | |||
3837 | goto hba_free; | 3851 | goto hba_free; |
3838 | } | 3852 | } |
3839 | 3853 | ||
3854 | if (!num_hba) { | ||
3855 | real_offset = (u8 *)phba->csr_va + MPU_EP_SEMAPHORE; | ||
3856 | value = readl((void *)real_offset); | ||
3857 | if (value & 0x00010000) { | ||
3858 | gcrashmode++; | ||
3859 | shost_printk(KERN_ERR, phba->shost, | ||
3860 | "Loading Driver in crashdump mode\n"); | ||
3861 | ret = beiscsi_pci_soft_reset(phba); | ||
3862 | if (ret) { | ||
3863 | shost_printk(KERN_ERR, phba->shost, | ||
3864 | "Reset Failed. Aborting Crashdump\n"); | ||
3865 | goto hba_free; | ||
3866 | } | ||
3867 | ret = be_chk_reset_complete(phba); | ||
3868 | if (ret) { | ||
3869 | shost_printk(KERN_ERR, phba->shost, | ||
3870 | "Failed to get out of reset." | ||
3871 | "Aborting Crashdump\n"); | ||
3872 | goto hba_free; | ||
3873 | } | ||
3874 | } else { | ||
3875 | value |= 0x00010000; | ||
3876 | writel(value, (void *)real_offset); | ||
3877 | num_hba++; | ||
3878 | } | ||
3879 | } | ||
3880 | |||
3840 | spin_lock_init(&phba->io_sgl_lock); | 3881 | spin_lock_init(&phba->io_sgl_lock); |
3841 | spin_lock_init(&phba->mgmt_sgl_lock); | 3882 | spin_lock_init(&phba->mgmt_sgl_lock); |
3842 | spin_lock_init(&phba->isr_lock); | 3883 | spin_lock_init(&phba->isr_lock); |
@@ -3907,6 +3948,15 @@ free_twq: | |||
3907 | beiscsi_clean_port(phba); | 3948 | beiscsi_clean_port(phba); |
3908 | beiscsi_free_mem(phba); | 3949 | beiscsi_free_mem(phba); |
3909 | free_port: | 3950 | free_port: |
3951 | real_offset = (u8 *)phba->csr_va + MPU_EP_SEMAPHORE; | ||
3952 | |||
3953 | value = readl((void *)real_offset); | ||
3954 | |||
3955 | if (value & 0x00010000) { | ||
3956 | value &= 0xfffeffff; | ||
3957 | writel(value, (void *)real_offset); | ||
3958 | } | ||
3959 | |||
3910 | pci_free_consistent(phba->pcidev, | 3960 | pci_free_consistent(phba->pcidev, |
3911 | phba->ctrl.mbox_mem_alloced.size, | 3961 | phba->ctrl.mbox_mem_alloced.size, |
3912 | phba->ctrl.mbox_mem_alloced.va, | 3962 | phba->ctrl.mbox_mem_alloced.va, |