Commit 302daab1 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/fifo/gf100-: call into BAR to reset BARs after MMU fault

This is needed for Turing, but we're supposed to wait for completion after
re-writing the value on older GPUs anyway.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 03da9faa
...@@ -16,8 +16,10 @@ struct nvkm_bar { ...@@ -16,8 +16,10 @@ struct nvkm_bar {
}; };
struct nvkm_vmm *nvkm_bar_bar1_vmm(struct nvkm_device *); struct nvkm_vmm *nvkm_bar_bar1_vmm(struct nvkm_device *);
void nvkm_bar_bar1_reset(struct nvkm_device *);
void nvkm_bar_bar2_init(struct nvkm_device *); void nvkm_bar_bar2_init(struct nvkm_device *);
void nvkm_bar_bar2_fini(struct nvkm_device *); void nvkm_bar_bar2_fini(struct nvkm_device *);
void nvkm_bar_bar2_reset(struct nvkm_device *);
struct nvkm_vmm *nvkm_bar_bar2_vmm(struct nvkm_device *); struct nvkm_vmm *nvkm_bar_bar2_vmm(struct nvkm_device *);
void nvkm_bar_flush(struct nvkm_bar *); void nvkm_bar_flush(struct nvkm_bar *);
......
...@@ -346,10 +346,10 @@ gf100_fifo_intr_fault(struct gf100_fifo *fifo, int unit) ...@@ -346,10 +346,10 @@ gf100_fifo_intr_fault(struct gf100_fifo *fifo, int unit)
if (eu && eu->data2) { if (eu && eu->data2) {
switch (eu->data2) { switch (eu->data2) {
case NVKM_SUBDEV_BAR: case NVKM_SUBDEV_BAR:
nvkm_mask(device, 0x001704, 0x00000000, 0x00000000); nvkm_bar_bar1_reset(device);
break; break;
case NVKM_SUBDEV_INSTMEM: case NVKM_SUBDEV_INSTMEM:
nvkm_mask(device, 0x001714, 0x00000000, 0x00000000); nvkm_bar_bar2_reset(device);
break; break;
case NVKM_ENGINE_IFB: case NVKM_ENGINE_IFB:
nvkm_mask(device, 0x001718, 0x00000000, 0x00000000); nvkm_mask(device, 0x001718, 0x00000000, 0x00000000);
......
...@@ -456,10 +456,10 @@ gk104_fifo_fault(struct nvkm_fifo *base, struct nvkm_fault_data *info) ...@@ -456,10 +456,10 @@ gk104_fifo_fault(struct nvkm_fifo *base, struct nvkm_fault_data *info)
if (ee && ee->data2) { if (ee && ee->data2) {
switch (ee->data2) { switch (ee->data2) {
case NVKM_SUBDEV_BAR: case NVKM_SUBDEV_BAR:
nvkm_mask(device, 0x001704, 0x00000000, 0x00000000); nvkm_bar_bar1_reset(device);
break; break;
case NVKM_SUBDEV_INSTMEM: case NVKM_SUBDEV_INSTMEM:
nvkm_mask(device, 0x001714, 0x00000000, 0x00000000); nvkm_bar_bar2_reset(device);
break; break;
case NVKM_ENGINE_IFB: case NVKM_ENGINE_IFB:
nvkm_mask(device, 0x001718, 0x00000000, 0x00000000); nvkm_mask(device, 0x001718, 0x00000000, 0x00000000);
......
...@@ -36,6 +36,16 @@ nvkm_bar_bar1_vmm(struct nvkm_device *device) ...@@ -36,6 +36,16 @@ nvkm_bar_bar1_vmm(struct nvkm_device *device)
return device->bar->func->bar1.vmm(device->bar); return device->bar->func->bar1.vmm(device->bar);
} }
void
nvkm_bar_bar1_reset(struct nvkm_device *device)
{
struct nvkm_bar *bar = device->bar;
if (bar) {
bar->func->bar1.init(bar);
bar->func->bar1.wait(bar);
}
}
struct nvkm_vmm * struct nvkm_vmm *
nvkm_bar_bar2_vmm(struct nvkm_device *device) nvkm_bar_bar2_vmm(struct nvkm_device *device)
{ {
...@@ -48,6 +58,16 @@ nvkm_bar_bar2_vmm(struct nvkm_device *device) ...@@ -48,6 +58,16 @@ nvkm_bar_bar2_vmm(struct nvkm_device *device)
return NULL; return NULL;
} }
void
nvkm_bar_bar2_reset(struct nvkm_device *device)
{
struct nvkm_bar *bar = device->bar;
if (bar && bar->bar2) {
bar->func->bar2.init(bar);
bar->func->bar2.wait(bar);
}
}
void void
nvkm_bar_bar2_fini(struct nvkm_device *device) nvkm_bar_bar2_fini(struct nvkm_device *device)
{ {
......
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