drivers/soc/ti/knav_qmss_queue.c
Source file repositories/reference/linux-study-clean/drivers/soc/ti/knav_qmss_queue.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/soc/ti/knav_qmss_queue.c- Extension
.c- Size
- 47733 bytes
- Lines
- 1892
- Domain
- Driver Families
- Bucket
- drivers/soc
- 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/debugfs.hlinux/dma-mapping.hlinux/firmware.hlinux/interrupt.hlinux/io.hlinux/module.hlinux/of.hlinux/of_address.hlinux/of_irq.hlinux/platform_device.hlinux/pm_runtime.hlinux/property.hlinux/slab.hlinux/soc/ti/knav_qmss.hknav_qmss.h
Detected Declarations
function knav_qmss_device_readyfunction knav_queue_notifyfunction knav_queue_int_handlerfunction knav_queue_setup_irqfunction knav_queue_free_irqfunction knav_queue_is_busyfunction knav_queue_is_reservedfunction knav_queue_is_sharedfunction knav_queue_match_typefunction knav_queue_match_id_to_instfunction for_each_instancefunction knav_queue_open_by_idfunction for_each_instancefunction knav_queue_set_notifyfunction knav_queue_enable_notifierfunction knav_queue_disable_notifierfunction knav_queue_set_notifierfunction knav_gp_set_notifyfunction knav_gp_open_queuefunction knav_gp_close_queuefunction knav_queue_get_countfunction knav_queue_debug_show_instancefunction for_each_possible_cpufunction knav_queue_debug_showfunction knav_queue_pdsp_waitfunction knav_queue_flushfunction knav_queue_openfunction knav_queue_closefunction knav_queue_device_controlfunction knav_queue_pushfunction knav_queue_popfunction kdesc_fill_poolfunction kdesc_empty_poolfunction knav_pool_desc_virt_to_dmafunction knav_pool_createfunction for_each_regionfunction knav_pool_destroyfunction knav_pool_desc_getfunction knav_pool_desc_putfunction knav_pool_desc_mapfunction knav_pool_desc_unmapfunction knav_pool_countfunction knav_queue_setup_regionfunction for_each_qmgrfunction knav_queue_setup_regionsfunction for_each_child_of_node_scopedfunction knav_get_link_ramfunction knav_queue_setup_link_ram
Annotated Snippet
if (range->irqs[queue].cpu_mask) {
ret = irq_set_affinity_hint(irq, range->irqs[queue].cpu_mask);
if (ret) {
dev_warn(range->kdev->dev,
"Failed to set IRQ affinity\n");
return ret;
}
}
}
return ret;
}
static void knav_queue_free_irq(struct knav_queue_inst *inst)
{
struct knav_range_info *range = inst->range;
unsigned queue = inst->id - inst->range->queue_base;
int irq;
if (range->flags & RANGE_HAS_IRQ) {
irq = range->irqs[queue].irq;
irq_set_affinity_hint(irq, NULL);
free_irq(irq, inst);
}
}
static inline bool knav_queue_is_busy(struct knav_queue_inst *inst)
{
return !list_empty(&inst->handles);
}
static inline bool knav_queue_is_reserved(struct knav_queue_inst *inst)
{
return inst->range->flags & RANGE_RESERVED;
}
static inline bool knav_queue_is_shared(struct knav_queue_inst *inst)
{
struct knav_queue *tmp;
rcu_read_lock();
for_each_handle_rcu(tmp, inst) {
if (tmp->flags & KNAV_QUEUE_SHARED) {
rcu_read_unlock();
return true;
}
}
rcu_read_unlock();
return false;
}
static inline bool knav_queue_match_type(struct knav_queue_inst *inst,
unsigned type)
{
if ((type == KNAV_QUEUE_QPEND) &&
(inst->range->flags & RANGE_HAS_IRQ)) {
return true;
} else if ((type == KNAV_QUEUE_ACC) &&
(inst->range->flags & RANGE_HAS_ACCUMULATOR)) {
return true;
} else if ((type == KNAV_QUEUE_GP) &&
!(inst->range->flags &
(RANGE_HAS_ACCUMULATOR | RANGE_HAS_IRQ))) {
return true;
}
return false;
}
static inline struct knav_queue_inst *
knav_queue_match_id_to_inst(struct knav_device *kdev, unsigned id)
{
struct knav_queue_inst *inst;
int idx;
for_each_instance(idx, inst, kdev) {
if (inst->id == id)
return inst;
}
return NULL;
}
static inline struct knav_queue_inst *knav_queue_find_by_id(int id)
{
if (knav_qdev->base_id <= id &&
knav_qdev->base_id + knav_qdev->num_queues > id) {
id -= knav_qdev->base_id;
return knav_queue_match_id_to_inst(knav_qdev, id);
}
return NULL;
}
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/dma-mapping.h`, `linux/firmware.h`, `linux/interrupt.h`, `linux/io.h`, `linux/module.h`, `linux/of.h`, `linux/of_address.h`.
- Detected declarations: `function knav_qmss_device_ready`, `function knav_queue_notify`, `function knav_queue_int_handler`, `function knav_queue_setup_irq`, `function knav_queue_free_irq`, `function knav_queue_is_busy`, `function knav_queue_is_reserved`, `function knav_queue_is_shared`, `function knav_queue_match_type`, `function knav_queue_match_id_to_inst`.
- Atlas domain: Driver Families / drivers/soc.
- 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.