Re: Locking question for DRM

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

 



On Fri, Apr 23, 2010 at 8:37 PM, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:
>> > and I can't see what makes this safe if the drm_release for the master
>> > and a client occur at the same time ?
>>
>> lock_kernel in drm_release. We probably need to clean that up.
>
> I don't think that works. drm_open_helper doesn't appear to be under the
> BKL merely the struct mutex.

It blocks the case you specified of two releases happening together.

>
>> > The setmaster/dropmaster ioctl seems similar - the various conditional
>> > checks are not protected from parallel changes occuring during their
>> > execution.
>> >
>> > Is this a bug or is something clever afoot ?
>>
>> These ioctls are also under the BKL.
>
> But setmaster can sleep so the BKL is dropped on contention of the
> struct_mutex, ditto dropmaster

they should only sleep in the mutex lock nuless the driver callback is
allocating memory. but yeah its a bit of a mess.

Dave.
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel

[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