Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3066952imu; Mon, 19 Nov 2018 10:07:34 -0800 (PST) X-Google-Smtp-Source: AJdET5c9bi/dZjz0IDSNkXg5JVgvoQvzunMpd0X0XOJnvoKQABMqVhbMPlidU3ECIzxhBhRYRVVi X-Received: by 2002:a17:902:481:: with SMTP id e1-v6mr23337247ple.132.1542650854742; Mon, 19 Nov 2018 10:07:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542650854; cv=none; d=google.com; s=arc-20160816; b=n9UI3q5pSqisuqQPturgiChK4HeXZFsmVV4T+CvhEhXzhAE1b8ts8y5BMEhFYAxg5c rHIKjUwGK8ESEWqTEKX1opRxGN0xt9TK7txllo1B4z5QC0CFGOWWhrmrDTCp8ziP5DFp iceI/HKxeuhpPSXllJBFxJqCRYAPbfuD5bw4pZz3q5KE97yrbLYS8OTHaiG/OmNmEtm0 dqTl+8eX9ejyrJBQFKFJRJsDMfpwJX9EwO/9exXn8KyS0Be/G8+/frdPNhR1c2Psyt0R g/1UZH5tqYL7X/gQUu5S0QQ86+EihvV0q4r0YAeTBS8Wm/xQ8ik4kvsDFYw3nkZoz75G RYgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uhkObNK5BYJIoggBYn1AyaHicz+BQtQmWQi6HndE/GA=; b=Krb0PXkyEPsrOeQGsoNUHxtNpXaHYb79itIvGFXHMdQYmkzDKS5Q6JU+l51uWIZJwg LoaYBm6f1wJTMV0uxls15kngj5MZpBfAsC2Pg7f/JSuUTvPpDSZcNScIiHgAirR4p+ey TXEBv88f8NST7e1MgSQzXqqf4dp2BToqlehg6X/RUYJt43GgcOhMfbkqFH30GZwoxFbw 14oq8KzBG6ibbEOEz6tyjYFZ61fMvSIgkVQFohbdBvSe6RAVseOC8XGu9Gya6nvlvHgy Sxv8/TnjFApv5sSG6zush8O/Y/nox+AXQ6j3mnc9IHdPWNLengXfw6EAnbhVkjHqzJ7X 9U+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SUnRkkT0; 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 e17si39502261pgj.142.2018.11.19.10.07.19; Mon, 19 Nov 2018 10:07:34 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=SUnRkkT0; 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 S1731304AbeKTEaW (ORCPT + 99 others); Mon, 19 Nov 2018 23:30:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:55070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730015AbeKTC4q (ORCPT ); Mon, 19 Nov 2018 21:56:46 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A17D62086A; Mon, 19 Nov 2018 16:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542645158; bh=9Pwyb9Zk1Wqu853gm/HfYstq04UQ2a5w2RUooEftKKw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SUnRkkT0NjV9NFFKn22T72boymMHxwrEKmJ6W9OgvMIf51kn0Q3HZReue++l+TL5x kOItr8BhnO9MGFWkv/AdyXpR6IJCTfNyuZKY2aLRVQFL7aNU/G/M/DAmUYWZgoLh9Q 9B+6kqDpgOzvjrZ+fIZC4GXqMc+MY9DXh2b8ILIk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Ewan D. Milne" , Himanshu Madhani , "Martin K. Petersen" Subject: [PATCH 4.19 057/205] scsi: qla2xxx: Fix re-using LoopID when handle is in use Date: Mon, 19 Nov 2018 17:26:04 +0100 Message-Id: <20181119162627.317466201@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162616.586062722@linuxfoundation.org> References: <20181119162616.586062722@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Quinn Tran commit 5c6400536481d9ef44ef94e7bf2c7b8e81534db7 upstream. This patch fixes issue where driver clears NPort ID map instead of marking handle in use. Once driver clears NPort ID from the database, it can reuse the same NPort ID resulting in a PLOGI failure. [mkp: fixed Himanshu's SoB] Fixes: a084fd68e1d2 ("scsi: qla2xxx: Fix re-login for Nport Handle in use") Cc: Signed-of-by: Quinn Tran Reviewed-by: Ewan D. Milne Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_init.c | 18 ++++-------------- drivers/scsi/qla2xxx/qla_target.c | 3 ++- 2 files changed, 6 insertions(+), 15 deletions(-) --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1954,25 +1954,15 @@ qla24xx_handle_plogi_done_event(struct s cid.b.rsvd_1 = 0; ql_dbg(ql_dbg_disc, vha, 0x20ec, - "%s %d %8phC LoopID 0x%x in use post gnl\n", + "%s %d %8phC lid %#x in use with pid %06x post gnl\n", __func__, __LINE__, ea->fcport->port_name, - ea->fcport->loop_id); + ea->fcport->loop_id, cid.b24); - if (IS_SW_RESV_ADDR(cid)) { - set_bit(ea->fcport->loop_id, vha->hw->loop_id_map); - ea->fcport->loop_id = FC_NO_LOOP_ID; - } else { - qla2x00_clear_loop_id(ea->fcport); - } + set_bit(ea->fcport->loop_id, vha->hw->loop_id_map); + ea->fcport->loop_id = FC_NO_LOOP_ID; qla24xx_post_gnl_work(vha, ea->fcport); break; case MBS_PORT_ID_USED: - ql_dbg(ql_dbg_disc, vha, 0x20ed, - "%s %d %8phC NPortId %02x%02x%02x inuse post gidpn\n", - __func__, __LINE__, ea->fcport->port_name, - ea->fcport->d_id.b.domain, ea->fcport->d_id.b.area, - ea->fcport->d_id.b.al_pa); - lid = ea->iop[1] & 0xffff; qlt_find_sess_invalidate_other(vha, wwn_to_u64(ea->fcport->port_name), --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -1261,7 +1261,8 @@ void qlt_schedule_sess_for_deletion(stru qla24xx_chk_fcp_state(sess); ql_dbg(ql_dbg_tgt, sess->vha, 0xe001, - "Scheduling sess %p for deletion\n", sess); + "Scheduling sess %p for deletion %8phC\n", + sess, sess->port_name); INIT_WORK(&sess->del_work, qla24xx_delete_sess_fn); WARN_ON(!queue_work(sess->vha->hw->wq, &sess->del_work));