Received: by 10.213.65.68 with SMTP id h4csp448471imn; Tue, 13 Mar 2018 09:22:12 -0700 (PDT) X-Google-Smtp-Source: AG47ELspLfJ1RZXkMZ+lEK0vp90W6Xkv0b58kGvxsMTCg3B1z1/zehUgc+r8SQx/qc8wNUW+W5eQ X-Received: by 10.98.214.218 with SMTP id a87mr1177978pfl.146.1520958132801; Tue, 13 Mar 2018 09:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520958132; cv=none; d=google.com; s=arc-20160816; b=dOl7KAPQgD6/jX3zJyMilCzj6oRfMc31v/5xqchAyy9V0eFMB3xiB4NQdiUdPG+weA 0hN4ZUj8+SQQT9/yLOU4i0rsvzqsLexlFtUJXDwSQA+++76AKJu32t6uaaQfAdVh5pNN hOTN6+TU2WXa9P9ebfAhpaNGdWAgDBBD7eUYcrWwIEZxegriOtbeQ5m09m7A3HQPhuni aVISMnmcF6VMWX3MRTpldMhvYHpEWJSiK0fjNd7rLFnb+/x2UcGTwY8vY3CxQm49wWi8 NiPQJqPQFZIrSNxCK0tfzcLvMX/5HeY0q5I3w3zI9Kr1dd9xjjIfJJS53UTwu+IWZymA 0Esg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=EhvJ5ljlER/7WKvTQRo8Oc0EN84SObeZDaJfoZXDpCs=; b=zX3+tsYSXipPsw63dW8VN4ltbh8RDcpZ0HXMawl6BxI55qV4UtqrFYWAugqfVmITPv 9ONHvnK/Pap6TUkBxD4JU9nnflqUNwrt+UQ8dFPq/fFHiTlqTK+Q2D1/GlmzFs172BQD F371gdRDJ69wQxkY0yf/+TvQyVPu2K3qcnFw28Lionj2GPMCyBJGHbKFC65ev5ykj8dZ Iy7F8a0/U0n21I+5XpmcLEJuwGnU4N6iIMXeez/CG6x8OBt7S15dPq9TYNc4/tgOTKJ/ 6tdb7y8DLSDRBSjTM41lDBParcZAHeKdF8LN9JFwfrjJScBRkhZLKBrn1744XQ2zlU0v HBUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e13si339033pff.8.2018.03.13.09.21.38; Tue, 13 Mar 2018 09:22:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933826AbeCMPeo (ORCPT + 99 others); Tue, 13 Mar 2018 11:34:44 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:32878 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933814AbeCMPel (ORCPT ); Tue, 13 Mar 2018 11:34:41 -0400 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 71E521079; Tue, 13 Mar 2018 15:34:40 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Quinn Tran , Himanshu Madhani , Hannes Reinecke , "Martin K. Petersen" Subject: [PATCH 4.15 131/146] scsi: qla2xxx: Fix login state machine stuck at GPDB Date: Tue, 13 Mar 2018 16:24:58 +0100 Message-Id: <20180313152330.273657910@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152320.439085687@linuxfoundation.org> References: <20180313152320.439085687@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Quinn Tran commit 414d9ff3f8039f85d23f619dcbbd1ba2628a1a67 upstream. This patch returns discovery state machine back to Login Complete. Fixes: 726b85487067d ("qla2xxx: Add framework for async fabric discovery") Cc: # 4.10+ Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_init.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -863,6 +863,7 @@ void qla24xx_handle_gpdb_event(scsi_qla_ int rval = ea->rc; fc_port_t *fcport = ea->fcport; unsigned long flags; + u16 opt = ea->sp->u.iocb_cmd.u.mbx.out_mb[10]; fcport->flags &= ~FCF_ASYNC_SENT; @@ -893,7 +894,8 @@ void qla24xx_handle_gpdb_event(scsi_qla_ } spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); - ea->fcport->login_gen++; + if (opt != PDO_FORCE_ADISC) + ea->fcport->login_gen++; ea->fcport->deleted = 0; ea->fcport->logout_on_delete = 1; @@ -917,6 +919,13 @@ void qla24xx_handle_gpdb_event(scsi_qla_ qla24xx_post_gpsc_work(vha, fcport); } + } else if (ea->fcport->login_succ) { + /* + * We have an existing session. A late RSCN delivery + * must have triggered the session to be re-validate. + * session is still valid. + */ + fcport->disc_state = DSC_LOGIN_COMPLETE; } spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); } /* gpdb event */