Re: [Nouveau] [PATCH 1/6] drm/nouveau: fault: Store aperture in fault information

2019-09-17 Thread Thierry Reding
On Tue, Sep 17, 2019 at 01:47:25PM +1000, Ben Skeggs wrote:
> On Tue, 17 Sep 2019 at 01:18, Thierry Reding  wrote:
> >
> > From: Thierry Reding 
> >
> > The fault information register contains data about the aperture that
> > caused the failure. This can be useful in debugging aperture related
> > programming bugs.
> Should this be parsed for fault buffer entries too?

Yes, it probably should. Will fix that in v2.

Thanks,
Thierry

> 
> >
> > Signed-off-by: Thierry Reding 
> > ---
> >  drivers/gpu/drm/nouveau/include/nvkm/subdev/fault.h | 1 +
> >  drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c| 3 ++-
> >  drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c   | 1 +
> >  3 files changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fault.h 
> > b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fault.h
> > index 97322f95b3ee..1cc862bc1122 100644
> > --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fault.h
> > +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fault.h
> > @@ -21,6 +21,7 @@ struct nvkm_fault_data {
> > u64  addr;
> > u64  inst;
> > u64  time;
> > +   u8 aperture;
> > u8 engine;
> > u8  valid;
> > u8gpc;
> > diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c 
> > b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
> > index 5d4b695cab8e..81cbe1cc4804 100644
> > --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
> > +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
> > @@ -519,9 +519,10 @@ gk104_fifo_fault(struct nvkm_fifo *base, struct 
> > nvkm_fault_data *info)
> > chan = nvkm_fifo_chan_inst_locked(>base, info->inst);
> >
> > nvkm_error(subdev,
> > -  "fault %02x [%s] at %016llx engine %02x [%s] client %02x 
> > "
> > +  "fault %02x [%s] at %016llx aperture %02x engine %02x 
> > [%s] client %02x "
> >"[%s%s] reason %02x [%s] on channel %d [%010llx %s]\n",
> >info->access, ea ? ea->name : "", info->addr,
> > +  info->aperture,
> >info->engine, ee ? ee->name : en,
> >info->client, ct, ec ? ec->name : "",
> >info->reason, er ? er->name : "", chan ? chan->chid : -1,
> > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c 
> > b/drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c
> > index 6747f09c2dc3..b5e32295237b 100644
> > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c
> > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c
> > @@ -138,6 +138,7 @@ gv100_fault_intr_fault(struct nvkm_fault *fault)
> > info.inst = ((u64)insthi << 32) | (info0 & 0xf000);
> > info.time = 0;
> > info.engine = (info0 & 0x00ff);
> > +   info.aperture = (info0 & 0x0c00) >> 10;
> > info.valid  = (info1 & 0x8000) >> 31;
> > info.gpc= (info1 & 0x1f00) >> 24;
> > info.hub= (info1 & 0x0010) >> 20;
> > --
> > 2.23.0
> >
> > ___
> > Nouveau mailing list
> > nouv...@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/nouveau


signature.asc
Description: PGP signature
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [Nouveau] [PATCH 1/6] drm/nouveau: fault: Store aperture in fault information

2019-09-16 Thread Ben Skeggs
On Tue, 17 Sep 2019 at 01:18, Thierry Reding  wrote:
>
> From: Thierry Reding 
>
> The fault information register contains data about the aperture that
> caused the failure. This can be useful in debugging aperture related
> programming bugs.
Should this be parsed for fault buffer entries too?

>
> Signed-off-by: Thierry Reding 
> ---
>  drivers/gpu/drm/nouveau/include/nvkm/subdev/fault.h | 1 +
>  drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c| 3 ++-
>  drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c   | 1 +
>  3 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fault.h 
> b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fault.h
> index 97322f95b3ee..1cc862bc1122 100644
> --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fault.h
> +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fault.h
> @@ -21,6 +21,7 @@ struct nvkm_fault_data {
> u64  addr;
> u64  inst;
> u64  time;
> +   u8 aperture;
> u8 engine;
> u8  valid;
> u8gpc;
> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c 
> b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
> index 5d4b695cab8e..81cbe1cc4804 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
> @@ -519,9 +519,10 @@ gk104_fifo_fault(struct nvkm_fifo *base, struct 
> nvkm_fault_data *info)
> chan = nvkm_fifo_chan_inst_locked(>base, info->inst);
>
> nvkm_error(subdev,
> -  "fault %02x [%s] at %016llx engine %02x [%s] client %02x "
> +  "fault %02x [%s] at %016llx aperture %02x engine %02x [%s] 
> client %02x "
>"[%s%s] reason %02x [%s] on channel %d [%010llx %s]\n",
>info->access, ea ? ea->name : "", info->addr,
> +  info->aperture,
>info->engine, ee ? ee->name : en,
>info->client, ct, ec ? ec->name : "",
>info->reason, er ? er->name : "", chan ? chan->chid : -1,
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c 
> b/drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c
> index 6747f09c2dc3..b5e32295237b 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c
> @@ -138,6 +138,7 @@ gv100_fault_intr_fault(struct nvkm_fault *fault)
> info.inst = ((u64)insthi << 32) | (info0 & 0xf000);
> info.time = 0;
> info.engine = (info0 & 0x00ff);
> +   info.aperture = (info0 & 0x0c00) >> 10;
> info.valid  = (info1 & 0x8000) >> 31;
> info.gpc= (info1 & 0x1f00) >> 24;
> info.hub= (info1 & 0x0010) >> 20;
> --
> 2.23.0
>
> ___
> Nouveau mailing list
> nouv...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 1/6] drm/nouveau: fault: Store aperture in fault information

2019-09-16 Thread Thierry Reding
From: Thierry Reding 

The fault information register contains data about the aperture that
caused the failure. This can be useful in debugging aperture related
programming bugs.

Signed-off-by: Thierry Reding 
---
 drivers/gpu/drm/nouveau/include/nvkm/subdev/fault.h | 1 +
 drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c| 3 ++-
 drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c   | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fault.h 
b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fault.h
index 97322f95b3ee..1cc862bc1122 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fault.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fault.h
@@ -21,6 +21,7 @@ struct nvkm_fault_data {
u64  addr;
u64  inst;
u64  time;
+   u8 aperture;
u8 engine;
u8  valid;
u8gpc;
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c 
b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
index 5d4b695cab8e..81cbe1cc4804 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
@@ -519,9 +519,10 @@ gk104_fifo_fault(struct nvkm_fifo *base, struct 
nvkm_fault_data *info)
chan = nvkm_fifo_chan_inst_locked(>base, info->inst);
 
nvkm_error(subdev,
-  "fault %02x [%s] at %016llx engine %02x [%s] client %02x "
+  "fault %02x [%s] at %016llx aperture %02x engine %02x [%s] 
client %02x "
   "[%s%s] reason %02x [%s] on channel %d [%010llx %s]\n",
   info->access, ea ? ea->name : "", info->addr,
+  info->aperture,
   info->engine, ee ? ee->name : en,
   info->client, ct, ec ? ec->name : "",
   info->reason, er ? er->name : "", chan ? chan->chid : -1,
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c 
b/drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c
index 6747f09c2dc3..b5e32295237b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c
@@ -138,6 +138,7 @@ gv100_fault_intr_fault(struct nvkm_fault *fault)
info.inst = ((u64)insthi << 32) | (info0 & 0xf000);
info.time = 0;
info.engine = (info0 & 0x00ff);
+   info.aperture = (info0 & 0x0c00) >> 10;
info.valid  = (info1 & 0x8000) >> 31;
info.gpc= (info1 & 0x1f00) >> 24;
info.hub= (info1 & 0x0010) >> 20;
-- 
2.23.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel