drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c- Extension
.c- Size
- 11959 bytes
- Lines
- 398
- 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/falcon.hcore/firmware.hnvfw/fw.hnvfw/ls.h
Detected Declarations
function filesfunction nvkm_acr_lsfw_del_allfunction nvkm_acr_lsfw_getfunction nvkm_acr_lsfw_addfunction nvkm_acr_lsfw_load_sig_image_desc_function nvkm_acr_lsfw_from_descfunction nvkm_acr_lsfw_load_sig_image_descfunction nvkm_acr_lsfw_load_sig_image_desc_v1function nvkm_acr_lsfw_load_sig_image_desc_v2function nvkm_acr_lsfw_load_bl_inst_data_sigfunction nvkm_acr_lsfw_load_bl_sig_net
Annotated Snippet
#include "priv.h"
#include <core/falcon.h>
#include <core/firmware.h>
#include <nvfw/fw.h>
#include <nvfw/ls.h>
void
nvkm_acr_lsfw_del(struct nvkm_acr_lsfw *lsfw)
{
nvkm_blob_dtor(&lsfw->img);
kfree(lsfw->sigs);
nvkm_firmware_put(lsfw->sig);
list_del(&lsfw->head);
kfree(lsfw);
}
void
nvkm_acr_lsfw_del_all(struct nvkm_acr *acr)
{
struct nvkm_acr_lsfw *lsfw, *lsft;
list_for_each_entry_safe(lsfw, lsft, &acr->lsfw, head) {
nvkm_acr_lsfw_del(lsfw);
}
}
static struct nvkm_acr_lsfw *
nvkm_acr_lsfw_get(struct nvkm_acr *acr, enum nvkm_acr_lsf_id id)
{
struct nvkm_acr_lsfw *lsfw;
list_for_each_entry(lsfw, &acr->lsfw, head) {
if (lsfw->id == id)
return lsfw;
}
return NULL;
}
struct nvkm_acr_lsfw *
nvkm_acr_lsfw_add(const struct nvkm_acr_lsf_func *func, struct nvkm_acr *acr,
struct nvkm_falcon *falcon, enum nvkm_acr_lsf_id id)
{
struct nvkm_acr_lsfw *lsfw;
if (!acr || list_empty(&acr->hsfw))
return ERR_PTR(-ENOSYS);
lsfw = nvkm_acr_lsfw_get(acr, id);
if (lsfw && lsfw->func) {
nvkm_error(&acr->subdev, "LSFW %d redefined\n", id);
return ERR_PTR(-EEXIST);
}
if (!lsfw) {
if (!(lsfw = kzalloc_obj(*lsfw)))
return ERR_PTR(-ENOMEM);
lsfw->id = id;
list_add_tail(&lsfw->head, &acr->lsfw);
}
lsfw->func = func;
lsfw->falcon = falcon;
return lsfw;
}
static struct nvkm_acr_lsfw *
nvkm_acr_lsfw_load_sig_image_desc_(struct nvkm_subdev *subdev,
struct nvkm_falcon *falcon,
enum nvkm_acr_lsf_id id,
const char *path, int ver,
const struct nvkm_acr_lsf_func *func,
const struct firmware **pdesc)
{
struct nvkm_acr *acr = subdev->device->acr;
struct nvkm_acr_lsfw *lsfw;
int ret;
if (IS_ERR((lsfw = nvkm_acr_lsfw_add(func, acr, falcon, id))))
return lsfw;
ret = nvkm_firmware_load_name(subdev, path, "sig", ver, &lsfw->sig);
if (ret)
goto done;
ret = nvkm_firmware_load_blob(subdev, path, "image", ver, &lsfw->img);
if (ret)
goto done;
ret = nvkm_firmware_load_name(subdev, path, "desc", ver, pdesc);
done:
if (ret) {
Annotation
- Immediate include surface: `priv.h`, `core/falcon.h`, `core/firmware.h`, `nvfw/fw.h`, `nvfw/ls.h`.
- Detected declarations: `function files`, `function nvkm_acr_lsfw_del_all`, `function nvkm_acr_lsfw_get`, `function nvkm_acr_lsfw_add`, `function nvkm_acr_lsfw_load_sig_image_desc_`, `function nvkm_acr_lsfw_from_desc`, `function nvkm_acr_lsfw_load_sig_image_desc`, `function nvkm_acr_lsfw_load_sig_image_desc_v1`, `function nvkm_acr_lsfw_load_sig_image_desc_v2`, `function nvkm_acr_lsfw_load_bl_inst_data_sig`.
- 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.