[bug report] drm/panthor: Expose size of driver internal BO's over fdinfo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Adrián Larumbe,

Commit 434e5ca5b5d7 ("drm/panthor: Expose size of driver internal
BO's over fdinfo") from Jan 30, 2025 (linux-next), leads to the
following Smatch static checker warning:

	drivers/gpu/drm/panthor/panthor_mmu.c:1968 panthor_vm_heaps_sizes()
	warn: sleeping in atomic context

drivers/gpu/drm/panthor/panthor_mmu.c
    1956 void panthor_vm_heaps_sizes(struct panthor_file *pfile, struct drm_memory_stats *stats)
    1957 {
    1958         struct panthor_vm *vm;
    1959         unsigned long i;
    1960 
    1961         if (!pfile->vms)
    1962                 return;
    1963 
    1964         xa_lock(&pfile->vms->xa);
                 ^^^^^^^
This is a spinlock.

    1965         xa_for_each(&pfile->vms->xa, i, vm) {
    1966                 size_t size = 0;
    1967 
--> 1968                 mutex_lock(&vm->heaps.lock);
                         ^^^^^^^^^^
So we can't take a mutex if we're holding a spinlock.

    1969                 if (vm->heaps.pool)
    1970                         size = panthor_heap_pool_size(vm->heaps.pool);
    1971                 mutex_unlock(&vm->heaps.lock);
    1972 
    1973                 stats->resident += size;
    1974                 if (vm->as.id >= 0)
    1975                         stats->active += size;
    1976         }
    1977         xa_unlock(&pfile->vms->xa);
    1978 }

regards,
dan carpenter



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux