From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [DRM] BUG: sleeping function called from invalid context, drm_lastclose Date: Wed, 11 Aug 2010 14:49:47 +0200 Message-ID: <201008111449.48141.arnd__44326.8029638149$1281561946$gmane$org@arndb.de> References: <20100811084828.GA5709@nb-core2.darkstar.lan> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net To: Dave Airlie Cc: Luca Tettamanti , linux-kernel@vger.kernel.org, dri-devel@lists.sourceforge.net List-Id: dri-devel@lists.freedesktop.org On Wednesday 11 August 2010, Dave Airlie wrote: > On Wed, Aug 11, 2010 at 6:48 PM, Luca Tettamanti wrote: > > > > > > moved the call to (inside drm_release) drm_lastclose inside dev->count_lock > > spinlock. > > drm_lastclose however takes dev->struct_mutex (now inside an atomic > > context): Yes, that's obviously been broken by me, sorry about the trouble. I must have been trying to simplify the error handling by adding a goto at the end of drm_release, which then happened to break the common path. The easiest way to fix this would be to go back to the way drm_release() worked previously and /only/ replace {,un}lock_kernel() with mutex_{,un}lock(&drm_global_mutex);. > I have a patch from Chris Wilson that I need to push to fix this, > basically reducing the spin lock coverage, > and relying on the global mutex to handle the open race. Yes, that sounds good, it's what the code used to do before my broken change. You might also be able to find a way to remove drm_global_lock from the open/close path entirely. Arnd ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev --