Skip to contentSkip to conversation

drm/nouveau: Ack interrupts for some fuc engines

PATCH In review Maarten Lankhorst 4 participants 5 messages Mar 25, 2013 – Mar 27, 2013 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau: Ack interrupts for some fuc engines

Fixes 100% cpu usage when the exit interrupt never got acked.

---

drivers/gpu/drm/nouveau/core/core/falcon.c +18 -0
index e05c157..b11c5f3 100644
@@ -229,6 +229,24 @@ _nouveau_falcon_fini(struct nouveau_object *object, bool suspend)
 	return nouveau_engine_fini(&falcon->base, suspend);
 }
 
+void
+nouveau_falcon_intr(struct nouveau_subdev *subdev)
+{
+	struct nouveau_falcon *falcon = (void*)subdev;
+	u32 intr = nv_ro32(falcon, 0x008);
+
+	nv_wo32(falcon, 0x004, intr);
+
+	if (intr & 0x10) {
+		intr &= ~0x10;
+
+		nv_info(falcon, "Exit interrupt called\n");
+	}
+
+	if (intr)
+		nv_error(falcon, "Unhandled interrupt %08x\n", intr);
+}
+
 int
 nouveau_falcon_create_(struct nouveau_object *parent,
 		       struct nouveau_object *engine,
drivers/gpu/drm/nouveau/core/engine/bsp/nvc0.c +1 -0
index 0a5aa6b..2201c96 100644
@@ -91,6 +91,7 @@ nvc0_bsp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
 		return ret;
 
 	nv_subdev(priv)->unit = 0x00008000;
+	nv_subdev(priv)->intr = nouveau_falcon_intr;
 	nv_engine(priv)->cclass = &nvc0_bsp_cclass;
 	nv_engine(priv)->sclass = nvc0_bsp_sclass;
 	return 0;
drivers/gpu/drm/nouveau/core/engine/bsp/nve0.c +1 -0
index d4f23bb..4e7f79b 100644
@@ -91,6 +91,7 @@ nve0_bsp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
 		return ret;
 
 	nv_subdev(priv)->unit = 0x00008000;
+	nv_subdev(priv)->intr = nouveau_falcon_intr;
 	nv_engine(priv)->cclass = &nve0_bsp_cclass;
 	nv_engine(priv)->sclass = nve0_bsp_sclass;
 	return 0;
drivers/gpu/drm/nouveau/core/engine/ppp/nvc0.c +1 -0
index ebf0d86..4557c3b 100644
@@ -91,6 +91,7 @@ nvc0_ppp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
 		return ret;
 
 	nv_subdev(priv)->unit = 0x00000002;
+	nv_subdev(priv)->intr = nouveau_falcon_intr;
 	nv_engine(priv)->cclass = &nvc0_ppp_cclass;
 	nv_engine(priv)->sclass = nvc0_ppp_sclass;
 	return 0;
drivers/gpu/drm/nouveau/core/engine/vp/nvc0.c +1 -0
index f761949..cc2c8cc 100644
@@ -91,6 +91,7 @@ nvc0_vp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
 		return ret;
 
 	nv_subdev(priv)->unit = 0x00020000;
+	nv_subdev(priv)->intr = nouveau_falcon_intr;
 	nv_engine(priv)->cclass = &nvc0_vp_cclass;
 	nv_engine(priv)->sclass = nvc0_vp_sclass;
 	return 0;
drivers/gpu/drm/nouveau/core/engine/vp/nve0.c +1 -0
index 2384ce5..774ec16 100644
@@ -91,6 +91,7 @@ nve0_vp_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
 		return ret;
 
 	nv_subdev(priv)->unit = 0x00020000;
+	nv_subdev(priv)->intr = nouveau_falcon_intr;
 	nv_engine(priv)->cclass = &nve0_vp_cclass;
 	nv_engine(priv)->sclass = nve0_vp_sclass;
 	return 0;
drivers/gpu/drm/nouveau/core/include/core/falcon.h +2 -0
index 1edec38..181aa7d 100644
@@ -72,6 +72,8 @@ int nouveau_falcon_create_(struct nouveau_object *, struct nouveau_object *,
 			   struct nouveau_oclass *, u32, bool, const char *,
 			   const char *, int, void **);
 
+void nouveau_falcon_intr(struct nouveau_subdev *subdev);
+
 #define _nouveau_falcon_dtor _nouveau_engine_dtor
 int  _nouveau_falcon_init(struct nouveau_object *);
 int  _nouveau_falcon_fini(struct nouveau_object *, bool);
#1 lore raw
Quoted 14 lines · Maarten Lankhorst

Fixes 100% cpu usage when the exit interrupt never got acked.

---

drivers/gpu/drm/nouveau/core/core/falcon.c +2 -0
index e05c157..b11c5f3 100644
@@ -229,6 +229,24 @@ _nouveau_falcon_fini(struct nouveau_object *object, bool suspend)
 	return nouveau_engine_fini(&falcon->base, suspend);
 }
 
