drivers/media/pci/intel/ipu6/ipu6-buttress.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/intel/ipu6/ipu6-buttress.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/intel/ipu6/ipu6-buttress.c- Extension
.c- Size
- 23705 bytes
- Lines
- 911
- Domain
- Driver Families
- Bucket
- drivers/media
- 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/bitfield.hlinux/bits.hlinux/completion.hlinux/delay.hlinux/device.hlinux/dma-mapping.hlinux/firmware.hlinux/interrupt.hlinux/iopoll.hlinux/math64.hlinux/mm.hlinux/mutex.hlinux/pci.hlinux/pfn.hlinux/pm_runtime.hlinux/scatterlist.hlinux/slab.hlinux/time64.hipu6.hipu6-bus.hipu6-dma.hipu6-buttress.hipu6-platform-buttress-regs.h
Detected Declarations
function ipu6_buttress_ipc_resetfunction ipu6_buttress_ipc_validity_closefunction ipu6_buttress_ipc_validity_openfunction ipu6_buttress_ipc_recvfunction ipu6_buttress_ipc_send_bulkfunction ipu6_buttress_ipc_sendfunction ipu6_buttress_call_isrfunction ipu6_buttress_isrfunction ipu6_buttress_isr_threadedfunction ipu6_buttress_powerfunction ipu6_buttress_get_secure_modefunction ipu6_buttress_auth_donefunction ipu6_buttress_reset_authenticationfunction ipu6_buttress_map_fw_imagefunction ipu6_buttress_unmap_fw_imagefunction ipu6_buttress_authenticatefunction ipu6_buttress_send_tsc_requestfunction ipu6_buttress_start_tsc_syncfunction ipu6_buttress_tsc_readfunction ipu6_buttress_tsc_ticks_to_nsfunction ipu6_buttress_restorefunction ipu6_buttress_initfunction ipu6_buttress_exit
Annotated Snippet
switch (val) {
case ENTRY | EXIT:
case ENTRY | EXIT | QUERY:
/*
* 1) Clear-by-1 CSR bits
* (IPC_PEER_COMP_ACTIONS_RST_PHASE1,
* IPC_PEER_COMP_ACTIONS_RST_PHASE2).
* 2) Set peer CSR bit
* IPC_PEER_QUERIED_IP_COMP_ACTIONS_RST_PHASE.
*/
writel(ENTRY | EXIT, isp->base + ipc->csr_in);
writel(QUERY, isp->base + ipc->csr_out);
break;
case ENTRY:
case ENTRY | QUERY:
/*
* 1) Clear-by-1 CSR bits
* (IPC_PEER_COMP_ACTIONS_RST_PHASE1,
* IPC_PEER_QUERIED_IP_COMP_ACTIONS_RST_PHASE).
* 2) Set peer CSR bit
* IPC_PEER_COMP_ACTIONS_RST_PHASE1.
*/
writel(ENTRY | QUERY, isp->base + ipc->csr_in);
writel(ENTRY, isp->base + ipc->csr_out);
break;
case EXIT:
case EXIT | QUERY:
/*
* Clear-by-1 CSR bit
* IPC_PEER_COMP_ACTIONS_RST_PHASE2.
* 1) Clear incoming doorbell.
* 2) Clear-by-1 all CSR bits EXCEPT following
* bits:
* A. IPC_PEER_COMP_ACTIONS_RST_PHASE1.
* B. IPC_PEER_COMP_ACTIONS_RST_PHASE2.
* C. Possibly custom bits, depending on
* their role.
* 3) Set peer CSR bit
* IPC_PEER_COMP_ACTIONS_RST_PHASE2.
*/
writel(EXIT, isp->base + ipc->csr_in);
writel(0, isp->base + ipc->db0_in);
writel(csr_in_clr, isp->base + ipc->csr_in);
writel(EXIT, isp->base + ipc->csr_out);
/*
* Read csr_in again to make sure if RST_PHASE2 is done.
* If csr_in is QUERY, it should be handled again.
*/
usleep_range(200, 300);
val = readl(isp->base + ipc->csr_in);
if (val & QUERY) {
dev_dbg(&isp->pdev->dev,
"RST_PHASE2 retry csr_in = %x\n", val);
break;
}
mutex_unlock(&b->ipc_mutex);
return 0;
case QUERY:
/*
* 1) Clear-by-1 CSR bit
* IPC_PEER_QUERIED_IP_COMP_ACTIONS_RST_PHASE.
* 2) Set peer CSR bit
* IPC_PEER_COMP_ACTIONS_RST_PHASE1
*/
writel(QUERY, isp->base + ipc->csr_in);
writel(ENTRY, isp->base + ipc->csr_out);
break;
default:
dev_dbg_ratelimited(&isp->pdev->dev,
"Unexpected CSR 0x%x\n", val);
break;
}
} while (retries--);
mutex_unlock(&b->ipc_mutex);
dev_err(&isp->pdev->dev, "Timed out while waiting for CSE\n");
return -ETIMEDOUT;
}
static void ipu6_buttress_ipc_validity_close(struct ipu6_device *isp,
struct ipu6_buttress_ipc *ipc)
{
writel(BUTTRESS_IU2CSECSR_IPC_PEER_DEASSERTED_REG_VALID_REQ,
isp->base + ipc->csr_out);
}
static int
ipu6_buttress_ipc_validity_open(struct ipu6_device *isp,
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bits.h`, `linux/completion.h`, `linux/delay.h`, `linux/device.h`, `linux/dma-mapping.h`, `linux/firmware.h`, `linux/interrupt.h`.
- Detected declarations: `function ipu6_buttress_ipc_reset`, `function ipu6_buttress_ipc_validity_close`, `function ipu6_buttress_ipc_validity_open`, `function ipu6_buttress_ipc_recv`, `function ipu6_buttress_ipc_send_bulk`, `function ipu6_buttress_ipc_send`, `function ipu6_buttress_call_isr`, `function ipu6_buttress_isr`, `function ipu6_buttress_isr_threaded`, `function ipu6_buttress_power`.
- Atlas domain: Driver Families / drivers/media.
- 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.