Thread (12 messages) 12 messages, 5 authors, 6d ago

Re: [PATCH 1/4] HID: amd_sfh: Remove redundant dev_err()

From: sashiko-bot@kernel.org
Date: 2026-07-13 13:34:58

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The driver requests a legacy PCI interrupt without the IRQF_SHARED flag and unconditionally returns IRQ_HANDLED.
--
--- Patch [1]: [PATCH 1/4] HID: amd_sfh: Remove redundant dev_err() ---
commit 545a05506a276434e2b80762c55fb8e2b1f6fc64
Author: Pan Chuang [off-list ref]

HID: amd_sfh: Remove redundant dev_err()

This commit removes a driver-specific error logging call after
devm_request_irq() because the core API now automatically logs detailed
error messages on failure.
quoted hunk ↗ jump to hunk
diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
index 4b81cebdc3359..a2acd3ca20e2c 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
@@ -128,11 +128,8 @@ int amd_sfh_irq_init_v2(struct amd_mp2_dev *privdata)
 
 	rc = devm_request_irq(&privdata->pdev->dev, privdata->pdev->irq,
 			      amd_sfh_irq_handler, 0, DRIVER_NAME, privdata);
[Severity: High]
This is a pre-existing issue, but does this code need to handle shared
interrupts?

Since this requests a legacy PCI interrupt (INTx) with irqflags=0, it requests
exclusive access to the IRQ. If the interrupt is routed to a shared line with
another device, will devm_request_irq() fail with -EBUSY and prevent the
driver from probing?

Additionally, the interrupt handler unconditionally returns IRQ_HANDLED:

drivers/hid/amd-sfh-hid/amd_sfh_pcie.c:amd_sfh_irq_handler() {
    amd_sfh_clear_intr(data);

    return IRQ_HANDLED;
}

If this driver successfully claims the IRQ first and the line is shared,
would this unconditional return erroneously suppress the kernel's unhandled
interrupt detection for other devices on the same line?
-	if (rc) {
-		dev_err(&privdata->pdev->dev, "failed to request irq %d err=%d\n",
-			privdata->pdev->irq, rc);
+	if (rc)
 		return rc;
-	}
 
 	return 0;
 }
-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260713132439.380121-1-panchuang@vivo.com?part=1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help