Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1013611pxb; Thu, 9 Sep 2021 18:01:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxjdm2g6nxpjGjm4wuFE/fAsSFsfQnivKSjyv0tcH8iFwMFG/pxqYMlEYYIWhOBJvf+s5P X-Received: by 2002:aa7:d645:: with SMTP id v5mr6179588edr.145.1631235667447; Thu, 09 Sep 2021 18:01:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631235667; cv=none; d=google.com; s=arc-20160816; b=lj54piGQNUJ8rODk6F81f4EYoaLcPY7Z5YbofpFW9gfZPMkA7uW8rquQUAtzJjUPy0 TwtuFspcclqxgjR5pqPjORazwjis+tuIEB3GReQc/XJvFlmHnYXHooAQTHIrXqPWZZb+ z0vjVwfSpSXrOTWWVD2ZRVYTjazGiFHp097TdJrFOhowswW4AyVB0cq7I/g1ZiNu22mn du4gev+75mChBGCq5T7PmfptdwkO7z+HaRDNtDRtRi3WYaYaXJ4SxnzevoLS/dCRqQ0I rJQwTl9nfLCZ8YU12ggafets4S8eiVzPKk+gfWqvW9Z8ScHWn3VCNVZxnjRoI1k47sYv 3WNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=D8VqhARpwrR7fIVnPj88+BC37kOnKqfI1zzAuhtRoXc=; b=tZgDH8krzAtWAhsyZxUXvPESIlTHYLjU+f2hS9VYtoH0HHuAWrTIKnz1RqnvK/wdMh N0qMQ7GjC5qbzOa2dCNh1SzKTPkIxRPGR40NXaL6wjt6aqPzLuob02FXhVuNDPhIZVwB KFNuDPsDHx3nFvZ1K6p5Pc2VZM65MhQ+vuDYGiABLtcOGO09sLQnwDhf9ggt5FhG/niP 3m8kBIvEfKCxW8ETHzvEh7m1LNYEGXOBumzB52IOHzxeh4ftw+Q/3vXtSP6l02LIy1+a ixA0BmMEdPfBRjZnpSDYmEA1JdXz1o3e7G7MpjsxroA+OtJUR8D7WHWtqljIfGG+gJIp 0XUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y9ZqW4Rs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du10si3583868ejc.531.2021.09.09.18.00.42; Thu, 09 Sep 2021 18:01:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y9ZqW4Rs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244729AbhIJBAB (ORCPT + 99 others); Thu, 9 Sep 2021 21:00:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:48768 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234372AbhIJAXP (ORCPT ); Thu, 9 Sep 2021 20:23:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5A06860FDA; Fri, 10 Sep 2021 00:22:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631233325; bh=OxASOjC7EytcYTCJPVKeGysVNA7MgCH/7dIyWqG5Y0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y9ZqW4RsPLQwucdv8vDLQuHHpZe1uagYCUjHPUfYqpQhKbpRg85WNN6RlWGDn1F6B +aubpHhOWe2UQNFTTFcE8yFFDPhM/oOkrume2yZMJwmwIePQdUrbvfJrfFTRseohy0 p0fuscOkvF2MRTVcILbM7wpPOAIllZpFjAxEtSZ3fes3w5ZceQhLtvEFsDhL8SqOq5 7Z5qB7N1tngpmVDPw6Q316ZeArtszCUQc2VivBB1H7EEdgJYs803rzPzXu+cXjJ4cr nDViQRa26z0UuNEei2IoU/Fb56vbtHjPFETRrVldWe4SHAdv6xwuLCbiKaholiDBdJ CA2r1lwnR32IA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Quinn Tran , Himanshu Madhani , Nilesh Javali , "Martin K . Petersen" , Sasha Levin , linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 16/37] scsi: qla2xxx: Fix NPIV create erroneous error Date: Thu, 9 Sep 2021 20:21:21 -0400 Message-Id: <20210910002143.175731-16-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210910002143.175731-1-sashal@kernel.org> References: <20210910002143.175731-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Quinn Tran [ Upstream commit a57214443f0f85639a0d9bbb8bd658d82dbf0927 ] When user creates multiple NPIVs, the switch capabilities field is checked before a vport is allowed to be created. This field is being toggled if a switch scan is in progress. This creates erroneous reject of vport create. Link: https://lore.kernel.org/r/20210810043720.1137-10-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/qla2xxx/qla_init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 643b8ae36cbe..a92e81a7b42d 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -4359,11 +4359,11 @@ qla2x00_configure_hba(scsi_qla_host_t *vha) /* initialize */ ha->min_external_loopid = SNS_FIRST_LOOP_ID; ha->operating_mode = LOOP; - ha->switch_cap = 0; switch (topo) { case 0: ql_dbg(ql_dbg_disc, vha, 0x200b, "HBA in NL topology.\n"); + ha->switch_cap = 0; ha->current_topology = ISP_CFG_NL; strcpy(connect_type, "(Loop)"); break; @@ -4377,6 +4377,7 @@ qla2x00_configure_hba(scsi_qla_host_t *vha) case 2: ql_dbg(ql_dbg_disc, vha, 0x200d, "HBA in N P2P topology.\n"); + ha->switch_cap = 0; ha->operating_mode = P2P; ha->current_topology = ISP_CFG_N; strcpy(connect_type, "(N_Port-to-N_Port)"); @@ -4393,6 +4394,7 @@ qla2x00_configure_hba(scsi_qla_host_t *vha) default: ql_dbg(ql_dbg_disc, vha, 0x200f, "HBA in unknown topology %x, using NL.\n", topo); + ha->switch_cap = 0; ha->current_topology = ISP_CFG_NL; strcpy(connect_type, "(Loop)"); break; -- 2.30.2