Commit 088bfe43 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/fifo/gf100-: switch static mmu fault id list to type+inst

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent c6198d34
...@@ -8,6 +8,7 @@ struct nvkm_enum { ...@@ -8,6 +8,7 @@ struct nvkm_enum {
const char *name; const char *name;
const void *data; const void *data;
u32 data2; u32 data2;
int inst;
}; };
const struct nvkm_enum *nvkm_enum_find(const struct nvkm_enum *, u32 value); const struct nvkm_enum *nvkm_enum_find(const struct nvkm_enum *, u32 value);
......
...@@ -25,7 +25,7 @@ struct nvkm_top_device { ...@@ -25,7 +25,7 @@ struct nvkm_top_device {
u32 nvkm_top_addr(struct nvkm_device *, enum nvkm_subdev_type, int); u32 nvkm_top_addr(struct nvkm_device *, enum nvkm_subdev_type, int);
u32 nvkm_top_reset(struct nvkm_device *, enum nvkm_subdev_type, int); u32 nvkm_top_reset(struct nvkm_device *, enum nvkm_subdev_type, int);
u32 nvkm_top_intr_mask(struct nvkm_device *, enum nvkm_subdev_type, int); u32 nvkm_top_intr_mask(struct nvkm_device *, enum nvkm_subdev_type, int);
int nvkm_top_fault_id(struct nvkm_device *, enum nvkm_devidx); int nvkm_top_fault_id(struct nvkm_device *, enum nvkm_subdev_type, int);
enum nvkm_devidx nvkm_top_fault(struct nvkm_device *, int fault); enum nvkm_devidx nvkm_top_fault(struct nvkm_device *, int fault);
int gk104_top_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_top **); int gk104_top_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_top **);
......
...@@ -205,8 +205,8 @@ gf100_fifo_fault_engine[] = { ...@@ -205,8 +205,8 @@ gf100_fifo_fault_engine[] = {
{ 0x11, "PMSPPP", NULL, NVKM_ENGINE_MSPPP }, { 0x11, "PMSPPP", NULL, NVKM_ENGINE_MSPPP },
{ 0x13, "PCOUNTER" }, { 0x13, "PCOUNTER" },
{ 0x14, "PMSPDEC", NULL, NVKM_ENGINE_MSPDEC }, { 0x14, "PMSPDEC", NULL, NVKM_ENGINE_MSPDEC },
{ 0x15, "PCE0", NULL, NVKM_ENGINE_CE0 }, { 0x15, "PCE0", NULL, NVKM_ENGINE_CE, 0 },
{ 0x16, "PCE1", NULL, NVKM_ENGINE_CE1 }, { 0x16, "PCE1", NULL, NVKM_ENGINE_CE, 1 },
{ 0x17, "PMU" }, { 0x17, "PMU" },
{} {}
}; };
...@@ -286,7 +286,7 @@ gf100_fifo_fault(struct nvkm_fifo *base, struct nvkm_fault_data *info) ...@@ -286,7 +286,7 @@ gf100_fifo_fault(struct nvkm_fifo *base, struct nvkm_fault_data *info)
nvkm_mask(device, 0x001718, 0x00000000, 0x00000000); nvkm_mask(device, 0x001718, 0x00000000, 0x00000000);
break; break;
default: default:
engine = nvkm_device_engine(device, eu->data2, 0); engine = nvkm_device_engine(device, eu->data2, eu->inst);
break; break;
} }
} }
......
...@@ -433,11 +433,12 @@ gk104_fifo_recover_engn(struct gk104_fifo *fifo, int engn) ...@@ -433,11 +433,12 @@ gk104_fifo_recover_engn(struct gk104_fifo *fifo, int engn)
* called from the fault handler already. * called from the fault handler already.
*/ */
if (!status.faulted && engine) { if (!status.faulted && engine) {
mmui = nvkm_top_fault_id(device, engine->subdev.index); mmui = nvkm_top_fault_id(device, engine->subdev.type, engine->subdev.inst);
if (mmui < 0) { if (mmui < 0) {
const struct nvkm_enum *en = fifo->func->fault.engine; const struct nvkm_enum *en = fifo->func->fault.engine;
for (; en && en->name; en++) { for (; en && en->name; en++) {
if (en->data2 == engine->subdev.index) { if (en->data2 == engine->subdev.type &&
en->inst == engine->subdev.inst) {
mmui = en->value; mmui = en->value;
break; break;
} }
...@@ -1111,12 +1112,12 @@ gk104_fifo_fault_engine[] = { ...@@ -1111,12 +1112,12 @@ gk104_fifo_fault_engine[] = {
{ 0x11, "MSPPP", NULL, NVKM_ENGINE_MSPPP }, { 0x11, "MSPPP", NULL, NVKM_ENGINE_MSPPP },
{ 0x13, "PERF" }, { 0x13, "PERF" },
{ 0x14, "MSPDEC", NULL, NVKM_ENGINE_MSPDEC }, { 0x14, "MSPDEC", NULL, NVKM_ENGINE_MSPDEC },
{ 0x15, "CE0", NULL, NVKM_ENGINE_CE0 }, { 0x15, "CE0", NULL, NVKM_ENGINE_CE, 0 },
{ 0x16, "CE1", NULL, NVKM_ENGINE_CE1 }, { 0x16, "CE1", NULL, NVKM_ENGINE_CE, 1 },
{ 0x17, "PMU" }, { 0x17, "PMU" },
{ 0x18, "PTP" }, { 0x18, "PTP" },
{ 0x19, "MSENC", NULL, NVKM_ENGINE_MSENC }, { 0x19, "MSENC", NULL, NVKM_ENGINE_MSENC },
{ 0x1b, "CE2", NULL, NVKM_ENGINE_CE2 }, { 0x1b, "CE2", NULL, NVKM_ENGINE_CE, 2 },
{} {}
}; };
......
...@@ -91,13 +91,13 @@ nvkm_top_intr_mask(struct nvkm_device *device, enum nvkm_subdev_type type, int i ...@@ -91,13 +91,13 @@ nvkm_top_intr_mask(struct nvkm_device *device, enum nvkm_subdev_type type, int i
} }
int int
nvkm_top_fault_id(struct nvkm_device *device, enum nvkm_devidx devidx) nvkm_top_fault_id(struct nvkm_device *device, enum nvkm_subdev_type type, int inst)
{ {
struct nvkm_top *top = device->top; struct nvkm_top *top = device->top;
struct nvkm_top_device *info; struct nvkm_top_device *info;
list_for_each_entry(info, &top->device, head) { list_for_each_entry(info, &top->device, head) {
if (info->index == devidx && info->fault >= 0) if (info->type == type && info->inst == inst && info->fault >= 0)
return info->fault; return info->fault;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment