Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3064379pxj; Mon, 17 May 2021 16:51:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIoeVrSSWu9SJb31kAfx3yHoPICn/pX9DVQ8d3WoJUS4i5/WTBRRGH6CG1/zTuGjCd9/of X-Received: by 2002:a17:907:960b:: with SMTP id gb11mr2683460ejc.123.1621295516587; Mon, 17 May 2021 16:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621295516; cv=none; d=google.com; s=arc-20160816; b=DnFgCWT87IFyL71xYZsI2tS2cEtDp1TpCezmTQUj1pVbKRefYG2WmzcU0HuemsfNu5 ts3HLWY8YynFOp/sI5cAWDNl0fnTu2khnqxWUm+kaEBKF3axMwyzIyWw1ukWr4dgwyOi +oVn2DSpVel1FWNSjxS6WuwNCMNns0yQRwRqNI4MTfasm8z41j4j91xCUwMXf/+PMwQm LMdv99GKhJPKFPXvjsGOI69hfA6P0UnZSTHbIO3hmoyptSenAxLslMXTYRTNrHy70mkk C0h1+F3MbPfyAPfZCB1tbQNFcA1UxjB+st/BCUjhaTLvxi4//RUkN96NJGvw51bc0zkR NU4g== 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=Z31r/1CsLMq9Vu2um/O7g/WNsfI0N9lAluBVoz0z8IU=; b=HnaGtjhE5lWJ092Li3D4tcG5S/Hhwxs0N3YqmBtP1uLhOgLxKQ9JxuxASWCxQ4S9Wn KjZPRpIknDpNsrKvBUrxVepojUFcKkCCscc3JJHFPprLrYfPZUsX3TJpS0Mn+2NEEpJK 4ggCN7cfzvN2/A86JEDx0RTcGNB9ioX4aeh3+g3D6rL2/LB2EjSwUih9yQIHfCwzk4fY +Lmos8TeXm9/GDLC5z2Farv9My8B9uUSX6jB0RhoV0dfwH/e0fURUQMS5d5rw0Pw7nO1 bAwuYgegzMaeXF18mx+a09fhQazH5VV9hTn86FMTcN8WiEZYStPDZrMnbyfquEh9lGPl 9hnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YoBVx6wU; 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 eb5si1026390edb.276.2021.05.17.16.51.10; Mon, 17 May 2021 16:51:56 -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=YoBVx6wU; 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 S238640AbhEQOXf (ORCPT + 99 others); Mon, 17 May 2021 10:23:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:35962 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239492AbhEQOUY (ORCPT ); Mon, 17 May 2021 10:20:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 90B086143C; Mon, 17 May 2021 14:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260669; bh=ddaFadP+k/vxd2qH9CXjFiJkwKg+GTupzW/5WeayJEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YoBVx6wUXQlsIr8OiQ9SDftg3RaKYTkhr56CGYiQonVibZcg2vLd8mXX1oVsl7y4+ QqS+TGBuxbNmmS+WyrO9Ub/kNoAtBzmfeTcCmLl4u4yEKsNuKcJAapos2Sc34uqxk0 DVZwl4GeBakpdgDxwoLxs5xwOAzho5GYTcHfZfYk= 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.12 187/363] scsi: qla2xxx: Prevent PRLI in target mode Date: Mon, 17 May 2021 16:00:53 +0200 Message-Id: <20210517140308.912185821@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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 f01f07116bd3..8cb0574cfa91 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1194,6 +1194,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