drivers/accel/ivpu/ivpu_coredump.c
Source file repositories/reference/linux-study-clean/drivers/accel/ivpu/ivpu_coredump.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/accel/ivpu/ivpu_coredump.c- Extension
.c- Size
- 987 bytes
- Lines
- 40
- Domain
- Driver Families
- Bucket
- drivers/accel
- 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
linux/devcoredump.hlinux/firmware.hivpu_coredump.hivpu_fw.hivpu_gem.hvpu_boot_api.h
Detected Declarations
function Copyright
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2020-2024 Intel Corporation
*/
#include <linux/devcoredump.h>
#include <linux/firmware.h>
#include "ivpu_coredump.h"
#include "ivpu_fw.h"
#include "ivpu_gem.h"
#include "vpu_boot_api.h"
#define CRASH_DUMP_HEADER "Intel NPU crash dump"
#define CRASH_DUMP_HEADERS_SIZE SZ_4K
void ivpu_dev_coredump(struct ivpu_device *vdev)
{
struct drm_print_iterator pi = {};
struct drm_printer p;
size_t coredump_size;
char *coredump;
coredump_size = CRASH_DUMP_HEADERS_SIZE + FW_VERSION_HEADER_SIZE +
ivpu_bo_size(vdev->fw->mem_log_crit) + ivpu_bo_size(vdev->fw->mem_log_verb);
coredump = vmalloc(coredump_size);
if (!coredump)
return;
pi.data = coredump;
pi.remain = coredump_size;
p = drm_coredump_printer(&pi);
drm_printf(&p, "%s\n", CRASH_DUMP_HEADER);
drm_printf(&p, "FW version: %s\n", vdev->fw->version);
ivpu_fw_log_print(vdev, false, &p);
dev_coredumpv(vdev->drm.dev, coredump, pi.offset, GFP_KERNEL);
}
Annotation
- Immediate include surface: `linux/devcoredump.h`, `linux/firmware.h`, `ivpu_coredump.h`, `ivpu_fw.h`, `ivpu_gem.h`, `vpu_boot_api.h`.
- Detected declarations: `function Copyright`.
- Atlas domain: Driver Families / drivers/accel.
- 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.