Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sakari Ailus and committed by
Alex Deucher
ef4a4b87 849ad2a3

+4 -55
-1
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
··· 507 507 pm_runtime_get_sync(adev_to_drm(adev)->dev); 508 508 /* Just fire off a uevent and let userspace tell us what to do */ 509 509 drm_helper_hpd_irq_event(adev_to_drm(adev)); 510 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 511 510 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 512 511 } 513 512 }
+4 -12
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
··· 734 734 735 735 amdgpu_connector_update_scratch_regs(connector, ret); 736 736 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()) 739 738 pm_runtime_put_autosuspend(connector->dev->dev); 740 - } 741 739 742 740 return ret; 743 741 } ··· 917 919 amdgpu_connector_update_scratch_regs(connector, ret); 918 920 919 921 out: 920 - if (!drm_kms_helper_is_poll_worker()) { 921 - pm_runtime_mark_last_busy(connector->dev->dev); 922 + if (!drm_kms_helper_is_poll_worker()) 922 923 pm_runtime_put_autosuspend(connector->dev->dev); 923 - } 924 924 925 925 return ret; 926 926 } ··· 1142 1146 amdgpu_connector_update_scratch_regs(connector, ret); 1143 1147 1144 1148 exit: 1145 - if (!drm_kms_helper_is_poll_worker()) { 1146 - pm_runtime_mark_last_busy(connector->dev->dev); 1149 + if (!drm_kms_helper_is_poll_worker()) 1147 1150 pm_runtime_put_autosuspend(connector->dev->dev); 1148 - } 1149 1151 1150 1152 return ret; 1151 1153 } ··· 1480 1486 1481 1487 amdgpu_connector_update_scratch_regs(connector, ret); 1482 1488 out: 1483 - if (!drm_kms_helper_is_poll_worker()) { 1484 - pm_runtime_mark_last_busy(connector->dev->dev); 1489 + if (!drm_kms_helper_is_poll_worker()) 1485 1490 pm_runtime_put_autosuspend(connector->dev->dev); 1486 - } 1487 1491 1488 1492 if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort || 1489 1493 connector->connector_type == DRM_MODE_CONNECTOR_eDP)
-25
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
··· 129 129 if (use_bank) { 130 130 if ((sh_bank != 0xFFFFFFFF && sh_bank >= adev->gfx.config.max_sh_per_se) || 131 131 (se_bank != 0xFFFFFFFF && se_bank >= adev->gfx.config.max_shader_engines)) { 132 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 133 132 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 134 133 amdgpu_virt_disable_access_debugfs(adev); 135 134 return -EINVAL; ··· 178 179 if (pm_pg_lock) 179 180 mutex_unlock(&adev->pm.mutex); 180 181 181 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 182 182 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 183 183 184 184 amdgpu_virt_disable_access_debugfs(adev); ··· 253 255 if (rd->id.use_grbm) { 254 256 if ((rd->id.grbm.sh != 0xFFFFFFFF && rd->id.grbm.sh >= adev->gfx.config.max_sh_per_se) || 255 257 (rd->id.grbm.se != 0xFFFFFFFF && rd->id.grbm.se >= adev->gfx.config.max_shader_engines)) { 256 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 257 258 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 258 259 amdgpu_virt_disable_access_debugfs(adev); 259 260 mutex_unlock(&rd->lock); ··· 307 310 308 311 mutex_unlock(&rd->lock); 309 312 310 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 311 313 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 312 314 313 315 amdgpu_virt_disable_access_debugfs(adev); ··· 442 446 amdgpu_gfx_select_se_sh(adev, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, rd->id.xcc_id); 443 447 mutex_unlock(&adev->grbm_idx_mutex); 444 448 445 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 446 449 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 447 450 448 451 if (!x) { ··· 552 557 553 558 r = result; 554 559 out: 555 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 556 560 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 557 561 amdgpu_virt_disable_access_debugfs(adev); 558 562 return r; ··· 611 617 612 618 r = result; 613 619 out: 614 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 615 620 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 616 621 amdgpu_virt_disable_access_debugfs(adev); 617 622 return r; ··· 669 676 670 677 r = result; 671 678 out: 672 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 673 679 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 674 680 amdgpu_virt_disable_access_debugfs(adev); 675 681 return r; ··· 728 736 729 737 r = result; 730 738 out: 731 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 732 739 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 733 740 amdgpu_virt_disable_access_debugfs(adev); 734 741 return r; ··· 786 795 787 796 r = result; 788 797 out: 789 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 790 798 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 791 799 amdgpu_virt_disable_access_debugfs(adev); 792 800 return r; ··· 845 855 846 856 r = result; 847 857 out: 848 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 849 858 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 850 859 amdgpu_virt_disable_access_debugfs(adev); 851 860 return r; ··· 992 1003 993 1004 r = amdgpu_dpm_read_sensor(adev, idx, &values[0], &valuesize); 994 1005 995 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 996 1006 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 997 1007 998 1008 if (r) { ··· 1082 1094 amdgpu_gfx_select_se_sh(adev, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0); 1083 1095 mutex_unlock(&adev->grbm_idx_mutex); 1084 1096 1085 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 1086 1097 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 1087 1098 1088 1099 if (!x) { ··· 1179 1192 amdgpu_gfx_select_se_sh(adev, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0); 1180 1193 mutex_unlock(&adev->grbm_idx_mutex); 1181 1194 1182 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 1183 1195 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 1184 1196 1185 1197 while (size) { ··· 1252 1266 1253 1267 r = result; 1254 1268 out: 1255 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 1256 1269 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 1257 1270 1258 1271 return r; ··· 1300 1315 1301 1316 r = result; 1302 1317 out: 1303 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 1304 1318 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 1305 1319 1306 1320 return r; ··· 1349 1365 1350 1366 r = result; 1351 1367 out: 1352 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 1353 1368 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 1354 1369 1355 1370 return r; ··· 1397 1414 1398 1415 r = result; 1399 1416 out: 1400 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 1401 1417 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 1402 1418 1403 1419 return r; ··· 1442 1460 1443 1461 r = result; 1444 1462 out: 1445 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 1446 1463 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 1447 1464 1448 1465 return r; ··· 1482 1501 1483 1502 r = result; 1484 1503 out: 1485 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 1486 1504 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 1487 1505 1488 1506 return r; ··· 1681 1701 1682 1702 up_write(&adev->reset_domain->sem); 1683 1703 1684 - pm_runtime_mark_last_busy(dev->dev); 1685 1704 pm_runtime_put_autosuspend(dev->dev); 1686 1705 1687 1706 return 0; ··· 1700 1721 1701 1722 *val = amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM); 1702 1723 1703 - pm_runtime_mark_last_busy(dev->dev); 1704 1724 pm_runtime_put_autosuspend(dev->dev); 1705 1725 1706 1726 return 0; ··· 1720 1742 1721 1743 *val = amdgpu_ttm_evict_resources(adev, TTM_PL_TT); 1722 1744 1723 - pm_runtime_mark_last_busy(dev->dev); 1724 1745 pm_runtime_put_autosuspend(dev->dev); 1725 1746 1726 1747 return 0; ··· 1739 1762 1740 1763 r = amdgpu_benchmark(adev, val); 1741 1764 1742 - pm_runtime_mark_last_busy(dev->dev); 1743 1765 pm_runtime_put_autosuspend(dev->dev); 1744 1766 1745 1767 return r; ··· 1990 2014 ret = -EINVAL; 1991 2015 1992 2016 out: 1993 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 1994 2017 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 1995 2018 1996 2019 return ret;
-2
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
··· 332 332 if (crtc->enabled) 333 333 active = true; 334 334 335 - pm_runtime_mark_last_busy(dev->dev); 336 - 337 335 adev = drm_to_adev(dev); 338 336 /* if we have active crtcs and we don't have a power ref, 339 337 * take the current one
-4
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
··· 2228 2228 adev->pdev->bus->number, i); 2229 2229 if (p) { 2230 2230 pm_runtime_get_sync(&p->dev); 2231 - pm_runtime_mark_last_busy(&p->dev); 2232 2231 pm_runtime_put_autosuspend(&p->dev); 2233 2232 pci_dev_put(p); 2234 2233 } ··· 2473 2474 2474 2475 pm_runtime_allow(ddev->dev); 2475 2476 2476 - pm_runtime_mark_last_busy(ddev->dev); 2477 2477 pm_runtime_put_autosuspend(ddev->dev); 2478 2478 2479 2479 pci_wake_from_d3(pdev, TRUE); ··· 2918 2920 2919 2921 ret = amdgpu_runtime_idle_check_userq(dev); 2920 2922 done: 2921 - pm_runtime_mark_last_busy(dev); 2922 2923 pm_runtime_autosuspend(dev); 2923 2924 return ret; 2924 2925 } ··· 2953 2956 2954 2957 ret = drm_ioctl(filp, cmd, arg); 2955 2958 2956 - pm_runtime_mark_last_busy(dev->dev); 2957 2959 out: 2958 2960 pm_runtime_put_autosuspend(dev->dev); 2959 2961 return ret;
-2
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
··· 250 250 drv->signalled_wptr = am_fence->wptr; 251 251 dma_fence_signal(fence); 252 252 dma_fence_put(fence); 253 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 254 253 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 255 254 } while (last_seq != seq); 256 255 ··· 927 928 928 929 *val = atomic_read(&adev->reset_domain->reset_res); 929 930 930 - pm_runtime_mark_last_busy(dev->dev); 931 931 pm_runtime_put_autosuspend(dev->dev); 932 932 933 933 return 0;
-1
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
··· 1670 1670 1671 1671 ret = amdgpu_gfx_run_cleaner_shader(adev, value); 1672 1672 1673 - pm_runtime_mark_last_busy(ddev->dev); 1674 1673 pm_runtime_put_autosuspend(ddev->dev); 1675 1674 1676 1675 if (ret)
-2
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
··· 1471 1471 kfree(fpriv); 1472 1472 1473 1473 out_suspend: 1474 - pm_runtime_mark_last_busy(dev->dev); 1475 1474 pm_put: 1476 1475 pm_runtime_put_autosuspend(dev->dev); 1477 1476 ··· 1538 1539 kfree(fpriv); 1539 1540 file_priv->driver_priv = NULL; 1540 1541 1541 - pm_runtime_mark_last_busy(dev->dev); 1542 1542 pm_runtime_put_autosuspend(dev->dev); 1543 1543 } 1544 1544
-1
drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c
··· 101 101 } 102 102 103 103 amdgpu_gfx_off_ctrl(adev, true); 104 - pm_runtime_mark_last_busy(dev->dev); 105 104 pm_runtime_put_autosuspend(dev->dev); 106 105 107 106 return size;
-1
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
··· 4151 4151 atomic_set(&con->ras_ue_count, ue_count); 4152 4152 } 4153 4153 4154 - pm_runtime_mark_last_busy(dev->dev); 4155 4154 Out: 4156 4155 pm_runtime_put_autosuspend(dev->dev); 4157 4156 }
-1
drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c
··· 159 159 dev_err(adev->dev, "Invalid input: %s\n", str); 160 160 } 161 161 162 - pm_runtime_mark_last_busy(dev->dev); 163 162 pm_runtime_put_autosuspend(dev->dev); 164 163 165 164 return size;
-1
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
··· 488 488 amdgpu_userq_cleanup(uq_mgr, queue, queue_id); 489 489 mutex_unlock(&uq_mgr->userq_mutex); 490 490 491 - pm_runtime_mark_last_busy(adev_to_drm(adev)->dev); 492 491 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 493 492 494 493 return r;
-1
drivers/gpu/drm/amd/amdkfd/kfd_process.c
··· 1083 1083 * for auto suspend 1084 1084 */ 1085 1085 if (pdd->runtime_inuse) { 1086 - pm_runtime_mark_last_busy(adev_to_drm(pdd->dev->adev)->dev); 1087 1086 pm_runtime_put_autosuspend(adev_to_drm(pdd->dev->adev)->dev); 1088 1087 pdd->runtime_inuse = false; 1089 1088 }
-1
drivers/gpu/drm/amd/pm/amdgpu_pm.c
··· 174 174 */ 175 175 static inline void amdgpu_pm_put_access(struct amdgpu_device *adev) 176 176 { 177 - pm_runtime_mark_last_busy(adev->dev); 178 177 pm_runtime_put_autosuspend(adev->dev); 179 178 } 180 179