public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Dave Airlie <airlied@gmail.com>
Cc: Luca Tettamanti <kronos.it@gmail.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.sourceforge.net
Subject: Re: [DRM] BUG: sleeping function called from invalid context, drm_lastclose
Date: Wed, 11 Aug 2010 14:49:47 +0200	[thread overview]
Message-ID: <201008111449.48141.arnd@arndb.de> (raw)
In-Reply-To: <AANLkTimx0No2RgS8EdZCz=X8urJ8u4hVEVH5c1mcz_CW@mail.gmail.com>

On Wednesday 11 August 2010, Dave Airlie wrote:
> On Wed, Aug 11, 2010 at 6:48 PM, Luca Tettamanti <kronos.it@gmail.com> 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

  reply	other threads:[~2010-08-11 12:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-11  8:48 [DRM] BUG: sleeping function called from invalid context, drm_lastclose Luca Tettamanti
2010-08-11  8:50 ` Dave Airlie
2010-08-11 12:49   ` Arnd Bergmann [this message]
2010-08-11 14:17   ` Luca Tettamanti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201008111449.48141.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=kronos.it@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox