diff mbox

[11/19] lpfc: Fix issue_lip if link is disabled

Message ID 20180124224548.9530-12-jsmart2021@gmail.com (mailing list archive)
State Superseded
Headers show

Commit Message

James Smart Jan. 24, 2018, 10:45 p.m. UTC
The driver ignored checks on whether the link should be
kept administratively down after a link bounce. Correct the
checks.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
---
 drivers/scsi/lpfc/lpfc_attr.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Hannes Reinecke Jan. 29, 2018, 8:13 a.m. UTC | #1
On 01/24/2018 11:45 PM, James Smart wrote:
> The driver ignored checks on whether the link should be
> kept administratively down after a link bounce. Correct the
> checks.
> 
> Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
> Signed-off-by: James Smart <james.smart@broadcom.com>
> ---
>  drivers/scsi/lpfc/lpfc_attr.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
> index d8064e3ea0ba..b79dad7b8278 100644
> --- a/drivers/scsi/lpfc/lpfc_attr.c
> +++ b/drivers/scsi/lpfc/lpfc_attr.c
> @@ -911,7 +911,12 @@ lpfc_issue_lip(struct Scsi_Host *shost)
>  	LPFC_MBOXQ_t *pmboxq;
>  	int mbxstatus = MBXERR_ERROR;
>  
> +	/*
> +	 * If the link is offline, disabled or BLOCK_MGMT_IO
> +	 * it doesn't make any sense to allow issue_lip
> +	 */
>  	if ((vport->fc_flag & FC_OFFLINE_MODE) ||
> +	    (phba->hba_flag & LINK_DISABLED) ||
>  	    (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO))
>  		return -EPERM;
>  
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
diff mbox

Patch

diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index d8064e3ea0ba..b79dad7b8278 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -911,7 +911,12 @@  lpfc_issue_lip(struct Scsi_Host *shost)
 	LPFC_MBOXQ_t *pmboxq;
 	int mbxstatus = MBXERR_ERROR;
 
+	/*
+	 * If the link is offline, disabled or BLOCK_MGMT_IO
+	 * it doesn't make any sense to allow issue_lip
+	 */
 	if ((vport->fc_flag & FC_OFFLINE_MODE) ||
+	    (phba->hba_flag & LINK_DISABLED) ||
 	    (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO))
 		return -EPERM;