diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index b38f99f3be32..9598fdcb08ab 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************* | 1 | /******************************************************************* |
2 | * This file is part of the Emulex Linux Device Driver for * | 2 | * This file is part of the Emulex Linux Device Driver for * |
3 | * Fibre Channel Host Bus Adapters. * | 3 | * Fibre Channel Host Bus Adapters. * |
4 | * Copyright (C) 2004-2011 Emulex. All rights reserved. * | 4 | * Copyright (C) 2004-2012 Emulex. All rights reserved. * |
5 | * EMULEX and SLI are trademarks of Emulex. * | 5 | * EMULEX and SLI are trademarks of Emulex. * |
6 | * www.emulex.com * | 6 | * www.emulex.com * |
7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * | 7 | * Portions Copyright (C) 2004-2005 Christoph Hellwig * |
@@ -2704,16 +2704,14 @@ lpfc_offline_prep(struct lpfc_hba * phba) | |||
2704 | } | 2704 | } |
2705 | spin_lock_irq(shost->host_lock); | 2705 | spin_lock_irq(shost->host_lock); |
2706 | ndlp->nlp_flag &= ~NLP_NPR_ADISC; | 2706 | ndlp->nlp_flag &= ~NLP_NPR_ADISC; |
2707 | 2707 | spin_unlock_irq(shost->host_lock); | |
2708 | /* | 2708 | /* |
2709 | * Whenever an SLI4 port goes offline, free the | 2709 | * Whenever an SLI4 port goes offline, free the |
2710 | * RPI. A new RPI when the adapter port comes | 2710 | * RPI. Get a new RPI when the adapter port |
2711 | * back online. | 2711 | * comes back online. |
2712 | */ | 2712 | */ |
2713 | if (phba->sli_rev == LPFC_SLI_REV4) | 2713 | if (phba->sli_rev == LPFC_SLI_REV4) |
2714 | lpfc_sli4_free_rpi(phba, ndlp->nlp_rpi); | 2714 | lpfc_sli4_free_rpi(phba, ndlp->nlp_rpi); |
2715 | |||
2716 | spin_unlock_irq(shost->host_lock); | ||
2717 | lpfc_unreg_rpi(vports[i], ndlp); | 2715 | lpfc_unreg_rpi(vports[i], ndlp); |
2718 | } | 2716 | } |
2719 | } | 2717 | } |
@@ -2786,9 +2784,13 @@ lpfc_scsi_buf_update(struct lpfc_hba *phba) | |||
2786 | 2784 | ||
2787 | spin_lock_irq(&phba->hbalock); | 2785 | spin_lock_irq(&phba->hbalock); |
2788 | spin_lock(&phba->scsi_buf_list_lock); | 2786 | spin_lock(&phba->scsi_buf_list_lock); |
2789 | list_for_each_entry_safe(sb, sb_next, &phba->lpfc_scsi_buf_list, list) | 2787 | list_for_each_entry_safe(sb, sb_next, &phba->lpfc_scsi_buf_list, list) { |
2790 | sb->cur_iocbq.sli4_xritag = | 2788 | sb->cur_iocbq.sli4_xritag = |
2791 | phba->sli4_hba.xri_ids[sb->cur_iocbq.sli4_lxritag]; | 2789 | phba->sli4_hba.xri_ids[sb->cur_iocbq.sli4_lxritag]; |
2790 | set_bit(sb->cur_iocbq.sli4_lxritag, phba->sli4_hba.xri_bmask); | ||
2791 | phba->sli4_hba.max_cfg_param.xri_used++; | ||
2792 | phba->sli4_hba.xri_count++; | ||
2793 | } | ||
2792 | spin_unlock(&phba->scsi_buf_list_lock); | 2794 | spin_unlock(&phba->scsi_buf_list_lock); |
2793 | spin_unlock_irq(&phba->hbalock); | 2795 | spin_unlock_irq(&phba->hbalock); |
2794 | return 0; | 2796 | return 0; |
@@ -3723,6 +3725,7 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba *phba, | |||
3723 | break; | 3725 | break; |
3724 | 3726 | ||
3725 | case LPFC_FIP_EVENT_TYPE_FCF_DEAD: | 3727 | case LPFC_FIP_EVENT_TYPE_FCF_DEAD: |
3728 | phba->fcoe_cvl_eventtag = acqe_fip->event_tag; | ||
3726 | lpfc_printf_log(phba, KERN_ERR, LOG_FIP | LOG_DISCOVERY, | 3729 | lpfc_printf_log(phba, KERN_ERR, LOG_FIP | LOG_DISCOVERY, |
3727 | "2549 FCF (x%x) disconnected from network, " | 3730 | "2549 FCF (x%x) disconnected from network, " |
3728 | "tag:x%x\n", acqe_fip->index, acqe_fip->event_tag); | 3731 | "tag:x%x\n", acqe_fip->index, acqe_fip->event_tag); |
@@ -3784,6 +3787,7 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba *phba, | |||
3784 | } | 3787 | } |
3785 | break; | 3788 | break; |
3786 | case LPFC_FIP_EVENT_TYPE_CVL: | 3789 | case LPFC_FIP_EVENT_TYPE_CVL: |
3790 | phba->fcoe_cvl_eventtag = acqe_fip->event_tag; | ||
3787 | lpfc_printf_log(phba, KERN_ERR, LOG_FIP | LOG_DISCOVERY, | 3791 | lpfc_printf_log(phba, KERN_ERR, LOG_FIP | LOG_DISCOVERY, |
3788 | "2718 Clear Virtual Link Received for VPI 0x%x" | 3792 | "2718 Clear Virtual Link Received for VPI 0x%x" |
3789 | " tag 0x%x\n", acqe_fip->index, acqe_fip->event_tag); | 3793 | " tag 0x%x\n", acqe_fip->index, acqe_fip->event_tag); |
@@ -5226,8 +5230,7 @@ lpfc_sli4_create_rpi_hdr(struct lpfc_hba *phba) | |||
5226 | * rpi is normalized to a zero base because the physical rpi is | 5230 | * rpi is normalized to a zero base because the physical rpi is |
5227 | * port based. | 5231 | * port based. |
5228 | */ | 5232 | */ |
5229 | curr_rpi_range = phba->sli4_hba.next_rpi - | 5233 | curr_rpi_range = phba->sli4_hba.next_rpi; |
5230 | phba->sli4_hba.max_cfg_param.rpi_base; | ||
5231 | spin_unlock_irq(&phba->hbalock); | 5234 | spin_unlock_irq(&phba->hbalock); |
5232 | 5235 | ||
5233 | /* | 5236 | /* |
@@ -5818,10 +5821,9 @@ lpfc_sli4_post_status_check(struct lpfc_hba *phba) | |||
5818 | readl(phba->sli4_hba.u.if_type2. | 5821 | readl(phba->sli4_hba.u.if_type2. |
5819 | ERR2regaddr); | 5822 | ERR2regaddr); |
5820 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, | 5823 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
5821 | "2888 Port Error Detected " | 5824 | "2888 Unrecoverable port error " |
5822 | "during POST: " | 5825 | "following POST: port status reg " |
5823 | "port status reg 0x%x, " | 5826 | "0x%x, port_smphr reg 0x%x, " |
5824 | "port_smphr reg 0x%x, " | ||
5825 | "error 1=0x%x, error 2=0x%x\n", | 5827 | "error 1=0x%x, error 2=0x%x\n", |
5826 | reg_data.word0, | 5828 | reg_data.word0, |
5827 | portsmphr_reg.word0, | 5829 | portsmphr_reg.word0, |
@@ -6142,7 +6144,6 @@ lpfc_sli4_read_config(struct lpfc_hba *phba) | |||
6142 | phba->sli4_hba.next_xri = phba->sli4_hba.max_cfg_param.xri_base; | 6144 | phba->sli4_hba.next_xri = phba->sli4_hba.max_cfg_param.xri_base; |
6143 | phba->vpi_base = phba->sli4_hba.max_cfg_param.vpi_base; | 6145 | phba->vpi_base = phba->sli4_hba.max_cfg_param.vpi_base; |
6144 | phba->vfi_base = phba->sli4_hba.max_cfg_param.vfi_base; | 6146 | phba->vfi_base = phba->sli4_hba.max_cfg_param.vfi_base; |
6145 | phba->sli4_hba.next_rpi = phba->sli4_hba.max_cfg_param.rpi_base; | ||
6146 | phba->max_vpi = (phba->sli4_hba.max_cfg_param.max_vpi > 0) ? | 6147 | phba->max_vpi = (phba->sli4_hba.max_cfg_param.max_vpi > 0) ? |
6147 | (phba->sli4_hba.max_cfg_param.max_vpi - 1) : 0; | 6148 | (phba->sli4_hba.max_cfg_param.max_vpi - 1) : 0; |
6148 | phba->max_vports = phba->max_vpi; | 6149 | phba->max_vports = phba->max_vpi; |
@@ -7231,6 +7232,7 @@ lpfc_pci_function_reset(struct lpfc_hba *phba) | |||
7231 | uint32_t rdy_chk, num_resets = 0, reset_again = 0; | 7232 | uint32_t rdy_chk, num_resets = 0, reset_again = 0; |
7232 | union lpfc_sli4_cfg_shdr *shdr; | 7233 | union lpfc_sli4_cfg_shdr *shdr; |
7233 | struct lpfc_register reg_data; | 7234 | struct lpfc_register reg_data; |
7235 | uint16_t devid; | ||
7234 | 7236 | ||
7235 | if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf); | 7237 | if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf); |
7236 | switch (if_type) { | 7238 | switch (if_type) { |
@@ -7277,7 +7279,9 @@ lpfc_pci_function_reset(struct lpfc_hba *phba) | |||
7277 | LPFC_SLIPORT_INIT_PORT); | 7279 | LPFC_SLIPORT_INIT_PORT); |
7278 | writel(reg_data.word0, phba->sli4_hba.u.if_type2. | 7280 | writel(reg_data.word0, phba->sli4_hba.u.if_type2. |
7279 | CTRLregaddr); | 7281 | CTRLregaddr); |
7280 | 7282 | /* flush */ | |
7283 | pci_read_config_word(phba->pcidev, | ||
7284 | PCI_DEVICE_ID, &devid); | ||
7281 | /* | 7285 | /* |
7282 | * Poll the Port Status Register and wait for RDY for | 7286 | * Poll the Port Status Register and wait for RDY for |
7283 | * up to 10 seconds. If the port doesn't respond, treat | 7287 | * up to 10 seconds. If the port doesn't respond, treat |
@@ -7315,11 +7319,10 @@ lpfc_pci_function_reset(struct lpfc_hba *phba) | |||
7315 | phba->work_status[1] = readl( | 7319 | phba->work_status[1] = readl( |
7316 | phba->sli4_hba.u.if_type2.ERR2regaddr); | 7320 | phba->sli4_hba.u.if_type2.ERR2regaddr); |
7317 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, | 7321 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
7318 | "2890 Port Error Detected " | 7322 | "2890 Port error detected during port " |
7319 | "during Port Reset: " | 7323 | "reset(%d): port status reg 0x%x, " |
7320 | "port status reg 0x%x, " | ||
7321 | "error 1=0x%x, error 2=0x%x\n", | 7324 | "error 1=0x%x, error 2=0x%x\n", |
7322 | reg_data.word0, | 7325 | num_resets, reg_data.word0, |
7323 | phba->work_status[0], | 7326 | phba->work_status[0], |
7324 | phba->work_status[1]); | 7327 | phba->work_status[1]); |
7325 | rc = -ENODEV; | 7328 | rc = -ENODEV; |