Skip to contentSkip to conversation

PCI: amd-mdb: fix incorrect IRQ number in INTx error message

PATCH Applied Rakuram Eswaran 4 participants 6 messages Dec 23, 2025 – Feb 26

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: amd-mdb: fix incorrect IRQ number in INTx error message

The INTx devm_request_irq() failure path logs an incorrect IRQ number. The printed 'irq' variable refers to a previous MDB interrupt mapping and does not correspond to the INTx IRQ being requested.

Fix the error message to report pcie->intx_irq, which is the IRQ associated with the failing request.

---
Testing note:
Compile-tested only.

Static analysis was performed with Smatch to ensure the reported warning no longer reproduces after applying this fix.

Command using for testing:
~/project/smatch/smatch_scripts/kchecker ./drivers/pci/controller/dwc/pcie-amd-mdb.c

 drivers/pci/controller/dwc/pcie-amd-mdb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-amd-mdb.c +1 -1
index 3c6e837465bb..7e50e11fbffd 100644
@@ -389,7 +389,7 @@ static int amd_mdb_setup_irq(struct amd_mdb_pcie *pcie,
 			       IRQF_NO_THREAD, NULL, pcie);
 	if (err) {
 		dev_err(dev, "Failed to request INTx IRQ %d, err=%d\n",
-			irq, err);
+			pcie->intx_irq, err);
 		return err;
 	}
 
Signature · 1 line
2.51.0
#1 lore raw
Quoted 31 lines · Rakuram Eswaran

The INTx devm_request_irq() failure path logs an incorrect IRQ number. The printed 'irq' variable refers to a previous MDB interrupt mapping and does not correspond to the INTx IRQ being requested.

Fix the error message to report pcie->intx_irq, which is the IRQ associated with the failing request.

---
Testing note:
Compile-tested only.

Static analysis was performed with Smatch to ensure the reported warning no longer reproduces after applying this fix.

Command using for testing:
~/project/smatch/smatch_scripts/kchecker ./drivers/pci/controller/dwc/pcie-amd-mdb.c

 drivers/pci/controller/dwc/pcie-amd-mdb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-amd-mdb.c +0 -0
index 3c6e837465bb..7e50e11fbffd 100644

drivers/pci/controller/dwc/pcie-amd-mdb.c static int amd_mdb_setup_irq(struct amd_mdb_pcie *pcie, · line 395

Quoted 8 lines
drivers/pci/controller/dwc/pcie-amd-mdb.c +1 -1
@@ -389,7 +389,7 @@ static int amd_mdb_setup_irq(struct amd_mdb_pcie *pcie,
                               IRQF_NO_THREAD, NULL, pcie);
        if (err) {
                dev_err(dev, "Failed to request INTx IRQ %d, err=%d\n",
-                       irq, err);
+                       pcie->intx_irq, err);
                return err;
        }
 

Hello,

Gentle ping — any feedback on this patch?

Best Regards,
Rakuram

#2 lore raw
In reply to Rakuram Eswaran

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Rakuram,

Quoted 48 lines

-----Original Message-----
From: Rakuram Eswaran <[email protected]>
Sent: Wednesday, December 24, 2025 12:10 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; Musham, Sai Krishna <[email protected]>; [email protected]; [email protected]; Havalige, Thippeswamy <[email protected]>; linux- [email protected]; [email protected]; Rakuram Eswaran <[email protected]>; Dan Carpenter <[email protected]>
Subject: [PATCH] PCI: amd-mdb: fix incorrect IRQ number in INTx error message

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.

The INTx devm_request_irq() failure path logs an incorrect IRQ number. The printed 'irq' variable refers to a previous MDB interrupt mapping and does not correspond to the INTx IRQ being requested.

Fix the error message to report pcie->intx_irq, which is the IRQ associated with the failing request.

---
Testing note:
Compile-tested only.

Static analysis was performed with Smatch to ensure the reported warning no longer reproduces after applying this fix.

Command using for testing:
~/project/smatch/smatch_scripts/kchecker ./drivers/pci/controller/dwc/pcie-amd- mdb.c

 drivers/pci/controller/dwc/pcie-amd-mdb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie- renamed from drivers/pci/controller/dwc/pcie-amd-mdb.c +0 -0

amd-mdb.c
index 3c6e837465bb..7e50e11fbffd 100644

