[PATCH 26/80] HID: intel-thc-hid: Remove redundant pm_runtime_mark_last_busy() calls

Sakari Ailus posted 80 patches 3 months ago
[PATCH 26/80] HID: intel-thc-hid: Remove redundant pm_runtime_mark_last_busy() calls
Posted by Sakari Ailus 3 months ago
pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
pm_runtime_mark_last_busy().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
The cover letter of the set can be found here
<URL:https://lore.kernel.org/linux-pm/20250704075225.3212486-1-sakari.ailus@linux.intel.com>.

In brief, this patch depends on PM runtime patches adding marking the last
busy timestamp in autosuspend related functions. The patches are here, on
rc2:

        git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \
                pm-runtime-6.17-rc1

 drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c | 2 --
 drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c | 1 -
 drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c | 2 --
 drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c | 1 -
 4 files changed, 6 deletions(-)

diff --git a/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c b/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c
index e944a6ccb776..599f12d3e657 100644
--- a/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c
+++ b/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c
@@ -328,7 +328,6 @@ static irqreturn_t quicki2c_irq_thread_handler(int irq, void *dev_id)
 		if (try_recover(qcdev))
 			qcdev->state = QUICKI2C_DISABLED;
 
-	pm_runtime_mark_last_busy(qcdev->dev);
 	pm_runtime_put_autosuspend(qcdev->dev);
 
 	return IRQ_HANDLED;
@@ -711,7 +710,6 @@ static int quicki2c_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	/* Enable runtime power management */
 	pm_runtime_use_autosuspend(qcdev->dev);
 	pm_runtime_set_autosuspend_delay(qcdev->dev, DEFAULT_AUTO_SUSPEND_DELAY_MS);
-	pm_runtime_mark_last_busy(qcdev->dev);
 	pm_runtime_put_noidle(qcdev->dev);
 	pm_runtime_put_autosuspend(qcdev->dev);
 
diff --git a/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c b/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c
index 5c3ec95bb3fd..834a537b6780 100644
--- a/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c
+++ b/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c
@@ -72,7 +72,6 @@ static int quicki2c_hid_raw_request(struct hid_device *hid,
 		break;
 	}
 
-	pm_runtime_mark_last_busy(qcdev->dev);
 	pm_runtime_put_autosuspend(qcdev->dev);
 
 	return ret;
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 5e5f179dd113..2b518d88645a 100644
--- a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
+++ b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
@@ -335,7 +335,6 @@ static irqreturn_t quickspi_irq_thread_handler(int irq, void *dev_id)
 		if (try_recover(qsdev))
 			qsdev->state = QUICKSPI_DISABLED;
 
-	pm_runtime_mark_last_busy(qsdev->dev);
 	pm_runtime_put_autosuspend(qsdev->dev);
 
 	return IRQ_HANDLED;
@@ -670,7 +669,6 @@ static int quickspi_probe(struct pci_dev *pdev,
 	/* Enable runtime power management */
 	pm_runtime_use_autosuspend(qsdev->dev);
 	pm_runtime_set_autosuspend_delay(qsdev->dev, DEFAULT_AUTO_SUSPEND_DELAY_MS);
-	pm_runtime_mark_last_busy(qsdev->dev);
 	pm_runtime_put_noidle(qsdev->dev);
 	pm_runtime_put_autosuspend(qsdev->dev);
 
diff --git a/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c b/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c
index ad52e402c28a..82c72bfa2795 100644
--- a/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c
+++ b/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c
@@ -71,7 +71,6 @@ static int quickspi_hid_raw_request(struct hid_device *hid,
 		break;
 	}
 
-	pm_runtime_mark_last_busy(qsdev->dev);
 	pm_runtime_put_autosuspend(qsdev->dev);
 
 	return ret;
-- 
2.39.5
RE: [PATCH 26/80] HID: intel-thc-hid: Remove redundant pm_runtime_mark_last_busy() calls
Posted by Xu, Even 3 months ago

> -----Original Message-----
> From: Sakari Ailus <sakari.ailus@linux.intel.com>
> Sent: Friday, July 4, 2025 3:54 PM
> To: Xu, Even <even.xu@intel.com>; Sun, Xinpeng <xinpeng.sun@intel.com>; Jiri
> Kosina <jikos@kernel.org>; Benjamin Tissoires <bentiss@kernel.org>; Srinivas
> Pandruvada <srinivas.pandruvada@linux.intel.com>; Mark Pearson <mpearson-
> lenovo@squebb.ca>; Sakari Ailus <sakari.ailus@linux.intel.com>; Wentao Guan
> <guanwentao@uniontech.com>; Philipp Stanner <phasta@kernel.org>
> Cc: linux-input@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH 26/80] HID: intel-thc-hid: Remove redundant
> pm_runtime_mark_last_busy() calls
> 
> pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
> pm_runtime_autosuspend() and pm_request_autosuspend() now include a call to
> pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
> pm_runtime_mark_last_busy().
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
> The cover letter of the set can be found here <URL:https://lore.kernel.org/linux-
> pm/20250704075225.3212486-1-sakari.ailus@linux.intel.com>.
> 
> In brief, this patch depends on PM runtime patches adding marking the last busy
> timestamp in autosuspend related functions. The patches are here, on
> rc2:
> 
>         git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \
>                 pm-runtime-6.17-rc1
> 

