drivers/crypto/intel/qat/qat_common/adf_isr.c
Source file repositories/reference/linux-study-clean/drivers/crypto/intel/qat/qat_common/adf_isr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/crypto/intel/qat/qat_common/adf_isr.c- Extension
.c- Size
- 12160 bytes
- Lines
- 455
- Domain
- Driver Families
- Bucket
- drivers/crypto
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/init.hlinux/types.hlinux/pci.hlinux/slab.hlinux/errno.hlinux/interrupt.hadf_accel_devices.hadf_common_drv.hadf_cfg.hadf_cfg_strings.hadf_cfg_common.hadf_transport_access_macros.hadf_transport_internal.h
Detected Declarations
function adf_enable_msixfunction adf_disable_msixfunction adf_msix_isr_bundlefunction adf_enable_vf2pf_interruptsfunction adf_enable_all_vf2pf_interruptsfunction adf_disable_all_vf2pf_interruptsfunction adf_disable_pending_vf2pf_interruptsfunction adf_handle_vf2pf_intfunction for_each_set_bitfunction adf_handle_pm_intfunction adf_handle_ras_intfunction adf_msix_isr_aefunction adf_isr_sync_ae_clusterfunction adf_free_irqsfunction adf_request_irqsfunction adf_isr_alloc_msix_vectors_datafunction adf_isr_free_msix_vectors_datafunction adf_setup_bhfunction adf_cleanup_bhfunction adf_isr_resource_freefunction adf_isr_resource_allocfunction adf_init_misc_wqfunction adf_exit_misc_wqfunction adf_misc_wq_queue_workfunction adf_misc_wq_queue_delayed_workfunction adf_misc_wq_flushexport adf_isr_resource_freeexport adf_isr_resource_alloc
Annotated Snippet
for_each_set_bit(i, &vf_mask, ADF_MAX_NUM_VFS) {
vf_info = accel_dev->pf.vf_info + i;
if (!__ratelimit(&vf_info->vf2pf_ratelimit)) {
dev_info(&GET_DEV(accel_dev),
"Too many ints from VF%d\n",
vf_info->vf_nr);
continue;
}
adf_schedule_vf2pf_handler(vf_info);
irq_handled = true;
}
}
return irq_handled;
}
#endif /* CONFIG_PCI_IOV */
static bool adf_handle_pm_int(struct adf_accel_dev *accel_dev)
{
struct adf_hw_device_data *hw_data = accel_dev->hw_device;
if (hw_data->handle_pm_interrupt &&
hw_data->handle_pm_interrupt(accel_dev))
return true;
return false;
}
static bool adf_handle_ras_int(struct adf_accel_dev *accel_dev)
{
struct adf_ras_ops *ras_ops = &accel_dev->hw_device->ras_ops;
bool reset_required;
if (ras_ops->handle_interrupt &&
ras_ops->handle_interrupt(accel_dev, &reset_required)) {
if (reset_required) {
dev_err(&GET_DEV(accel_dev), "Fatal error, reset required\n");
if (adf_notify_fatal_error(accel_dev))
dev_err(&GET_DEV(accel_dev),
"Failed to notify fatal error\n");
}
return true;
}
return false;
}
static irqreturn_t adf_msix_isr_ae(int irq, void *dev_ptr)
{
struct adf_accel_dev *accel_dev = dev_ptr;
#ifdef CONFIG_PCI_IOV
/* If SR-IOV is enabled (vf_info is non-NULL), check for VF->PF ints */
if (accel_dev->pf.vf_info && adf_handle_vf2pf_int(accel_dev))
return IRQ_HANDLED;
#endif /* CONFIG_PCI_IOV */
if (adf_handle_pm_int(accel_dev))
return IRQ_HANDLED;
if (adf_handle_ras_int(accel_dev))
return IRQ_HANDLED;
dev_dbg(&GET_DEV(accel_dev), "qat_dev%d spurious AE interrupt\n",
accel_dev->accel_id);
return IRQ_NONE;
}
void adf_isr_sync_ae_cluster(struct adf_accel_dev *accel_dev)
{
struct adf_accel_pci *pci_dev_info = &accel_dev->accel_pci_dev;
struct adf_hw_device_data *hw_data = GET_HW_DATA(accel_dev);
u32 num_entries = pci_dev_info->msix_entries.num_entries;
struct adf_irq *irqs = pci_dev_info->msix_entries.irqs;
u32 irq_idx;
int irq;
if (!test_bit(ADF_STATUS_IRQ_ALLOCATED, &accel_dev->status) || !irqs)
return;
irq_idx = num_entries > 1 ? hw_data->num_banks : 0;
if (irq_idx >= num_entries || !irqs[irq_idx].enabled)
return;
irq = pci_irq_vector(pci_dev_info->pci_dev, hw_data->num_banks);
if (irq > 0)
synchronize_irq(irq);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/types.h`, `linux/pci.h`, `linux/slab.h`, `linux/errno.h`, `linux/interrupt.h`, `adf_accel_devices.h`.
- Detected declarations: `function adf_enable_msix`, `function adf_disable_msix`, `function adf_msix_isr_bundle`, `function adf_enable_vf2pf_interrupts`, `function adf_enable_all_vf2pf_interrupts`, `function adf_disable_all_vf2pf_interrupts`, `function adf_disable_pending_vf2pf_interrupts`, `function adf_handle_vf2pf_int`, `function for_each_set_bit`, `function adf_handle_pm_int`.
- Atlas domain: Driver Families / drivers/crypto.
- 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.