+void
+nouveau_falcon_intr(struct nouveau_subdev *subdev)

drivers/gpu/drm/nouveau/core/core/falcon.c _nouveau_falcon_fini(struct nouveau_object *object, bool suspend) · line 243

Quoted 10 lines
drivers/gpu/drm/nouveau/core/core/falcon.c +10 -0
+{
+	struct nouveau_falcon *falcon = (void*)subdev;
+	u32 intr = nv_ro32(falcon, 0x008);
+
+	nv_wo32(falcon, 0x004, intr);
+
+	if (intr & 0x10) {
+		intr &= ~0x10;
+
+		nv_info(falcon, "Exit interrupt called\n");

Do you really want to print it at "info" level? How frequent it is?

Quoted 9 lines
drivers/gpu/drm/nouveau/core/core/falcon.c +6 -0
+	}
+
+	if (intr)
+		nv_error(falcon, "Unhandled interrupt %08x\n", intr);
+}
+
 int
 nouveau_falcon_create_(struct nouveau_object *parent,
 		       struct nouveau_object *engine,
#2 lore raw

Op 25-03-13 19:14, Marcin Slusarz schreef:

Quoted 13 lines · Maarten Lankhorst
Quoted 12 lines

Fixes 100% cpu usage when the exit interrupt never got acked.

---

drivers/gpu/drm/nouveau/core/core/falcon.c +0 -0
index e05c157..b11c5f3 100644
@@ -229,6 +229,24 @@ _nouveau_falcon_fini(struct nouveau_object *object, bool suspend)
 	return nouveau_engine_fini(&falcon->base, suspend);
 }
 
Quoted 13 lines

drivers/gpu/drm/nouveau/core/core/falcon.c _nouveau_falcon_fini(struct nouveau_object *object, bool suspend) · line 243

Quoted 12 lines
drivers/gpu/drm/nouveau/core/core/falcon.c +12 -0
+void
+nouveau_falcon_intr(struct nouveau_subdev *subdev)
+{
+	struct nouveau_falcon *falcon = (void*)subdev;
+	u32 intr = nv_ro32(falcon, 0x008);
+
+	nv_wo32(falcon, 0x004, intr);
+
+	if (intr & 0x10) {
+		intr &= ~0x10;
+
+		nv_info(falcon, "Exit interrupt called\n");

Do you really want to print it at "info" level? How frequent it is?

It shouldn't be often, I want it to run at the error level since that usually means the firmware exited prematurely/crashed and things go bad, but it happens with the secret scrubber finishing on initialization too. That one is harmless though.

Quoted 14 lines

drivers/gpu/drm/nouveau/core/core/falcon.c _nouveau_falcon_fini(struct nouveau_object *object, bool suspend) · line 252

Quoted 9 lines
drivers/gpu/drm/nouveau/core/core/falcon.c +6 -0
+	}
+
+	if (intr)
+		nv_error(falcon, "Unhandled interrupt %08x\n", intr);
+}
+
 int
 nouveau_falcon_create_(struct nouveau_object *parent,
 		       struct nouveau_object *engine,

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 27 lines · Maarten Lankhorst

Op 25-03-13 19:14, Marcin Slusarz schreef:

Quoted 13 lines · Maarten Lankhorst
Quoted 12 lines

Fixes 100% cpu usage when the exit interrupt never got acked.

---

drivers/gpu/drm/nouveau/core/core/falcon.c +0 -0
index e05c157..b11c5f3 100644
@@ -229,6 +229,24 @@ _nouveau_falcon_fini(struct nouveau_object *object, bool suspend)
 	return nouveau_engine_fini(&falcon->base, suspend);
 }
 
