Received: by 10.213.65.68 with SMTP id h4csp443243imn; Tue, 13 Mar 2018 09:12:13 -0700 (PDT) X-Google-Smtp-Source: AG47ELuFS+JHIKrygiVtnHJUvQGzrpIxKQt4CoLVMerMLK/6rItrHD4hMamk8KONLtRV3UwK4M3P X-Received: by 10.101.70.10 with SMTP id v10mr914821pgq.327.1520957533282; Tue, 13 Mar 2018 09:12:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520957533; cv=none; d=google.com; s=arc-20160816; b=c+cQ/L3M8uw3K13a2KsrYqRQOIU1O8zn+1U4StIU5pfLmSzJYrMaHAXcOsyZawv8Uh GBnF7oEPRsIn/HCop256qDAUhTFPWG7j7EcbGueXYvwWAZY3TVnsKSiU9USlxAE9/MuY AQe16pBrNXb/dPKYe/Q/o/sFXAP/jek827NLIRdj6bxWrWDmgiKICV0rnxP+k64AgERX DUjtcVKEAdCa8zK2ovIPJSqWIgpTFKIL+BAVzQKudDH/98w9jVXShyzrpaG/uQoW1zIo QjU/zOPAfvqUM4jx+Mz7qfND0QrU7qhmG60NI85JDWGQCErtw7DexHngKvDBoIAE1hyQ 0YEw== 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=V21ddycvkr2m4PhYCgi5x6JDfGrZ0eZnTkT7vDtZa30=; b=RNHwkV+Ln58VgXpXhWVN15gnEOFs3ep/IbgdKU+UuRhI5jBpBOS6Y4hIqbC8Ki0XIY J3/R1oJh4e7CnY2stTYEQRO6NOTx3Bsg1Hig0QEsHw39HzlMrrWf3jFI6CT2OU59IygF A7egp8YOX1SgsSjddmvf4oNz3Uk/wWzgsfSgBVGbrRvidoa6ve0XqG/LKUnNUOohiDq7 SI9TbOfmSb/NZOD8/VEWJK2ASnjaWf5z8khneTzNzSCBoZWcSPCM4Dd3NwBInJpolr8N x3KInH2THGNyv4LRSKa+GD295vdv6hE9w99IJhizb4Ft+fCEMT9aFx8oUzmgXTNVe54N R6Fw== 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 h125si319394pfc.133.2018.03.13.09.11.58; Tue, 13 Mar 2018 09:12:13 -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 S934219AbeCMQLK (ORCPT + 99 others); Tue, 13 Mar 2018 12:11:10 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33494 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753035AbeCMPgQ (ORCPT ); Tue, 13 Mar 2018 11:36:16 -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 B827611A6; Tue, 13 Mar 2018 15:36:15 +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 029/140] scsi: qla2xxx: Retry switch command on time out Date: Tue, 13 Mar 2018 16:23:52 +0100 Message-Id: <20180313152459.998681258@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 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);