drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c- Extension
.c- Size
- 10622 bytes
- Lines
- 447
- 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/firmware.hcore/memory.hsubdev/mmu.hsubdev/gsp.hsubdev/pmu.hengine/sec2.hengine/nvdec.h
Detected Declarations
function filesfunction list_for_each_entryfunction nvkm_acr_hsfw_bootfunction nvkm_acr_rtosfunction nvkm_acr_unloadfunction nvkm_acr_loadfunction nvkm_acr_reloadfunction nvkm_acr_bootstrap_falconsfunction for_each_set_bitfunction nvkm_acr_managed_falconfunction nvkm_acr_finifunction nvkm_acr_initfunction nvkm_acr_cleanupfunction nvkm_acr_oneinitfunction nvkm_acr_dtorfunction list_for_each_entry_safefunction list_for_each_entry_safefunction nvkm_acr_ctor_wprfunction nvkm_acr_new_
Annotated Snippet
list_for_each_entry(lsf, &acr->lsf, head) {
if (lsf->func->bootstrap_falcon)
return lsf;
}
}
return NULL;
}
static void
nvkm_acr_unload(struct nvkm_acr *acr)
{
if (acr->done) {
if (acr->rtos) {
nvkm_subdev_unref(acr->rtos->falcon->owner);
acr->rtos = NULL;
}
nvkm_acr_hsfw_boot(acr, "unload");
acr->done = false;
}
}
static int
nvkm_acr_load(struct nvkm_acr *acr)
{
struct nvkm_subdev *subdev = &acr->subdev;
struct nvkm_acr_lsf *rtos = nvkm_acr_rtos(acr);
u64 start, limit;
int ret;
if (list_empty(&acr->lsf)) {
nvkm_debug(subdev, "No LSF(s) present.\n");
return 0;
}
ret = acr->func->init(acr);
if (ret)
return ret;
acr->func->wpr_check(acr, &start, &limit);
if (start != acr->wpr_start || limit != acr->wpr_end) {
nvkm_error(subdev, "WPR not configured as expected: "
"%016llx-%016llx vs %016llx-%016llx\n",
acr->wpr_start, acr->wpr_end, start, limit);
return -EIO;
}
acr->done = true;
if (rtos) {
ret = nvkm_subdev_ref(rtos->falcon->owner);
if (ret)
return ret;
acr->rtos = rtos;
}
return ret;
}
static int
nvkm_acr_reload(struct nvkm_acr *acr)
{
nvkm_acr_unload(acr);
return nvkm_acr_load(acr);
}
int
nvkm_acr_bootstrap_falcons(struct nvkm_device *device, unsigned long mask)
{
struct nvkm_acr *acr = device->acr;
struct nvkm_acr_lsf *rtos = nvkm_acr_rtos(acr);
unsigned long id;
/* If there's no LS FW managing bootstrapping of other LS falcons,
* we depend on the HS firmware being able to do it instead.
*/
if (!rtos) {
/* Which isn't possible everywhere... */
if ((mask & acr->func->bootstrap_falcons) == mask) {
int ret = nvkm_acr_reload(acr);
if (ret)
return ret;
return acr->done ? 0 : -EINVAL;
}
return -ENOSYS;
}
Annotation
- Immediate include surface: `priv.h`, `core/firmware.h`, `core/memory.h`, `subdev/mmu.h`, `subdev/gsp.h`, `subdev/pmu.h`, `engine/sec2.h`, `engine/nvdec.h`.
- Detected declarations: `function files`, `function list_for_each_entry`, `function nvkm_acr_hsfw_boot`, `function nvkm_acr_rtos`, `function nvkm_acr_unload`, `function nvkm_acr_load`, `function nvkm_acr_reload`, `function nvkm_acr_bootstrap_falcons`, `function for_each_set_bit`, `function nvkm_acr_managed_falcon`.
- 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.