All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: lpfc: fix block guard enablement on SLI3 adapters
@ 2018-11-12  8:58 Martin Wilck
  2018-11-16 11:00 ` Hannes Reinecke
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Martin Wilck @ 2018-11-12  8:58 UTC (permalink / raw)
  To: Martin K. Petersen, James Smart, James Smart, Dick Kennedy
  Cc: Hannes Reinecke, David Bond, linux-scsi, Martin Wilck, stable

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"
Tested-by: David Bond <dbond@suse.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Cc: stable@vger.kernel.org # 4.17.x
Cc: stable@vger.kernel.org # 4.18.x
Cc: stable@vger.kernel.org # 4.19.x
---
 drivers/scsi/lpfc/lpfc_init.c | 6 +++++-
 drivers/scsi/lpfc/lpfc_sli.c  | 1 -
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 323a32e..6b61cae 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -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);
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 783a154..b9e5cd7 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -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,
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: lpfc: fix block guard enablement on SLI3 adapters
  2018-11-12  8:58 [PATCH] scsi: lpfc: fix block guard enablement on SLI3 adapters Martin Wilck
@ 2018-11-16 11:00 ` Hannes Reinecke
  2018-11-22  3:28 ` Martin K. Petersen
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Hannes Reinecke @ 2018-11-16 11:00 UTC (permalink / raw)
  To: Martin Wilck, Martin K. Petersen, James Smart, James Smart, Dick Kennedy
  Cc: David Bond, linux-scsi, stable

On 11/12/18 9:58 AM, Martin Wilck wrote:
> 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"
> Tested-by: David Bond <dbond@suse.com>
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> Cc: stable@vger.kernel.org # 4.17.x
> Cc: stable@vger.kernel.org # 4.18.x
> Cc: stable@vger.kernel.org # 4.19.x
> ---
>   drivers/scsi/lpfc/lpfc_init.c | 6 +++++-
>   drivers/scsi/lpfc/lpfc_sli.c  | 1 -
>   2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> index 323a32e..6b61cae 100644
> --- a/drivers/scsi/lpfc/lpfc_init.c
> +++ b/drivers/scsi/lpfc/lpfc_init.c
> @@ -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);
> diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
> index 783a154..b9e5cd7 100644
> --- a/drivers/scsi/lpfc/lpfc_sli.c
> +++ b/drivers/scsi/lpfc/lpfc_sli.c
> @@ -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,
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: lpfc: fix block guard enablement on SLI3 adapters
  2018-11-12  8:58 [PATCH] scsi: lpfc: fix block guard enablement on SLI3 adapters Martin Wilck
  2018-11-16 11:00 ` Hannes Reinecke
@ 2018-11-22  3:28 ` Martin K. Petersen
  2018-11-27 17:12 ` James Smart
  2018-11-28 17:20 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2018-11-22  3:28 UTC (permalink / raw)
  To: James Smart
  Cc: Martin K. Petersen, Martin Wilck, James Smart, Dick Kennedy,
	Hannes Reinecke, David Bond, linux-scsi, stable


> 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!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: lpfc: fix block guard enablement on SLI3 adapters
  2018-11-12  8:58 [PATCH] scsi: lpfc: fix block guard enablement on SLI3 adapters Martin Wilck
  2018-11-16 11:00 ` Hannes Reinecke
  2018-11-22  3:28 ` Martin K. Petersen
@ 2018-11-27 17:12 ` James Smart
  2018-11-28 17:20 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: James Smart @ 2018-11-27 17:12 UTC (permalink / raw)
  To: Martin Wilck, Martin K. Petersen, James Smart, Dick Kennedy
  Cc: Hannes Reinecke, David Bond, linux-scsi, stable



On 11/12/2018 12:58 AM, Martin Wilck wrote:
> 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"
> Tested-by: David Bond <dbond@suse.com>
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> Cc: stable@vger.kernel.org # 4.17.x
> Cc: stable@vger.kernel.org # 4.18.x
> Cc: stable@vger.kernel.org # 4.19.x
> ---
>   drivers/scsi/lpfc/lpfc_init.c | 6 +++++-
>   drivers/scsi/lpfc/lpfc_sli.c  | 1 -
>   2 files changed, 5 insertions(+), 2 deletions(-)
>
>
thanks

Signed-off-by:  James Smart <jsmart2021@gmail.com>

-- james

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: lpfc: fix block guard enablement on SLI3 adapters
  2018-11-12  8:58 [PATCH] scsi: lpfc: fix block guard enablement on SLI3 adapters Martin Wilck
                   ` (2 preceding siblings ...)
  2018-11-27 17:12 ` James Smart
@ 2018-11-28 17:20 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2018-11-28 17:20 UTC (permalink / raw)
  To: Martin Wilck
  Cc: Martin K. Petersen, James Smart, James Smart, Dick Kennedy,
	Hannes Reinecke, David Bond, linux-scsi, stable


Martin,

> 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!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-11-29  4:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-12  8:58 [PATCH] scsi: lpfc: fix block guard enablement on SLI3 adapters Martin Wilck
2018-11-16 11:00 ` Hannes Reinecke
2018-11-22  3:28 ` Martin K. Petersen
2018-11-27 17:12 ` James Smart
2018-11-28 17:20 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.