drivers/irqchip/irq-ti-sci-inta.c
Source file repositories/reference/linux-study-clean/drivers/irqchip/irq-ti-sci-inta.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/irqchip/irq-ti-sci-inta.c- Extension
.c- Size
- 22043 bytes
- Lines
- 746
- Domain
- Driver Families
- Bucket
- drivers/irqchip
- 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.
- 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/err.hlinux/io.hlinux/irq.hlinux/irqchip.hlinux/irqdomain.hlinux/interrupt.hlinux/msi.hlinux/module.hlinux/moduleparam.hlinux/of.hlinux/of_irq.hlinux/platform_device.hlinux/irqchip/chained_irq.hlinux/soc/ti/ti_sci_inta_msi.hlinux/soc/ti/ti_sci_protocol.hasm-generic/msi.h
Detected Declarations
struct ti_sci_inta_event_descstruct ti_sci_inta_vint_descstruct ti_sci_inta_irq_domainfunction ti_sci_inta_get_dev_idfunction ti_sci_inta_irq_handlerfunction ti_sci_inta_xlate_irqfunction ti_sci_inta_alloc_parent_irqfunction ti_sci_inta_alloc_eventfunction ti_sci_inta_alloc_irqfunction ti_sci_inta_free_parent_irqfunction ti_sci_inta_free_irqfunction ti_sci_inta_request_resourcesfunction ti_sci_inta_release_resourcesfunction ti_sci_inta_manage_eventfunction ti_sci_inta_mask_irqfunction ti_sci_inta_unmask_irqfunction ti_sci_inta_ack_irqfunction ti_sci_inta_set_affinityfunction ti_sci_inta_set_typefunction ti_sci_inta_irq_domain_freefunction ti_sci_inta_irq_domain_allocfunction ti_sci_inta_msi_set_descfunction ti_sci_inta_get_unmapped_sourcesfunction ti_sci_inta_irq_domain_probe
Annotated Snippet
struct ti_sci_inta_event_desc {
u16 global_event;
u32 hwirq;
u8 vint_bit;
};
/**
* struct ti_sci_inta_vint_desc - Description of a virtual interrupt coming out
* of Interrupt Aggregator.
* @domain: Pointer to IRQ domain to which this vint belongs.
* @list: List entry for the vint list
* @event_map: Bitmap to manage the allocation of events to vint.
* @events: Array of event descriptors assigned to this vint.
* @parent_virq: Linux IRQ number that gets attached to parent
* @vint_id: TISCI vint ID
*/
struct ti_sci_inta_vint_desc {
struct irq_domain *domain;
struct list_head list;
DECLARE_BITMAP(event_map, MAX_EVENTS_PER_VINT);
struct ti_sci_inta_event_desc events[MAX_EVENTS_PER_VINT];
unsigned int parent_virq;
u16 vint_id;
};
/**
* struct ti_sci_inta_irq_domain - Structure representing a TISCI based
* Interrupt Aggregator IRQ domain.
* @sci: Pointer to TISCI handle
* @vint: TISCI resource pointer representing IA interrupts.
* @global_event: TISCI resource pointer representing global events.
* @vint_list: List of the vints active in the system
* @vint_mutex: Mutex to protect vint_list
* @base: Base address of the memory mapped IO registers
* @pdev: Pointer to platform device.
* @ti_sci_id: TI-SCI device identifier
* @unmapped_cnt: Number of @unmapped_dev_ids entries
* @unmapped_dev_ids: Pointer to an array of TI-SCI device identifiers of
* unmapped event sources.
* Unmapped Events are not part of the Global Event Map and
* they are converted to Global event within INTA to be
* received by the same INTA to generate an interrupt.
* In case an interrupt request comes for a device which is
* generating Unmapped Event, we must use the INTA's TI-SCI
* device identifier in place of the source device
* identifier to let sysfw know where it has to program the
* Global Event number.
*/
struct ti_sci_inta_irq_domain {
const struct ti_sci_handle *sci;
struct ti_sci_resource *vint;
struct ti_sci_resource *global_event;
struct list_head vint_list;
/* Mutex to protect vint list */
struct mutex vint_mutex;
void __iomem *base;
struct platform_device *pdev;
u32 ti_sci_id;
int unmapped_cnt;
u16 *unmapped_dev_ids;
};
#define to_vint_desc(e, i) container_of(e, struct ti_sci_inta_vint_desc, \
events[i])
static u16 ti_sci_inta_get_dev_id(struct ti_sci_inta_irq_domain *inta, u32 hwirq)
{
u16 dev_id = HWIRQ_TO_DEVID(hwirq);
int i;
if (inta->unmapped_cnt == 0)
return dev_id;
/*
* For devices sending Unmapped Events we must use the INTA's TI-SCI
* device identifier number to be able to convert it to a Global Event
* and map it to an interrupt.
*/
for (i = 0; i < inta->unmapped_cnt; i++) {
if (dev_id == inta->unmapped_dev_ids[i]) {
dev_id = inta->ti_sci_id;
break;
}
}
return dev_id;
}
/**
Annotation
- Immediate include surface: `linux/err.h`, `linux/io.h`, `linux/irq.h`, `linux/irqchip.h`, `linux/irqdomain.h`, `linux/interrupt.h`, `linux/msi.h`, `linux/module.h`.
- Detected declarations: `struct ti_sci_inta_event_desc`, `struct ti_sci_inta_vint_desc`, `struct ti_sci_inta_irq_domain`, `function ti_sci_inta_get_dev_id`, `function ti_sci_inta_irq_handler`, `function ti_sci_inta_xlate_irq`, `function ti_sci_inta_alloc_parent_irq`, `function ti_sci_inta_alloc_event`, `function ti_sci_inta_alloc_irq`, `function ti_sci_inta_free_parent_irq`.
- Atlas domain: Driver Families / drivers/irqchip.
- Implementation status: source 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.