All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Jiri Slaby <jirislaby@gmail.com>, Hans de Goede <hdegoede@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Ben Skeggs <bskeggs@redhat.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: 4.9-rc1 lockdep warning suggesting a deadlock between nouveau and i915 with prime video outputs active
Date: Thu, 13 Jul 2017 15:04:58 +0100	[thread overview]
Message-ID: <149995469805.29380.5405466287939095053@mail.alporthouse.com> (raw)
In-Reply-To: <2007195d-6663-867a-ecc3-03d2d348fb72@gmail.com>

Quoting Jiri Slaby (2017-07-13 14:57:31)
> Stealing this thread as an opensuse user hit that too:
> https://bugzilla.suse.com/show_bug.cgi?id=1045105

It's a false positive. I did once upon a time send some patches to move
the lockdep warning to kref so that didn't need to call it from drm
before an unlocked path. Basically you want

diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 8dc11064253d..3118aed844f1 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -826,7 +826,6 @@ drm_gem_object_put_unlocked(struct drm_gem_object *obj)
                return;
 
        dev = obj->dev;
-       might_lock(&dev->struct_mutex);
 
        if (dev->driver->gem_free_object_unlocked)
                kref_put(&obj->refcount, drm_gem_object_free);
diff --git a/include/linux/kref.h b/include/linux/kref.h
index 29220724bf1c..4b1133cd5d20 100644
--- a/include/linux/kref.h
+++ b/include/linux/kref.h
@@ -77,6 +77,8 @@ static inline int kref_put_mutex(struct kref *kref,
                                 void (*release)(struct kref *kref),
                                 struct mutex *lock)
 {
+       might_lock(lock);
+
        if (refcount_dec_and_mutex_lock(&kref->refcount, lock)) {
                release(kref);
                return 1;


Though now we probably want to move that might_lock() into refcount.
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-07-13 14:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-09 17:02 4.9-rc1 lockdep warning suggesting a deadlock between nouveau and i915 with prime video outputs active Hans de Goede
2016-11-09 17:26 ` Chris Wilson
2016-11-09 18:36   ` Hans de Goede
2017-07-13 13:57   ` Jiri Slaby
2017-07-13 14:01     ` Peter Zijlstra
2017-07-13 14:04     ` Chris Wilson [this message]
2017-07-13 18:59       ` Daniel Vetter

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=149995469805.29380.5405466287939095053@mail.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=jirislaby@gmail.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.