linux-stable/drivers/gpu/drm
Umesh Nerlige Ramappa 907ef0398c i915/guc: Get runtime pm in busyness worker only if already active
Ideally the busyness worker should take a gt pm wakeref because the
worker only needs to be active while gt is awake. However, the gt_park
path cancels the worker synchronously and this complicates the flow if
the worker is also running at the same time. The cancel waits for the
worker and when the worker releases the wakeref, that would call gt_park
and would lead to a deadlock.

The resolution is to take the global pm wakeref if runtime pm is already
active. If not, we don't need to update the busyness stats as the stats
would already be updated when the gt was parked.

Note:
- We do not requeue the worker if we cannot take a reference to runtime
  pm since intel_guc_busyness_unpark would requeue the worker in the
  resume path.

- If the gt was parked longer than time taken for GT timestamp to roll
  over, we ignore those rollovers since we don't care about tracking the
  exact GT time. We only care about roll overs when the gt is active and
  running workloads.

- There is a window of time between gt_park and runtime suspend, where
  the worker may run. This is acceptable since the worker will not find
  any new data to update busyness.

v2: (Daniele)
- Edit commit message and code comment
- Use runtime pm in the worker
- Put runtime pm after enabling the worker
- Use Link tag and add Fixes tag

v3: (Daniele)
- Reword commit and comments and add details

