Skip to content

Commit ef4a4b8

Browse files
Sakari Ailusalexdeucher
authored andcommitted
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-redundant explicit call to pm_runtime_mark_last_busy(). Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 849ad2a commit ef4a4b8

14 files changed

Lines changed: 4 additions & 55 deletions

drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,6 @@ static int amdgpu_atif_handler(struct amdgpu_device *adev,
507507
pm_runtime_get_sync(adev_to_drm(adev)->dev);
508508
/* Just fire off a uevent and let userspace tell us what to do */
509509
drm_helper_hpd_irq_event(adev_to_drm(adev));
510-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
511510
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
512511
}
513512
}

drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -734,10 +734,8 @@ amdgpu_connector_lvds_detect(struct drm_connector *connector, bool force)
734734

735735
amdgpu_connector_update_scratch_regs(connector, ret);
736736

737-
if (!drm_kms_helper_is_poll_worker()) {
738-
pm_runtime_mark_last_busy(connector->dev->dev);
737+
if (!drm_kms_helper_is_poll_worker())
739738
pm_runtime_put_autosuspend(connector->dev->dev);
740-
}
741739

742740
return ret;
743741
}
@@ -919,10 +917,8 @@ amdgpu_connector_vga_detect(struct drm_connector *connector, bool force)
919917
amdgpu_connector_update_scratch_regs(connector, ret);
920918

921919
out:
922-
if (!drm_kms_helper_is_poll_worker()) {
923-
pm_runtime_mark_last_busy(connector->dev->dev);
920+
if (!drm_kms_helper_is_poll_worker())
924921
pm_runtime_put_autosuspend(connector->dev->dev);
925-
}
926922

927923
return ret;
928924
}
@@ -1146,10 +1142,8 @@ amdgpu_connector_dvi_detect(struct drm_connector *connector, bool force)
11461142
amdgpu_connector_update_scratch_regs(connector, ret);
11471143

11481144
exit:
1149-
if (!drm_kms_helper_is_poll_worker()) {
1150-
pm_runtime_mark_last_busy(connector->dev->dev);
1145+
if (!drm_kms_helper_is_poll_worker())
11511146
pm_runtime_put_autosuspend(connector->dev->dev);
1152-
}
11531147

11541148
return ret;
11551149
}
@@ -1486,10 +1480,8 @@ amdgpu_connector_dp_detect(struct drm_connector *connector, bool force)
14861480

14871481
amdgpu_connector_update_scratch_regs(connector, ret);
14881482
out:
1489-
if (!drm_kms_helper_is_poll_worker()) {
1490-
pm_runtime_mark_last_busy(connector->dev->dev);
1483+
if (!drm_kms_helper_is_poll_worker())
14911484
pm_runtime_put_autosuspend(connector->dev->dev);
1492-
}
14931485

14941486
if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
14951487
connector->connector_type == DRM_MODE_CONNECTOR_eDP)

drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ static int amdgpu_debugfs_process_reg_op(bool read, struct file *f,
129129
if (use_bank) {
130130
if ((sh_bank != 0xFFFFFFFF && sh_bank >= adev->gfx.config.max_sh_per_se) ||
131131
(se_bank != 0xFFFFFFFF && se_bank >= adev->gfx.config.max_shader_engines)) {
132-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
133132
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
134133
amdgpu_virt_disable_access_debugfs(adev);
135134
return -EINVAL;
@@ -179,7 +178,6 @@ static int amdgpu_debugfs_process_reg_op(bool read, struct file *f,
179178
if (pm_pg_lock)
180179
mutex_unlock(&adev->pm.mutex);
181180

182-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
183181
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
184182

185183
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
255253
if (rd->id.use_grbm) {
256254
if ((rd->id.grbm.sh != 0xFFFFFFFF && rd->id.grbm.sh >= adev->gfx.config.max_sh_per_se) ||
257255
(rd->id.grbm.se != 0xFFFFFFFF && rd->id.grbm.se >= adev->gfx.config.max_shader_engines)) {
258-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
259256
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
260257
amdgpu_virt_disable_access_debugfs(adev);
261258
mutex_unlock(&rd->lock);
@@ -310,7 +307,6 @@ static ssize_t amdgpu_debugfs_regs2_op(struct file *f, char __user *buf, u32 off
310307

311308
mutex_unlock(&rd->lock);
312309

313-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
314310
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
315311

316312
amdgpu_virt_disable_access_debugfs(adev);
@@ -446,7 +442,6 @@ static ssize_t amdgpu_debugfs_gprwave_read(struct file *f, char __user *buf, siz
446442
amdgpu_gfx_select_se_sh(adev, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, rd->id.xcc_id);
447443
mutex_unlock(&adev->grbm_idx_mutex);
448444

449-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
450445
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
451446

452447
if (!x) {
@@ -557,7 +552,6 @@ static ssize_t amdgpu_debugfs_regs_pcie_read(struct file *f, char __user *buf,
557552

558553
r = result;
559554
out:
560-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
561555
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
562556
amdgpu_virt_disable_access_debugfs(adev);
563557
return r;
@@ -617,7 +611,6 @@ static ssize_t amdgpu_debugfs_regs_pcie_write(struct file *f, const char __user
617611

618612
r = result;
619613
out:
620-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
621614
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
622615
amdgpu_virt_disable_access_debugfs(adev);
623616
return r;
@@ -676,7 +669,6 @@ static ssize_t amdgpu_debugfs_regs_didt_read(struct file *f, char __user *buf,
676669

677670
r = result;
678671
out:
679-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
680672
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
681673
amdgpu_virt_disable_access_debugfs(adev);
682674
return r;
@@ -736,7 +728,6 @@ static ssize_t amdgpu_debugfs_regs_didt_write(struct file *f, const char __user
736728

737729
r = result;
738730
out:
739-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
740731
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
741732
amdgpu_virt_disable_access_debugfs(adev);
742733
return r;
@@ -795,7 +786,6 @@ static ssize_t amdgpu_debugfs_regs_smc_read(struct file *f, char __user *buf,
795786

796787
r = result;
797788
out:
798-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
799789
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
800790
amdgpu_virt_disable_access_debugfs(adev);
801791
return r;
@@ -855,7 +845,6 @@ static ssize_t amdgpu_debugfs_regs_smc_write(struct file *f, const char __user *
855845

856846
r = result;
857847
out:
858-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
859848
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
860849
amdgpu_virt_disable_access_debugfs(adev);
861850
return r;
@@ -1003,7 +992,6 @@ static ssize_t amdgpu_debugfs_sensor_read(struct file *f, char __user *buf,
1003992

1004993
r = amdgpu_dpm_read_sensor(adev, idx, &values[0], &valuesize);
1005994

1006-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
1007995
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
1008996

1009997
if (r) {
@@ -1094,7 +1082,6 @@ static ssize_t amdgpu_debugfs_wave_read(struct file *f, char __user *buf,
10941082
amdgpu_gfx_select_se_sh(adev, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0);
10951083
mutex_unlock(&adev->grbm_idx_mutex);
10961084

1097-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
10981085
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
10991086

11001087
if (!x) {
@@ -1192,7 +1179,6 @@ static ssize_t amdgpu_debugfs_gpr_read(struct file *f, char __user *buf,
11921179
amdgpu_gfx_select_se_sh(adev, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0);
11931180
mutex_unlock(&adev->grbm_idx_mutex);
11941181

1195-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
11961182
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
11971183

11981184
while (size) {
@@ -1266,7 +1252,6 @@ static ssize_t amdgpu_debugfs_gfxoff_residency_read(struct file *f, char __user
12661252

12671253
r = result;
12681254
out:
1269-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
12701255
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
12711256

12721257
return r;
@@ -1315,7 +1300,6 @@ static ssize_t amdgpu_debugfs_gfxoff_residency_write(struct file *f, const char
13151300

13161301
r = result;
13171302
out:
1318-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
13191303
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
13201304

13211305
return r;
@@ -1365,7 +1349,6 @@ static ssize_t amdgpu_debugfs_gfxoff_count_read(struct file *f, char __user *buf
13651349

13661350
r = result;
13671351
out:
1368-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
13691352
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
13701353

13711354
return r;
@@ -1414,7 +1397,6 @@ static ssize_t amdgpu_debugfs_gfxoff_write(struct file *f, const char __user *bu
14141397

14151398
r = result;
14161399
out:
1417-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
14181400
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
14191401

14201402
return r;
@@ -1460,7 +1442,6 @@ static ssize_t amdgpu_debugfs_gfxoff_read(struct file *f, char __user *buf,
14601442

14611443
r = result;
14621444
out:
1463-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
14641445
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
14651446

14661447
return r;
@@ -1501,7 +1482,6 @@ static ssize_t amdgpu_debugfs_gfxoff_status_read(struct file *f, char __user *bu
15011482

15021483
r = result;
15031484
out:
1504-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
15051485
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
15061486

15071487
return r;
@@ -1701,7 +1681,6 @@ static int amdgpu_debugfs_test_ib_show(struct seq_file *m, void *unused)
17011681

17021682
up_write(&adev->reset_domain->sem);
17031683

1704-
pm_runtime_mark_last_busy(dev->dev);
17051684
pm_runtime_put_autosuspend(dev->dev);
17061685

17071686
return 0;
@@ -1721,7 +1700,6 @@ static int amdgpu_debugfs_evict_vram(void *data, u64 *val)
17211700

17221701
*val = amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM);
17231702

1724-
pm_runtime_mark_last_busy(dev->dev);
17251703
pm_runtime_put_autosuspend(dev->dev);
17261704

17271705
return 0;
@@ -1742,7 +1720,6 @@ static int amdgpu_debugfs_evict_gtt(void *data, u64 *val)
17421720

17431721
*val = amdgpu_ttm_evict_resources(adev, TTM_PL_TT);
17441722

1745-
pm_runtime_mark_last_busy(dev->dev);
17461723
pm_runtime_put_autosuspend(dev->dev);
17471724

17481725
return 0;
@@ -1762,7 +1739,6 @@ static int amdgpu_debugfs_benchmark(void *data, u64 val)
17621739

17631740
r = amdgpu_benchmark(adev, val);
17641741

1765-
pm_runtime_mark_last_busy(dev->dev);
17661742
pm_runtime_put_autosuspend(dev->dev);
17671743

17681744
return r;
@@ -2014,7 +1990,6 @@ static int amdgpu_debugfs_sclk_set(void *data, u64 val)
20141990
ret = -EINVAL;
20151991

20161992
out:
2017-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
20181993
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
20191994

20201995
return ret;

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,6 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set,
332332
if (crtc->enabled)
333333
active = true;
334334

335-
pm_runtime_mark_last_busy(dev->dev);
336-
337335
adev = drm_to_adev(dev);
338336
/* if we have active crtcs and we don't have a power ref,
339337
* take the current one

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,7 +2228,6 @@ static void amdgpu_get_secondary_funcs(struct amdgpu_device *adev)
22282228
adev->pdev->bus->number, i);
22292229
if (p) {
22302230
pm_runtime_get_sync(&p->dev);
2231-
pm_runtime_mark_last_busy(&p->dev);
22322231
pm_runtime_put_autosuspend(&p->dev);
22332232
pci_dev_put(p);
22342233
}
@@ -2474,7 +2473,6 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
24742473

24752474
pm_runtime_allow(ddev->dev);
24762475

2477-
pm_runtime_mark_last_busy(ddev->dev);
24782476
pm_runtime_put_autosuspend(ddev->dev);
24792477

24802478
pci_wake_from_d3(pdev, TRUE);
@@ -2920,7 +2918,6 @@ static int amdgpu_pmops_runtime_idle(struct device *dev)
29202918

29212919
ret = amdgpu_runtime_idle_check_userq(dev);
29222920
done:
2923-
pm_runtime_mark_last_busy(dev);
29242921
pm_runtime_autosuspend(dev);
29252922
return ret;
29262923
}
@@ -2956,7 +2953,6 @@ long amdgpu_drm_ioctl(struct file *filp,
29562953

29572954
ret = drm_ioctl(filp, cmd, arg);
29582955

2959-
pm_runtime_mark_last_busy(dev->dev);
29602956
out:
29612957
pm_runtime_put_autosuspend(dev->dev);
29622958
return ret;

drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ bool amdgpu_fence_process(struct amdgpu_ring *ring)
250250
drv->signalled_wptr = am_fence->wptr;
251251
dma_fence_signal(fence);
252252
dma_fence_put(fence);
253-
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
254253
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
255254
} while (last_seq != seq);
256255

@@ -928,7 +927,6 @@ static int gpu_recover_get(void *data, u64 *val)
928927

929928
*val = atomic_read(&adev->reset_domain->reset_res);
930929

931-
pm_runtime_mark_last_busy(dev->dev);
932930
pm_runtime_put_autosuspend(dev->dev);
933931

934932
return 0;

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,6 @@ static ssize_t amdgpu_gfx_set_run_cleaner_shader(struct device *dev,
16701670

16711671
ret = amdgpu_gfx_run_cleaner_shader(adev, value);
16721672

1673-
pm_runtime_mark_last_busy(ddev->dev);
16741673
pm_runtime_put_autosuspend(ddev->dev);
16751674

16761675
if (ret)

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,6 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
14711471
kfree(fpriv);
14721472

14731473
out_suspend:
1474-
pm_runtime_mark_last_busy(dev->dev);
14751474
pm_put:
14761475
pm_runtime_put_autosuspend(dev->dev);
14771476

@@ -1539,7 +1538,6 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
15391538
kfree(fpriv);
15401539
file_priv->driver_priv = NULL;
15411540

1542-
pm_runtime_mark_last_busy(dev->dev);
15431541
pm_runtime_put_autosuspend(dev->dev);
15441542
}
15451543

drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ static ssize_t amdgpu_rap_debugfs_write(struct file *f, const char __user *buf,
101101
}
102102

103103
amdgpu_gfx_off_ctrl(adev, true);
104-
pm_runtime_mark_last_busy(dev->dev);
105104
pm_runtime_put_autosuspend(dev->dev);
106105

107106
return size;

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4151,7 +4151,6 @@ static void amdgpu_ras_counte_dw(struct work_struct *work)
41514151
atomic_set(&con->ras_ue_count, ue_count);
41524152
}
41534153

4154-
pm_runtime_mark_last_busy(dev->dev);
41554154
Out:
41564155
pm_runtime_put_autosuspend(dev->dev);
41574156
}

0 commit comments

Comments
 (0)