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
vc4_bo.c drm/vc4: Get the rid of DRM_ERROR() 2024-08-22 07:57:44 -03:00
vc4_crtc.c
vc4_debugfs.c
vc4_dpi.c drm/vc4: Get the rid of DRM_ERROR() 2024-08-22 07:57:44 -03:00
vc4_drv.c
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
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
vc4_render_cl.c
vc4_trace.h
vc4_trace_points.c
vc4_txp.c
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