Received: by 10.213.65.68 with SMTP id h4csp448591imn; Tue, 13 Mar 2018 09:22:23 -0700 (PDT) X-Google-Smtp-Source: AG47ELsTlqH9t7VRwvBCa6koSfPyEeh5clSjV1IKDe6PWLrgZ6YvVvXgw6OH67wgjT8l7QiPz76r X-Received: by 10.99.101.198 with SMTP id z189mr945562pgb.97.1520958143668; Tue, 13 Mar 2018 09:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520958143; cv=none; d=google.com; s=arc-20160816; b=Cql3VReYB9f72NC3k5TLz/cdDgOPXLZ3SzpLPdm8pm9gKoJ46sumlxyKQDr60iGug7 +TA79/iqfeB4P5zquuiwjPcT8lN5+Oo7L2bloKmniSBXLi9dM2Fd7tcTquRcFRAsQ00b Ocf4mRu5JfBT+vYS+neLLJSpHQ0d/9bNhPAN8ZKLmXGs66mGhtZsMw48t7t6WfpAw7Wp TcvgKyKk2/YkLwzIyKYJ1i8biBUH+SohhCKDVmWWkisNfnePrtdpBc/nPQQaGF11A3c/ 3T+bXgvz5KbuWkU7YCuehJaL4wjuOqYKF+n0HIKHrJP4qrlq7tWS8C2bnOUGKZD+CulA FwWg== 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=BYMkOgtg2AhxFOH235tf1Ea8+vFbU6MFq4434g3f1vc=; b=pQkE0cUvrLqCE6qXw0ZiaO8VRXPKC+nMpSrlcqQbpS8AOAgkE70MFSvuXUiggUweWV VFQOfp0Gs12K8XPinyQOi07u/eJWD5uVEw3jnF3oiBODgGdQXiDEXpO/NsnyNmAi/Bf6 wTVgIuFIKOKMq/xtgMfk25bfI2k+l4lp1tqy17azt4aqoWsSONjeEpEkla1vwUXVUh5y say4BV8J0mBRrjsO2GJdlTovFCZD9p9d2XZr/+YtFPhHg8RU0pOrnxW3/hMZH2ljALLz tSMbGerdsrAvezy2ZIhNfoq1DYkk1nrK2gnqsVT4GHBZsH90psoLykO2brhk1tSqK4u2 JExg== 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 c7si285753pfi.323.2018.03.13.09.22.08; Tue, 13 Mar 2018 09:22:23 -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 S933809AbeCMPei (ORCPT + 99 others); Tue, 13 Mar 2018 11:34:38 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:32846 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933369AbeCMPef (ORCPT ); Tue, 13 Mar 2018 11:34:35 -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 B89601035; Tue, 13 Mar 2018 15:34:34 +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 129/146] scsi: qla2xxx: Retry switch command on time out Date: Tue, 13 Mar 2018 16:24:56 +0100 Message-Id: <20180313152330.147327688@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 25ad76b703d9ad536f3411b15b1070aeb059ab55 upstream. Retry GID_PN & GPN_ID switch commands for time out case. 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_gs.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -175,6 +175,9 @@ qla2x00_chk_ms_status(scsi_qla_host_t *v set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); } break; + case CS_TIMEOUT: + rval = QLA_FUNCTION_TIMEOUT; + /* drop through */ default: ql_dbg(ql_dbg_disc, vha, 0x2033, "%s failed, completion status (%x) on port_id: " @@ -2889,9 +2892,22 @@ static void qla2x00_async_gidpn_sp_done( ea.rc = res; ea.event = FCME_GIDPN_DONE; - ql_dbg(ql_dbg_disc, vha, 0x204f, - "Async done-%s res %x, WWPN %8phC ID %3phC \n", - sp->name, res, fcport->port_name, id); + if (res == QLA_FUNCTION_TIMEOUT) { + ql_dbg(ql_dbg_disc, sp->vha, 0xffff, + "Async done-%s WWPN %8phC timed out.\n", + sp->name, fcport->port_name); + qla24xx_post_gidpn_work(sp->vha, fcport); + sp->free(sp); + return; + } else if (res) { + ql_dbg(ql_dbg_disc, sp->vha, 0xffff, + "Async done-%s fail res %x, WWPN %8phC\n", + sp->name, res, fcport->port_name); + } else { + ql_dbg(ql_dbg_disc, vha, 0x204f, + "Async done-%s good WWPN %8phC ID %3phC\n", + sp->name, fcport->port_name, id); + } qla2x00_fcport_event_handler(vha, &ea); @@ -3217,11 +3233,6 @@ static void qla2x00_async_gpnid_sp_done( sp->name, ct_req->req.port_id.port_id, ct_rsp->rsp.gpn_id.port_name); - if (res) { - sp->free(sp); - return; - } - memset(&ea, 0, sizeof(ea)); memcpy(ea.port_name, ct_rsp->rsp.gpn_id.port_name, WWN_SIZE); ea.sp = sp; @@ -3231,6 +3242,13 @@ static void qla2x00_async_gpnid_sp_done( ea.rc = res; ea.event = FCME_GPNID_DONE; + if (res) { + if (res == QLA_FUNCTION_TIMEOUT) + qla24xx_post_gpnid_work(sp->vha, &ea.id); + sp->free(sp); + return; + } + qla2x00_fcport_event_handler(vha, &ea); e = qla2x00_alloc_work(vha, QLA_EVT_GPNID_DONE);