Received: by 10.213.65.68 with SMTP id h4csp442817imn; Tue, 13 Mar 2018 09:11:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELter6+HJavTbmzY8QQtL56/ve1KxKvCjiH/WUpLJPfdHYPh0q9FUREKAYKg+jAxZSMbea/k X-Received: by 10.98.64.146 with SMTP id f18mr1162175pfd.30.1520957486296; Tue, 13 Mar 2018 09:11:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520957486; cv=none; d=google.com; s=arc-20160816; b=z3tJmKAoiiQispA9SLqayg4zgVcMND+J+yTWen0OqR+Ql8f37IpXhuj2s/P1vTBfri LZ07FdvkEgdkE9XR4GY4VmJ33HwkBraaUDdjxX5EPF8/0yyQcdDIpRywaWcaB+Dc7B8p z5R0NuXJFPHDRDwoHxVZu/yLqk++6H3oBR575TB8nyKSSzs0EcLguL78VoH5DTEBRfaV 6cvTWA0iBOBFOTkK0+T06RwAkaWjFAj56GT5MAPEnfewk0WWXGNBMP6P8PyvlyY9TRcl wdrTWQUoZx5HlqJ2juTZmISOuWux6dF4O/Dr28xPQyvEBmyFJMT4xqvNOuRKM/ZCVb6A +vvw== 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=bej/QXWtf6/G+FYbOkf7YB0F77BpUjKTCqIJWTmk5O4=; b=H7Ua8T96H64f43yeQAkcUi/hVS4XtPQKYsc/lRO18AfsBNgKRH36MsBP0BG1wBXQnj uVGw81lFu34DNJ8Ft/+9JcHJPTvHaMBP8L8Op3aGkD1ANN8xSYD2jTS2J6B8btqTI/Mq v9n8Bh0unsYQ/g77bzfrCctlnHS9+aMthAQ0rNEvgl9OSPyw9tUcW9/rsPRXX4T21rdR yr4MbioZHw+SG0nMhm4O7OXFtbxF3CBfV2GOPuWO+QdWF32KszjieLFN2ImYsciJOkB5 w76TfGKfHGyj6FHxjf2h+oji3UuG1WzAsa/8nrTT1EvEcBuCR2We0OxUPqs3vGwBF6Mt Kxmg== 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 j1si305522pgt.317.2018.03.13.09.11.12; Tue, 13 Mar 2018 09:11:26 -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 S933348AbeCMQKV (ORCPT + 99 others); Tue, 13 Mar 2018 12:10:21 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33548 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934181AbeCMPgW (ORCPT ); Tue, 13 Mar 2018 11:36:22 -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 823E011A6; Tue, 13 Mar 2018 15:36:21 +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.14 031/140] scsi: qla2xxx: Fix login state machine stuck at GPDB Date: Tue, 13 Mar 2018 16:23:54 +0100 Message-Id: <20180313152500.172736062@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152458.201155692@linuxfoundation.org> References: <20180313152458.201155692@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.14-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 @@ -864,6 +864,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; @@ -894,7 +895,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; @@ -918,6 +920,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 */