Quoted 13 lines

drivers/gpu/drm/nouveau/core/core/falcon.c _nouveau_falcon_fini(struct nouveau_object *object, bool suspend) · line 243

Quoted 12 lines
drivers/gpu/drm/nouveau/core/core/falcon.c +12 -0
+void
+nouveau_falcon_intr(struct nouveau_subdev *subdev)
+{
+	struct nouveau_falcon *falcon = (void*)subdev;
+	u32 intr = nv_ro32(falcon, 0x008);
+
+	nv_wo32(falcon, 0x004, intr);
+
+	if (intr & 0x10) {
+		intr &= ~0x10;
+
+		nv_info(falcon, "Exit interrupt called\n");

Do you really want to print it at "info" level? How frequent it is?

Quoted 4 lines

It shouldn't be often, I want it to run at the error level since that usually means the firmware exited prematurely/crashed and things go bad, but it happens with the secret scrubber finishing on initialization too. That one is harmless though.

Maybe it should say:
nv_error(falcon, "firmware exited prematurely\n"); ?

Quoted 15 lines
Quoted 14 lines

drivers/gpu/drm/nouveau/core/core/falcon.c _nouveau_falcon_fini(struct nouveau_object *object, bool suspend) · line 252

Quoted 9 lines
drivers/gpu/drm/nouveau/core/core/falcon.c +6 -0
+	}
+
+	if (intr)
+		nv_error(falcon, "Unhandled interrupt %08x\n", intr);
+}
+
 int
 nouveau_falcon_create_(struct nouveau_object *parent,
 		       struct nouveau_object *engine,

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
In reply to a message not in the archive

Op 26-03-13 21:29, Marcin Slusarz schreef:

Quoted 28 lines · Maarten Lankhorst
Quoted 27 lines

Op 25-03-13 19:14, Marcin Slusarz schreef:

Quoted 26 lines · Maarten Lankhorst
Quoted 14 lines

Fixes 100% cpu usage when the exit interrupt never got acked.

---

drivers/gpu/drm/nouveau/core/core/falcon.c +2 -0
index e05c157..b11c5f3 100644
@@ -229,6 +229,24 @@ _nouveau_falcon_fini(struct nouveau_object *object, bool suspend)
 	return nouveau_engine_fini(&falcon->base, suspend);
 }
 
+void
+nouveau_falcon_intr(struct nouveau_subdev *subdev)

drivers/gpu/drm/nouveau/core/core/falcon.c _nouveau_falcon_fini(struct nouveau_object *object, bool suspend) · line 243

Quoted 10 lines
drivers/gpu/drm/nouveau/core/core/falcon.c +10 -0
+{
+	struct nouveau_falcon *falcon = (void*)subdev;
+	u32 intr = nv_ro32(falcon, 0x008);
+
+	nv_wo32(falcon, 0x004, intr);
+
+	if (intr & 0x10) {
+		intr &= ~0x10;
+
+		nv_info(falcon, "Exit interrupt called\n");

Do you really want to print it at "info" level? How frequent it is?

Quoted 8 lines
Quoted 4 lines

It shouldn't be often, I want it to run at the error level since that usually means the firmware exited prematurely/crashed and things go bad, but it happens with the secret scrubber finishing on initialization too. That one is harmless though.

Maybe it should say:
nv_error(falcon, "firmware exited prematurely\n"); ?

That is only 1 of the 2 causes, the other is when it's a secret engine (CRYPT/BSP/VP for <nvd0) and the scrubber finished running. In that case it's not an error.

~Maarten