Skip to contentSkip to conversation

drm/amd: Remove redundant pm_runtime_mark_last_busy() calls

PATCH Applied Sakari Ailus 3 participants 6 messages Oct 27, 2025 – Oct 28, 2025

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

PATCH 1/3 drm/amd: 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().

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c      |  1 -
 .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    | 16 +++---------
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c   | 25 -------------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |  2 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       |  4 ---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c     |  2 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c       |  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c       |  2 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c       |  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c       |  1 -
 .../gpu/drm/amd/amdgpu/amdgpu_securedisplay.c |  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c     |  1 -
 drivers/gpu/drm/amd/amdkfd/kfd_process.c      |  1 -
 drivers/gpu/drm/amd/pm/amdgpu_pm.c            |  1 -
 14 files changed, 4 insertions(+), 55 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +0 -1
index 6c62e27b9800..d31460a9e958 100644
@@ -507,7 +507,6 @@ static int amdgpu_atif_handler(struct amdgpu_device *adev,
 				pm_runtime_get_sync(adev_to_drm(adev)->dev);
 				/* Just fire off a uevent and let userspace tell us what to do */
 				drm_helper_hpd_irq_event(adev_to_drm(adev));
-				pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 				pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 			}
 		}
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +4 -12
index 47e9bfba0642..9f96d568acf2 100644
@@ -734,10 +734,8 @@ amdgpu_connector_lvds_detect(struct drm_connector *connector, bool force)
 
 	amdgpu_connector_update_scratch_regs(connector, ret);
 
-	if (!drm_kms_helper_is_poll_worker()) {
-		pm_runtime_mark_last_busy(connector->dev->dev);
+	if (!drm_kms_helper_is_poll_worker())
 		pm_runtime_put_autosuspend(connector->dev->dev);
-	}
 
 	return ret;
 }
@@ -919,10 +917,8 @@ amdgpu_connector_vga_detect(struct drm_connector *connector, bool force)
 	amdgpu_connector_update_scratch_regs(connector, ret);
 
 out:
-	if (!drm_kms_helper_is_poll_worker()) {
-		pm_runtime_mark_last_busy(connector->dev->dev);
+	if (!drm_kms_helper_is_poll_worker())
 		pm_runtime_put_autosuspend(connector->dev->dev);
-	}
 
 	return ret;
 }
@@ -1146,10 +1142,8 @@ amdgpu_connector_dvi_detect(struct drm_connector *connector, bool force)
 	amdgpu_connector_update_scratch_regs(connector, ret);
 
 exit:
-	if (!drm_kms_helper_is_poll_worker()) {
-		pm_runtime_mark_last_busy(connector->dev->dev);
+	if (!drm_kms_helper_is_poll_worker())
 		pm_runtime_put_autosuspend(connector->dev->dev);
-	}
 
 	return ret;
 }
@@ -1486,10 +1480,8 @@ amdgpu_connector_dp_detect(struct drm_connector *connector, bool force)
 
 	amdgpu_connector_update_scratch_regs(connector, ret);
 out:
-	if (!drm_kms_helper_is_poll_worker()) {
-		pm_runtime_mark_last_busy(connector->dev->dev);
+	if (!drm_kms_helper_is_poll_worker())
 		pm_runtime_put_autosuspend(connector->dev->dev);
-	}
 
 	if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
 	    connector->connector_type == DRM_MODE_CONNECTOR_eDP)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -25
