Skip to content

Commit e28f639

Browse files
committed
Merge branch 'drm-nouveau-fixes-3.8' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next
Fixes for one major lockdep warning, one oops reported by a few people, and fix for a long hang on some gpu engines. * 'drm-nouveau-fixes-3.8' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: drm/nouveau: add lockdep annotations drm/nv50/fb: Fix nullptr-deref on IGPs drm/nouveau: use different register to wait for secret scrubber
2 parents ff7c60c + 5f97ab9 commit e28f639

6 files changed

Lines changed: 19 additions & 9 deletions

File tree

‎drivers/gpu/drm/nouveau/core/core/falcon.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,11 @@ _nouveau_falcon_init(struct nouveau_object *object)
7373
nv_debug(falcon, "data limit: %d\n", falcon->data.limit);
7474

7575
/* wait for 'uc halted' to be signalled before continuing */
76-
if (falcon->secret) {
77-
nv_wait(falcon, 0x008, 0x00000010, 0x00000010);
76+
if (falcon->secret && falcon->version < 4) {
77+
if (!falcon->version)
78+
nv_wait(falcon, 0x008, 0x00000010, 0x00000010);
79+
else
80+
nv_wait(falcon, 0x180, 0x80000000, 0);
7881
nv_wo32(falcon, 0x004, 0x00000010);
7982
}
8083

‎drivers/gpu/drm/nouveau/core/core/subdev.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ nouveau_subdev_create_(struct nouveau_object *parent,
9999
if (ret)
100100
return ret;
101101

102-
mutex_init(&subdev->mutex);
102+
__mutex_init(&subdev->mutex, subname, &oclass->lock_class_key);
103103
subdev->name = subname;
104104

105105
if (parent) {

‎drivers/gpu/drm/nouveau/core/include/core/object.h‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,13 @@ int nouveau_object_fini(struct nouveau_object *, bool suspend);
5050

5151
extern struct nouveau_ofuncs nouveau_object_ofuncs;
5252

53+
/* Don't allocate dynamically, because lockdep needs lock_class_keys to be in
54+
* ".data". */
5355
struct nouveau_oclass {
5456
u32 handle;
55-
struct nouveau_ofuncs *ofuncs;
56-
struct nouveau_omthds *omthds;
57+
struct nouveau_ofuncs * const ofuncs;
58+
struct nouveau_omthds * const omthds;
59+
struct lock_class_key lock_class_key;
5760
};
5861

5962
#define nv_oclass(o) nv_object(o)->oclass

‎drivers/gpu/drm/nouveau/core/subdev/fb/base.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ nouveau_fb_preinit(struct nouveau_fb *pfb)
8686
return ret;
8787
}
8888

89-
if (!nouveau_mm_initialised(&pfb->tags) && tags) {
90-
ret = nouveau_mm_init(&pfb->tags, 0, ++tags, 1);
89+
if (!nouveau_mm_initialised(&pfb->tags)) {
90+
ret = nouveau_mm_init(&pfb->tags, 0, tags ? ++tags : 0, 1);
9191
if (ret)
9292
return ret;
9393
}

‎drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ nv50_fb_vram_init(struct nouveau_fb *pfb)
9999
struct nouveau_bios *bios = nouveau_bios(device);
100100
const u32 rsvd_head = ( 256 * 1024) >> 12; /* vga memory */
101101
const u32 rsvd_tail = (1024 * 1024) >> 12; /* vbios etc */
102-
u32 size;
102+
u32 size, tags = 0;
103103
int ret;
104104

105105
pfb->ram.size = nv_rd32(pfb, 0x10020c);
@@ -140,10 +140,11 @@ nv50_fb_vram_init(struct nouveau_fb *pfb)
140140
return ret;
141141

142142
pfb->ram.ranks = (nv_rd32(pfb, 0x100200) & 0x4) ? 2 : 1;
143+
tags = nv_rd32(pfb, 0x100320);
143144
break;
144145
}
145146

146-
return nv_rd32(pfb, 0x100320);
147+
return tags;
147148
}
148149

149150
static int

‎drivers/gpu/drm/nouveau/nouveau_drm.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
245245
return 0;
246246
}
247247

248+
static struct lock_class_key drm_client_lock_class_key;
249+
248250
static int
249251
nouveau_drm_load(struct drm_device *dev, unsigned long flags)
250252
{
@@ -256,6 +258,7 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags)
256258
ret = nouveau_cli_create(pdev, "DRM", sizeof(*drm), (void**)&drm);
257259
if (ret)
258260
return ret;
261+
lockdep_set_class(&drm->client.mutex, &drm_client_lock_class_key);
259262

260263
dev->dev_private = drm;
261264
drm->dev = dev;

0 commit comments

Comments
 (0)