drivers/firmware/arm_scmi/perf.c
Source file repositories/reference/linux-study-clean/drivers/firmware/arm_scmi/perf.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/arm_scmi/perf.c- Extension
.c- Size
- 32053 bytes
- Lines
- 1319
- Domain
- Driver Families
- Bucket
- drivers/firmware
- 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/bits.hlinux/hashtable.hlinux/io.hlinux/log2.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/pm_opp.hlinux/scmi_protocol.hlinux/sort.hlinux/xarray.htrace/events/scmi.hprotocols.hnotify.h
Detected Declarations
struct scmi_oppstruct scmi_msg_resp_perf_attributesstruct scmi_msg_resp_perf_domain_attributesstruct scmi_msg_perf_describe_levelsstruct scmi_perf_set_limitsstruct scmi_perf_get_limitsstruct scmi_perf_set_levelstruct scmi_perf_notify_level_or_limitsstruct scmi_perf_limits_notify_payldstruct scmi_perf_level_notify_payldstruct scmi_msg_resp_perf_describe_levelsstruct scmi_msg_resp_perf_describe_levels_v4struct perf_dom_infostruct scmi_perf_infoenum scmi_performance_protocol_cmdfunction scmi_perf_attributes_getfunction scmi_perf_xa_destroyfunction scmi_perf_domain_attributes_getfunction integerfunction opp_cmp_funcfunction iter_perf_levels_prepare_messagefunction iter_perf_levels_update_statefunction process_response_oppfunction process_response_opp_v4function iter_perf_levels_process_responsefunction scmi_perf_describe_levels_getfunction scmi_perf_num_domains_getfunction scmi_perf_domain_lookupfunction scmi_perf_info_getfunction scmi_perf_msg_limits_setfunction __scmi_perf_limits_setfunction scmi_perf_limits_setfunction scmi_perf_msg_limits_getfunction __scmi_perf_limits_getfunction scmi_perf_limits_getfunction scmi_perf_msg_level_setfunction __scmi_perf_level_setfunction scmi_perf_level_setfunction scmi_perf_msg_level_getfunction __scmi_perf_level_getfunction scmi_perf_level_getfunction scmi_perf_level_limits_notifyfunction scmi_perf_domain_init_fcfunction scmi_dvfs_device_opps_addfunction scmi_dvfs_transition_latency_getfunction scmi_dvfs_rate_limit_getfunction scmi_dvfs_freq_setfunction scmi_dvfs_freq_get
Annotated Snippet
struct scmi_opp {
u32 perf;
u32 power;
u32 trans_latency_us;
u32 indicative_freq;
u32 level_index;
struct hlist_node hash;
};
struct scmi_msg_resp_perf_attributes {
__le16 num_domains;
__le16 flags;
#define POWER_SCALE_IN_MILLIWATT(x) ((x) & BIT(0))
#define POWER_SCALE_IN_MICROWATT(x) ((x) & BIT(1))
__le32 stats_addr_low;
__le32 stats_addr_high;
__le32 stats_size;
};
struct scmi_msg_resp_perf_domain_attributes {
__le32 flags;
#define SUPPORTS_SET_LIMITS(x) ((x) & BIT(31))
#define SUPPORTS_SET_PERF_LVL(x) ((x) & BIT(30))
#define SUPPORTS_PERF_LIMIT_NOTIFY(x) ((x) & BIT(29))
#define SUPPORTS_PERF_LEVEL_NOTIFY(x) ((x) & BIT(28))
#define SUPPORTS_PERF_FASTCHANNELS(x) ((x) & BIT(27))
#define SUPPORTS_EXTENDED_NAMES(x) ((x) & BIT(26))
#define SUPPORTS_LEVEL_INDEXING(x) ((x) & BIT(25))
__le32 rate_limit_us;
__le32 sustained_freq_khz;
__le32 sustained_perf_level;
u8 name[SCMI_SHORT_NAME_MAX_SIZE];
};
struct scmi_msg_perf_describe_levels {
__le32 domain;
__le32 level_index;
};
struct scmi_perf_set_limits {
__le32 domain;
__le32 max_level;
__le32 min_level;
};
struct scmi_perf_get_limits {
__le32 max_level;
__le32 min_level;
};
struct scmi_perf_set_level {
__le32 domain;
__le32 level;
};
struct scmi_perf_notify_level_or_limits {
__le32 domain;
__le32 notify_enable;
};
struct scmi_perf_limits_notify_payld {
__le32 agent_id;
__le32 domain_id;
__le32 range_max;
__le32 range_min;
};
struct scmi_perf_level_notify_payld {
__le32 agent_id;
__le32 domain_id;
__le32 performance_level;
};
struct scmi_msg_resp_perf_describe_levels {
__le16 num_returned;
__le16 num_remaining;
struct {
__le32 perf_val;
__le32 power;
__le16 transition_latency_us;
__le16 reserved;
} opp[];
};
struct scmi_msg_resp_perf_describe_levels_v4 {
__le16 num_returned;
__le16 num_remaining;
struct {
__le32 perf_val;
__le32 power;
Annotation
- Immediate include surface: `linux/bits.h`, `linux/hashtable.h`, `linux/io.h`, `linux/log2.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/pm_opp.h`.
- Detected declarations: `struct scmi_opp`, `struct scmi_msg_resp_perf_attributes`, `struct scmi_msg_resp_perf_domain_attributes`, `struct scmi_msg_perf_describe_levels`, `struct scmi_perf_set_limits`, `struct scmi_perf_get_limits`, `struct scmi_perf_set_level`, `struct scmi_perf_notify_level_or_limits`, `struct scmi_perf_limits_notify_payld`, `struct scmi_perf_level_notify_payld`.
- Atlas domain: Driver Families / drivers/firmware.
- 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.