diff options
| -rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 08bdba520c90..80f4f9de8182 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
| @@ -768,42 +768,16 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *ha) | |||
| 768 | mem_size = (ha->fw_memory_size - 0x100000 + 1) * | 768 | mem_size = (ha->fw_memory_size - 0x100000 + 1) * |
| 769 | sizeof(uint32_t); | 769 | sizeof(uint32_t); |
| 770 | 770 | ||
| 771 | /* Allocate memory for Extended Trace Buffer. */ | ||
| 772 | tc = dma_alloc_coherent(&ha->pdev->dev, EFT_SIZE, &tc_dma, | ||
| 773 | GFP_KERNEL); | ||
| 774 | if (!tc) { | ||
| 775 | qla_printk(KERN_WARNING, ha, "Unable to allocate " | ||
| 776 | "(%d KB) for EFT.\n", EFT_SIZE / 1024); | ||
| 777 | goto cont_alloc; | ||
| 778 | } | ||
| 779 | |||
| 780 | memset(tc, 0, EFT_SIZE); | ||
| 781 | rval = qla2x00_enable_eft_trace(ha, tc_dma, EFT_NUM_BUFFERS); | ||
| 782 | if (rval) { | ||
| 783 | qla_printk(KERN_WARNING, ha, "Unable to initialize " | ||
| 784 | "EFT (%d).\n", rval); | ||
| 785 | dma_free_coherent(&ha->pdev->dev, EFT_SIZE, tc, | ||
| 786 | tc_dma); | ||
| 787 | goto cont_alloc; | ||
| 788 | } | ||
| 789 | |||
| 790 | qla_printk(KERN_INFO, ha, "Allocated (%d KB) for EFT...\n", | ||
| 791 | EFT_SIZE / 1024); | ||
| 792 | |||
| 793 | eft_size = EFT_SIZE; | ||
| 794 | ha->eft_dma = tc_dma; | ||
| 795 | ha->eft = tc; | ||
| 796 | |||
| 797 | /* Allocate memory for Fibre Channel Event Buffer. */ | 771 | /* Allocate memory for Fibre Channel Event Buffer. */ |
| 798 | if (!IS_QLA25XX(ha)) | 772 | if (!IS_QLA25XX(ha)) |
| 799 | goto cont_alloc; | 773 | goto try_eft; |
| 800 | 774 | ||
| 801 | tc = dma_alloc_coherent(&ha->pdev->dev, FCE_SIZE, &tc_dma, | 775 | tc = dma_alloc_coherent(&ha->pdev->dev, FCE_SIZE, &tc_dma, |
| 802 | GFP_KERNEL); | 776 | GFP_KERNEL); |
| 803 | if (!tc) { | 777 | if (!tc) { |
| 804 | qla_printk(KERN_WARNING, ha, "Unable to allocate " | 778 | qla_printk(KERN_WARNING, ha, "Unable to allocate " |
| 805 | "(%d KB) for FCE.\n", FCE_SIZE / 1024); | 779 | "(%d KB) for FCE.\n", FCE_SIZE / 1024); |
| 806 | goto cont_alloc; | 780 | goto try_eft; |
| 807 | } | 781 | } |
| 808 | 782 | ||
| 809 | memset(tc, 0, FCE_SIZE); | 783 | memset(tc, 0, FCE_SIZE); |
| @@ -815,7 +789,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *ha) | |||
| 815 | dma_free_coherent(&ha->pdev->dev, FCE_SIZE, tc, | 789 | dma_free_coherent(&ha->pdev->dev, FCE_SIZE, tc, |
| 816 | tc_dma); | 790 | tc_dma); |
| 817 | ha->flags.fce_enabled = 0; | 791 | ha->flags.fce_enabled = 0; |
| 818 | goto cont_alloc; | 792 | goto try_eft; |
| 819 | } | 793 | } |
| 820 | 794 | ||
| 821 | qla_printk(KERN_INFO, ha, "Allocated (%d KB) for FCE...\n", | 795 | qla_printk(KERN_INFO, ha, "Allocated (%d KB) for FCE...\n", |
| @@ -825,6 +799,32 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *ha) | |||
| 825 | ha->flags.fce_enabled = 1; | 799 | ha->flags.fce_enabled = 1; |
| 826 | ha->fce_dma = tc_dma; | 800 | ha->fce_dma = tc_dma; |
| 827 | ha->fce = tc; | 801 | ha->fce = tc; |
| 802 | try_eft: | ||
| 803 | /* Allocate memory for Extended Trace Buffer. */ | ||
| 804 | tc = dma_alloc_coherent(&ha->pdev->dev, EFT_SIZE, &tc_dma, | ||
| 805 | GFP_KERNEL); | ||
| 806 | if (!tc) { | ||
| 807 | qla_printk(KERN_WARNING, ha, "Unable to allocate " | ||
| 808 | "(%d KB) for EFT.\n", EFT_SIZE / 1024); | ||
| 809 | goto cont_alloc; | ||
| 810 | } | ||
| 811 | |||
| 812 | memset(tc, 0, EFT_SIZE); | ||
| 813 | rval = qla2x00_enable_eft_trace(ha, tc_dma, EFT_NUM_BUFFERS); | ||
| 814 | if (rval) { | ||
| 815 | qla_printk(KERN_WARNING, ha, "Unable to initialize " | ||
| 816 | "EFT (%d).\n", rval); | ||
| 817 | dma_free_coherent(&ha->pdev->dev, EFT_SIZE, tc, | ||
| 818 | tc_dma); | ||
| 819 | goto cont_alloc; | ||
| 820 | } | ||
| 821 | |||
| 822 | qla_printk(KERN_INFO, ha, "Allocated (%d KB) for EFT...\n", | ||
| 823 | EFT_SIZE / 1024); | ||
| 824 | |||
| 825 | eft_size = EFT_SIZE; | ||
| 826 | ha->eft_dma = tc_dma; | ||
| 827 | ha->eft = tc; | ||
| 828 | } | 828 | } |
| 829 | cont_alloc: | 829 | cont_alloc: |
| 830 | req_q_size = ha->request_q_length * sizeof(request_t); | 830 | req_q_size = ha->request_q_length * sizeof(request_t); |
| @@ -3286,17 +3286,6 @@ qla2x00_abort_isp(scsi_qla_host_t *ha) | |||
| 3286 | ha->isp_abort_cnt = 0; | 3286 | ha->isp_abort_cnt = 0; |
| 3287 | clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags); | 3287 | clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags); |
| 3288 | 3288 | ||
| 3289 | if (ha->eft) { | ||
| 3290 | memset(ha->eft, 0, EFT_SIZE); | ||
| 3291 | rval = qla2x00_enable_eft_trace(ha, | ||
| 3292 | ha->eft_dma, EFT_NUM_BUFFERS); | ||
| 3293 | if (rval) { | ||
| 3294 | qla_printk(KERN_WARNING, ha, | ||
| 3295 | "Unable to reinitialize EFT " | ||
| 3296 | "(%d).\n", rval); | ||
| 3297 | } | ||
| 3298 | } | ||
| 3299 | |||
| 3300 | if (ha->fce) { | 3289 | if (ha->fce) { |
| 3301 | ha->flags.fce_enabled = 1; | 3290 | ha->flags.fce_enabled = 1; |
| 3302 | memset(ha->fce, 0, | 3291 | memset(ha->fce, 0, |
| @@ -3311,6 +3300,17 @@ qla2x00_abort_isp(scsi_qla_host_t *ha) | |||
| 3311 | ha->flags.fce_enabled = 0; | 3300 | ha->flags.fce_enabled = 0; |
| 3312 | } | 3301 | } |
| 3313 | } | 3302 | } |
| 3303 | |||
| 3304 | if (ha->eft) { | ||
| 3305 | memset(ha->eft, 0, EFT_SIZE); | ||
| 3306 | rval = qla2x00_enable_eft_trace(ha, | ||
| 3307 | ha->eft_dma, EFT_NUM_BUFFERS); | ||
| 3308 | if (rval) { | ||
| 3309 | qla_printk(KERN_WARNING, ha, | ||
| 3310 | "Unable to reinitialize EFT " | ||
| 3311 | "(%d).\n", rval); | ||
| 3312 | } | ||
| 3313 | } | ||
| 3314 | } else { /* failed the ISP abort */ | 3314 | } else { /* failed the ISP abort */ |
| 3315 | ha->flags.online = 1; | 3315 | ha->flags.online = 1; |
| 3316 | if (test_bit(ISP_ABORT_RETRY, &ha->dpc_flags)) { | 3316 | if (test_bit(ISP_ABORT_RETRY, &ha->dpc_flags)) { |
