Re: [PATCH 4/4] HID: Intel-thc-hid: Intel-quickspi: Remove redundant dev_err()
From: sashiko-bot@kernel.org
Date: 2026-07-13 13:35:45
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: Pre-existing issues: - [High] This problem wasn't introduced by this patch, but the driver double-decrements the runtime PM usage counter in quickspi_probe, leading to an underflow. --
--- Patch [4]: [PATCH 4/4] HID: Intel-thc-hid: Intel-quickspi: Remove redundant dev_err() ---commit 8f8bad90f3cb44d16834df11da9c79f13af5488d Author: Pan Chuang [off-list ref] HID: Intel-thc-hid: Intel-quickspi: Remove redundant dev_err() This commit removes a redundant dev_err() call after devm_request_threaded_irq() in the quickspi_probe function, relying on the core's built-in error logging to handle failures.
quoted hunk ↗ jump to hunk
diff --git a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c index 4ae2e1718b30c..504ef3c842ab6 100644 --- a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c +++ b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c@@ -636,11 +636,8 @@ static int quickspi_probe(struct pci_dev *pdev, quickspi_irq_thread_handler, IRQF_ONESHOT, KBUILD_MODNAME, qsdev); - if (ret) { - dev_err(&pdev->dev, - "Failed to request threaded IRQ, irq = %d.\n", pdev->irq); + if (ret) goto dev_deinit;
[Severity: High]
This problem wasn't introduced by this patch, but while reviewing
quickspi_probe(), I noticed the driver appears to double-decrement the
runtime PM usage counter later in the same function:
drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c:quickspi_probe() {
...
/* Enable runtime power management */
pm_runtime_use_autosuspend(qsdev->dev);
pm_runtime_set_autosuspend_delay(qsdev->dev, DEFAULT_AUTO_SUSPEND_DELAY_MS);
pm_runtime_put_noidle(qsdev->dev);
pm_runtime_put_autosuspend(qsdev->dev);
...
}
Will this cause a PM runtime usage count underflow?
During device probe, the PCI core inherently takes a PM runtime reference.
Calling both pm_runtime_put_noidle() and pm_runtime_put_autosuspend() drops
two references while only one was acquired. This could potentially break
runtime power management for the device.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260713132439.380121-1-panchuang@vivo.com?part=4