* Fwd: [PATCH] [SCSI] qla2xxx: Handle the INTx not connected while passing through
2026-05-15 13:45 [PATCH] [SCSI] qla2xxx: Handle the INTx not connected while passing through Shivaprasad G Bhat
@ 2026-05-25 4:24 ` priyama2
2026-06-03 8:12 ` Madhavan Srinivasan
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: priyama2 @ 2026-05-25 4:24 UTC (permalink / raw)
To: linux-scsi
Cc: Shivaprasad G Bhat, njavali, GR-QLogic-Storage-Upstream,
James.Bottomley, martin.petersen
Hi Shiva,
I have tested this patch and can confirm it resolves the issue. Could
you please add the following tags to the patch in v2:
Reported-by: Priya A <priyama2@in.ibm.com>
Tested-by: Priya A <priyama2@in.ibm.com>
Thanks,
Priya A
-------- Forwarded Message --------
Subject: [PATCH] [SCSI] qla2xxx: Handle the INTx not connected while
passing through
Date: Fri, 15 May 2026 13:45:18 +0000
From: Shivaprasad G Bhat <sbhat@linux.ibm.com>
To: njavali@marvell.com, GR-QLogic-Storage-Upstream@marvell.com,
James.Bottomley@HansenPartnership.com, martin.petersen@oracle.com
CC: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
alex.williamson@nvidia.com, Kyle.Mahlkuch@ibm.com, sbhat@linux.ibm.com
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.
The patch handles the case, and sets 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 <sbhat@linux.ibm.com>
---
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 72b1c28e4dae..a8d6a0a021f4 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2803,11 +2803,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,
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH] [SCSI] qla2xxx: Handle the INTx not connected while passing through
2026-05-15 13:45 [PATCH] [SCSI] qla2xxx: Handle the INTx not connected while passing through Shivaprasad G Bhat
2026-05-25 4:24 ` Fwd: " priyama2
@ 2026-06-03 8:12 ` Madhavan Srinivasan
2026-06-03 10:56 ` Shivaprasad G Bhat
2026-06-18 16:56 ` Kyle Mahlkuch
2026-07-29 2:55 ` Martin K. Petersen
3 siblings, 1 reply; 8+ messages in thread
From: Madhavan Srinivasan @ 2026-06-03 8:12 UTC (permalink / raw)
To: Shivaprasad G Bhat, njavali, GR-QLogic-Storage-Upstream,
James.Bottomley, martin.petersen
Cc: linux-scsi, linux-kernel, alex.williamson, Kyle.Mahlkuch,
linuxppc-dev
On 5/15/26 7:15 PM, Shivaprasad G Bhat wrote:
> 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.
>
> The patch handles the case, and sets the port_no to devfn like
> its done everywhere else.
Any update on this? do you have any comments/concerns that should be
addressed
Maddy
> Reference: commit 2bd42b03ab6b ("vfio/pci: Virtualize zero INTx PIN if no pdev->irq")
> Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
> ---
> 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 72b1c28e4dae..a8d6a0a021f4 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -2803,11 +2803,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,
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] [SCSI] qla2xxx: Handle the INTx not connected while passing through
2026-06-03 8:12 ` Madhavan Srinivasan
@ 2026-06-03 10:56 ` Shivaprasad G Bhat
0 siblings, 0 replies; 8+ messages in thread
From: Shivaprasad G Bhat @ 2026-06-03 10:56 UTC (permalink / raw)
To: Madhavan Srinivasan, njavali, GR-QLogic-Storage-Upstream,
James.Bottomley, martin.petersen, Kyle.Mahlkuch
Cc: linux-scsi, linux-kernel, alex.williamson, linuxppc-dev, harshpb
On 6/3/26 1:42 PM, Madhavan Srinivasan wrote:
>
> On 5/15/26 7:15 PM, Shivaprasad G Bhat wrote:
>> 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.
>>
>> The patch handles the case, and sets the port_no to devfn like
>> its done everywhere else.
>
> Any update on this? do you have any comments/concerns that should be
> addressed
>
Hi Maddy,
Priya has tested this already. I have requested Kyle to help with
reviewing this patch.
Meanwhile, would request Nilesh, James or Martin to provide feedback, if
any.
Thanks,
Shivaprasad
> Maddy
>
>> Reference: commit 2bd42b03ab6b ("vfio/pci: Virtualize zero INTx PIN
>> if no pdev->irq")
>> Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
>> ---
>> 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 72b1c28e4dae..a8d6a0a021f4 100644
>> --- a/drivers/scsi/qla2xxx/qla_os.c
>> +++ b/drivers/scsi/qla2xxx/qla_os.c
>> @@ -2803,11 +2803,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,
>>
>>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] [SCSI] qla2xxx: Handle the INTx not connected while passing through
2026-05-15 13:45 [PATCH] [SCSI] qla2xxx: Handle the INTx not connected while passing through Shivaprasad G Bhat
2026-05-25 4:24 ` Fwd: " priyama2
2026-06-03 8:12 ` Madhavan Srinivasan
@ 2026-06-18 16:56 ` Kyle Mahlkuch
2026-07-29 2:55 ` Martin K. Petersen
3 siblings, 0 replies; 8+ messages in thread
From: Kyle Mahlkuch @ 2026-06-18 16:56 UTC (permalink / raw)
To: Shivaprasad G Bhat, njavali, GR-QLogic-Storage-Upstream,
James.Bottomley, martin.petersen
Cc: linux-scsi, linux-kernel, alex.williamson
> 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.
>
> The patch handles the case, and sets 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 <sbhat@linux.ibm.com>
Hi Shiva,
Your changes look reasonable and fix a known bug.
Reviewed-by: Kyle Mahlkuch <kmahlkuc@linux.ibm.com>
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] [SCSI] qla2xxx: Handle the INTx not connected while passing through
2026-05-15 13:45 [PATCH] [SCSI] qla2xxx: Handle the INTx not connected while passing through Shivaprasad G Bhat
` (2 preceding siblings ...)
2026-06-18 16:56 ` Kyle Mahlkuch
@ 2026-07-29 2:55 ` Martin K. Petersen
2026-08-07 8:23 ` Shivaprasad G Bhat
3 siblings, 1 reply; 8+ messages in thread
From: Martin K. Petersen @ 2026-07-29 2:55 UTC (permalink / raw)
To: njavali, GR-QLogic-Storage-Upstream, James.Bottomley,
Shivaprasad G Bhat
Cc: Martin K . Petersen, linux-scsi, linux-kernel, alex.williamson,
Kyle.Mahlkuch
On Fri, 15 May 2026 13:45:18 +0000, Shivaprasad G Bhat wrote:
> 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.
>
> [...]
Applied to 7.3/scsi-queue, thanks!
[1/1] qla2xxx: Handle the INTx not connected while passing through
https://git.kernel.org/mkp/scsi/c/7268e509b43a
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] [SCSI] qla2xxx: Handle the INTx not connected while passing through
2026-07-29 2:55 ` Martin K. Petersen
@ 2026-08-07 8:23 ` Shivaprasad G Bhat
2026-08-07 14:45 ` Martin K. Petersen
0 siblings, 1 reply; 8+ messages in thread
From: Shivaprasad G Bhat @ 2026-08-07 8:23 UTC (permalink / raw)
To: Martin K. Petersen, njavali, James.Bottomley
Cc: Madhavan Srinivasan, Harsh Prateek Bora, linux-kernel,
linuxppc-dev, linux-scsi
Hi Martin,
On 7/29/26 8:25 AM, Martin K. Petersen wrote:
> On Fri, 15 May 2026 13:45:18 +0000, Shivaprasad G Bhat wrote:
>
>> 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.
>>
>> [...]
>
> Applied to 7.3/scsi-queue, thanks!
Thanks for pulling the patch. Would it possible to get this fix into 7.2
stream as well?
Regards,
Shivaprasad
</snip>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] [SCSI] qla2xxx: Handle the INTx not connected while passing through
2026-08-07 8:23 ` Shivaprasad G Bhat
@ 2026-08-07 14:45 ` Martin K. Petersen
0 siblings, 0 replies; 8+ messages in thread
From: Martin K. Petersen @ 2026-08-07 14:45 UTC (permalink / raw)
To: Shivaprasad G Bhat
Cc: Martin K. Petersen, njavali, James.Bottomley, Madhavan Srinivasan,
Harsh Prateek Bora, linux-kernel, linuxppc-dev, linux-scsi
Shivaprasad,
> Thanks for pulling the patch. Would it possible to get this fix into
> 7.2 stream as well?
Due to conflicting with the large qla2xxx update this cycle, I deemed it
best to leave it in 7.3. But you can post a stable backport request once
Linus has merged the SCSI tree.
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 8+ messages in thread