Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp462102pxj; Tue, 18 May 2021 07:17:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNK/fd6zDjpQwTL/1wvMt7loGGn2qgnusxI2u4XXVlAzMYI7zEDjvzLn+3uZ6Rie3VkbZg X-Received: by 2002:a17:906:3a04:: with SMTP id z4mr6174394eje.221.1621347422646; Tue, 18 May 2021 07:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621347422; cv=none; d=google.com; s=arc-20160816; b=TnfGQlE6/PLhf9prJ/sgqzX7spETdBQ0MTkOL++5QhlzH3GcLGkRQRDGTmdQOqaG3U scmngnbiuvet1uw9rZgE7y878Hqf/AZCslb60YkCHdJtxxAaWps2GCfe5gbCrEX32V4o fgVjqkzTBESvWQqsgr1exsj/KYLhYJTQCdK8REjwfUCj2ShZN/3vjA+FVIZLmct1QCIf kv1fjFH7usuRv6vnFeUYyLSZJDViIV5972468kmT0JYHqJuMj8vgfNDgUcBCeIDkdxW8 GMhj5rfsQLQbWWBUjo9jp/AQJjvYV5oPKfsZ9Hteurx/xMYq+Lr1FgZsSvuuOWgGF09y Zeng== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YCmqgSScm8iOou4dvkKb+v5t70UFu9vrbdkH9VIxqS8=; b=If6WjttcHygvfrEwKjCO7d0ztHvvl47GvYWkDjMLl+Ab78DYo5JzdImS4IVqpkzMO6 68hT6XPaFCvlrsm/TNGk5k3GDVZZGFiKQeCZJhPSArCcbTLsFcDGF9hsBq/mOr0nSpQD Zdj/vgLQYXFnrfmDNQoE2KSwABn4CPNGvwFi8E5AHUOX0bB37irUwgq+1XrcmsJ+mZOB TXpk33JwEuzrn7fgc/DwnWbN+zq00fVDNMIp9D0nOp55W3RbzG6NTad9cgcHX502Pp66 l6Ns3QW/49cCgqX/0BSIZT54uI0FbospKBx7NBMCVqhuRtVmsNINfW44/g+t2wwNvz6X SqcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FwpkYa64; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o1si8782346edr.22.2021.05.18.07.16.40; Tue, 18 May 2021 07:17:02 -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=@linuxfoundation.org header.s=korg header.b=FwpkYa64; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344411AbhEQPoi (ORCPT + 99 others); Mon, 17 May 2021 11:44:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:56322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244403AbhEQP3B (ORCPT ); Mon, 17 May 2021 11:29:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E31BC61CBA; Mon, 17 May 2021 14:37:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262245; bh=bDdVezbQV24ZSV5CqB+afjH1cjjLiMUa02Hsb2TYgis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FwpkYa646FR2no1AJ+t0wf2CiSPl4+lGJOE8/0GAezK3RceFqp5jR4d7o2wWlnTBO 79IyAYIpMwlVPwI6FdKPDiWTXSTHW4hABn17KCS3INcIJm8X57C7gKO8FbhW90uIPm LBxPBZgCLom3F7oC5j5EqSCuZViBnUGPgOeXjPLA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Roman Bolshakov , Himanshu Madhani , Anastasia Kovaleva , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.10 140/289] scsi: qla2xxx: Prevent PRLI in target mode Date: Mon, 17 May 2021 16:01:05 +0200 Message-Id: <20210517140309.865578700@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anastasia Kovaleva [ Upstream commit fcb16d9a8ecf1e9bfced0fc654ea4e2caa7517f4 ] In a case when the initiator in P2P mode by some circumstances does not send PRLI, the target, in a case when the target port's WWPN is less than initiator's, changes the discovery state in DSC_GNL. When gnl completes it sends PRLI to the initiator. Usually the initiator in P2P mode always sends PRLI. We caught this issue on Linux stable v5.4.6 https://www.spinics.net/lists/stable/msg458515.html. Fix this particular corner case in the behaviour of the P2P mod target login state machine. Link: https://lore.kernel.org/r/20210422153414.4022-1-a.kovaleva@yadro.com Fixes: a9ed06d4e640 ("scsi: qla2xxx: Allow PLOGI in target mode") Reviewed-by: Roman Bolshakov Reviewed-by: Himanshu Madhani Signed-off-by: Anastasia Kovaleva Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/qla2xxx/qla_init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 52e8b555bd1d..6faf34fa6220 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1190,6 +1190,9 @@ static int qla24xx_post_prli_work(struct scsi_qla_host *vha, fc_port_t *fcport) { struct qla_work_evt *e; + if (vha->host->active_mode == MODE_TARGET) + return QLA_FUNCTION_FAILED; + e = qla2x00_alloc_work(vha, QLA_EVT_PRLI); if (!e) return QLA_FUNCTION_FAILED; -- 2.30.2