drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/base.c- Extension
.c- Size
- 4151 bytes
- Lines
- 164
- 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.h
Detected Declarations
function filesfunction nvkm_gsp_intr_stallfunction nvkm_gsp_finifunction nvkm_gsp_initfunction nvkm_gsp_oneinitfunction nvkm_gsp_dtor_fwsfunction nvkm_gsp_dtorfunction nvkm_gsp_load_fwfunction nvkm_gsp_new_
Annotated Snippet
if (gsp->intr[i].type == type && gsp->intr[i].inst == inst) {
if (gsp->intr[i].stall != ~0)
return gsp->intr[i].stall;
return -EINVAL;
}
}
return -ENOENT;
}
static int
nvkm_gsp_fini(struct nvkm_subdev *subdev, enum nvkm_suspend_state suspend)
{
struct nvkm_gsp *gsp = nvkm_gsp(subdev);
if (!gsp->func->fini || !gsp->running)
return 0;
return gsp->func->fini(gsp, suspend);
}
static int
nvkm_gsp_init(struct nvkm_subdev *subdev)
{
struct nvkm_gsp *gsp = nvkm_gsp(subdev);
if (!gsp->func->init)
return 0;
return gsp->func->init(gsp);
}
static int
nvkm_gsp_oneinit(struct nvkm_subdev *subdev)
{
struct nvkm_gsp *gsp = nvkm_gsp(subdev);
if (!gsp->func->oneinit)
return 0;
return gsp->func->oneinit(gsp);
}
void
nvkm_gsp_dtor_fws(struct nvkm_gsp *gsp)
{
nvkm_firmware_put(gsp->fws.fmc);
gsp->fws.fmc = NULL;
nvkm_firmware_put(gsp->fws.bl);
gsp->fws.bl = NULL;
nvkm_firmware_put(gsp->fws.booter.unload);
gsp->fws.booter.unload = NULL;
nvkm_firmware_put(gsp->fws.booter.load);
gsp->fws.booter.load = NULL;
nvkm_firmware_put(gsp->fws.rm);
gsp->fws.rm = NULL;
}
static void *
nvkm_gsp_dtor(struct nvkm_subdev *subdev)
{
struct nvkm_gsp *gsp = nvkm_gsp(subdev);
if (gsp->func && gsp->func->dtor)
gsp->func->dtor(gsp);
nvkm_falcon_dtor(&gsp->falcon);
kfree(gsp->rm);
return gsp;
}
static const struct nvkm_subdev_func
nvkm_gsp = {
.dtor = nvkm_gsp_dtor,
.oneinit = nvkm_gsp_oneinit,
.init = nvkm_gsp_init,
.fini = nvkm_gsp_fini,
};
int
nvkm_gsp_load_fw(struct nvkm_gsp *gsp, const char *name, const char *ver,
const struct firmware **pfw)
{
char fwname[64];
snprintf(fwname, sizeof(fwname), "gsp/%s-%s", name, ver);
return nvkm_firmware_get(&gsp->subdev, fwname, 0, pfw);
}
Annotation
- Immediate include surface: `priv.h`.
- Detected declarations: `function files`, `function nvkm_gsp_intr_stall`, `function nvkm_gsp_fini`, `function nvkm_gsp_init`, `function nvkm_gsp_oneinit`, `function nvkm_gsp_dtor_fws`, `function nvkm_gsp_dtor`, `function nvkm_gsp_load_fw`, `function nvkm_gsp_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.