linux/drivers/gpu/drm/vc4
Maíra Canal 0b2ad4f6f2
drm/vc4: Stop the active perfmon before being destroyed
Upon closing the file descriptor, the active performance monitor is not
stopped. Although all perfmons are destroyed in `vc4_perfmon_close_file()`,
the active performance monitor's pointer (`vc4->active_perfmon`) is still
retained.

If we open a new file descriptor and submit a few jobs with performance
monitors, the driver will attempt to stop the active performance monitor
using the stale pointer in `vc4->active_perfmon`. However, this pointer
is no longer valid because the previous process has already terminated,
and all performance monitors associated with it have been destroyed and
freed.

To fix this, when the active performance monitor belongs to a given
process, explicitly stop it before destroying and freeing it.

Cc: stable@vger.kernel.org # v4.17+
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: Juan A. Suarez Romero <jasuarez@igalia.com>
Fixes: 65101d8c91 ("drm/vc4: Expose performance counters to userspace")
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241004123817.890016-2-mcanal@igalia.com
2024-10-07 09:06:46 -03:00
..
tests drm/vc4: tests: Convert to plane creation helper 2024-05-28 10:24:42 +02:00
Kconfig drm/vc4: hdmi: Switch to HDMI connector 2024-05-28 10:24:41 +02:00
Makefile drm/vc4: tests: Add unit test suite for the PV muxing 2022-12-08 09:56:56 +01:00
vc4_bo.c drm/vc4: Get the rid of DRM_ERROR() 2024-08-22 07:57:44 -03:00
vc4_crtc.c drm: Explicitly include correct DT includes 2023-07-21 09:12:43 +02:00
vc4_debugfs.c drm/vc4: use new debugfs device-centered functions 2022-12-22 14:59:16 -03:00
vc4_dpi.c drm/vc4: Get the rid of DRM_ERROR() 2024-08-22 07:57:44 -03:00
vc4_drv.c drm/vc4: Call drm_atomic_helper_shutdown() at shutdown time 2023-09-21 10:49:04 -07:00
vc4_drv.h drm/print: drop include debugfs.h and include where needed 2024-04-25 17:05:48 +03:00
vc4_dsi.c drm/vc4: Get the rid of DRM_ERROR() 2024-08-22 07:57:44 -03:00
vc4_fence.c
vc4_gem.c drm/vc4: Get the rid of DRM_ERROR() 2024-08-22 07:57:44 -03:00
vc4_hdmi.c drm/vc4: Get the rid of DRM_ERROR() 2024-08-22 07:57:44 -03:00
vc4_hdmi.h drm/vc4: hdmi: Switch to HDMI connector 2024-05-28 10:24:41 +02:00
vc4_hdmi_phy.c drm/vc4: hdmi: Switch to HDMI connector 2024-05-28 10:24:41 +02:00
vc4_hdmi_regs.h
vc4_hvs.c drm/vc4: Get the rid of DRM_ERROR() 2024-08-22 07:57:44 -03:00
vc4_irq.c drm/vc4: Get the rid of DRM_ERROR() 2024-08-22 07:57:44 -03:00
vc4_kms.c drm/vc4: Switch to container_of_const 2023-04-25 09:32:25 +02:00
vc4_packet.h
vc4_perfmon.c drm/vc4: Stop the active perfmon before being destroyed 2024-10-07 09:06:46 -03:00
vc4_plane.c drm/vc4: don't check if plane->state->fb == state->fb 2024-01-11 10:32:12 -03:00
vc4_qpu_defines.h
vc4_regs.h drm/vc4: fix typo 2023-10-23 16:24:55 +02:00
vc4_render_cl.c
vc4_trace.h
vc4_trace_points.c
vc4_txp.c drm: Explicitly include correct DT includes 2023-07-21 09:12:43 +02:00
vc4_v3d.c drm/vc4: v3d: simplify clock retrieval 2024-08-22 07:57:44 -03:00
vc4_validate.c drm/vc4: Get the rid of DRM_ERROR() 2024-08-22 07:57:44 -03:00
vc4_validate_shaders.c
vc4_vec.c drm/vc4: Get the rid of DRM_ERROR() 2024-08-22 07:57:44 -03:00