Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/nouveau/fault: missing 9-bit engine update in tu102 fault
  and fifo paths
--

commit db6fbbacd1ecc5e23e3d429db261eb685b2e5bf0
Author: Thierry Reding <[email protected]>

drm/nouveau/fault: Widen engine field

This commit widens nvkm_fault_data.engine to 16 bits and updates the GV100
fault handlers to extract a 9-bit engine ID from info0.

Link: https://lists.freedesktop.org/archives/nouveau/2019-September/033796.html

> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c 
> b/drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c
> index 8e34d40e7649b..47e34943b77f8 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fault/gv100.c
> @@ -59,7 +59,7 @@ gv100_fault_buffer_process(struct work_struct *work)
>               info.addr   = ((u64)addrhi << 32) | addrlo;
>               info.inst   = ((u64)insthi << 32) | instlo;
>               info.time   = ((u64)timehi << 32) | timelo;
> -             info.engine = (info0 & 0x000000ff);
> +             info.engine = (info0 & 0x000001ff);
>               info.valid  = (info1 & 0x80000000) >> 31;
>               info.gpc    = (info1 & 0x1f000000) >> 24;
>               info.hub    = (info1 & 0x00100000) >> 20;
> @@ -140,7 +140,7 @@ gv100_fault_intr_fault(struct nvkm_fault *fault)
>       info.addr = ((u64)addrhi << 32) | addrlo;
>       info.inst = ((u64)insthi << 32) | (info0 & 0xfffff000);
>       info.time = 0;
> -     info.engine = (info0 & 0x000000ff);
> +     info.engine = (info0 & 0x000001ff);
>       info.valid  = (info1 & 0x80000000) >> 31;
>       info.gpc    = (info1 & 0x1f000000) >> 24;
>       info.hub    = (info1 & 0x00100000) >> 20;

[Severity: Medium]
Should tu102_fault_info_fault() and tu102_fifo_mmu_fault_engine[] also be
updated for 9-bit engine IDs?

tu102_fault_new() shares gv100_fault_buffer_process() for non-replayable
fault buffer processing, which now extracts 9-bit engine IDs such as 0x180
(BAR1) and 0x1c0 (BAR2).  However, tu102_fifo_mmu_fault_engine[] still lists
the 8-bit truncated values:

drivers/gpu/drm/nouveau/nvkm/engine/fifo/tu102.c:tu102_fifo_mmu_fault_engine[] {
    ...
        { 0x80, "BAR1", NULL, NVKM_SUBDEV_BAR },
        { 0xc0, "BAR2", NULL, NVKM_SUBDEV_INSTMEM },
        {}
};

When a BAR1 or BAR2 fault is processed through gv100_fault_buffer_process()
on TU102+, nvkm_enum_find() in gf100_fifo_mmu_fault_recover() will no longer
match the engine entry and will skip the BAR1/BAR2 reset recovery.
Meanwhile, tu102_fault_info_fault() in
drivers/gpu/drm/nouveau/nvkm/subdev/fault/tu102.c still masks info0 with
0x000000ff.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to