Re: [PATCH v8 3/7] drm: lock drm_global_mutex earlier in the ioctl handler

2021-08-30 Thread Desmond Cheong Zhi Xi
On 26/8/21 5:58 pm, Daniel Vetter wrote: On Thu, Aug 26, 2021 at 10:01:18AM +0800, Desmond Cheong Zhi Xi wrote: In a future patch, a read lock on drm_device.master_rwsem is held in the ioctl handler before the check for ioctl permissions. However, this inverts the lock hierarchy of drm_global_mu

Re: [PATCH v8 3/7] drm: lock drm_global_mutex earlier in the ioctl handler

2021-08-26 Thread Daniel Vetter
On Thu, Aug 26, 2021 at 10:01:18AM +0800, Desmond Cheong Zhi Xi wrote: > In a future patch, a read lock on drm_device.master_rwsem is > held in the ioctl handler before the check for ioctl > permissions. However, this inverts the lock hierarchy of > drm_global_mutex --> master_rwsem. > > To avoid

[PATCH v8 3/7] drm: lock drm_global_mutex earlier in the ioctl handler

2021-08-25 Thread Desmond Cheong Zhi Xi
In a future patch, a read lock on drm_device.master_rwsem is held in the ioctl handler before the check for ioctl permissions. However, this inverts the lock hierarchy of drm_global_mutex --> master_rwsem. To avoid this, we do some prep work to grab the drm_global_mutex before checking for ioctl p