From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795033741; b=rZlExnv2a+9r24QcTciZdFHzANOKWTPe96I1dy64z2wUVBJsPm43I9m1cvkM+GOqJBhc 4V8RagSLMc0F/WQ1H0b9H1k2NUEAqm6LhUAs5CR3xT7E8aEOFenbWRZbMxzt4ZwhoxChz 859W3pLNv1CnPFhWGS8xWlihMgZdKt8nd+BCW3E1JW7Rchl50TeEI1naJa8khqtc0C/Gp 6apFbF/FNoFjfzLidYz4MtIpdNYDdfg7L3eCcAytnvbl5DpcOtEe5L/2yffTWuL6R1BbA +5HeK+VNonvi4e1hTcV/FUAs14knv8Hy0ewUojryixGr7BhyG7MeydFQscF3B/YmMwQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795033741; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=eQ1gzVRx0laIZOXPeAD65bZOWtgUQLMyoU/Gf5bHOPI=; b=bAK1jC0CCKIWxlDQ0Hxu4fom+PnnDcb/lKUmsZXayDAJQm4cZMjvM+2Xb3mI6J+raO90 KzQdvLJSIc//d4pFYZsWJC2XFeQjPTsrVFuCF65ip7WdxDz0IhjUOS7hqnMQh9Ca6DTed JKFt57wmIIvtPxxFOblCvksl4ezqyVshiukgxUJ69jwUrqwth3jvx520r6QkLakSIPUCF JS2gi8oIdkl2gtseYmoSXHlAEjzqIRN90f0YGnX75k2CXYt83vidrzWc0101cCObLe2af PcskcXqHDXBWH5zzXw/M/8NIsqNky51TgFhi7mQY9Kx5+wRODy7DS023lTkOE5TIFmw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=L3EnRB8s; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2CD7606A32F; Wed, 18 Nov 2026 20:29:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=L3EnRB8s Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50EAF1F000C9; Wed, 18 Nov 2026 20:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795033740; bh=eQ1gzVRx0laIZOXPeAD65bZOWtgUQLMyoU/Gf5bHOPI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=L3EnRB8s4MYlR7jGVu33wS0kt32MVuJKqstKFU6M77uxSHH1ySOYXkzATlHApCTJb +3VWa9Kxdmpk3bOUxAadQhA7hrjlKjqImc1kNmR4fBOc6uIBa1U0W3Hlny7qYqNcfn 8wgywUJq98TM1kRlZ5kFd5xNkB54iWHjruDMjruo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shivaprasad G Bhat , Kyle Mahlkuch , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 6.6 0115/3318] scsi: qla2xxx: Handle INTx not connected while passing through Date: Wed, 18 Nov 2026 15:12:17 +0100 Message-ID: <20261118150317.751498433@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150313.527275416@linuxfoundation.org> References: <20261118150313.527275416@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shivaprasad G Bhat [ Upstream commit 7268e509b43ac1734e1bdb7d18553f7e1080dfb4 ] The PCI_INTERRUPT_PIN reports if the device supports the INTx. However, when the device is assigned to a guest via vfio, the PCI_INTERRUPT_PIN is set to 0 (i.e none) if the line is not connected and/or the platform cannot route the interrupt. In such cases, the guest PCI_INTERRUPT_PIN is 0 and the port number becomes -1 (255, uint8_t underflow) for qla[25|27|28]xx and qla2031 devices. The flt_region_nvram is never set, and subsequently the LUN detection fails. Below warnings show the NVRAM configuration failure: []-0073:1: Inconsistent NVRAM checksum=0xffffffc0 id=HCAM version=0x100. []-0074:1: Falling back to functioning (yet invalid -- WWPN) defaults. []-0076:1: NVRAM configuration failed. Handle this case and set the port_no to devfn like its done everywhere else. Reference: commit 2bd42b03ab6b ("vfio/pci: Virtualize zero INTx PIN if no pdev->irq") Signed-off-by: Shivaprasad G Bhat Reviewed-by: Kyle Mahlkuch Link: https://patch.msgid.link/177885270578.1573.14283751510936407585.stgit@linux.ibm.com Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/qla2xxx/qla_os.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index cac01f733492b..d343bda31f827 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -2818,11 +2818,16 @@ qla2x00_set_isp_flags(struct qla_hw_data *ha) else { /* Get adapter physical port no from interrupt pin register. */ pci_read_config_byte(ha->pdev, PCI_INTERRUPT_PIN, &ha->port_no); - if (IS_QLA25XX(ha) || IS_QLA2031(ha) || - IS_QLA27XX(ha) || IS_QLA28XX(ha)) - ha->port_no--; - else - ha->port_no = !(ha->port_no & 1); + if (ha->port_no == 0) { + /* None of INT[A|B|C|D] may be virtualized by vfio */ + ha->port_no = PCI_FUNC(ha->pdev->devfn); + } else { + if (IS_QLA25XX(ha) || IS_QLA2031(ha) || + IS_QLA27XX(ha) || IS_QLA28XX(ha)) + ha->port_no--; + else + ha->port_no = !(ha->port_no & 1); + } } ql_dbg_pci(ql_dbg_init, ha->pdev, 0x000b, -- 2.53.0