diff options
-rw-r--r-- | drivers/scsi/lpfc/lpfc_crtn.h | 1 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 7 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 19 |
3 files changed, 20 insertions, 7 deletions
diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h index 944b32ca4931..1c55408ac718 100644 --- a/drivers/scsi/lpfc/lpfc_crtn.h +++ b/drivers/scsi/lpfc/lpfc_crtn.h | |||
@@ -294,6 +294,7 @@ int lpfc_selective_reset(struct lpfc_hba *); | |||
294 | void lpfc_reset_barrier(struct lpfc_hba *); | 294 | void lpfc_reset_barrier(struct lpfc_hba *); |
295 | int lpfc_sli_brdready(struct lpfc_hba *, uint32_t); | 295 | int lpfc_sli_brdready(struct lpfc_hba *, uint32_t); |
296 | int lpfc_sli_brdkill(struct lpfc_hba *); | 296 | int lpfc_sli_brdkill(struct lpfc_hba *); |
297 | int lpfc_sli_chipset_init(struct lpfc_hba *phba); | ||
297 | int lpfc_sli_brdreset(struct lpfc_hba *); | 298 | int lpfc_sli_brdreset(struct lpfc_hba *); |
298 | int lpfc_sli_brdrestart(struct lpfc_hba *); | 299 | int lpfc_sli_brdrestart(struct lpfc_hba *); |
299 | int lpfc_sli_hba_setup(struct lpfc_hba *); | 300 | int lpfc_sli_hba_setup(struct lpfc_hba *); |
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 90ae354a9c45..e85f273e34ac 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -3602,6 +3602,13 @@ lpfc_get_wwpn(struct lpfc_hba *phba) | |||
3602 | LPFC_MBOXQ_t *mboxq; | 3602 | LPFC_MBOXQ_t *mboxq; |
3603 | MAILBOX_t *mb; | 3603 | MAILBOX_t *mb; |
3604 | 3604 | ||
3605 | if (phba->sli_rev < LPFC_SLI_REV4) { | ||
3606 | /* Reset the port first */ | ||
3607 | lpfc_sli_brdrestart(phba); | ||
3608 | rc = lpfc_sli_chipset_init(phba); | ||
3609 | if (rc) | ||
3610 | return (uint64_t)-1; | ||
3611 | } | ||
3605 | 3612 | ||
3606 | mboxq = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, | 3613 | mboxq = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, |
3607 | GFP_KERNEL); | 3614 | GFP_KERNEL); |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index cf19f4976f5f..2a4fc00dfa9b 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -4204,13 +4204,16 @@ lpfc_sli_brdreset(struct lpfc_hba *phba) | |||
4204 | /* Reset HBA */ | 4204 | /* Reset HBA */ |
4205 | lpfc_printf_log(phba, KERN_INFO, LOG_SLI, | 4205 | lpfc_printf_log(phba, KERN_INFO, LOG_SLI, |
4206 | "0325 Reset HBA Data: x%x x%x\n", | 4206 | "0325 Reset HBA Data: x%x x%x\n", |
4207 | phba->pport->port_state, psli->sli_flag); | 4207 | (phba->pport) ? phba->pport->port_state : 0, |
4208 | psli->sli_flag); | ||
4208 | 4209 | ||
4209 | /* perform board reset */ | 4210 | /* perform board reset */ |
4210 | phba->fc_eventTag = 0; | 4211 | phba->fc_eventTag = 0; |
4211 | phba->link_events = 0; | 4212 | phba->link_events = 0; |
4212 | phba->pport->fc_myDID = 0; | 4213 | if (phba->pport) { |
4213 | phba->pport->fc_prevDID = 0; | 4214 | phba->pport->fc_myDID = 0; |
4215 | phba->pport->fc_prevDID = 0; | ||
4216 | } | ||
4214 | 4217 | ||
4215 | /* Turn off parity checking and serr during the physical reset */ | 4218 | /* Turn off parity checking and serr during the physical reset */ |
4216 | pci_read_config_word(phba->pcidev, PCI_COMMAND, &cfg_value); | 4219 | pci_read_config_word(phba->pcidev, PCI_COMMAND, &cfg_value); |
@@ -4336,7 +4339,8 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba) | |||
4336 | /* Restart HBA */ | 4339 | /* Restart HBA */ |
4337 | lpfc_printf_log(phba, KERN_INFO, LOG_SLI, | 4340 | lpfc_printf_log(phba, KERN_INFO, LOG_SLI, |
4338 | "0337 Restart HBA Data: x%x x%x\n", | 4341 | "0337 Restart HBA Data: x%x x%x\n", |
4339 | phba->pport->port_state, psli->sli_flag); | 4342 | (phba->pport) ? phba->pport->port_state : 0, |
4343 | psli->sli_flag); | ||
4340 | 4344 | ||
4341 | word0 = 0; | 4345 | word0 = 0; |
4342 | mb = (MAILBOX_t *) &word0; | 4346 | mb = (MAILBOX_t *) &word0; |
@@ -4350,7 +4354,7 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba) | |||
4350 | readl(to_slim); /* flush */ | 4354 | readl(to_slim); /* flush */ |
4351 | 4355 | ||
4352 | /* Only skip post after fc_ffinit is completed */ | 4356 | /* Only skip post after fc_ffinit is completed */ |
4353 | if (phba->pport->port_state) | 4357 | if (phba->pport && phba->pport->port_state) |
4354 | word0 = 1; /* This is really setting up word1 */ | 4358 | word0 = 1; /* This is really setting up word1 */ |
4355 | else | 4359 | else |
4356 | word0 = 0; /* This is really setting up word1 */ | 4360 | word0 = 0; /* This is really setting up word1 */ |
@@ -4359,7 +4363,8 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba) | |||
4359 | readl(to_slim); /* flush */ | 4363 | readl(to_slim); /* flush */ |
4360 | 4364 | ||
4361 | lpfc_sli_brdreset(phba); | 4365 | lpfc_sli_brdreset(phba); |
4362 | phba->pport->stopped = 0; | 4366 | if (phba->pport) |
4367 | phba->pport->stopped = 0; | ||
4363 | phba->link_state = LPFC_INIT_START; | 4368 | phba->link_state = LPFC_INIT_START; |
4364 | phba->hba_flag = 0; | 4369 | phba->hba_flag = 0; |
4365 | spin_unlock_irq(&phba->hbalock); | 4370 | spin_unlock_irq(&phba->hbalock); |
@@ -4446,7 +4451,7 @@ lpfc_sli_brdrestart(struct lpfc_hba *phba) | |||
4446 | * iteration, the function will restart the HBA again. The function returns | 4451 | * iteration, the function will restart the HBA again. The function returns |
4447 | * zero if HBA successfully restarted else returns negative error code. | 4452 | * zero if HBA successfully restarted else returns negative error code. |
4448 | **/ | 4453 | **/ |
4449 | static int | 4454 | int |
4450 | lpfc_sli_chipset_init(struct lpfc_hba *phba) | 4455 | lpfc_sli_chipset_init(struct lpfc_hba *phba) |
4451 | { | 4456 | { |
4452 | uint32_t status, i = 0; | 4457 | uint32_t status, i = 0; |