Re: Locking question for DRM

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alan Cox
Date: Friday, April 23, 2010 - 4:00 am

> > I don't think that works. drm_open_helper doesn't appear to be under the

But not parallel open/release


With the mutex alone the damage is done. Consider two setmasters and some
other action which is making the mutex contend

		CPU1				CPU2

file->priv->minor->master == NULL ?
file_priv->minor->master != file_priv->master

mutex_lock	(drop BKL)
				file->priv->minor->master === NULL
				master != file_priv->master
				mutex_lock   [drop BKL]
takes mutex
minor->master = drm_master_get
is_master = 1
master_set
drop mutex
return 0
				takes mutex
				minor->master = drm_master_get
				is_master = 1
				master_set
				drops mutex
				return 0


Alan
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Locking question for DRM, Alan Cox, (Fri Apr 23, 3:22 am)
Re: Locking question for DRM, Dave Airlie, (Fri Apr 23, 3:24 am)
Re: Locking question for DRM, Alan Cox, (Fri Apr 23, 3:37 am)
Re: Locking question for DRM, Dave Airlie, (Fri Apr 23, 3:44 am)
Re: Locking question for DRM, Alan Cox, (Fri Apr 23, 4:00 am)