drivers/media/pci/intel/ipu6/ipu6-fw-isys.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/intel/ipu6/ipu6-fw-isys.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/intel/ipu6/ipu6-fw-isys.c- Extension
.c- Size
- 14725 bytes
- Lines
- 488
- Domain
- Driver Families
- Bucket
- drivers/media
- 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.
- 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/cacheflush.hlinux/delay.hlinux/device.hlinux/io.hlinux/spinlock.hlinux/types.hipu6-bus.hipu6-fw-com.hipu6-isys.hipu6-platform-isys-csi2-reg.hipu6-platform-regs.h
Detected Declarations
function handle_proxy_responsefunction ipu6_fw_isys_send_proxy_tokenfunction ipu6_fw_isys_complex_cmdfunction ipu6_fw_isys_simple_cmdfunction ipu6_fw_isys_closefunction ipu6_fw_isys_cleanupfunction start_spfunction query_spfunction ipu6_isys_fwcom_cfg_initfunction ipu6_fw_isys_initfunction ipu6_fw_isys_get_respfunction ipu6_fw_isys_put_respfunction ipu6_fw_isys_dump_stream_cfgfunction ipu6_fw_isys_dump_frame_buff_set
Annotated Snippet
if (ret == -EIO) {
dev_err(dev, "Proxy respond with unexpected id\n");
break;
}
timeout--;
} while (ret && timeout);
if (!timeout)
dev_err(dev, "Proxy response timed out\n");
return ret;
}
int ipu6_fw_isys_complex_cmd(struct ipu6_isys *isys,
const unsigned int stream_handle,
void *cpu_mapped_buf,
dma_addr_t dma_mapped_buf,
size_t size, u16 send_type)
{
struct ipu6_fw_com_context *ctx = isys->fwcom;
struct device *dev = &isys->adev->auxdev.dev;
struct ipu6_fw_send_queue_token *token;
if (send_type >= N_IPU6_FW_ISYS_SEND_TYPE)
return -EINVAL;
dev_dbg(dev, "send_token: %s\n", send_msg_types[send_type]);
/*
* Time to flush cache in case we have some payload. Not all messages
* have that
*/
if (cpu_mapped_buf)
clflush_cache_range(cpu_mapped_buf, size);
token = ipu6_send_get_token(ctx,
stream_handle + IPU6_BASE_MSG_SEND_QUEUES);
if (!token)
return -EBUSY;
token->payload = dma_mapped_buf;
token->buf_handle = (unsigned long)cpu_mapped_buf;
token->send_type = send_type;
ipu6_send_put_token(ctx, stream_handle + IPU6_BASE_MSG_SEND_QUEUES);
return 0;
}
int ipu6_fw_isys_simple_cmd(struct ipu6_isys *isys,
const unsigned int stream_handle, u16 send_type)
{
return ipu6_fw_isys_complex_cmd(isys, stream_handle, NULL, 0, 0,
send_type);
}
int ipu6_fw_isys_close(struct ipu6_isys *isys)
{
struct device *dev = &isys->adev->auxdev.dev;
int retry = IPU6_ISYS_CLOSE_RETRY;
unsigned long flags;
void *fwcom;
int ret;
/*
* Stop the isys fw. Actual close takes
* some time as the FW must stop its actions including code fetch
* to SP icache.
* spinlock to wait the interrupt handler to be finished
*/
spin_lock_irqsave(&isys->power_lock, flags);
ret = ipu6_fw_com_close(isys->fwcom);
fwcom = isys->fwcom;
isys->fwcom = NULL;
spin_unlock_irqrestore(&isys->power_lock, flags);
if (ret)
dev_err(dev, "Device close failure: %d\n", ret);
/* release probably fails if the close failed. Let's try still */
do {
usleep_range(400, 500);
ret = ipu6_fw_com_release(fwcom, 0);
retry--;
} while (ret && retry);
if (ret) {
dev_err(dev, "Device release time out %d\n", ret);
spin_lock_irqsave(&isys->power_lock, flags);
isys->fwcom = fwcom;
spin_unlock_irqrestore(&isys->power_lock, flags);
Annotation
- Immediate include surface: `linux/cacheflush.h`, `linux/delay.h`, `linux/device.h`, `linux/io.h`, `linux/spinlock.h`, `linux/types.h`, `ipu6-bus.h`, `ipu6-fw-com.h`.
- Detected declarations: `function handle_proxy_response`, `function ipu6_fw_isys_send_proxy_token`, `function ipu6_fw_isys_complex_cmd`, `function ipu6_fw_isys_simple_cmd`, `function ipu6_fw_isys_close`, `function ipu6_fw_isys_cleanup`, `function start_sp`, `function query_sp`, `function ipu6_isys_fwcom_cfg_init`, `function ipu6_fw_isys_init`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.