index d3a5189bd512..62d43b8cbe58 100644
@@ -129,7 +129,6 @@ static int  amdgpu_debugfs_process_reg_op(bool read, struct file *f,
 	if (use_bank) {
 		if ((sh_bank != 0xFFFFFFFF && sh_bank >= adev->gfx.config.max_sh_per_se) ||
 		    (se_bank != 0xFFFFFFFF && se_bank >= adev->gfx.config.max_shader_engines)) {
-			pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 			pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 			amdgpu_virt_disable_access_debugfs(adev);
 			return -EINVAL;
@@ -179,7 +178,6 @@ static int  amdgpu_debugfs_process_reg_op(bool read, struct file *f,
 	if (pm_pg_lock)
 		mutex_unlock(&adev->pm.mutex);
 
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
 	amdgpu_virt_disable_access_debugfs(adev);
@@ -255,7 +253,6 @@ static ssize_t amdgpu_debugfs_regs2_op(struct file *f, char __user *buf, u32 off
 	if (rd->id.use_grbm) {
 		if ((rd->id.grbm.sh != 0xFFFFFFFF && rd->id.grbm.sh >= adev->gfx.config.max_sh_per_se) ||
 		    (rd->id.grbm.se != 0xFFFFFFFF && rd->id.grbm.se >= adev->gfx.config.max_shader_engines)) {
-			pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 			pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 			amdgpu_virt_disable_access_debugfs(adev);
 			mutex_unlock(&rd->lock);
@@ -310,7 +307,6 @@ static ssize_t amdgpu_debugfs_regs2_op(struct file *f, char __user *buf, u32 off
 
 	mutex_unlock(&rd->lock);
 
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
 	amdgpu_virt_disable_access_debugfs(adev);
@@ -446,7 +442,6 @@ static ssize_t amdgpu_debugfs_gprwave_read(struct file *f, char __user *buf, siz
 	amdgpu_gfx_select_se_sh(adev, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, rd->id.xcc_id);
 	mutex_unlock(&adev->grbm_idx_mutex);
 
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
 	if (!x) {
@@ -557,7 +552,6 @@ static ssize_t amdgpu_debugfs_regs_pcie_read(struct file *f, char __user *buf,
 
 	r = result;
 out:
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 	amdgpu_virt_disable_access_debugfs(adev);
 	return r;
@@ -617,7 +611,6 @@ static ssize_t amdgpu_debugfs_regs_pcie_write(struct file *f, const char __user
 
 	r = result;
 out:
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 	amdgpu_virt_disable_access_debugfs(adev);
 	return r;
@@ -676,7 +669,6 @@ static ssize_t amdgpu_debugfs_regs_didt_read(struct file *f, char __user *buf,
 
 	r = result;
 out:
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 	amdgpu_virt_disable_access_debugfs(adev);
 	return r;
@@ -736,7 +728,6 @@ static ssize_t amdgpu_debugfs_regs_didt_write(struct file *f, const char __user
 
 	r = result;
 out:
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 	amdgpu_virt_disable_access_debugfs(adev);
 	return r;
@@ -795,7 +786,6 @@ static ssize_t amdgpu_debugfs_regs_smc_read(struct file *f, char __user *buf,
 
 	r = result;
 out:
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 	amdgpu_virt_disable_access_debugfs(adev);
 	return r;
@@ -855,7 +845,6 @@ static ssize_t amdgpu_debugfs_regs_smc_write(struct file *f, const char __user *
 
 	r = result;
 out:
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 	amdgpu_virt_disable_access_debugfs(adev);
 	return r;
@@ -1003,7 +992,6 @@ static ssize_t amdgpu_debugfs_sensor_read(struct file *f, char __user *buf,
 
 	r = amdgpu_dpm_read_sensor(adev, idx, &values[0], &valuesize);
 
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
 	if (r) {
@@ -1094,7 +1082,6 @@ static ssize_t amdgpu_debugfs_wave_read(struct file *f, char __user *buf,
 	amdgpu_gfx_select_se_sh(adev, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0);
 	mutex_unlock(&adev->grbm_idx_mutex);
 
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
 	if (!x) {
@@ -1192,7 +1179,6 @@ static ssize_t amdgpu_debugfs_gpr_read(struct file *f, char __user *buf,
 	amdgpu_gfx_select_se_sh(adev, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0);
 	mutex_unlock(&adev->grbm_idx_mutex);
 
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
 	while (size) {
@@ -1266,7 +1252,6 @@ static ssize_t amdgpu_debugfs_gfxoff_residency_read(struct file *f, char __user
 
 	r = result;
 out:
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
 	return r;
@@ -1315,7 +1300,6 @@ static ssize_t amdgpu_debugfs_gfxoff_residency_write(struct file *f, const char
 
 	r = result;
 out:
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
 	return r;
@@ -1365,7 +1349,6 @@ static ssize_t amdgpu_debugfs_gfxoff_count_read(struct file *f, char __user *buf
 
 	r = result;
 out:
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
 	return r;
@@ -1414,7 +1397,6 @@ static ssize_t amdgpu_debugfs_gfxoff_write(struct file *f, const char __user *bu
 
 	r = result;
 out:
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
 	return r;
@@ -1460,7 +1442,6 @@ static ssize_t amdgpu_debugfs_gfxoff_read(struct file *f, char __user *buf,
 
 	r = result;
 out:
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
 	return r;
@@ -1501,7 +1482,6 @@ static ssize_t amdgpu_debugfs_gfxoff_status_read(struct file *f, char __user *bu
 
 	r = result;
 out:
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
 	return r;
@@ -1701,7 +1681,6 @@ static int amdgpu_debugfs_test_ib_show(struct seq_file *m, void *unused)
 
 	up_write(&adev->reset_domain->sem);
 
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 
 	return 0;
@@ -1721,7 +1700,6 @@ static int amdgpu_debugfs_evict_vram(void *data, u64 *val)
 
 	*val = amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM);
 
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 
 	return 0;
@@ -1742,7 +1720,6 @@ static int amdgpu_debugfs_evict_gtt(void *data, u64 *val)
 
 	*val = amdgpu_ttm_evict_resources(adev, TTM_PL_TT);
 
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 
 	return 0;
@@ -1762,7 +1739,6 @@ static int amdgpu_debugfs_benchmark(void *data, u64 val)
 
 	r = amdgpu_benchmark(adev, val);
 
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 
 	return r;
@@ -2014,7 +1990,6 @@ static int amdgpu_debugfs_sclk_set(void *data, u64 val)
 		ret = -EINVAL;
 
 out:
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
 	return ret;
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0 -2
index 51bab32fd8c6..eca8443d9256 100644
@@ -332,8 +332,6 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set,
 		if (crtc->enabled)
 			active = true;
 
-	pm_runtime_mark_last_busy(dev->dev);
-
 	adev = drm_to_adev(dev);
 	/* if we have active crtcs and we don't have a power ref,
 	 * take the current one
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -4
index a36e15beafeb..f159515b7d95 100644
@@ -2228,7 +2228,6 @@ static void amdgpu_get_secondary_funcs(struct amdgpu_device *adev)
 						adev->pdev->bus->number, i);
 		if (p) {
 			pm_runtime_get_sync(&p->dev);
-			pm_runtime_mark_last_busy(&p->dev);
 			pm_runtime_put_autosuspend(&p->dev);
 			pci_dev_put(p);
 		}
@@ -2474,7 +2473,6 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 
 		pm_runtime_allow(ddev->dev);
 
-		pm_runtime_mark_last_busy(ddev->dev);
 		pm_runtime_put_autosuspend(ddev->dev);
 
 		pci_wake_from_d3(pdev, TRUE);
@@ -2934,7 +2932,6 @@ static int amdgpu_pmops_runtime_idle(struct device *dev)
 
 	ret = amdgpu_runtime_idle_check_userq(dev);
 done:
-	pm_runtime_mark_last_busy(dev);
 	pm_runtime_autosuspend(dev);
 	return ret;
 }
@@ -2970,7 +2967,6 @@ long amdgpu_drm_ioctl(struct file *filp,
 
 	ret = drm_ioctl(filp, cmd, arg);
 
-	pm_runtime_mark_last_busy(dev->dev);
 out:
 	pm_runtime_put_autosuspend(dev->dev);
 	return ret;
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +0 -2
index 1fe31d2f2706..c7843e336310 100644
@@ -250,7 +250,6 @@ bool amdgpu_fence_process(struct amdgpu_ring *ring)
 		drv->signalled_wptr = am_fence->wptr;
 		dma_fence_signal(fence);
 		dma_fence_put(fence);
-		pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 		pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 	} while (last_seq != seq);
 
@@ -928,7 +927,6 @@ static int gpu_recover_get(void *data, u64 *val)
 
 	*val = atomic_read(&adev->reset_domain->reset_res);
 
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 
 	return 0;
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0 -1
index 29c927f4d6df..8b118c53f351 100644
@@ -1670,7 +1670,6 @@ static ssize_t amdgpu_gfx_set_run_cleaner_shader(struct device *dev,
 
 	ret = amdgpu_gfx_run_cleaner_shader(adev, value);
 
-	pm_runtime_mark_last_busy(ddev->dev);
 	pm_runtime_put_autosuspend(ddev->dev);
 
 	if (ret)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -2
index b3e6b3fcdf2c..6ee77f431d56 100644
@@ -1471,7 +1471,6 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
 	kfree(fpriv);
 
 out_suspend:
-	pm_runtime_mark_last_busy(dev->dev);
 pm_put:
 	pm_runtime_put_autosuspend(dev->dev);
 
@@ -1539,7 +1538,6 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
 	kfree(fpriv);
 	file_priv->driver_priv = NULL;
 
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 }
 
drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c +0 -1
index 123bcf5c2bb1..bacf888735db 100644
@@ -101,7 +101,6 @@ static ssize_t amdgpu_rap_debugfs_write(struct file *f, const char __user *buf,
 	}
 
 	amdgpu_gfx_off_ctrl(adev, true);
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 
 	return size;
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -1
index ff34e1c0d9e2..c806d4af8c05 100644
@@ -4099,7 +4099,6 @@ static void amdgpu_ras_counte_dw(struct work_struct *work)
 		atomic_set(&con->ras_ue_count, ue_count);
 	}
 
-	pm_runtime_mark_last_busy(dev->dev);
 Out:
 	pm_runtime_put_autosuspend(dev->dev);
 }
drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c +0 -1
index 41ebe690eeff..3739be1b71e0 100644
@@ -159,7 +159,6 @@ static ssize_t amdgpu_securedisplay_debugfs_write(struct file *f, const char __u
 		dev_err(adev->dev, "Invalid input: %s\n", str);
 	}
 
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 
 	return size;
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +0 -1
index 9d4751a39c20..3f75d5daa5a8 100644
@@ -479,7 +479,6 @@ amdgpu_userq_destroy(struct drm_file *filp, int queue_id)
 	amdgpu_userq_cleanup(uq_mgr, queue, queue_id);
 	mutex_unlock(&uq_mgr->userq_mutex);
 
-	pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
 	pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
 	return r;
drivers/gpu/drm/amd/amdkfd/kfd_process.c +0 -1
index ddfe30c13e9d..9e30b9df6d53 100644
@@ -1083,7 +1083,6 @@ static void kfd_process_destroy_pdds(struct kfd_process *p)
 		 * for auto suspend
 		 */
 		if (pdd->runtime_inuse) {
-			pm_runtime_mark_last_busy(adev_to_drm(pdd->dev->adev)->dev);
 			pm_runtime_put_autosuspend(adev_to_drm(pdd->dev->adev)->dev);
 			pdd->runtime_inuse = false;
 		}
drivers/gpu/drm/amd/pm/amdgpu_pm.c +0 -1
index c83d69994380..c88a76cce401 100644
@@ -174,7 +174,6 @@ static int amdgpu_pm_get_access_if_active(struct amdgpu_device *adev)
  */
 static inline void amdgpu_pm_put_access(struct amdgpu_device *adev)
 {
-	pm_runtime_mark_last_busy(adev->dev);
 	pm_runtime_put_autosuspend(adev->dev);
 }
 
Signature · 1 line
2.47.3
#1 lore raw

PATCH 2/3 drm/nouveau: 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().

---
 drivers/gpu/drm/nouveau/dispnv50/disp.c     | 2 --
 drivers/gpu/drm/nouveau/nouveau_connector.c | 1 -
 drivers/gpu/drm/nouveau/nouveau_debugfs.c   | 1 -
 drivers/gpu/drm/nouveau/nouveau_display.c   | 1 -
 drivers/gpu/drm/nouveau/nouveau_drm.c       | 4 ----
 drivers/gpu/drm/nouveau/nouveau_gem.c       | 6 +-----
 6 files changed, 1 insertion(+), 14 deletions(-)
drivers/gpu/drm/nouveau/dispnv50/disp.c +0 -2
index e97e39abf3a2..682d21a8a82d 100644
@@ -1222,7 +1222,6 @@ nv50_mstc_detect(struct drm_connector *connector,
 		goto out;
 
 out:
-	pm_runtime_mark_last_busy(connector->dev->dev);
 	pm_runtime_put_autosuspend(connector->dev->dev);
 	return ret;
 }
@@ -2411,7 +2410,6 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)
 	drm_atomic_state_put(state);
 
 	/* Drop the RPM ref we got from nv50_disp_atomic_commit() */
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 }
 
drivers/gpu/drm/nouveau/nouveau_connector.c +0 -1
index 63621b1510f6..7d0c5e42d1dd 100644
@@ -673,7 +673,6 @@ nouveau_connector_detect(struct drm_connector *connector, bool force)
 	if (!nv_connector->edid)
 		drm_dp_cec_unset_edid(&nv_connector->aux);
 
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 
 	return conn_status;
drivers/gpu/drm/nouveau/nouveau_debugfs.c +0 -1
index c7869a639bef..70ce03e9d7fc 100644
@@ -62,7 +62,6 @@ nouveau_debugfs_strap_peek(struct seq_file *m, void *data)
 	seq_printf(m, "0x%08x\n",
 		   nvif_rd32(&drm->client.device.object, 0x101000));
 
-	pm_runtime_mark_last_busy(drm->dev->dev);
 	pm_runtime_put_autosuspend(drm->dev->dev);
 
 	return 0;
drivers/gpu/drm/nouveau/nouveau_display.c +0 -1
index 00515623a2cc..6747fb5f6b0c 100644
@@ -495,7 +495,6 @@ nouveau_display_hpd_work(struct work_struct *work)
 	if (first_changed_connector)
 		drm_connector_put(first_changed_connector);
 
-	pm_runtime_mark_last_busy(dev->dev);
 noop:
 	pm_runtime_put_autosuspend(dev->dev);
 }
drivers/gpu/drm/nouveau/nouveau_drm.c +0 -4
index 1527b801f013..c077a2b8fc41 100644
@@ -1177,7 +1177,6 @@ nouveau_pmops_runtime_idle(struct device *dev)
 		return -EBUSY;
 	}
 
-	pm_runtime_mark_last_busy(dev);
 	pm_runtime_autosuspend(dev);
 	/* we don't want the main rpm_idle to call suspend - we want to autosuspend */
 	return 1;
@@ -1224,7 +1223,6 @@ nouveau_drm_open(struct drm_device *dev, struct drm_file *fpriv)
 		kfree(cli);
 	}
 
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 	return ret;
 }
@@ -1258,7 +1256,6 @@ nouveau_drm_postclose(struct drm_device *dev, struct drm_file *fpriv)
 
 	nouveau_cli_fini(cli);
 	kfree(cli);
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 	drm_dev_exit(dev_index);
 }
@@ -1306,7 +1303,6 @@ nouveau_drm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		break;
 	}
 
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 	return ret;
 }
drivers/gpu/drm/nouveau/nouveau_gem.c +1 -5
index 395d92ab6271..2abb04ff09f5 100644
@@ -89,7 +89,6 @@ nouveau_gem_object_del(struct drm_gem_object *gem)
 
 	ttm_bo_fini(&nvbo->bo);
 
-	pm_runtime_mark_last_busy(dev);
 	pm_runtime_put_autosuspend(dev);
 }
 
@@ -127,7 +126,6 @@ nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv)
 		ret = nouveau_vma_new(nvbo, vmm, &vma);
 	else
 		ret = 0;
-	pm_runtime_mark_last_busy(dev);
 	pm_runtime_put_autosuspend(dev);
 out:
 	ttm_bo_unreserve(&nvbo->bo);
@@ -204,10 +202,8 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv)
 	if (vma) {
 		if (--vma->refs == 0) {
 			ret = pm_runtime_get_sync(dev);
-			if (!WARN_ON(ret < 0 && ret != -EACCES)) {
+			if (!WARN_ON(ret < 0 && ret != -EACCES))
 				nouveau_gem_object_unmap(nvbo, vma);
-				pm_runtime_mark_last_busy(dev);
-			}
 			pm_runtime_put_autosuspend(dev);
 		}
 	}
Signature · 1 line
2.47.3
#2 lore raw

PATCH 3/3 drm/radeon: Remove redundant pm_runtime_mark_last_busy() calls

In reply to Sakari Ailus

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().

---
 drivers/gpu/drm/radeon/radeon_acpi.c       |  1 -
 drivers/gpu/drm/radeon/radeon_connectors.c | 20 +++++---------------
 drivers/gpu/drm/radeon/radeon_display.c    |  2 --
 drivers/gpu/drm/radeon/radeon_drv.c        |  2 --
 drivers/gpu/drm/radeon/radeon_fbdev.c      |  2 --
 drivers/gpu/drm/radeon/radeon_kms.c        |  4 ----
 6 files changed, 5 insertions(+), 26 deletions(-)
drivers/gpu/drm/radeon/radeon_acpi.c +0 -1
index 22ce61bdfc06..08f8ba4fd148 100644
@@ -408,7 +408,6 @@ static int radeon_atif_handler(struct radeon_device *rdev,
 			pm_runtime_get_sync(rdev_to_drm(rdev)->dev);
 			/* Just fire off a uevent and let userspace tell us what to do */
 			drm_helper_hpd_irq_event(rdev_to_drm(rdev));
-			pm_runtime_mark_last_busy(rdev_to_drm(rdev)->dev);
 			pm_runtime_put_autosuspend(rdev_to_drm(rdev)->dev);
 		}
 	}
drivers/gpu/drm/radeon/radeon_connectors.c +5 -15
index 9f6a3df951ba..012d8b2295b8 100644
@@ -875,10 +875,8 @@ radeon_lvds_detect(struct drm_connector *connector, bool force)
 
 	radeon_connector_update_scratch_regs(connector, ret);
 
-	if (!drm_kms_helper_is_poll_worker()) {
-		pm_runtime_mark_last_busy(connector->dev->dev);
+	if (!drm_kms_helper_is_poll_worker())
 		pm_runtime_put_autosuspend(connector->dev->dev);
-	}
 
 	return ret;
 }
@@ -1066,10 +1064,8 @@ radeon_vga_detect(struct drm_connector *connector, bool force)
 	radeon_connector_update_scratch_regs(connector, ret);
 
 out:
-	if (!drm_kms_helper_is_poll_worker()) {
-		pm_runtime_mark_last_busy(connector->dev->dev);
+	if (!drm_kms_helper_is_poll_worker())
 		pm_runtime_put_autosuspend(connector->dev->dev);
-	}
 
 	return ret;
 }
@@ -1154,10 +1150,8 @@ radeon_tv_detect(struct drm_connector *connector, bool force)
 		ret = radeon_connector_analog_encoder_conflict_solve(connector, encoder, ret, false);
 	radeon_connector_update_scratch_regs(connector, ret);
 
-	if (!drm_kms_helper_is_poll_worker()) {
-		pm_runtime_mark_last_busy(connector->dev->dev);
+	if (!drm_kms_helper_is_poll_worker())
 		pm_runtime_put_autosuspend(connector->dev->dev);
-	}
 
 	return ret;
 }
@@ -1402,10 +1396,8 @@ radeon_dvi_detect(struct drm_connector *connector, bool force)
 	}
 
 exit:
-	if (!drm_kms_helper_is_poll_worker()) {
-		pm_runtime_mark_last_busy(connector->dev->dev);
+	if (!drm_kms_helper_is_poll_worker())
 		pm_runtime_put_autosuspend(connector->dev->dev);
-	}
 
 	return ret;
 }
@@ -1714,10 +1706,8 @@ radeon_dp_detect(struct drm_connector *connector, bool force)
 	}
 
 out:
-	if (!drm_kms_helper_is_poll_worker()) {
-		pm_runtime_mark_last_busy(connector->dev->dev);
+	if (!drm_kms_helper_is_poll_worker())
 		pm_runtime_put_autosuspend(connector->dev->dev);
-	}
 
 	return ret;
 }
drivers/gpu/drm/radeon/radeon_display.c +0 -2
index 351b9dfcdad8..35fb99bcd9a7 100644
@@ -644,8 +644,6 @@ radeon_crtc_set_config(struct drm_mode_set *set,
 		if (crtc->enabled)
 			active = true;
 
-	pm_runtime_mark_last_busy(dev->dev);
-
 	rdev = dev->dev_private;
 	/* if we have active crtcs and we don't have a power ref,
 	   take the current one */
drivers/gpu/drm/radeon/radeon_drv.c +0 -2
index 88e821d67af7..d0af0cef178a 100644
@@ -477,7 +477,6 @@ static int radeon_pmops_runtime_idle(struct device *dev)
 		}
 	}
 
-	pm_runtime_mark_last_busy(dev);
 	pm_runtime_autosuspend(dev);
 	/* we don't want the main rpm_idle to call suspend - we want to autosuspend */
 	return 1;
@@ -499,7 +498,6 @@ long radeon_drm_ioctl(struct file *filp,
 
 	ret = drm_ioctl(filp, cmd, arg);
 
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 	return ret;
 }
drivers/gpu/drm/radeon/radeon_fbdev.c +0 -2
index 4df6c9167bf0..c2cfe2d7915f 100644
@@ -154,7 +154,6 @@ static int radeon_fbdev_fb_open(struct fb_info *info, int user)
 	return 0;
 
 err_pm_runtime_mark_last_busy:
-	pm_runtime_mark_last_busy(rdev_to_drm(rdev)->dev);
 	pm_runtime_put_autosuspend(rdev_to_drm(rdev)->dev);
 	return ret;
 }
@@ -164,7 +163,6 @@ static int radeon_fbdev_fb_release(struct fb_info *info, int user)
 	struct drm_fb_helper *fb_helper = info->par;
 	struct radeon_device *rdev = fb_helper->dev->dev_private;
 
-	pm_runtime_mark_last_busy(rdev_to_drm(rdev)->dev);
 	pm_runtime_put_autosuspend(rdev_to_drm(rdev)->dev);
 
 	return 0;
drivers/gpu/drm/radeon/radeon_kms.c +0 -4
index 645e33bf7947..3144890b6007 100644
@@ -170,7 +170,6 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
 		pm_runtime_set_autosuspend_delay(dev->dev, 5000);
 		pm_runtime_set_active(dev->dev);
 		pm_runtime_allow(dev->dev);
-		pm_runtime_mark_last_busy(dev->dev);
 		pm_runtime_put_autosuspend(dev->dev);
 	}
 
@@ -677,7 +676,6 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
 		file_priv->driver_priv = fpriv;
 	}
 
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 	return 0;
 
@@ -687,7 +685,6 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
 	kfree(fpriv);
 
 err_suspend:
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 	return r;
 }
@@ -737,7 +734,6 @@ void radeon_driver_postclose_kms(struct drm_device *dev,
 		kfree(fpriv);
 		file_priv->driver_priv = NULL;
 	}
-	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
 }
 
Signature · 1 line
2.47.3
maintainer Acked-by on v1 1/3
#3 lore raw
In reply to Sakari Ailus

[Public]

Quoted 35 lines

-----Original Message-----
From: Sakari Ailus <[email protected]>
Sent: Monday, October 27, 2025 9:15 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; David Airlie <[email protected]>; Simona Vetter <[email protected]>; Kuehling, Felix <[email protected]>; Feng, Kenneth <[email protected]>; Lyude Paul <[email protected]>; Danilo Krummrich <[email protected]>; Maarten Lankhorst <[email protected]>; Maxime Ripard <[email protected]>; Thomas Zimmermann <[email protected]>; Limonciello, Mario <[email protected]>; Hung, Alex <[email protected]>; Antonio Quartulli <[email protected]>; Nirujogi, Pratap <[email protected]>; Lazar, Lijo <[email protected]>; Dmitry Baryshkov <[email protected]>; SHANMUGAM, SRINIVASAN <[email protected]>; Wang, Yang(Kevin) <[email protected]>; Khatri, Sunil <[email protected]>; Zhang, Jesse(Jie) <[email protected]>; Ville Syrjälä <[email protected]>; Liviu Dudau <[email protected]>; Laurent Pinchart <[email protected]>; Zhang, Hawking <[email protected]>; Prosyak, Vitaly <[email protected]>; Arnd Bergmann <[email protected]>; Thomas Gleixner <[email protected]>; Ingo Molnar <[email protected]>; Liao Yuanhong <[email protected]>; Rodrigo Siqueira <[email protected]>; Liang, Prike <[email protected]>; Sharma, Shashank <[email protected]>; Paneer Selvam, Arunpravin <[email protected]>; Zhou1, Tao <[email protected]>; Chai, Thomas <[email protected]>; Xie, Patrick <[email protected]>; Liu, Xiang(Dean) <[email protected]>; Skvortsov, Victor <[email protected]>; Sun, Ce(Overlord) <[email protected]>; Dave Airlie <[email protected]>; Jani Nikula <[email protected]>; Gustavo A. R. Silva <[email protected]>; Imre Deak <[email protected]>; Ben Skeggs <[email protected]>; [email protected]; amd- [email protected]
Subject: [PATCH 1/3] drm/amd: Remove redundant pm_runtime_mark_last_busy() calls

Quoted 4 lines

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().

Typo: should be "now-redundant"

Quoted 2 lines

Patches 1, 3 are:

When did mark_last_busy get pulled into the other runtime_pm functions? Did you want me to pick these up or did you want to send them via some other tree?

Thanks,

Alex

Quoted 526 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c      |  1 -
 .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    | 16 +++---------
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c   | 25 -------------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |  2 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       |  4 ---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c     |  2 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c       |  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c       |  2 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c       |  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c       |  1 -
 .../gpu/drm/amd/amdgpu/amdgpu_securedisplay.c |  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c     |  1 -
 drivers/gpu/drm/amd/amdkfd/kfd_process.c      |  1 -
 drivers/gpu/drm/amd/pm/amdgpu_pm.c            |  1 -
 14 files changed, 4 insertions(+), 55 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +0 -0
index 6c62e27b9800..d31460a9e958 100644
@@ -507,7 +507,6 @@ static int amdgpu_atif_handler(struct amdgpu_device
 *adev,
                              pm_runtime_get_sync(adev_to_drm(adev)->dev);
                              /* Just fire off a uevent and let userspace tell us what

to do */

                              drm_helper_hpd_irq_event(adev_to_drm(adev));

- pm_runtime_mark_last_busy(adev_to_drm(adev)-

Quoted 1 line

dev);

pm_runtime_put_autosuspend(adev_to_drm(adev)-

Quoted 1 line

dev);

                      }
              }
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +1 -3
index 47e9bfba0642..9f96d568acf2 100644
@@ -734,10 +734,8 @@ amdgpu_connector_lvds_detect(struct drm_connector
 *connector, bool force)
 
      amdgpu_connector_update_scratch_regs(connector, ret);
 
