Skip to contentSkip to conversation

scsi: lpfc: fix block guard enablement on SLI3 adapters

PATCH Applied Martin Wilck 4 participants 5 messages Nov 12, 2018 – Nov 28, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: lpfc: fix block guard enablement on SLI3 adapters

Since f44ac12f1dcc, 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 f44ac12f1dcc "scsi: lpfc: Memory allocation error during driver start-up on power8"
Cc [email protected] # 4.17.x
Cc [email protected] # 4.18.x
Cc [email protected] # 4.19.x
---
 drivers/scsi/lpfc/lpfc_init.c | 6 +++++-
 drivers/scsi/lpfc/lpfc_sli.c  | 1 -
 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/scsi/lpfc/lpfc_init.c +5 -1
index 323a32e..6b61cae 100644
@@ -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);
drivers/scsi/lpfc/lpfc_sli.c +0 -1
index 783a154..b9e5cd7 100644
@@ -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,
Signature · 1 line
2.19.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 40 lines · Martin Wilck

Since f44ac12f1dcc, 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 f44ac12f1dcc "scsi: lpfc: Memory allocation error during driver start-up on power8"
Cc [email protected] # 4.17.x
Cc [email protected] # 4.18.x
Cc [email protected] # 4.19.x
---
  drivers/scsi/lpfc/lpfc_init.c | 6 +++++-
  drivers/scsi/lpfc/lpfc_sli.c  | 1 -
  2 files changed, 5 insertions(+), 2 deletions(-)
drivers/scsi/lpfc/lpfc_init.c +5 -1
index 323a32e..6b61cae 100644
@@ -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);
drivers/scsi/lpfc/lpfc_sli.c +0 -0
index 783a154..b9e5cd7 100644

drivers/scsi/lpfc/lpfc_sli.c lpfc_sli_config_port(struct lpfc_hba *phba, int sli_mode) · line 4970

Quoted 7 lines
drivers/scsi/lpfc/lpfc_sli.c +0 -1
@@ -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,

Cheers,

Hannes

Signature · 5 lines
Dr. Hannes Reinecke		   Teamlead Storage & Networking
[email protected]			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
#2 lore raw
In reply to Martin Wilck
Quoted 5 lines

Since f44ac12f1dcc, 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.

James, please review.

Thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#3 lore raw
In reply to Martin Wilck
Quoted 12 lines · Martin Wilck

Since f44ac12f1dcc, 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 f44ac12f1dcc "scsi: lpfc: Memory allocation error during driver start-up on power8"
Cc [email protected] # 4.17.x
Cc [email protected] # 4.18.x
Cc [email protected] # 4.19.x
Quoted 6 lines
---
  drivers/scsi/lpfc/lpfc_init.c | 6 +++++-
  drivers/scsi/lpfc/lpfc_sli.c  | 1 -
  2 files changed, 5 insertions(+), 2 deletions(-)

thanks

-- james

#4 lore raw
In reply to Martin Wilck

Martin,

Quoted 4 lines

Since f44ac12f1dcc, 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.

Applied to 4.20/scsi-fixes, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering