drivers/gpu/drm/nouveau/nvkm/subdev/fault/tu102.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/fault/tu102.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/fault/tu102.c- Extension
.c- Size
- 5658 bytes
- Lines
- 191
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
priv.hcore/memory.hsubdev/gsp.hsubdev/mc.hsubdev/mmu.hsubdev/vfn.hengine/fifo.hnvif/class.h
Detected Declarations
function filesfunction tu102_fault_buffer_intrfunction tu102_fault_buffer_finifunction tu102_fault_buffer_initfunction tu102_fault_buffer_infofunction tu102_fault_info_faultfunction tu102_fault_finifunction tu102_fault_initfunction tu102_fault_oneinitfunction tu102_fault_new
Annotated Snippet
#include "priv.h"
#include <core/memory.h>
#include <subdev/gsp.h>
#include <subdev/mc.h>
#include <subdev/mmu.h>
#include <subdev/vfn.h>
#include <engine/fifo.h>
#include <nvif/class.h>
static irqreturn_t
tu102_fault_buffer_notify(struct nvkm_inth *inth)
{
struct nvkm_fault_buffer *buffer = container_of(inth, typeof(*buffer), inth);
nvkm_event_ntfy(&buffer->fault->event, buffer->id, NVKM_FAULT_BUFFER_EVENT_PENDING);
return IRQ_HANDLED;
}
static void
tu102_fault_buffer_intr(struct nvkm_fault_buffer *buffer, bool enable)
{
if (enable)
nvkm_inth_allow(&buffer->inth);
else
nvkm_inth_block(&buffer->inth);
}
static void
tu102_fault_buffer_fini(struct nvkm_fault_buffer *buffer)
{
struct nvkm_device *device = buffer->fault->subdev.device;
const u32 foff = buffer->id * 0x20;
nvkm_mask(device, 0xb83010 + foff, 0x80000000, 0x00000000);
}
static void
tu102_fault_buffer_init(struct nvkm_fault_buffer *buffer)
{
struct nvkm_device *device = buffer->fault->subdev.device;
const u32 foff = buffer->id * 0x20;
nvkm_mask(device, 0xb83010 + foff, 0xc0000000, 0x40000000);
nvkm_wr32(device, 0xb83004 + foff, upper_32_bits(buffer->addr));
nvkm_wr32(device, 0xb83000 + foff, lower_32_bits(buffer->addr));
nvkm_mask(device, 0xb83010 + foff, 0x80000000, 0x80000000);
}
static void
tu102_fault_buffer_info(struct nvkm_fault_buffer *buffer)
{
struct nvkm_device *device = buffer->fault->subdev.device;
const u32 foff = buffer->id * 0x20;
nvkm_mask(device, 0xb83010 + foff, 0x40000000, 0x40000000);
buffer->entries = nvkm_rd32(device, 0xb83010 + foff) & 0x000fffff;
buffer->get = 0xb83008 + foff;
buffer->put = 0xb8300c + foff;
}
static irqreturn_t
tu102_fault_info_fault(struct nvkm_inth *inth)
{
struct nvkm_fault *fault = container_of(inth, typeof(*fault), info_fault);
struct nvkm_subdev *subdev = &fault->subdev;
struct nvkm_device *device = subdev->device;
struct nvkm_fault_data info;
const u32 addrlo = nvkm_rd32(device, 0xb83080);
const u32 addrhi = nvkm_rd32(device, 0xb83084);
const u32 info0 = nvkm_rd32(device, 0xb83088);
const u32 insthi = nvkm_rd32(device, 0xb8308c);
const u32 info1 = nvkm_rd32(device, 0xb83090);
info.addr = ((u64)addrhi << 32) | addrlo;
info.inst = ((u64)insthi << 32) | (info0 & 0xfffff000);
info.time = 0;
info.engine = (info0 & 0x000000ff);
info.valid = (info1 & 0x80000000) >> 31;
info.gpc = (info1 & 0x1f000000) >> 24;
info.hub = (info1 & 0x00100000) >> 20;
info.access = (info1 & 0x000f0000) >> 16;
info.client = (info1 & 0x00007f00) >> 8;
info.reason = (info1 & 0x0000001f);
nvkm_fifo_fault(device->fifo, &info);
nvkm_wr32(device, 0xb83094, 0x80000000);
Annotation
- Immediate include surface: `priv.h`, `core/memory.h`, `subdev/gsp.h`, `subdev/mc.h`, `subdev/mmu.h`, `subdev/vfn.h`, `engine/fifo.h`, `nvif/class.h`.
- Detected declarations: `function files`, `function tu102_fault_buffer_intr`, `function tu102_fault_buffer_fini`, `function tu102_fault_buffer_init`, `function tu102_fault_buffer_info`, `function tu102_fault_info_fault`, `function tu102_fault_fini`, `function tu102_fault_init`, `function tu102_fault_oneinit`, `function tu102_fault_new`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.