drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c- Extension
.c- Size
- 8104 bytes
- Lines
- 297
- 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
smu_v13_0_10.hamdgpu_reset.hamdgpu_dpm.hamdgpu_job.hamdgpu_ring.hamdgpu_ras.hamdgpu_psp.h
Detected Declarations
function filesfunction smu_v13_0_10_get_reset_handlerfunction smu_v13_0_10_mode2_suspend_ipfunction smu_v13_0_10_mode2_prepare_hwcontextfunction smu_v13_0_10_mode2_resetfunction smu_v13_0_10_async_resetfunction for_each_handlerfunction smu_v13_0_10_mode2_perform_resetfunction smu_v13_0_10_mode2_restore_ipfunction smu_v13_0_10_mode2_restore_hwcontextfunction smu_v13_0_10_reset_initfunction smu_v13_0_10_reset_fini
Annotated Snippet
for_each_handler(i, handler, reset_ctl) {
if (handler->reset_method == reset_context->method)
return handler;
}
}
if (smu_v13_0_10_is_mode2_default(reset_ctl) &&
amdgpu_asic_reset_method(adev) == AMD_RESET_METHOD_MODE2) {
for_each_handler(i, handler, reset_ctl) {
if (handler->reset_method == AMD_RESET_METHOD_MODE2)
return handler;
}
}
return NULL;
}
static int smu_v13_0_10_mode2_suspend_ip(struct amdgpu_device *adev)
{
int r, i;
amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
if (!(adev->ip_blocks[i].version->type ==
AMD_IP_BLOCK_TYPE_GFX ||
adev->ip_blocks[i].version->type ==
AMD_IP_BLOCK_TYPE_SDMA ||
adev->ip_blocks[i].version->type ==
AMD_IP_BLOCK_TYPE_MES))
continue;
r = amdgpu_ip_block_suspend(&adev->ip_blocks[i]);
if (r)
return r;
}
return 0;
}
static int
smu_v13_0_10_mode2_prepare_hwcontext(struct amdgpu_reset_control *reset_ctl,
struct amdgpu_reset_context *reset_context)
{
int r = 0;
struct amdgpu_device *adev = (struct amdgpu_device *)reset_ctl->handle;
if (!amdgpu_sriov_vf(adev))
r = smu_v13_0_10_mode2_suspend_ip(adev);
return r;
}
static int smu_v13_0_10_mode2_reset(struct amdgpu_device *adev)
{
return amdgpu_dpm_mode2_reset(adev);
}
static void smu_v13_0_10_async_reset(struct work_struct *work)
{
struct amdgpu_reset_handler *handler;
struct amdgpu_reset_control *reset_ctl =
container_of(work, struct amdgpu_reset_control, reset_work);
struct amdgpu_device *adev = (struct amdgpu_device *)reset_ctl->handle;
int i;
for_each_handler(i, handler, reset_ctl) {
if (handler->reset_method == reset_ctl->active_reset) {
dev_dbg(adev->dev, "Resetting device\n");
handler->do_reset(adev);
break;
}
}
}
static int
smu_v13_0_10_mode2_perform_reset(struct amdgpu_reset_control *reset_ctl,
struct amdgpu_reset_context *reset_context)
{
struct amdgpu_device *adev = (struct amdgpu_device *)reset_ctl->handle;
int r;
r = smu_v13_0_10_mode2_reset(adev);
if (r) {
dev_err(adev->dev,
"ASIC reset failed with error, %d ", r);
}
return r;
}
Annotation
- Immediate include surface: `smu_v13_0_10.h`, `amdgpu_reset.h`, `amdgpu_dpm.h`, `amdgpu_job.h`, `amdgpu_ring.h`, `amdgpu_ras.h`, `amdgpu_psp.h`.
- Detected declarations: `function files`, `function smu_v13_0_10_get_reset_handler`, `function smu_v13_0_10_mode2_suspend_ip`, `function smu_v13_0_10_mode2_prepare_hwcontext`, `function smu_v13_0_10_mode2_reset`, `function smu_v13_0_10_async_reset`, `function for_each_handler`, `function smu_v13_0_10_mode2_perform_reset`, `function smu_v13_0_10_mode2_restore_ip`, `function smu_v13_0_10_mode2_restore_hwcontext`.
- 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.