drivers/acpi/arm64/iort.c
Source file repositories/reference/linux-study-clean/drivers/acpi/arm64/iort.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/arm64/iort.c- Extension
.c- Size
- 56348 bytes
- Lines
- 2169
- Domain
- Driver Families
- Bucket
- drivers/acpi
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/acpi_iort.hlinux/bitfield.hlinux/iommu.hlinux/kernel.hlinux/list.hlinux/pci.hlinux/platform_device.hlinux/slab.hlinux/dma-map-ops.hinit.h
Detected Declarations
struct iort_its_msi_chipstruct iort_fwnodestruct iort_pci_alias_infostruct iort_dev_configfunction iort_set_fwnodefunction iort_get_fwnodefunction iort_delete_fwnodefunction iort_get_iort_nodefunction iort_register_domain_tokenfunction iort_deregister_domain_tokenfunction iort_find_domain_tokenfunction iort_match_node_callbackfunction iort_match_iwb_callbackfunction iort_id_mapfunction iort_get_id_mapping_indexfunction iort_msi_map_idfunction iort_msi_xlatefunction iort_its_translate_pafunction iort_find_its_basefunction iort_pmsi_get_msi_infofunction iort_dev_find_its_idfunction iort_get_device_domainfunction iort_set_device_domainfunction iort_get_platform_device_domainfunction acpi_configure_pmsi_domainfunction iort_rmr_freefunction iort_rmr_desc_check_overlapfunction iort_get_rmrsfunction iort_rmr_has_devfunction validfunction iort_node_get_rmr_infofunction iort_find_rmrsfunction devfunction spacesfunction iort_iommu_get_resv_regionsfunction iort_get_rmr_sidsfunction iort_put_rmr_sidsfunction iort_iommu_driver_enabledfunction iort_pci_rc_supports_atsfunction iort_pci_rc_supports_canwbsfunction iort_iommu_xlatefunction iort_pci_iommu_initfunction iort_named_component_initfunction iort_nc_iommu_mapfunction iort_nc_iommu_map_idfunction iort_iommu_configure_idfunction iort_iommu_get_resv_regionsfunction nc_dma_get_range
Annotated Snippet
struct iort_its_msi_chip {
struct list_head list;
struct fwnode_handle *fw_node;
phys_addr_t base_addr;
u32 translation_id;
};
struct iort_fwnode {
struct list_head list;
struct acpi_iort_node *iort_node;
struct fwnode_handle *fwnode;
};
static LIST_HEAD(iort_fwnode_list);
static DEFINE_SPINLOCK(iort_fwnode_lock);
/**
* iort_set_fwnode() - Create iort_fwnode and use it to register
* iommu data in the iort_fwnode_list
*
* @iort_node: IORT table node associated with the IOMMU
* @fwnode: fwnode associated with the IORT node
*
* Returns: 0 on success
* <0 on failure
*/
static inline int iort_set_fwnode(struct acpi_iort_node *iort_node,
struct fwnode_handle *fwnode)
{
struct iort_fwnode *np;
np = kzalloc_obj(struct iort_fwnode, GFP_ATOMIC);
if (WARN_ON(!np))
return -ENOMEM;
INIT_LIST_HEAD(&np->list);
np->iort_node = iort_node;
np->fwnode = fwnode;
spin_lock(&iort_fwnode_lock);
list_add_tail(&np->list, &iort_fwnode_list);
spin_unlock(&iort_fwnode_lock);
return 0;
}
/**
* iort_get_fwnode() - Retrieve fwnode associated with an IORT node
*
* @node: IORT table node to be looked-up
*
* Returns: fwnode_handle pointer on success, NULL on failure
*/
static inline struct fwnode_handle *iort_get_fwnode(
struct acpi_iort_node *node)
{
struct iort_fwnode *curr;
struct fwnode_handle *fwnode = NULL;
spin_lock(&iort_fwnode_lock);
list_for_each_entry(curr, &iort_fwnode_list, list) {
if (curr->iort_node == node) {
fwnode = curr->fwnode;
break;
}
}
spin_unlock(&iort_fwnode_lock);
return fwnode;
}
/**
* iort_delete_fwnode() - Delete fwnode associated with an IORT node
*
* @node: IORT table node associated with fwnode to delete
*/
static inline void iort_delete_fwnode(struct acpi_iort_node *node)
{
struct iort_fwnode *curr, *tmp;
spin_lock(&iort_fwnode_lock);
list_for_each_entry_safe(curr, tmp, &iort_fwnode_list, list) {
if (curr->iort_node == node) {
list_del(&curr->list);
kfree(curr);
break;
}
}
spin_unlock(&iort_fwnode_lock);
}
Annotation
- Immediate include surface: `linux/acpi_iort.h`, `linux/bitfield.h`, `linux/iommu.h`, `linux/kernel.h`, `linux/list.h`, `linux/pci.h`, `linux/platform_device.h`, `linux/slab.h`.
- Detected declarations: `struct iort_its_msi_chip`, `struct iort_fwnode`, `struct iort_pci_alias_info`, `struct iort_dev_config`, `function iort_set_fwnode`, `function iort_get_fwnode`, `function iort_delete_fwnode`, `function iort_get_iort_node`, `function iort_register_domain_token`, `function iort_deregister_domain_token`.
- Atlas domain: Driver Families / drivers/acpi.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.