aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_drm.c
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2013-02-04 21:52:54 +0100
committerBen Skeggs <bskeggs@redhat.com>2013-02-09 10:12:21 +1000
commit5f97ab913cf0fbc378ea8ffc3ee66f4890d11c55 (patch)
tree1f3341522f74292c1890a93b368fc9c94d5a726d /drivers/gpu/drm/nouveau/nouveau_drm.c
parentdrm/nv50/fb: Fix nullptr-deref on IGPs (diff)
downloadlinux-dev-5f97ab913cf0fbc378ea8ffc3ee66f4890d11c55.tar.xz
linux-dev-5f97ab913cf0fbc378ea8ffc3ee66f4890d11c55.zip
drm/nouveau: add lockdep annotations
1) Lockdep thinks all nouveau subdevs belong to the same class and can be locked in arbitrary order, which is not true (at least in general case). Tell it to distinguish subdevs by (o)class type. 2) DRM client can be locked under user client lock - tell lockdep to put DRM client lock in a separate class. Reported-by: Arend van Spriel <arend@broadcom.com> Reported-by: Peter Hurley <peter@hurleysoftware.com> Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reported-by: Daniel J Blueman <daniel@quora.org> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: stable@vger.kernel.org [3.7, but needs s/const ofuncs/ofuncs/ to build] Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to '')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index efcfefa04123..43c78516941b 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -245,6 +245,8 @@ nouveau_drm_probe(struct pci_dev *pdev, const struct pci_device_id *pent)
return 0;
}
+static struct lock_class_key drm_client_lock_class_key;
+
static int
nouveau_drm_load(struct drm_device *dev, unsigned long flags)
{
@@ -256,6 +258,7 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags)
ret = nouveau_cli_create(pdev, "DRM", sizeof(*drm), (void**)&drm);
if (ret)
return ret;
+ lockdep_set_class(&drm->client.mutex, &drm_client_lock_class_key);
dev->dev_private = drm;
drm->dev = dev;