[PATCH v10 1/9] drm/panic: Add drm panic locking

John Ogness john.ogness at linutronix.de
Fri Mar 15 15:28:18 UTC 2024


On 2024-03-15, Jocelyn Falempe <jfalempe at redhat.com> wrote:
> +static inline int drm_panic_trylock(struct drm_device *dev, unsigned long *flags)
> +{
> +	return raw_spin_trylock_irqsave(&dev->mode_config.panic_lock, *flags);
> +}

[...]

> +static inline unsigned long drm_panic_lock(struct drm_device *dev)
> +{
> +	unsigned long flags;
> +
> +	raw_spin_lock_irqsave(&dev->mode_config.panic_lock, flags);
> +	return flags;
> +}

I find it a bit strange that @flags is passed as an argument in the
trylock variant but returned in the lock variant. I would pass it as an
argument in both variants. Just a suggestion.

John Ogness


More information about the dri-devel mailing list