drivers/crypto/intel/qat/qat_common/adf_vf_isr.c
Source file repositories/reference/linux-study-clean/drivers/crypto/intel/qat/qat_common/adf_vf_isr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/crypto/intel/qat/qat_common/adf_vf_isr.c- Extension
.c- Size
- 8150 bytes
- Lines
- 315
- 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.
- 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/kernel.hlinux/init.hlinux/types.hlinux/pci.hlinux/slab.hlinux/errno.hlinux/interrupt.hlinux/workqueue.hadf_accel_devices.hadf_common_drv.hadf_cfg.hadf_cfg_strings.hadf_cfg_common.hadf_pfvf_vf_msg.hadf_transport_access_macros.hadf_transport_internal.h
Detected Declarations
struct adf_vf_stop_datafunction adf_enable_pf2vf_interruptsfunction adf_disable_pf2vf_interruptsfunction adf_enable_msifunction adf_disable_msifunction adf_dev_stop_asyncfunction adf_pf2vf_handle_pf_restartingfunction adf_pf2vf_bh_handlerfunction adf_setup_pf2vf_bhfunction adf_cleanup_pf2vf_bhfunction adf_isrfunction adf_request_msi_irqfunction adf_setup_bhfunction adf_cleanup_bhfunction adf_vf_isr_resource_freefunction adf_vf_isr_resource_allocfunction adf_flush_vf_wqfunction adf_init_vf_wqfunction adf_exit_vf_wqexport adf_disable_pf2vf_interruptsexport adf_vf_isr_resource_freeexport adf_vf_isr_resource_allocexport adf_flush_vf_wq
Annotated Snippet
struct adf_vf_stop_data {
struct adf_accel_dev *accel_dev;
struct work_struct work;
};
void adf_enable_pf2vf_interrupts(struct adf_accel_dev *accel_dev)
{
void __iomem *pmisc_addr = adf_get_pmisc_base(accel_dev);
ADF_CSR_WR(pmisc_addr, ADF_VINTMSK_OFFSET, 0x0);
}
void adf_disable_pf2vf_interrupts(struct adf_accel_dev *accel_dev)
{
void __iomem *pmisc_addr = adf_get_pmisc_base(accel_dev);
ADF_CSR_WR(pmisc_addr, ADF_VINTMSK_OFFSET, 0x2);
}
EXPORT_SYMBOL_GPL(adf_disable_pf2vf_interrupts);
static int adf_enable_msi(struct adf_accel_dev *accel_dev)
{
struct adf_accel_pci *pci_dev_info = &accel_dev->accel_pci_dev;
int stat = pci_alloc_irq_vectors(pci_dev_info->pci_dev, 1, 1,
PCI_IRQ_MSI);
if (unlikely(stat < 0)) {
dev_err(&GET_DEV(accel_dev),
"Failed to enable MSI interrupt: %d\n", stat);
return stat;
}
return 0;
}
static void adf_disable_msi(struct adf_accel_dev *accel_dev)
{
struct pci_dev *pdev = accel_to_pci_dev(accel_dev);
pci_free_irq_vectors(pdev);
}
static void adf_dev_stop_async(struct work_struct *work)
{
struct adf_vf_stop_data *stop_data =
container_of(work, struct adf_vf_stop_data, work);
struct adf_accel_dev *accel_dev = stop_data->accel_dev;
adf_dev_restarting_notify(accel_dev);
adf_dev_down(accel_dev);
/* Re-enable PF2VF interrupts */
adf_enable_pf2vf_interrupts(accel_dev);
adf_vf2pf_notify_restart_complete(accel_dev);
kfree(stop_data);
}
int adf_pf2vf_handle_pf_restarting(struct adf_accel_dev *accel_dev)
{
struct adf_vf_stop_data *stop_data;
clear_bit(ADF_STATUS_PF_RUNNING, &accel_dev->status);
stop_data = kzalloc_obj(*stop_data, GFP_ATOMIC);
if (!stop_data) {
dev_err(&GET_DEV(accel_dev),
"Couldn't schedule stop for vf_%d\n",
accel_dev->accel_id);
return -ENOMEM;
}
stop_data->accel_dev = accel_dev;
INIT_WORK(&stop_data->work, adf_dev_stop_async);
queue_work(adf_vf_stop_wq, &stop_data->work);
return 0;
}
static void adf_pf2vf_bh_handler(void *data)
{
struct adf_accel_dev *accel_dev = data;
bool ret;
ret = adf_recv_and_handle_pf2vf_msg(accel_dev);
if (ret)
/* Re-enable PF2VF interrupts */
adf_enable_pf2vf_interrupts(accel_dev);
return;
}
static int adf_setup_pf2vf_bh(struct adf_accel_dev *accel_dev)
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`, `linux/workqueue.h`.
- Detected declarations: `struct adf_vf_stop_data`, `function adf_enable_pf2vf_interrupts`, `function adf_disable_pf2vf_interrupts`, `function adf_enable_msi`, `function adf_disable_msi`, `function adf_dev_stop_async`, `function adf_pf2vf_handle_pf_restarting`, `function adf_pf2vf_bh_handler`, `function adf_setup_pf2vf_bh`, `function adf_cleanup_pf2vf_bh`.
- Atlas domain: Driver Families / drivers/crypto.
- Implementation status: integration implementation candidate.
- 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.