diff options
author | James Smart <james.smart@emulex.com> | 2011-10-10 21:32:10 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-10-16 12:28:48 -0400 |
commit | 73d91e503a60bd164b636258ae9f558b72010602 (patch) | |
tree | dc319fbf3cb55fc8d011720d5c13f1b814ae8539 /drivers/scsi/lpfc/lpfc_init.c | |
parent | 8d6f5cea12e5eebdaca94b3a3a4bd4f12e83d85d (diff) |
[SCSI] lpfc 8.3.27: Miscellanous logic and interface fixes
Miscellanous logic and interface fixes
- Fix lpfc_init_vfi_cmpl to check the interface type for interface type 0
before parsing the results.
- Cast uint32_t values that are multiplied to uint64_t before the
multiplication.
- Instead of "break" statement when PCI read returned error, use the goto
statement to the end of the routine after setting return value
- moved the msleep(10) to the beginning of the wait loop for checking the
SLIPort_Status register
- Added the code to follow the existing wait for SLIPort_Status register RDY,
ERR, and RN bits to be set by the port before proceeding to perform PCI
function reset.
- Do not override ulpCt_h and ulpCt_l for SLI 4 ports.
- For vport delete, call lpfc_nlp_put when the vport's vpi state is not
marked with VPI_REGISTERED.
- Added missed fields into the driver's Controller Attributes Structure
- Changed ringing EQ/CQ/RQ doorbell register to be dependent on the size
of the queue.
- Return -EACCES in issue_reset if cfg_enable_hba_reset is zero.
- Added new logging flag LOG_FCP_UNDER 0x00040000 to qualify underrun logging.
- Add a check in the fabric name display routine to display 0 if the port
state is <= FLOGI.
- Add a check to the switch statement in lpfc_decode_firmware_rev to check
for an 'X'.
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index d8ac7694854e..bdb8f2da27cc 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -1438,6 +1438,7 @@ lpfc_handle_eratt_s4(struct lpfc_hba *phba) | |||
1438 | struct Scsi_Host *shost; | 1438 | struct Scsi_Host *shost; |
1439 | uint32_t if_type; | 1439 | uint32_t if_type; |
1440 | struct lpfc_register portstat_reg; | 1440 | struct lpfc_register portstat_reg; |
1441 | int rc; | ||
1441 | 1442 | ||
1442 | /* If the pci channel is offline, ignore possible errors, since | 1443 | /* If the pci channel is offline, ignore possible errors, since |
1443 | * we cannot communicate with the pci card anyway. | 1444 | * we cannot communicate with the pci card anyway. |
@@ -1480,7 +1481,12 @@ lpfc_handle_eratt_s4(struct lpfc_hba *phba) | |||
1480 | lpfc_sli4_offline_eratt(phba); | 1481 | lpfc_sli4_offline_eratt(phba); |
1481 | return; | 1482 | return; |
1482 | } | 1483 | } |
1483 | if (bf_get(lpfc_sliport_status_rn, &portstat_reg)) { | 1484 | /* |
1485 | * On error status condition, driver need to wait for port | ||
1486 | * ready before performing reset. | ||
1487 | */ | ||
1488 | rc = lpfc_sli4_pdev_status_reg_wait(phba); | ||
1489 | if (!rc) { | ||
1484 | /* need reset: attempt for port recovery */ | 1490 | /* need reset: attempt for port recovery */ |
1485 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, | 1491 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
1486 | "2887 Port Error: Attempting " | 1492 | "2887 Port Error: Attempting " |
@@ -6725,6 +6731,10 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) | |||
6725 | "0540 Receive Queue not allocated\n"); | 6731 | "0540 Receive Queue not allocated\n"); |
6726 | goto out_destroy_fcp_wq; | 6732 | goto out_destroy_fcp_wq; |
6727 | } | 6733 | } |
6734 | |||
6735 | lpfc_rq_adjust_repost(phba, phba->sli4_hba.hdr_rq, LPFC_ELS_HBQ); | ||
6736 | lpfc_rq_adjust_repost(phba, phba->sli4_hba.dat_rq, LPFC_ELS_HBQ); | ||
6737 | |||
6728 | rc = lpfc_rq_create(phba, phba->sli4_hba.hdr_rq, phba->sli4_hba.dat_rq, | 6738 | rc = lpfc_rq_create(phba, phba->sli4_hba.hdr_rq, phba->sli4_hba.dat_rq, |
6729 | phba->sli4_hba.els_cq, LPFC_USOL); | 6739 | phba->sli4_hba.els_cq, LPFC_USOL); |
6730 | if (rc) { | 6740 | if (rc) { |
@@ -6733,6 +6743,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) | |||
6733 | "rc = 0x%x\n", rc); | 6743 | "rc = 0x%x\n", rc); |
6734 | goto out_destroy_fcp_wq; | 6744 | goto out_destroy_fcp_wq; |
6735 | } | 6745 | } |
6746 | |||
6736 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, | 6747 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, |
6737 | "2592 USL RQ setup: hdr-rq-id=%d, dat-rq-id=%d " | 6748 | "2592 USL RQ setup: hdr-rq-id=%d, dat-rq-id=%d " |
6738 | "parent cq-id=%d\n", | 6749 | "parent cq-id=%d\n", |
@@ -7042,10 +7053,11 @@ lpfc_pci_function_reset(struct lpfc_hba *phba) | |||
7042 | * the loop again. | 7053 | * the loop again. |
7043 | */ | 7054 | */ |
7044 | for (rdy_chk = 0; rdy_chk < 1000; rdy_chk++) { | 7055 | for (rdy_chk = 0; rdy_chk < 1000; rdy_chk++) { |
7056 | msleep(10); | ||
7045 | if (lpfc_readl(phba->sli4_hba.u.if_type2. | 7057 | if (lpfc_readl(phba->sli4_hba.u.if_type2. |
7046 | STATUSregaddr, ®_data.word0)) { | 7058 | STATUSregaddr, ®_data.word0)) { |
7047 | rc = -ENODEV; | 7059 | rc = -ENODEV; |
7048 | break; | 7060 | goto out; |
7049 | } | 7061 | } |
7050 | if (bf_get(lpfc_sliport_status_rdy, ®_data)) | 7062 | if (bf_get(lpfc_sliport_status_rdy, ®_data)) |
7051 | break; | 7063 | break; |
@@ -7053,7 +7065,6 @@ lpfc_pci_function_reset(struct lpfc_hba *phba) | |||
7053 | reset_again++; | 7065 | reset_again++; |
7054 | break; | 7066 | break; |
7055 | } | 7067 | } |
7056 | msleep(10); | ||
7057 | } | 7068 | } |
7058 | 7069 | ||
7059 | /* | 7070 | /* |
@@ -7067,11 +7078,6 @@ lpfc_pci_function_reset(struct lpfc_hba *phba) | |||
7067 | } | 7078 | } |
7068 | 7079 | ||
7069 | /* Detect any port errors. */ | 7080 | /* Detect any port errors. */ |
7070 | if (lpfc_readl(phba->sli4_hba.u.if_type2.STATUSregaddr, | ||
7071 | ®_data.word0)) { | ||
7072 | rc = -ENODEV; | ||
7073 | break; | ||
7074 | } | ||
7075 | if ((bf_get(lpfc_sliport_status_err, ®_data)) || | 7081 | if ((bf_get(lpfc_sliport_status_err, ®_data)) || |
7076 | (rdy_chk >= 1000)) { | 7082 | (rdy_chk >= 1000)) { |
7077 | phba->work_status[0] = readl( | 7083 | phba->work_status[0] = readl( |
@@ -7104,6 +7110,7 @@ lpfc_pci_function_reset(struct lpfc_hba *phba) | |||
7104 | break; | 7110 | break; |
7105 | } | 7111 | } |
7106 | 7112 | ||
7113 | out: | ||
7107 | /* Catch the not-ready port failure after a port reset. */ | 7114 | /* Catch the not-ready port failure after a port reset. */ |
7108 | if (num_resets >= MAX_IF_TYPE_2_RESETS) | 7115 | if (num_resets >= MAX_IF_TYPE_2_RESETS) |
7109 | rc = -ENODEV; | 7116 | rc = -ENODEV; |