diff options
author | Dave Airlie <airlied@redhat.com> | 2013-02-10 18:40:14 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-02-10 18:40:14 -0500 |
commit | e28f639eeaa97b6029b0db8890b2a4ce99e642c6 (patch) | |
tree | f35c61e3b70297299f6d7c18db3e078d1e04aa8f /drivers | |
parent | ff7c60c580d9722f820d85c9c58ca55ecc1ee7c4 (diff) | |
parent | 5f97ab913cf0fbc378ea8ffc3ee66f4890d11c55 (diff) |
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
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/core/falcon.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/core/subdev.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/include/core/object.h | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/fb/base.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.c | 3 |
6 files changed, 19 insertions, 9 deletions
diff --git a/drivers/gpu/drm/nouveau/core/core/falcon.c b/drivers/gpu/drm/nouveau/core/core/falcon.c index 6b0843c33877..e05c15777588 100644 --- a/drivers/gpu/drm/nouveau/core/core/falcon.c +++ b/drivers/gpu/drm/nouveau/core/core/falcon.c | |||
@@ -73,8 +73,11 @@ _nouveau_falcon_init(struct nouveau_object *object) | |||
73 | nv_debug(falcon, "data limit: %d\n", falcon->data.limit); | 73 | nv_debug(falcon, "data limit: %d\n", falcon->data.limit); |
74 | 74 | ||
75 | /* wait for 'uc halted' to be signalled before continuing */ | 75 | /* wait for 'uc halted' to be signalled before continuing */ |
76 | if (falcon->secret) { | 76 | if (falcon->secret && falcon->version < 4) { |
77 | nv_wait(falcon, 0x008, 0x00000010, 0x00000010); | 77 | if (!falcon->version) |
78 | nv_wait(falcon, 0x008, 0x00000010, 0x00000010); | ||
79 | else | ||
80 | nv_wait(falcon, 0x180, 0x80000000, 0); | ||
78 | nv_wo32(falcon, 0x004, 0x00000010); | 81 | nv_wo32(falcon, 0x004, 0x00000010); |
79 | } | 82 | } |
80 | 83 | ||
diff --git a/drivers/gpu/drm/nouveau/core/core/subdev.c b/drivers/gpu/drm/nouveau/core/core/subdev.c index f74c30aa33a0..48f06378d3f9 100644 --- a/drivers/gpu/drm/nouveau/core/core/subdev.c +++ b/drivers/gpu/drm/nouveau/core/core/subdev.c | |||
@@ -99,7 +99,7 @@ nouveau_subdev_create_(struct nouveau_object *parent, | |||
99 | if (ret) | 99 | if (ret) |
100 | return ret; | 100 | return ret; |
101 | 101 | ||
102 | mutex_init(&subdev->mutex); | 102 | __mutex_init(&subdev->mutex, subname, &oclass->lock_class_key); |
103 | subdev->name = subname; | 103 | subdev->name = subname; |
104 | 104 | ||
105 | if (parent) { | 105 | if (parent) { |
diff --git a/drivers/gpu/drm/nouveau/core/include/core/object.h b/drivers/gpu/drm/nouveau/core/include/core/object.h index 5982935ee23a..106bb19fdd9a 100644 --- a/drivers/gpu/drm/nouveau/core/include/core/object.h +++ b/drivers/gpu/drm/nouveau/core/include/core/object.h | |||
@@ -50,10 +50,13 @@ int nouveau_object_fini(struct nouveau_object *, bool suspend); | |||
50 | 50 | ||
51 | extern struct nouveau_ofuncs nouveau_object_ofuncs; | 51 | extern struct nouveau_ofuncs nouveau_object_ofuncs; |
52 | 52 | ||
53 | /* Don't allocate dynamically, because lockdep needs lock_class_keys to be in | ||
54 | * ".data". */ | ||
53 | struct nouveau_oclass { | 55 | struct nouveau_oclass { |
54 | u32 handle; | 56 | u32 handle; |
55 | struct nouveau_ofuncs *ofuncs; | 57 | struct nouveau_ofuncs * const ofuncs; |
56 | struct nouveau_omthds *omthds; | 58 | struct nouveau_omthds * const omthds; |
59 | struct lock_class_key lock_class_key; | ||
57 | }; | 60 | }; |
58 | 61 | ||
59 | #define nv_oclass(o) nv_object(o)->oclass | 62 | #define nv_oclass(o) nv_object(o)->oclass |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/base.c b/drivers/gpu/drm/nouveau/core/subdev/fb/base.c index d6d16007ec1a..d62045f454b2 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/fb/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/fb/base.c | |||
@@ -86,8 +86,8 @@ nouveau_fb_preinit(struct nouveau_fb *pfb) | |||
86 | return ret; | 86 | return ret; |
87 | } | 87 | } |
88 | 88 | ||
89 | if (!nouveau_mm_initialised(&pfb->tags) && tags) { | 89 | if (!nouveau_mm_initialised(&pfb->tags)) { |
90 | ret = nouveau_mm_init(&pfb->tags, 0, ++tags, 1); | 90 | ret = nouveau_mm_init(&pfb->tags, 0, tags ? ++tags : 0, 1); |
91 | if (ret) | 91 | if (ret) |
92 | return ret; | 92 | return ret; |
93 | } | 93 | } |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c b/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c index 487cb8c6c204..eac236ed19b2 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c +++ b/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c | |||
@@ -99,7 +99,7 @@ nv50_fb_vram_init(struct nouveau_fb *pfb) | |||
99 | struct nouveau_bios *bios = nouveau_bios(device); | 99 | struct nouveau_bios *bios = nouveau_bios(device); |
100 | const u32 rsvd_head = ( 256 * 1024) >> 12; /* vga memory */ | 100 | const u32 rsvd_head = ( 256 * 1024) >> 12; /* vga memory */ |
101 | const u32 rsvd_tail = (1024 * 1024) >> 12; /* vbios etc */ | 101 | const u32 rsvd_tail = (1024 * 1024) >> 12; /* vbios etc */ |
102 | u32 size; | 102 | u32 size, tags = 0; |
103 | int ret; | 103 | int ret; |
104 | 104 | ||
105 | pfb->ram.size = nv_rd32(pfb, 0x10020c); | 105 | pfb->ram.size = nv_rd32(pfb, 0x10020c); |
@@ -140,10 +140,11 @@ nv50_fb_vram_init(struct nouveau_fb *pfb) | |||
140 | return ret; | 140 | return ret; |
141 | 141 | ||
142 | pfb->ram.ranks = (nv_rd32(pfb, 0x100200) & 0x4) ? 2 : 1; | 142 | pfb->ram.ranks = (nv_rd32(pfb, 0x100200) & 0x4) ? 2 : 1; |
143 | tags = nv_rd32(pfb, 0x100320); | ||
143 | break; | 144 | break; |
144 | } | 145 | } |
145 | 146 | ||
146 | return nv_rd32(pfb, 0x100320); | 147 | return tags; |
147 | } | 148 | } |
148 | 149 | ||
149 | static int | 150 | static int |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 8b090f1eb51d..5e7aef23825a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |||
@@ -245,6 +245,8 @@ static int nouveau_drm_probe(struct pci_dev *pdev, | |||
245 | return 0; | 245 | return 0; |
246 | } | 246 | } |
247 | 247 | ||
248 | static struct lock_class_key drm_client_lock_class_key; | ||
249 | |||
248 | static int | 250 | static int |
249 | nouveau_drm_load(struct drm_device *dev, unsigned long flags) | 251 | nouveau_drm_load(struct drm_device *dev, unsigned long flags) |
250 | { | 252 | { |
@@ -256,6 +258,7 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags) | |||
256 | ret = nouveau_cli_create(pdev, "DRM", sizeof(*drm), (void**)&drm); | 258 | ret = nouveau_cli_create(pdev, "DRM", sizeof(*drm), (void**)&drm); |
257 | if (ret) | 259 | if (ret) |
258 | return ret; | 260 | return ret; |
261 | lockdep_set_class(&drm->client.mutex, &drm_client_lock_class_key); | ||
259 | 262 | ||
260 | dev->dev_private = drm; | 263 | dev->dev_private = drm; |
261 | drm->dev = dev; | 264 | drm->dev = dev; |