PCI: amd-mdb: fix incorrect IRQ number in INTx error message
Subsystems (2)
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
@@ -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
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.Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by Rakuram Eswaran <[email protected]>---
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.cdrivers/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
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
[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 messageCaution: 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.Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by Rakuram Eswaran <[email protected]>---
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.cdrivers/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
index3c6e837465bb..7e50e11fbffd100644
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
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 messageCaution: 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.Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by Rakuram Eswaran <[email protected]>---
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.cdrivers/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
index3c6e837465bb..7e50e11fbffd100644drivers/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
irqvariable at that point contains the last IRQ mapped in the preceding for loop (an MDB event IRQ), not the INTx IRQ being requested viadevm_request_irq(). Usingpcie->intx_irqaccurately 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.
[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 messageCaution: 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.Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by Rakuram Eswaran <[email protected]>---
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.cdrivers/pci/controller/dwc/pcie-amd-mdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Manivannan Sadhasivam
AppliedQuoted 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]>