drivers/resctrl/mpam_internal.h
Source file repositories/reference/linux-study-clean/drivers/resctrl/mpam_internal.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/resctrl/mpam_internal.h- Extension
.h- Size
- 23168 bytes
- Lines
- 754
- Domain
- Driver Families
- Bucket
- drivers/resctrl
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/arm_mpam.hlinux/atomic.hlinux/bitmap.hlinux/cpumask.hlinux/io.hlinux/jump_label.hlinux/llist.hlinux/mutex.hlinux/resctrl.hlinux/spinlock.hlinux/srcu.hlinux/types.hasm/mpam.h
Detected Declarations
struct platform_devicestruct mpam_garbagestruct mpam_mscstruct mpam_propsstruct mpam_quirkstruct mon_cfgstruct msmon_mbwu_statestruct mpam_classstruct mpam_configstruct mpam_componentstruct mpam_vmscstruct mpam_msc_risstruct mpam_resctrl_domstruct mpam_resctrl_resstruct mpam_resctrl_monenum mpam_device_featuresenum mpam_device_quirksenum mon_filter_optionsfunction mpam_is_enabledfunction mpam_mon_sel_lockfunction mpam_mon_sel_unlockfunction mpam_mon_sel_lock_heldfunction mpam_mon_sel_lock_initfunction mpam_alloc_csu_monfunction mpam_free_csu_monfunction mpam_alloc_mbwu_monfunction mpam_free_mbwu_monfunction mpam_resctrl_setupfunction mpam_resctrl_exitfunction mpam_resctrl_offline_cpu
Annotated Snippet
struct mpam_garbage {
/* member of mpam_garbage */
struct llist_node llist;
void *to_free;
struct platform_device *pdev;
};
struct mpam_msc {
/* member of mpam_all_msc */
struct list_head all_msc_list;
int id;
struct platform_device *pdev;
/* Not modified after mpam_is_enabled() becomes true */
enum mpam_msc_iface iface;
u32 nrdy_usec;
cpumask_t accessibility;
bool has_extd_esr;
int reenable_error_ppi;
struct mpam_msc * __percpu *error_dev_id;
atomic_t online_refs;
/*
* probe_lock is only taken during discovery. After discovery these
* properties become read-only and the lists are protected by SRCU.
*/
struct mutex probe_lock;
bool probed;
u16 partid_max;
u8 pmg_max;
unsigned long ris_idxs;
u32 ris_max;
u32 iidr;
u16 quirks;
/*
* error_irq_lock is taken when registering/unregistering the error
* interrupt and maniupulating the below flags.
*/
struct mutex error_irq_lock;
bool error_irq_req;
bool error_irq_hw_enabled;
/* mpam_msc_ris of this component */
struct list_head ris;
/*
* part_sel_lock protects access to the MSC hardware registers that are
* affected by MPAMCFG_PART_SEL. (including the ID registers that vary
* by RIS).
* If needed, take msc->probe_lock first.
*/
struct mutex part_sel_lock;
/*
* cfg_lock protects the msc configuration and guards against mbwu_state
* save and restore racing.
*/
struct mutex cfg_lock;
/*
* mon_sel_lock protects access to the MSC hardware registers that are
* affected by MPAMCFG_MON_SEL, and the mbwu_state.
* Access to mon_sel is needed from both process and interrupt contexts,
* but is complicated by firmware-backed platforms that can't make any
* access unless they can sleep.
* Always use the mpam_mon_sel_lock() helpers.
* Accesses to mon_sel need to be able to fail if they occur in the wrong
* context.
* If needed, take msc->probe_lock first.
*/
raw_spinlock_t _mon_sel_lock;
unsigned long _mon_sel_flags;
void __iomem *mapped_hwpage;
size_t mapped_hwpage_sz;
/* Values only used on some platforms for quirks */
u32 t241_id;
struct mpam_garbage garbage;
};
/* Returning false here means accesses to mon_sel must fail and report an error. */
static inline bool __must_check mpam_mon_sel_lock(struct mpam_msc *msc)
{
Annotation
- Immediate include surface: `linux/arm_mpam.h`, `linux/atomic.h`, `linux/bitmap.h`, `linux/cpumask.h`, `linux/io.h`, `linux/jump_label.h`, `linux/llist.h`, `linux/mutex.h`.
- Detected declarations: `struct platform_device`, `struct mpam_garbage`, `struct mpam_msc`, `struct mpam_props`, `struct mpam_quirk`, `struct mon_cfg`, `struct msmon_mbwu_state`, `struct mpam_class`, `struct mpam_config`, `struct mpam_component`.
- Atlas domain: Driver Families / drivers/resctrl.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.