[PATCH 2/2] drm: make unplugged flag specific to udl driver

David Herrmann dh.herrmann at gmail.com
Tue Feb 9 20:52:09 UTC 2016


Hi

On Tue, Feb 9, 2016 at 9:45 PM, Haixia Shi <hshi at chromium.org> wrote:
> Regarding the following comment:
>
>> diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
>> index 1ea8790..b4332d4 100644
>> --- a/drivers/gpu/drm/drm_fops.c
>> +++ b/drivers/gpu/drm/drm_fops.c
>> @@ -497,8 +497,6 @@ int drm_release(struct inode *inode, struct file
>> *filp)
>>
>>         if (!--dev->open_count) {
>>                 retcode = drm_lastclose(dev);
>> -               if (drm_device_is_unplugged(dev))
>> -                       drm_put_dev(dev);
>
>>Again, you cannot drop this without replacement! In this case, you
>>really should wrap fops.release() from UDL and call into drm_release()
>>before copying this unplug-logic.
>
> Does this really work? drm_release() will release minor at the end,
> regardless of dev->open_count.

"open_count" is about "drm_device". "drm_minor" is completely unrelated to this.

> If minor is released, can I still safely get dev and call drm_put_dev(dev)
> afterwards?

Of course!

David


More information about the dri-devel mailing list