[bug report] drm/xe: Introduce a new DRM driver for Intel GPUs

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

 



Hello Matthew Brost,

The patch dd08ebf6c352: "drm/xe: Introduce a new DRM driver for Intel
GPUs" from Mar 30, 2023 (linux-next), leads to the following Smatch
static checker warning:

	drivers/gpu/drm/xe/tests/xe_bo.c:298 evict_test_run_tile()
	error: double unlocked 'external->ttm.base.resv' (orig line 220)

drivers/gpu/drm/xe/tests/xe_bo.c
    294 
    295                 xe_bo_lock(external, false);
    296                 xe_bo_unpin_external(external);
    297                 xe_bo_unlock(external);

This is a false positive, but the API is ugly...  xe_bo_lock() is an
interruptible lock if the second argument is true.  Why not just
create a xe_bo_lock_interruptible()?  This has several advantages:

1) More readable and you could delete the comments explaining how to
   use it because it's so obvious.
2) Less typing because you wouldn't have to write ", false" so much.
3) You could mark the _interruptible version as must check and the other
   version could be a void function.
4) Smatch could parse it automatically.  I can write some custom code
   to parse the existing function but it's a small hassle for me.

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