I should have mentioned that this applies to Linus' 3.13.0-rc7 and rc8 git. Maybe it's obvious.
Sorry about that.
Bob -------- Forwarded Message -------- From: Bob Gleitsmann rjgleits@bellsouth.net To: bskeggs@redhat.com Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH] Fix null dereference oopses for nv40 cards Date: Mon, 13 Jan 2014 01:45:36 -0500
The problem affects nv40 cards during booting. It comes from there being two places where subdev arrays are maintained. A commit was recently added to make the two equal. However, the struct nouveau_device version ends up being referenced before it is initialized. The problem arises during the creation of the INSTMEM and THERM subdevs. '
Signed off by: Bob Gleitsmann rjgleits@bellsouth.net
diff --git a/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c b/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c index b10a143..0f494ca 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c +++ b/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c @@ -23,6 +23,7 @@ */
#include <engine/graph/nv40.h> +#include <core/device.h>
#include "nv04.h"
@@ -38,6 +39,7 @@ nv40_instmem_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
ret = nouveau_instmem_create(parent, engine, oclass, &priv); *pobject = nv_object(priv); + device->subdev[NVDEV_SUBDEV_INSTMEM] = *pobject; if (ret) return ret;
diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c index 002e51b..59b25be 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c @@ -187,9 +187,11 @@ nv40_therm_ctor(struct nouveau_object *parent, { struct nv40_therm_priv *priv; int ret; + struct nouveau_device *device = nv_device(parent);
ret = nouveau_therm_create(parent, engine, oclass, &priv); *pobject = nv_object(priv); + device->subdev[NVDEV_SUBDEV_THERM] = *pobject; if (ret) return ret;
On Tue, Jan 14, 2014 at 1:22 PM, Bob Gleitsmann rjgleits@bellsouth.net wrote:
I should have mentioned that this applies to Linus' 3.13.0-rc7 and rc8 git. Maybe it's obvious.
Hey Bob,
Thanks for reporting this. Can you try the attached patch instead and report if it helps you?
Ben.
Sorry about that.
Bob -------- Forwarded Message -------- From: Bob Gleitsmann rjgleits@bellsouth.net To: bskeggs@redhat.com Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH] Fix null dereference oopses for nv40 cards Date: Mon, 13 Jan 2014 01:45:36 -0500
The problem affects nv40 cards during booting. It comes from there being two places where subdev arrays are maintained. A commit was recently added to make the two equal. However, the struct nouveau_device version ends up being referenced before it is initialized. The problem arises during the creation of the INSTMEM and THERM subdevs. '
Signed off by: Bob Gleitsmann rjgleits@bellsouth.net
diff --git a/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c b/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c index b10a143..0f494ca 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c +++ b/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c @@ -23,6 +23,7 @@ */
#include <engine/graph/nv40.h> +#include <core/device.h>
#include "nv04.h"
@@ -38,6 +39,7 @@ nv40_instmem_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
ret = nouveau_instmem_create(parent, engine, oclass, &priv); *pobject = nv_object(priv);
device->subdev[NVDEV_SUBDEV_INSTMEM] = *pobject; if (ret) return ret;
diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c index 002e51b..59b25be 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c @@ -187,9 +187,11 @@ nv40_therm_ctor(struct nouveau_object *parent, { struct nv40_therm_priv *priv; int ret;
struct nouveau_device *device = nv_device(parent); ret = nouveau_therm_create(parent, engine, oclass, &priv); *pobject = nv_object(priv);
device->subdev[NVDEV_SUBDEV_THERM] = *pobject; if (ret) return ret;
Nouveau mailing list Nouveau@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/nouveau
On Tue, Jan 14, 2014 at 3:07 PM, Ben Skeggs skeggsb@gmail.com wrote:
On Tue, Jan 14, 2014 at 1:22 PM, Bob Gleitsmann rjgleits@bellsouth.net wrote:
I should have mentioned that this applies to Linus' 3.13.0-rc7 and rc8 git. Maybe it's obvious.
Hey Bob,
Thanks for reporting this. Can you try the attached patch instead and report if it helps you?
Thinko in first attempt, new one attached.
Ben.
Sorry about that.
Bob -------- Forwarded Message -------- From: Bob Gleitsmann rjgleits@bellsouth.net To: bskeggs@redhat.com Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH] Fix null dereference oopses for nv40 cards Date: Mon, 13 Jan 2014 01:45:36 -0500
The problem affects nv40 cards during booting. It comes from there being two places where subdev arrays are maintained. A commit was recently added to make the two equal. However, the struct nouveau_device version ends up being referenced before it is initialized. The problem arises during the creation of the INSTMEM and THERM subdevs. '
Signed off by: Bob Gleitsmann rjgleits@bellsouth.net
diff --git a/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c b/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c index b10a143..0f494ca 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c +++ b/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c @@ -23,6 +23,7 @@ */
#include <engine/graph/nv40.h> +#include <core/device.h>
#include "nv04.h"
@@ -38,6 +39,7 @@ nv40_instmem_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
ret = nouveau_instmem_create(parent, engine, oclass, &priv); *pobject = nv_object(priv);
device->subdev[NVDEV_SUBDEV_INSTMEM] = *pobject; if (ret) return ret;
diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c index 002e51b..59b25be 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c @@ -187,9 +187,11 @@ nv40_therm_ctor(struct nouveau_object *parent, { struct nv40_therm_priv *priv; int ret;
struct nouveau_device *device = nv_device(parent); ret = nouveau_therm_create(parent, engine, oclass, &priv); *pobject = nv_object(priv);
device->subdev[NVDEV_SUBDEV_THERM] = *pobject; if (ret) return ret;
Nouveau mailing list Nouveau@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/nouveau
On 14/01/14 05:15, Ben Skeggs wrote:
On Tue, Jan 14, 2014 at 3:07 PM, Ben Skeggs skeggsb@gmail.com wrote:
On Tue, Jan 14, 2014 at 1:22 PM, Bob Gleitsmann rjgleits@bellsouth.net wrote:
I should have mentioned that this applies to Linus' 3.13.0-rc7 and rc8 git. Maybe it's obvious.
Hey Bob,
Thanks for reporting this. Can you try the attached patch instead and report if it helps you?
Thinko in first attempt, new one attached.
Seems to resolve the problem over at https://bugs.freedesktop.org/show_bug.cgi?id=73607
Thanks Ben
Ben.
Sorry about that.
Bob -------- Forwarded Message -------- From: Bob Gleitsmann rjgleits@bellsouth.net To: bskeggs@redhat.com Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH] Fix null dereference oopses for nv40 cards Date: Mon, 13 Jan 2014 01:45:36 -0500
The problem affects nv40 cards during booting. It comes from there being two places where subdev arrays are maintained. A commit was recently added to make the two equal. However, the struct nouveau_device version ends up being referenced before it is initialized. The problem arises during the creation of the INSTMEM and THERM subdevs. '
Signed off by: Bob Gleitsmann rjgleits@bellsouth.net
diff --git a/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c b/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c index b10a143..0f494ca 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c +++ b/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c @@ -23,6 +23,7 @@ */
#include <engine/graph/nv40.h> +#include <core/device.h>
#include "nv04.h"
@@ -38,6 +39,7 @@ nv40_instmem_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
ret = nouveau_instmem_create(parent, engine, oclass, &priv); *pobject = nv_object(priv);
device->subdev[NVDEV_SUBDEV_INSTMEM] = *pobject; if (ret) return ret;
diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c index 002e51b..59b25be 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c @@ -187,9 +187,11 @@ nv40_therm_ctor(struct nouveau_object *parent, { struct nv40_therm_priv *priv; int ret;
struct nouveau_device *device = nv_device(parent); ret = nouveau_therm_create(parent, engine, oclass, &priv); *pobject = nv_object(priv);
device->subdev[NVDEV_SUBDEV_THERM] = *pobject; if (ret) return ret;
Nouveau mailing list Nouveau@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/nouveau
Nouveau mailing list Nouveau@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/nouveau
Seems to work OK thanks.
Bob
On Tue, 2014-01-14 at 15:15 +1000, Ben Skeggs wrote:
On Tue, Jan 14, 2014 at 3:07 PM, Ben Skeggs skeggsb@gmail.com wrote:
On Tue, Jan 14, 2014 at 1:22 PM, Bob Gleitsmann rjgleits@bellsouth.net wrote:
I should have mentioned that this applies to Linus' 3.13.0-rc7 and rc8 git. Maybe it's obvious.
Hey Bob,
Thanks for reporting this. Can you try the attached patch instead and report if it helps you?
Thinko in first attempt, new one attached.
Ben.
Sorry about that.
Bob -------- Forwarded Message -------- From: Bob Gleitsmann rjgleits@bellsouth.net To: bskeggs@redhat.com Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH] Fix null dereference oopses for nv40 cards Date: Mon, 13 Jan 2014 01:45:36 -0500
The problem affects nv40 cards during booting. It comes from there being two places where subdev arrays are maintained. A commit was recently added to make the two equal. However, the struct nouveau_device version ends up being referenced before it is initialized. The problem arises during the creation of the INSTMEM and THERM subdevs. '
Signed off by: Bob Gleitsmann rjgleits@bellsouth.net
diff --git a/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c b/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c index b10a143..0f494ca 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c +++ b/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c @@ -23,6 +23,7 @@ */
#include <engine/graph/nv40.h> +#include <core/device.h>
#include "nv04.h"
@@ -38,6 +39,7 @@ nv40_instmem_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
ret = nouveau_instmem_create(parent, engine, oclass, &priv); *pobject = nv_object(priv);
device->subdev[NVDEV_SUBDEV_INSTMEM] = *pobject; if (ret) return ret;
diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c index 002e51b..59b25be 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c @@ -187,9 +187,11 @@ nv40_therm_ctor(struct nouveau_object *parent, { struct nv40_therm_priv *priv; int ret;
struct nouveau_device *device = nv_device(parent); ret = nouveau_therm_create(parent, engine, oclass, &priv); *pobject = nv_object(priv);
device->subdev[NVDEV_SUBDEV_THERM] = *pobject; if (ret) return ret;
Nouveau mailing list Nouveau@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/nouveau
dri-devel@lists.freedesktop.org