Skip to content

Commit

Permalink
scsi: lpfc: fix block guard enablement on SLI3 adapters
Browse files Browse the repository at this point in the history
Since f44ac12, BG enablement is tracked with the LPFC_SLI3_BG_ENABLED
bit, which is set in lpfc_get_cfgparam before lpfc_sli_config_sli_port() is
called. The bit shouldn't be cleared before checking the feature.  Based on
problem analysis by David Bond.

Fixes: f44ac12 "scsi: lpfc: Memory allocation error during driver start-up on power8"
Tested-by: David Bond <[email protected]>
Signed-off-by: Martin Wilck <[email protected]>
Cc: [email protected] # 4.17.x
Cc: [email protected] # 4.18.x
Cc: [email protected] # 4.19.x
Reviewed-by: Hannes Reinecke <[email protected]>
Acked-by: James Smart <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
mwilck authored and martinkpetersen committed Nov 28, 2018
1 parent 8e4829c commit dfb7513
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion drivers/scsi/lpfc/lpfc_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
sizeof(phba->wwpn));
}

phba->sli3_options = 0x0;
/*
* Clear all option bits except LPFC_SLI3_BG_ENABLED,
* which was already set in lpfc_get_cfgparam()
*/
phba->sli3_options &= (uint32_t)LPFC_SLI3_BG_ENABLED;

/* Setup and issue mailbox READ REV command */
lpfc_read_rev(phba, pmb);
Expand Down
1 change: 0 additions & 1 deletion drivers/scsi/lpfc/lpfc_sli.c
Original file line number Diff line number Diff line change
Expand Up @@ -4965,7 +4965,6 @@ lpfc_sli_config_port(struct lpfc_hba *phba, int sli_mode)
phba->sli3_options &= ~(LPFC_SLI3_NPIV_ENABLED |
LPFC_SLI3_HBQ_ENABLED |
LPFC_SLI3_CRP_ENABLED |
LPFC_SLI3_BG_ENABLED |
LPFC_SLI3_DSS_ENABLED);
if (rc != MBX_SUCCESS) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
Expand Down

0 comments on commit dfb7513

Please sign in to comment.