Link: https://gitlab.freedesktop.org/drm/intel/-/issues/7077
Fixes: 77cdd054dd ("drm/i915/pmu: Connect engine busyness stats from GuC to pmu")
Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230925192117.2497058-1-umesh.nerlige.ramappa@intel.com
(cherry picked from commit e2f99b79d4)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2023-09-26 13:58:16 -04:00
..
amd drm/amdkfd: Use gpu_offset for user queue's wptr 2023-09-20 17:30:42 -04:00
arm drm for 6.6-rc1 2023-08-30 13:34:34 -07:00
armada fbdev: Use _IOMEM_ infix for I/O-memory helpers 2023-07-31 20:06:52 +02:00
aspeed
ast drm/ast: report connection status on Display Port. 2023-07-28 17:08:28 +02:00
atmel-hlcdc drm: atmel-hlcdc: Support inverting the pixel clock polarity 2023-08-10 08:44:34 +02:00
bridge drm for 6.6-rc1 2023-08-30 13:34:34 -07:00
ci drm: Add initial ci/ subdirectory 2023-08-29 19:56:11 +02:00
display
etnaviv Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm-next 2023-08-18 06:42:12 +10:00
exynos drm/exynos: remove redundant of_match_ptr 2023-08-08 09:35:19 +09:00
fsl-dcu
gma500 fbdev: Use _IOMEM_ infix for I/O-memory helpers 2023-07-31 20:06:52 +02:00
gud
hisilicon
hyperv
i2c
i915 i915/guc: Get runtime pm in busyness worker only if already active 2023-09-26 13:58:16 -04:00
imx Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
ingenic
kmb
lib
lima
logicvc
loongson drm/loongson: Add a check for lsdc_bo_create() errors 2023-08-04 13:31:32 +08:00
mcde drm/mcde: remove redundant of_match_ptr 2023-08-07 22:58:52 +02:00
mediatek Mediatek DRM Next for Linux 6.6 2023-08-15 12:07:19 +10:00
meson drm/meson: fix memory leak on ->hpd_notify callback 2023-09-20 15:44:31 +02:00
mgag200
msm drm for 6.6-rc1 2023-08-30 13:34:34 -07:00
mxsfb
nouveau nouveau/u_memcpya: fix NULL vs error pointer bug 2023-09-20 00:20:08 +02:00
omapdrm fbdev: Use _DMAMEM_ infix for DMA-memory helpers 2023-07-31 20:07:18 +02:00
panel Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
panfrost drm for 6.6-rc1 2023-08-30 13:34:34 -07:00
pl111
qxl Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
radeon Merge drm/drm-fixes into drm-misc-fixes 2023-09-12 08:53:30 +02:00
renesas drm:rcar-du: Enable ABGR and XBGR formats 2023-08-14 13:47:30 +03:00
rockchip Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
scheduler
solomon drm/ssd130x: clean up some inconsistent indenting 2023-07-31 10:07:31 +02:00
sprd
sti
stm
sun4i This pull request is full of clk driver changes. In fact, there aren't any 2023-08-30 19:53:39 -07:00
tegra fbdev: Use _DMAMEM_ infix for DMA-memory helpers 2023-07-31 20:07:18 +02:00
tests drm/tests: Fix incorrect argument in drm_test_mm_insert_range 2023-09-15 11:39:48 -03:00
tidss drm: Fix references to drm_plane_helper_check_state() 2023-07-29 21:25:18 +02:00
tilcdc
tiny One doc fix for drm/connector, one fix for amdgpu for an crash when 2023-09-14 14:00:51 +02:00
ttm Short summary of fixes pull: 2023-08-25 06:28:33 +10:00
tve200 drm/tve200: remove redundant of_match_ptr 2023-08-07 22:58:01 +02:00
udl drm/udl: Convert to drm_crtc_helper_atomic_check() 2023-07-29 21:01:27 +02:00
v3d
vboxvideo
vc4 sound updates for 6.6-rc1 2023-08-30 13:45:05 -07:00
vgem
virtio drm/virtio: clean out_fence on complete_submit 2023-09-21 00:11:24 +03:00
vkms Revert "drm/vkms: Fix race-condition between the hrtimer and the atomic commit" 2023-09-14 07:48:19 -03:00
vmwgfx drm/vmwgfx: Fix possible invalid drm gem put calls 2023-08-23 13:20:04 -04:00
xen
xlnx drm: xlnx: zynqmp_dpsub: Use devm_platform_ioremap_resource_byname() 2023-08-02 01:36:54 +03:00
drm_agpsupport.c
drm_aperture.c
drm_atomic.c
drm_atomic_helper.c drm/atomic-helper: Update reference to drm_crtc_force_disable_all() 2023-07-28 11:43:32 +02:00
drm_atomic_state_helper.c
drm_atomic_uapi.c
drm_auth.c
drm_blend.c
drm_bridge.c drm/bridge: Add debugfs print for bridge chains 2023-08-02 10:05:01 +02:00
drm_bridge_connector.c drm/bridge_connector: Handle drm_connector_init_with_ddc() failures 2023-07-29 20:56:42 +02:00
drm_buddy.c drm/buddy: Fix drm buddy info output format 2023-08-09 09:46:05 -04:00
drm_bufs.c
drm_cache.c
drm_client.c
drm_client_modeset.c
drm_color_mgmt.c
drm_connector.c One doc fix for drm/connector, one fix for amdgpu for an crash when 2023-09-14 14:00:51 +02:00
drm_context.c
drm_crtc.c
drm_crtc_helper.c
drm_crtc_helper_internal.h
drm_crtc_internal.h
drm_damage_helper.c
drm_debugfs.c drm/bridge: Add debugfs print for bridge chains 2023-08-02 10:05:01 +02:00
drm_debugfs_crc.c
drm_displayid.c
drm_dma.c
drm_drv.c
drm_dumb_buffers.c
drm_edid.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
drm_edid_load.c
drm_encoder.c
drm_encoder_slave.c
drm_exec.c drm/drm_exec: Work around a WW mutex lockdep oddity 2023-09-07 10:30:12 +02:00
drm_fb_dma_helper.c
drm_fb_helper.c
drm_fbdev_dma.c fbdev: Use _DMAMEM_ infix for DMA-memory helpers 2023-07-31 20:07:18 +02:00
drm_fbdev_generic.c fbdev: Align deferred I/O with naming of helpers 2023-07-31 20:07:24 +02:00
drm_file.c
drm_flip_work.c
drm_format_helper.c
drm_fourcc.c
drm_framebuffer.c
drm_gem.c
drm_gem_atomic_helper.c
drm_gem_dma_helper.c
drm_gem_framebuffer_helper.c drm/gem-fb-helper: Consistenly use drm_dbg_kms() 2023-07-28 11:46:02 +02:00
drm_gem_shmem_helper.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
drm_gem_ttm_helper.c
drm_gem_vram_helper.c
drm_gpuva_mgr.c drm/gpuva_mgr: remove unused prev pointer in __drm_gpuva_sm_map() 2023-08-24 14:27:14 +02:00
drm_hashtab.c
drm_internal.h
drm_ioc32.c
drm_ioctl.c
drm_irq.c
drm_kms_helper_common.c
drm_lease.c
drm_legacy.h
drm_legacy_misc.c
drm_lock.c
drm_managed.c
drm_memory.c
drm_mipi_dbi.c drm/mipi-dbi: Lock SPI bus before setting D/C GPIO 2023-08-02 13:18:07 +02:00
drm_mipi_dsi.c
drm_mm.c
drm_mode_config.c
drm_mode_object.c
drm_modes.c
drm_modeset_helper.c
drm_modeset_lock.c
drm_of.c
drm_panel.c drm/panel: Add a way for other devices to follow panel state 2023-08-01 07:38:13 -07:00
drm_panel_orientation_quirks.c
drm_pci.c
drm_plane.c
drm_plane_helper.c drm: Remove references to removed transitional helpers 2023-07-29 21:25:16 +02:00
drm_prime.c
drm_print.c
drm_privacy_screen.c
drm_privacy_screen_x86.c
drm_probe_helper.c drm: Add an HPD poll helper to reschedule the poll work 2023-08-23 17:14:37 -04:00
drm_property.c
drm_rect.c
drm_scatter.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c
drm_suballoc.c
drm_syncobj.c
drm_sysfs.c
drm_trace.h
drm_trace_points.c
drm_vblank.c
drm_vblank_work.c
drm_vm.c
drm_vma_manager.c
drm_writeback.c
Kconfig drm: fix up fbdev Kconfig defaults 2023-09-18 10:52:55 +02:00
Makefile