drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c- Extension
.c- Size
- 4472 bytes
- Lines
- 167
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
priv.hcore/memory.h
Detected Declarations
function filesfunction nvkm_fault_ntfy_initfunction nvkm_fault_intrfunction nvkm_fault_finifunction nvkm_fault_initfunction nvkm_fault_oneinit_bufferfunction nvkm_fault_oneinitfunction nvkm_fault_dtorfunction nvkm_fault_new_
Annotated Snippet
if (i < fault->func->buffer.nr) {
ret = nvkm_fault_oneinit_buffer(fault, i);
if (ret)
return ret;
fault->buffer_nr = i + 1;
}
}
ret = nvkm_event_init(&nvkm_fault_ntfy, subdev, 1, fault->buffer_nr, &fault->event);
if (ret)
return ret;
if (fault->func->oneinit)
ret = fault->func->oneinit(fault);
return ret;
}
static void *
nvkm_fault_dtor(struct nvkm_subdev *subdev)
{
struct nvkm_fault *fault = nvkm_fault(subdev);
int i;
nvkm_event_ntfy_del(&fault->nrpfb);
nvkm_event_fini(&fault->event);
for (i = 0; i < fault->buffer_nr; i++) {
if (fault->buffer[i]) {
nvkm_memory_unref(&fault->buffer[i]->mem);
kfree(fault->buffer[i]);
}
}
return fault;
}
static const struct nvkm_subdev_func
nvkm_fault = {
.dtor = nvkm_fault_dtor,
.oneinit = nvkm_fault_oneinit,
.init = nvkm_fault_init,
.fini = nvkm_fault_fini,
.intr = nvkm_fault_intr,
};
int
nvkm_fault_new_(const struct nvkm_fault_func *func, struct nvkm_device *device,
enum nvkm_subdev_type type, int inst, struct nvkm_fault **pfault)
{
struct nvkm_fault *fault;
if (!(fault = *pfault = kzalloc_obj(*fault)))
return -ENOMEM;
nvkm_subdev_ctor(&nvkm_fault, device, type, inst, &fault->subdev);
fault->func = func;
fault->user.ctor = nvkm_ufault_new;
fault->user.base = func->user.base;
return 0;
}
Annotation
- Immediate include surface: `priv.h`, `core/memory.h`.
- Detected declarations: `function files`, `function nvkm_fault_ntfy_init`, `function nvkm_fault_intr`, `function nvkm_fault_fini`, `function nvkm_fault_init`, `function nvkm_fault_oneinit_buffer`, `function nvkm_fault_oneinit`, `function nvkm_fault_dtor`, `function nvkm_fault_new_`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.