Re: [PATCH 09/15] accel/qda: Add DMA-backed GEM objects and memory manager integration

From: Markus Elfring

Date: Tue May 19 2026 - 08:16:18 EST



> Assisted-by: Claude:claude-4-6-sonnet


Did such an information source gather the knowledge to benefit more
from the application of scope-based resource management?



> +++ b/drivers/accel/qda/qda_drv.c

> @@ -32,6 +33,18 @@ static void qda_postclose(struct drm_device *dev, struct drm_file *file)
> {

> + if (refcount_dec_and_test(&iommu_dev->refcount)) {
> + spin_lock_irqsave(&iommu_dev->lock, flags);
> + iommu_dev->assigned_pid = 0;
> + iommu_dev->assigned_file_priv = NULL;
> + spin_unlock_irqrestore(&iommu_dev->lock, flags);
> + }


Under which circumstances would you become interested to apply a statement
like “guard(spinlock_irqsave)(&iommu_dev->lock);”?
https://elixir.bootlin.com/linux/v7.1-rc4/source/include/linux/spinlock.h#L619-L622

Regards,
Markus