[PATCH v9 1/9] drm/panic: Add drm panic locking
John Ogness
john.ogness at linutronix.de
Thu Mar 7 10:27:21 UTC 2024
On 2024-03-07, Jocelyn Falempe <jfalempe at redhat.com> wrote:
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 39ef0a6addeb..c0bb91312fb2 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -38,6 +38,7 @@
> #include <drm/drm_drv.h>
> #include <drm/drm_framebuffer.h>
> #include <drm/drm_gem_atomic_helper.h>
> +#include <drm/drm_panic.h>
> #include <drm/drm_print.h>
> #include <drm/drm_self_refresh_helper.h>
> #include <drm/drm_vblank.h>
> @@ -3099,6 +3100,7 @@ int drm_atomic_helper_swap_state(struct drm_atomic_state *state,
> }
> }
>
> + drm_panic_lock(state->dev);
> for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
> WARN_ON(plane->state != old_plane_state);
>
> @@ -3108,6 +3110,7 @@ int drm_atomic_helper_swap_state(struct drm_atomic_state *state,
> state->planes[i].state = old_plane_state;
> plane->state = new_plane_state;
> }
> + drm_panic_unlock(state->dev);
Is there a reason irqsave/irqrestore variants are not used? Maybe this
code path is too hot?
By leaving interrupts enabled, there is the risk that a panic from
within any interrupt handler may block the drm panic handler.
John Ogness
More information about the dri-devel
mailing list