-     if (!drm_kms_helper_is_poll_worker()) {
-             pm_runtime_mark_last_busy(connector->dev->dev);
+     if (!drm_kms_helper_is_poll_worker())
              pm_runtime_put_autosuspend(connector->dev->dev);
-     }
 
      return ret;

}

drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +1 -3
@@ -919,10 +917,8 @@ amdgpu_connector_vga_detect(struct drm_connector
 *connector, bool force)
      amdgpu_connector_update_scratch_regs(connector, ret);
 
 out:
-     if (!drm_kms_helper_is_poll_worker()) {
-             pm_runtime_mark_last_busy(connector->dev->dev);
+     if (!drm_kms_helper_is_poll_worker())
              pm_runtime_put_autosuspend(connector->dev->dev);
-     }
 
      return ret;

}

drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +1 -3
@@ -1146,10 +1142,8 @@ amdgpu_connector_dvi_detect(struct drm_connector
 *connector, bool force)
      amdgpu_connector_update_scratch_regs(connector, ret);
 
 exit:
-     if (!drm_kms_helper_is_poll_worker()) {
-             pm_runtime_mark_last_busy(connector->dev->dev);
+     if (!drm_kms_helper_is_poll_worker())
              pm_runtime_put_autosuspend(connector->dev->dev);
-     }
 
      return ret;

}

drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +1 -3
@@ -1486,10 +1480,8 @@ amdgpu_connector_dp_detect(struct drm_connector
 *connector, bool force)
 
      amdgpu_connector_update_scratch_regs(connector, ret);
 out:
-     if (!drm_kms_helper_is_poll_worker()) {
-             pm_runtime_mark_last_busy(connector->dev->dev);
+     if (!drm_kms_helper_is_poll_worker())
              pm_runtime_put_autosuspend(connector->dev->dev);
-     }
 
      if (connector->connector_type ==

DRM_MODE_CONNECTOR_DisplayPort ||

          connector->connector_type == DRM_MODE_CONNECTOR_eDP) diff --

git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index d3a5189bd512..62d43b8cbe58 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -0
@@ -129,7 +129,6 @@ static int  amdgpu_debugfs_process_reg_op(bool read,
 struct file *f,
      if (use_bank) {
              if ((sh_bank != 0xFFFFFFFF && sh_bank >= adev-
Quoted 1 line

gfx.config.max_sh_per_se) ||

                  (se_bank != 0xFFFFFFFF && se_bank >= adev-
Quoted 1 line

gfx.config.max_shader_engines)) {

drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -2
-                     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
                      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
                      amdgpu_virt_disable_access_debugfs(adev);
                      return -EINVAL;
@@ -179,7 +178,6 @@ static int  amdgpu_debugfs_process_reg_op(bool read,
 struct file *f,
      if (pm_pg_lock)
              mutex_unlock(&adev->pm.mutex);
 
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
      amdgpu_virt_disable_access_debugfs(adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -0
@@ -255,7 +253,6 @@ static ssize_t amdgpu_debugfs_regs2_op(struct file *f,

char __user *buf, u32 off

      if (rd->id.use_grbm) {
              if ((rd->id.grbm.sh != 0xFFFFFFFF && rd->id.grbm.sh >= adev-
Quoted 1 line

gfx.config.max_sh_per_se) ||

                  (rd->id.grbm.se != 0xFFFFFFFF && rd->id.grbm.se >= adev-
Quoted 1 line

gfx.config.max_shader_engines)) {

drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
-                     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
                      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
                      amdgpu_virt_disable_access_debugfs(adev);
                      mutex_unlock(&rd->lock);
@@ -310,7 +307,6 @@ static ssize_t amdgpu_debugfs_regs2_op(struct file *f,

char __user *buf, u32 off

      mutex_unlock(&rd->lock);
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -2
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
      amdgpu_virt_disable_access_debugfs(adev);
@@ -446,7 +442,6 @@ static ssize_t amdgpu_debugfs_gprwave_read(struct file
 *f, char __user *buf, siz
      amdgpu_gfx_select_se_sh(adev, 0xFFFFFFFF, 0xFFFFFFFF,
 0xFFFFFFFF, rd->id.xcc_id);
      mutex_unlock(&adev->grbm_idx_mutex);
 
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
      if (!x) {
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
@@ -557,7 +552,6 @@ static ssize_t amdgpu_debugfs_regs_pcie_read(struct file
 *f, char __user *buf,
 
      r = result;
 out:
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
      amdgpu_virt_disable_access_debugfs(adev);
      return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
@@ -617,7 +611,6 @@ static ssize_t amdgpu_debugfs_regs_pcie_write(struct file
 *f, const char __user
 
      r = result;
 out:
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
      amdgpu_virt_disable_access_debugfs(adev);
      return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
@@ -676,7 +669,6 @@ static ssize_t amdgpu_debugfs_regs_didt_read(struct file
 *f, char __user *buf,
 
      r = result;
 out:
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
      amdgpu_virt_disable_access_debugfs(adev);
      return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
@@ -736,7 +728,6 @@ static ssize_t amdgpu_debugfs_regs_didt_write(struct file
 *f, const char __user
 
      r = result;
 out:
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
      amdgpu_virt_disable_access_debugfs(adev);
      return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
@@ -795,7 +786,6 @@ static ssize_t amdgpu_debugfs_regs_smc_read(struct file
 *f, char __user *buf,
 
      r = result;
 out:
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
      amdgpu_virt_disable_access_debugfs(adev);
      return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
@@ -855,7 +845,6 @@ static ssize_t amdgpu_debugfs_regs_smc_write(struct file
 *f, const char __user *
 
      r = result;
 out:
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
      amdgpu_virt_disable_access_debugfs(adev);
      return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
@@ -1003,7 +992,6 @@ static ssize_t amdgpu_debugfs_sensor_read(struct file
 *f, char __user *buf,
 
      r = amdgpu_dpm_read_sensor(adev, idx, &values[0], &valuesize);
 
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
      if (r) {
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
@@ -1094,7 +1082,6 @@ static ssize_t amdgpu_debugfs_wave_read(struct file *f,
 char __user *buf,
      amdgpu_gfx_select_se_sh(adev, 0xFFFFFFFF, 0xFFFFFFFF,
 0xFFFFFFFF, 0);
      mutex_unlock(&adev->grbm_idx_mutex);
 
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
      if (!x) {
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
@@ -1192,7 +1179,6 @@ static ssize_t amdgpu_debugfs_gpr_read(struct file *f,
 char __user *buf,
      amdgpu_gfx_select_se_sh(adev, 0xFFFFFFFF, 0xFFFFFFFF,
 0xFFFFFFFF, 0);
      mutex_unlock(&adev->grbm_idx_mutex);
 
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
      while (size) {
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -0
@@ -1266,7 +1252,6 @@ static ssize_t

amdgpu_debugfs_gfxoff_residency_read(struct file *f, char __user

      r = result;

out:

drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
      return r;
@@ -1315,7 +1300,6 @@ static ssize_t

amdgpu_debugfs_gfxoff_residency_write(struct file *f, const char

      r = result;

out:

drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
      return r;
@@ -1365,7 +1349,6 @@ static ssize_t

amdgpu_debugfs_gfxoff_count_read(struct file *f, char __user *buf

      r = result;

out:

drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -2
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
      return r;
@@ -1414,7 +1397,6 @@ static ssize_t amdgpu_debugfs_gfxoff_write(struct file
 *f, const char __user *bu
 
      r = result;
 out:
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
      return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
@@ -1460,7 +1442,6 @@ static ssize_t amdgpu_debugfs_gfxoff_read(struct file *f,
 char __user *buf,
 
      r = result;
 out:
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
      return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -0
@@ -1501,7 +1482,6 @@ static ssize_t

amdgpu_debugfs_gfxoff_status_read(struct file *f, char __user *bu

      r = result;

out:

drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -2
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
      return r;
@@ -1701,7 +1681,6 @@ static int amdgpu_debugfs_test_ib_show(struct seq_file
 *m, void *unused)
 
      up_write(&adev->reset_domain->sem);
 
-     pm_runtime_mark_last_busy(dev->dev);
      pm_runtime_put_autosuspend(dev->dev);
 
      return 0;
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
@@ -1721,7 +1700,6 @@ static int amdgpu_debugfs_evict_vram(void *data, u64
 *val)
 
      *val = amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM);
 
-     pm_runtime_mark_last_busy(dev->dev);
      pm_runtime_put_autosuspend(dev->dev);
 
      return 0;
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
@@ -1742,7 +1720,6 @@ static int amdgpu_debugfs_evict_gtt(void *data, u64
 *val)
 
      *val = amdgpu_ttm_evict_resources(adev, TTM_PL_TT);
 
-     pm_runtime_mark_last_busy(dev->dev);
      pm_runtime_put_autosuspend(dev->dev);
 
      return 0;
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
@@ -1762,7 +1739,6 @@ static int amdgpu_debugfs_benchmark(void *data, u64
 val)
 
      r = amdgpu_benchmark(adev, val);
 
-     pm_runtime_mark_last_busy(dev->dev);
      pm_runtime_put_autosuspend(dev->dev);
 
      return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -1
@@ -2014,7 +1990,6 @@ static int amdgpu_debugfs_sclk_set(void *data, u64 val)
              ret = -EINVAL;
 
 out:
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
      return ret;
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0 -2
index 51bab32fd8c6..eca8443d9256 100644
@@ -332,8 +332,6 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set
 *set,
              if (crtc->enabled)
                      active = true;
 
-     pm_runtime_mark_last_busy(dev->dev);
-
      adev = drm_to_adev(dev);
      /* if we have active crtcs and we don't have a power ref,

* take the current one

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -1
index a36e15beafeb..f159515b7d95 100644
@@ -2228,7 +2228,6 @@ static void amdgpu_get_secondary_funcs(struct
 amdgpu_device *adev)
                                              adev->pdev->bus->number, i);
              if (p) {
                      pm_runtime_get_sync(&p->dev);
-                     pm_runtime_mark_last_busy(&p->dev);
                      pm_runtime_put_autosuspend(&p->dev);
                      pci_dev_put(p);
              }
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -2
@@ -2474,7 +2473,6 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
 
              pm_runtime_allow(ddev->dev);
 
-             pm_runtime_mark_last_busy(ddev->dev);
              pm_runtime_put_autosuspend(ddev->dev);
 
              pci_wake_from_d3(pdev, TRUE);
@@ -2934,7 +2932,6 @@ static int amdgpu_pmops_runtime_idle(struct device
 *dev)
 
      ret = amdgpu_runtime_idle_check_userq(dev);
 done:
-     pm_runtime_mark_last_busy(dev);
      pm_runtime_autosuspend(dev);
      return ret;

}

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0 -1
@@ -2970,7 +2967,6 @@ long amdgpu_drm_ioctl(struct file *filp,
 
      ret = drm_ioctl(filp, cmd, arg);
 
-     pm_runtime_mark_last_busy(dev->dev);
 out:
      pm_runtime_put_autosuspend(dev->dev);
      return ret;
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +0 -2
index 1fe31d2f2706..c7843e336310 100644
@@ -250,7 +250,6 @@ bool amdgpu_fence_process(struct amdgpu_ring *ring)
              drv->signalled_wptr = am_fence->wptr;
              dma_fence_signal(fence);
              dma_fence_put(fence);
-             pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
              pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
      } while (last_seq != seq);
 
@@ -928,7 +927,6 @@ static int gpu_recover_get(void *data, u64 *val)
 
      *val = atomic_read(&adev->reset_domain->reset_res);
 
-     pm_runtime_mark_last_busy(dev->dev);
      pm_runtime_put_autosuspend(dev->dev);
 
      return 0;
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0 -1
index 29c927f4d6df..8b118c53f351 100644
@@ -1670,7 +1670,6 @@ static ssize_t
 amdgpu_gfx_set_run_cleaner_shader(struct device *dev,
 
      ret = amdgpu_gfx_run_cleaner_shader(adev, value);
 
-     pm_runtime_mark_last_busy(ddev->dev);
      pm_runtime_put_autosuspend(ddev->dev);
 

if (ret)

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -2
index b3e6b3fcdf2c..6ee77f431d56 100644
@@ -1471,7 +1471,6 @@ int amdgpu_driver_open_kms(struct drm_device *dev,
 struct drm_file *file_priv)
      kfree(fpriv);
 
 out_suspend:
-     pm_runtime_mark_last_busy(dev->dev);
 pm_put:
      pm_runtime_put_autosuspend(dev->dev);
@@ -1539,7 +1538,6 @@ void amdgpu_driver_postclose_kms(struct drm_device
 *dev,
      kfree(fpriv);
      file_priv->driver_priv = NULL;
 
-     pm_runtime_mark_last_busy(dev->dev);
      pm_runtime_put_autosuspend(dev->dev);
 }
drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c +0 -1
index 123bcf5c2bb1..bacf888735db 100644
@@ -101,7 +101,6 @@ static ssize_t amdgpu_rap_debugfs_write(struct file *f,
 const char __user *buf,
      }
 
      amdgpu_gfx_off_ctrl(adev, true);
-     pm_runtime_mark_last_busy(dev->dev);
      pm_runtime_put_autosuspend(dev->dev);
 
      return size;
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +0 -1
index ff34e1c0d9e2..c806d4af8c05 100644
@@ -4099,7 +4099,6 @@ static void amdgpu_ras_counte_dw(struct work_struct
 *work)
              atomic_set(&con->ras_ue_count, ue_count);
      }
 
-     pm_runtime_mark_last_busy(dev->dev);
 Out:
      pm_runtime_put_autosuspend(dev->dev);

}

drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c +0 -0
index 41ebe690eeff..3739be1b71e0 100644
@@ -159,7 +159,6 @@ static ssize_t

amdgpu_securedisplay_debugfs_write(struct file *f, const char __u

              dev_err(adev->dev, "Invalid input: %s\n", str);
      }
drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c +0 -1
-     pm_runtime_mark_last_busy(dev->dev);
      pm_runtime_put_autosuspend(dev->dev);
 
      return size;
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +0 -1
index 9d4751a39c20..3f75d5daa5a8 100644
@@ -479,7 +479,6 @@ amdgpu_userq_destroy(struct drm_file *filp, int queue_id)
      amdgpu_userq_cleanup(uq_mgr, queue, queue_id);
      mutex_unlock(&uq_mgr->userq_mutex);
 
-     pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
      pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
      return r;
drivers/gpu/drm/amd/amdkfd/kfd_process.c +0 -1
index ddfe30c13e9d..9e30b9df6d53 100644
@@ -1083,7 +1083,6 @@ static void kfd_process_destroy_pdds(struct
 kfd_process *p)
               * for auto suspend
               */
              if (pdd->runtime_inuse) {
-                     pm_runtime_mark_last_busy(adev_to_drm(pdd->dev-
 >adev)->dev);
                      pm_runtime_put_autosuspend(adev_to_drm(pdd->dev-
Quoted 1 line

adev)->dev);

                      pdd->runtime_inuse = false;
              }
drivers/gpu/drm/amd/pm/amdgpu_pm.c +0 -2
index c83d69994380..c88a76cce401 100644
@@ -174,7 +174,6 @@ static int amdgpu_pm_get_access_if_active(struct
 amdgpu_device *adev)
  */
 static inline void amdgpu_pm_put_access(struct amdgpu_device *adev)  {
-     pm_runtime_mark_last_busy(adev->dev);
      pm_runtime_put_autosuspend(adev->dev);
 }
 
--

2.47.3

#4 lore raw

Hi Alexander,

Quoted 37 lines · Alexander

[Public]

Quoted 35 lines

-----Original Message-----
From: Sakari Ailus <[email protected]>
Sent: Monday, October 27, 2025 9:15 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; David Airlie <[email protected]>; Simona Vetter <[email protected]>; Kuehling, Felix <[email protected]>; Feng, Kenneth <[email protected]>; Lyude Paul <[email protected]>; Danilo Krummrich <[email protected]>; Maarten Lankhorst <[email protected]>; Maxime Ripard <[email protected]>; Thomas Zimmermann <[email protected]>; Limonciello, Mario <[email protected]>; Hung, Alex <[email protected]>; Antonio Quartulli <[email protected]>; Nirujogi, Pratap <[email protected]>; Lazar, Lijo <[email protected]>; Dmitry Baryshkov <[email protected]>; SHANMUGAM, SRINIVASAN <[email protected]>; Wang, Yang(Kevin) <[email protected]>; Khatri, Sunil <[email protected]>; Zhang, Jesse(Jie) <[email protected]>; Ville Syrjälä <[email protected]>; Liviu Dudau <[email protected]>; Laurent Pinchart <[email protected]>; Zhang, Hawking <[email protected]>; Prosyak, Vitaly <[email protected]>; Arnd Bergmann <[email protected]>; Thomas Gleixner <[email protected]>; Ingo Molnar <[email protected]>; Liao Yuanhong <[email protected]>; Rodrigo Siqueira <[email protected]>; Liang, Prike <[email protected]>; Sharma, Shashank <[email protected]>; Paneer Selvam, Arunpravin <[email protected]>; Zhou1, Tao <[email protected]>; Chai, Thomas <[email protected]>; Xie, Patrick <[email protected]>; Liu, Xiang(Dean) <[email protected]>; Skvortsov, Victor <[email protected]>; Sun, Ce(Overlord) <[email protected]>; Dave Airlie <[email protected]>; Jani Nikula <[email protected]>; Gustavo A. R. Silva <[email protected]>; Imre Deak <[email protected]>; Ben Skeggs <[email protected]>; [email protected]; amd- [email protected]
Subject: [PATCH 1/3] drm/amd: Remove redundant pm_runtime_mark_last_busy() calls

Quoted 7 lines
Quoted 4 lines

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().

Typo: should be "now-redundant"

Oops. You're first one to notice, in fact.

Quoted 10 lines
Quoted 3 lines

Patches 1, 3 are:

When did mark_last_busy get pulled into the other runtime_pm functions? Did you want me to pick these up or did you want to send them via some other tree?

Yes, please merge these.

pm_runtime_mark_last_busy() has been part of autosuspend related functions since commit 18c1fe53d186867243f4cf17f4eef60737a16c4c, i.e. v6.17.

Signature · 3 lines
Kind regards,

Sakari Ailus
Applied
#5 lore raw
Quoted 55 lines · Sakari Ailus

Hi Alexander,

Quoted 37 lines · Alexander

[Public]

Quoted 35 lines

-----Original Message-----
From: Sakari Ailus <[email protected]>
Sent: Monday, October 27, 2025 9:15 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; David Airlie <[email protected]>; Simona Vetter <[email protected]>; Kuehling, Felix <[email protected]>; Feng, Kenneth <[email protected]>; Lyude Paul <[email protected]>; Danilo Krummrich <[email protected]>; Maarten Lankhorst <[email protected]>; Maxime Ripard <[email protected]>; Thomas Zimmermann <[email protected]>; Limonciello, Mario <[email protected]>; Hung, Alex <[email protected]>; Antonio Quartulli <[email protected]>; Nirujogi, Pratap <[email protected]>; Lazar, Lijo <[email protected]>; Dmitry Baryshkov <[email protected]>; SHANMUGAM, SRINIVASAN <[email protected]>; Wang, Yang(Kevin) <[email protected]>; Khatri, Sunil <[email protected]>; Zhang, Jesse(Jie) <[email protected]>; Ville Syrjälä <[email protected]>; Liviu Dudau <[email protected]>; Laurent Pinchart <[email protected]>; Zhang, Hawking <[email protected]>; Prosyak, Vitaly <[email protected]>; Arnd Bergmann <[email protected]>; Thomas Gleixner <[email protected]>; Ingo Molnar <[email protected]>; Liao Yuanhong <[email protected]>; Rodrigo Siqueira <[email protected]>; Liang, Prike <[email protected]>; Sharma, Shashank <[email protected]>; Paneer Selvam, Arunpravin <[email protected]>; Zhou1, Tao <[email protected]>; Chai, Thomas <[email protected]>; Xie, Patrick <[email protected]>; Liu, Xiang(Dean) <[email protected]>; Skvortsov, Victor <[email protected]>; Sun, Ce(Overlord) <[email protected]>; Dave Airlie <[email protected]>; Jani Nikula <[email protected]>; Gustavo A. R. Silva <[email protected]>; Imre Deak <[email protected]>; Ben Skeggs <[email protected]>; [email protected]; amd- [email protected]
Subject: [PATCH 1/3] drm/amd: Remove redundant pm_runtime_mark_last_busy() calls

Quoted 7 lines
Quoted 4 lines

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().

Typo: should be "now-redundant"

Oops. You're first one to notice, in fact.

Quoted 4 lines
Quoted 3 lines
Quoted 8 lines
Quoted 6 lines

Patches 1, 3 are:

When did mark_last_busy get pulled into the other runtime_pm functions? Did you want me to pick these up or did you want to send them via some other tree?

Yes, please merge these.

Applied. Thanks!

Alex

Quoted 8 lines

pm_runtime_mark_last_busy() has been part of autosuspend related functions since commit 18c1fe53d186867243f4cf17f4eef60737a16c4c, i.e. v6.17.

--
Kind regards,

Sakari Ailus