From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AFBB3537E0 for ; Fri, 11 Sep 2026 14:32:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789137123; cv=none; b=S1tSM4b258LrzReuLZ+Vfy7ORRjo9kxCYluSdz3u0xXi30/HOzfQVYdQ544QkGCWvRhfocM+JxyxiJIkHFfxFRMXrAcqCLqUNarK5hpFcGb2ZfywjAcLOTgG+cljfkUnCBnQNo0XTkejtKjUYAvn79FLQndWatZmGE6pRd5apKI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789137123; c=relaxed/simple; bh=o/GiTQ1VFJQNzKMX9Li9rhyzlQEs44hXP7WlxQ5TJA0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NzxYnl8+yHN1Vjlm/P+T8n+hzWpexgb7Tu2Ijf+5EJDuOvT2kxNGThFz11X9Y3wMXsbaHfx9NEKmGi9oo+FLSVIHJ2rprSd5vYP+285PWRPdfM8AnGGNhOSfGct/KSM5NgHoZy5D6oUVFOu2ir5mnD/ka+PbXgTYaL+/b9eC+y0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E4gwZirx; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="E4gwZirx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 875081F00893; Fri, 11 Sep 2026 14:32:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789137122; bh=YBtZxXlja+SCyPN0xU8PkMXy9H7WBfEivBu2tXgam7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=E4gwZirxinOSSstTwKgSLf1GuWg9+vAQyD2FTQ5nK4Znq/NXrKC0z0ihgVpyuVN+c XlgZ0WSekY7gVa++3tV1trHIpw++vZ6jX0H/LKIWEc52cedspS4KLk1q8x1MB4k7FG LstjXZc+vba0ZuPlDRb0gjG2deY0/ilLSPZ3irWea9mibOT1s5Y3afefSluDSD07Po p8Opwy96+4Tq/0n5kHPyV6M3k+2cIrCJS5i88zcP4+hNRIPD3nNDFzo0W6XkXNKiVv ZT4hr/QVpxVGn/PhtF3JOyVIOmm0sXvTFAhsPqKLy0qusk1I0m5lRBLS3R9k8bjrSr paQaLK6YAmdrg== From: Sasha Levin To: stable@vger.kernel.org Cc: Nilesh Javali , Sashiko , "Martin K. Petersen (Oracle)" , Sasha Levin Subject: [PATCH 6.6.y 2/2] scsi: qla2xxx: Skip NVMe LS reject IOCB when FW not started Date: Fri, 11 Sep 2026 10:31:58 -0400 Message-ID: <20260911143159.922147-2-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260911143159.922147-1-sashal@kernel.org> References: <2026090922-debtless-broadband-c2ee@gregkh> <20260911143159.922147-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Nilesh Javali [ Upstream commit f7e46ebffc5781aab3f1f5a5d4350addbb5833f4 ] qla_nvme_xmt_ls_rsp() bails out to the out: label when firmware is not started (!ha->flags.fw_started), but the out: path unconditionally calls qla_nvme_ls_reject_iocb(), which ends in qla2x00_start_iocbs() and an unconditional doorbell write to the request queue in-pointer register. This rings the firmware doorbell and queues an IOCB that stopped or resetting firmware cannot consume, and touches MMIO during the reset/EEH window where fw_started is also clear. Only emit the LS reject IOCB (and ring the doorbell) when fw_started is set; otherwise just clean up and return. The post-allocation failure cases (SRB alloc / qla2x00_start_sp() failure) run with firmware started and still send the reject. Apply the same guard to the reject emission in qla2xxx_process_purls_pkt(). Fixes: 875386b98857 ("scsi: qla2xxx: Add Unsolicited LS Request and Response Support for NVMe") Cc: stable@vger.kernel.org Reported-by: Sashiko Signed-off-by: Nilesh Javali Link: https://patch.msgid.link/20260730155838.2119230-26-njavali@marvell.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Sasha Levin --- drivers/scsi/qla2xxx/qla_nvme.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index cfde62464340b..4a7cf88d46428 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -442,9 +442,11 @@ static int qla_nvme_xmt_ls_rsp(struct nvme_fc_local_port *lport, a.vp_idx = vha->vp_idx; a.nport_handle = uctx->nport_handle; a.xchg_address = uctx->exchange_address; - spin_lock_irqsave(ha->base_qpair->qp_lock_ptr, flags); - qla_nvme_ls_reject_iocb(vha, ha->base_qpair, &a, true); - spin_unlock_irqrestore(ha->base_qpair->qp_lock_ptr, flags); + if (ha->flags.fw_started) { + spin_lock_irqsave(ha->base_qpair->qp_lock_ptr, flags); + qla_nvme_ls_reject_iocb(vha, ha->base_qpair, &a, true); + spin_unlock_irqrestore(ha->base_qpair->qp_lock_ptr, flags); + } kfree(uctx); return rval; } @@ -1204,9 +1206,14 @@ qla2xxx_process_purls_pkt(struct scsi_qla_host *vha, struct purex_item *item) a.vp_idx = vha->vp_idx; a.nport_handle = uctx->nport_handle; a.xchg_address = uctx->exchange_address; - spin_lock_irqsave(vha->hw->base_qpair->qp_lock_ptr, flags); - qla_nvme_ls_reject_iocb(vha, vha->hw->base_qpair, &a, true); - spin_unlock_irqrestore(vha->hw->base_qpair->qp_lock_ptr, flags); + if (vha->hw->flags.fw_started) { + spin_lock_irqsave(vha->hw->base_qpair->qp_lock_ptr, + flags); + qla_nvme_ls_reject_iocb(vha, vha->hw->base_qpair, &a, + true); + spin_unlock_irqrestore(vha->hw->base_qpair->qp_lock_ptr, + flags); + } list_del(&uctx->elem); kfree(uctx); } -- 2.53.0