drivers/pci/controller/dwc/pcie-amd-mdb.c static int amd_mdb_setup_irq(struct amd_mdb_pcie *pcie, · line 392

Quoted 5 lines
drivers/pci/controller/dwc/pcie-amd-mdb.c +1 -1
@@ -389,7 +389,7 @@ static int amd_mdb_setup_irq(struct amd_mdb_pcie *pcie,
                               IRQF_NO_THREAD, NULL, pcie);
        if (err) {
                dev_err(dev, "Failed to request INTx IRQ %d, err=%d\n",
-                       irq, err);
+                       pcie->intx_irq, err);

The fix is correct. The irq variable at that point contains the last IRQ mapped in the preceding for loop (an MDB event IRQ), not the INTx IRQ being requested via devm_request_irq(). Using pcie->intx_irq accurately reports the failing IRQ number.

Thanks,
Sai Krishna

#3 lore raw
Quoted 63 lines · Sai Krishna

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Rakuram,

Quoted 48 lines

-----Original Message-----
From: Rakuram Eswaran <[email protected]>
Sent: Wednesday, December 24, 2025 12:10 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; Musham, Sai Krishna <[email protected]>; [email protected]; [email protected]; Havalige, Thippeswamy <[email protected]>; linux- [email protected]; [email protected]; Rakuram Eswaran <[email protected]>; Dan Carpenter <[email protected]>
Subject: [PATCH] PCI: amd-mdb: fix incorrect IRQ number in INTx error message

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.

The INTx devm_request_irq() failure path logs an incorrect IRQ number. The printed 'irq' variable refers to a previous MDB interrupt mapping and does not correspond to the INTx IRQ being requested.

Fix the error message to report pcie->intx_irq, which is the IRQ associated with the failing request.

---
Testing note:
Compile-tested only.

Static analysis was performed with Smatch to ensure the reported warning no longer reproduces after applying this fix.

Command using for testing:
~/project/smatch/smatch_scripts/kchecker ./drivers/pci/controller/dwc/pcie-amd- mdb.c

 drivers/pci/controller/dwc/pcie-amd-mdb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie- renamed from drivers/pci/controller/dwc/pcie-amd-mdb.c +0 -0

amd-mdb.c
index 3c6e837465bb..7e50e11fbffd 100644

drivers/pci/controller/dwc/pcie-amd-mdb.c static int amd_mdb_setup_irq(struct amd_mdb_pcie *pcie, · line 392

Quoted 5 lines
drivers/pci/controller/dwc/pcie-amd-mdb.c +1 -1
@@ -389,7 +389,7 @@ static int amd_mdb_setup_irq(struct amd_mdb_pcie *pcie,
                               IRQF_NO_THREAD, NULL, pcie);
        if (err) {
                dev_err(dev, "Failed to request INTx IRQ %d, err=%d\n",
-                       irq, err);
+                       pcie->intx_irq, err);

The fix is correct. The irq variable at that point contains the last IRQ mapped in the preceding for loop (an MDB event IRQ), not the INTx IRQ being requested via devm_request_irq(). Using pcie->intx_irq accurately reports the failing IRQ number.

Quoted 2 lines

Thanks,
Sai Krishna

Sai, if you include a "Reviewed-by: Sai Krishna <email-addr>", we can add that when merging the fix. It sounds like that's your intent, but I don't want to presume.

Reviewed-by on v1 1/1
#4 lore raw
In reply to Rakuram Eswaran

[AMD Official Use Only - AMD Internal Distribution Only]

Quoted 35 lines

-----Original Message-----
From: Rakuram Eswaran <[email protected]>
Sent: Wednesday, December 24, 2025 12:10 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; Musham, Sai Krishna <[email protected]>; [email protected]; [email protected]; Havalige, Thippeswamy <[email protected]>; linux- [email protected]; [email protected]; Rakuram Eswaran <[email protected]>; Dan Carpenter <[email protected]>
Subject: [PATCH] PCI: amd-mdb: fix incorrect IRQ number in INTx error message

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.

The INTx devm_request_irq() failure path logs an incorrect IRQ number. The printed 'irq' variable refers to a previous MDB interrupt mapping and does not correspond to the INTx IRQ being requested.

Fix the error message to report pcie->intx_irq, which is the IRQ associated with the failing request.

---
Testing note:
Compile-tested only.

Static analysis was performed with Smatch to ensure the reported warning no longer reproduces after applying this fix.

Quoted 7 lines

Command using for testing:
~/project/smatch/smatch_scripts/kchecker ./drivers/pci/controller/dwc/pcie-amd- mdb.c

 drivers/pci/controller/dwc/pcie-amd-mdb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#5 lore raw
In reply to Rakuram Eswaran
Quoted 9 lines · Rakuram Eswaran

The INTx devm_request_irq() failure path logs an incorrect IRQ number. The printed 'irq' variable refers to a previous MDB interrupt mapping and does not correspond to the INTx IRQ being requested.

Fix the error message to report pcie->intx_irq, which is the IRQ associated with the failing request.

[...]

Applied, thanks!

[1/1] PCI: amd-mdb: fix incorrect IRQ number in INTx error message

      commit: 821578559ef68583dc3f1fcaaf9dfa00147348b7

Best regards,

Signature · 1 line
Manivannan Sadhasivam <[email protected]>