Make sense, Thanks for the change!

Reviewed-by: Even Xu <even.xu@intel.com>

>  drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c | 2 --  drivers/hid/intel-
> thc-hid/intel-quicki2c/quicki2c-hid.c | 1 -  drivers/hid/intel-thc-hid/intel-
> quickspi/pci-quickspi.c | 2 --  drivers/hid/intel-thc-hid/intel-quickspi/quickspi-
> hid.c | 1 -
>  4 files changed, 6 deletions(-)
> 
> diff --git a/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c
> b/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c
> index e944a6ccb776..599f12d3e657 100644
> --- a/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c
> +++ b/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c
> @@ -328,7 +328,6 @@ static irqreturn_t quicki2c_irq_thread_handler(int irq,
> void *dev_id)
>  		if (try_recover(qcdev))
>  			qcdev->state = QUICKI2C_DISABLED;
> 
> -	pm_runtime_mark_last_busy(qcdev->dev);
>  	pm_runtime_put_autosuspend(qcdev->dev);
> 
>  	return IRQ_HANDLED;
> @@ -711,7 +710,6 @@ static int quicki2c_probe(struct pci_dev *pdev, const
> struct pci_device_id *id)
>  	/* Enable runtime power management */
>  	pm_runtime_use_autosuspend(qcdev->dev);
>  	pm_runtime_set_autosuspend_delay(qcdev->dev,
> DEFAULT_AUTO_SUSPEND_DELAY_MS);
> -	pm_runtime_mark_last_busy(qcdev->dev);
>  	pm_runtime_put_noidle(qcdev->dev);
>  	pm_runtime_put_autosuspend(qcdev->dev);
> 
> diff --git a/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c
> b/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c
> index 5c3ec95bb3fd..834a537b6780 100644
> --- a/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c
> +++ b/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c
> @@ -72,7 +72,6 @@ static int quicki2c_hid_raw_request(struct hid_device *hid,
>  		break;
>  	}
> 
> -	pm_runtime_mark_last_busy(qcdev->dev);
>  	pm_runtime_put_autosuspend(qcdev->dev);
> 
>  	return ret;
> 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 5e5f179dd113..2b518d88645a 100644
> --- a/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> +++ b/drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c
> @@ -335,7 +335,6 @@ static irqreturn_t quickspi_irq_thread_handler(int irq,
> void *dev_id)
>  		if (try_recover(qsdev))
>  			qsdev->state = QUICKSPI_DISABLED;
> 
> -	pm_runtime_mark_last_busy(qsdev->dev);
>  	pm_runtime_put_autosuspend(qsdev->dev);
> 
>  	return IRQ_HANDLED;
> @@ -670,7 +669,6 @@ static int quickspi_probe(struct pci_dev *pdev,
>  	/* Enable runtime power management */
>  	pm_runtime_use_autosuspend(qsdev->dev);
>  	pm_runtime_set_autosuspend_delay(qsdev->dev,
> DEFAULT_AUTO_SUSPEND_DELAY_MS);
> -	pm_runtime_mark_last_busy(qsdev->dev);
>  	pm_runtime_put_noidle(qsdev->dev);
>  	pm_runtime_put_autosuspend(qsdev->dev);
> 
> diff --git a/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c
> b/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c
> index ad52e402c28a..82c72bfa2795 100644
> --- a/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c
> +++ b/drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c
> @@ -71,7 +71,6 @@ static int quickspi_hid_raw_request(struct hid_device *hid,
>  		break;
>  	}
> 
> -	pm_runtime_mark_last_busy(qsdev->dev);
>  	pm_runtime_put_autosuspend(qsdev->dev);
> 
>  	return ret;
> --
> 2.39.5