drivers/crypto/intel/qat/qat_common/adf_gen6_pm_dbgfs.c
Source file repositories/reference/linux-study-clean/drivers/crypto/intel/qat/qat_common/adf_gen6_pm_dbgfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/crypto/intel/qat/qat_common/adf_gen6_pm_dbgfs.c- Extension
.c- Size
- 3781 bytes
- Lines
- 125
- Domain
- Driver Families
- Bucket
- drivers/crypto
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/dma-mapping.hlinux/export.hlinux/string_helpers.hadf_admin.hadf_common_drv.hadf_gen6_pm.hadf_pm_dbgfs_utils.hicp_qat_fw_init_admin.h
Detected Declarations
function adf_gen6_print_pm_statusfunction adf_gen6_init_dev_pm_dataexport adf_gen6_init_dev_pm_data
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright(c) 2025 Intel Corporation */
#include <linux/dma-mapping.h>
#include <linux/export.h>
#include <linux/string_helpers.h>
#include "adf_admin.h"
#include "adf_common_drv.h"
#include "adf_gen6_pm.h"
#include "adf_pm_dbgfs_utils.h"
#include "icp_qat_fw_init_admin.h"
#define PM_INFO_REGSET_ENTRY(_reg_, _field_) \
PM_INFO_REGSET_ENTRY_MASK(_reg_, _field_, ADF_GEN6_PM_##_field_##_MASK)
static struct pm_status_row pm_fuse_rows[] = {
PM_INFO_REGSET_ENTRY(fusectl0, ENABLE_PM),
PM_INFO_REGSET_ENTRY(fusectl0, ENABLE_PM_IDLE),
PM_INFO_REGSET_ENTRY(fusectl0, ENABLE_DEEP_PM_IDLE),
};
static struct pm_status_row pm_info_rows[] = {
PM_INFO_REGSET_ENTRY(pm.status, CPM_PM_STATE),
PM_INFO_REGSET_ENTRY(pm.fw_init, IDLE_ENABLE),
PM_INFO_REGSET_ENTRY(pm.fw_init, IDLE_FILTER),
};
static struct pm_status_row pm_ssm_rows[] = {
PM_INFO_REGSET_ENTRY(ssm.pm_enable, SSM_PM_ENABLE),
PM_INFO_REGSET_ENTRY(ssm.pm_domain_status, DOMAIN_POWERED_UP),
};
static struct pm_status_row pm_csrs_rows[] = {
PM_INFO_REGSET_ENTRY32(pm.fw_init, CPM_PM_FW_INIT),
PM_INFO_REGSET_ENTRY32(pm.status, CPM_PM_STATUS),
};
static_assert(sizeof(struct icp_qat_fw_init_admin_pm_info) < PAGE_SIZE);
static ssize_t adf_gen6_print_pm_status(struct adf_accel_dev *accel_dev,
char __user *buf, size_t count,
loff_t *pos)
{
void __iomem *pmisc = adf_get_pmisc_base(accel_dev);
struct icp_qat_fw_init_admin_pm_info *pm_info;
dma_addr_t p_state_addr;
u32 *pm_info_regs;
size_t len = 0;
char *pm_kv;
u32 val;
int ret;
pm_info = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!pm_info)
return -ENOMEM;
pm_kv = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!pm_kv) {
kfree(pm_info);
return -ENOMEM;
}
p_state_addr = dma_map_single(&GET_DEV(accel_dev), pm_info, PAGE_SIZE,
DMA_FROM_DEVICE);
ret = dma_mapping_error(&GET_DEV(accel_dev), p_state_addr);
if (ret)
goto out_free;
/* Query power management information from QAT FW */
ret = adf_get_pm_info(accel_dev, p_state_addr, PAGE_SIZE);
dma_unmap_single(&GET_DEV(accel_dev), p_state_addr, PAGE_SIZE,
DMA_FROM_DEVICE);
if (ret)
goto out_free;
pm_info_regs = (u32 *)pm_info;
/* Fuse control register */
len += scnprintf(&pm_kv[len], PAGE_SIZE - len,
"----------- PM Fuse info ---------\n");
len += adf_pm_scnprint_table_lower_keys(&pm_kv[len], pm_fuse_rows,
pm_info_regs, PAGE_SIZE - len,
ARRAY_SIZE(pm_fuse_rows));
/* Power management */
len += scnprintf(&pm_kv[len], PAGE_SIZE - len,
"----------- PM Info --------------\n");
len += adf_pm_scnprint_table_lower_keys(&pm_kv[len], pm_info_rows,
pm_info_regs, PAGE_SIZE - len,
Annotation
- Immediate include surface: `linux/dma-mapping.h`, `linux/export.h`, `linux/string_helpers.h`, `adf_admin.h`, `adf_common_drv.h`, `adf_gen6_pm.h`, `adf_pm_dbgfs_utils.h`, `icp_qat_fw_init_admin.h`.
- Detected declarations: `function adf_gen6_print_pm_status`, `function adf_gen6_init_dev_pm_data`, `export adf_gen6_init_dev_pm_data`.
- Atlas domain: Driver Families / drivers/crypto.
- Implementation status: integration implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.