From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794418016; b=k0/EIrx5kzR7xc4CLqeB8EymCXUXaYKUs92yWXaXCSHRbQQohTaDvbWet2gEUbgwoA3N gswDnJEssGMr6zZBslrVU+DrPc3PpXT/OBB70PQIoWQfSKR1+LzfUDzSY+u1dR0nURmnQ KW0oK24EOOsZfSkx9BmKKt6A6CeSnPIhjjfOfscMPLGezcwPMEJQwTM99WUpsh12HGFv1 F21vZJ9x+2jY8N0gOCevqInkWBg/jspe8uybhiosU/4Vfi0g7qcrflKJGg3G6fnQyqtib CezSRH44XC1YuooW3SckMFHq100gXIfpf3mO83SJrEKZErbfSlk8QbDoSkxAeA84yCQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794418016; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=Gna+NcqPvqPYHLK7g4j7zHFE6fsFd+qE5Y6PTDItBzk=; b=qMrRdATlHwa6EKSrnW87Acrw1HiJPWR39p7xs14hLAy+RKfZvwKMyKay+enCP0Cp28/p XQNkucJ6RPziK260oGkfAn4vke4FFBQyzTsTek8Zzxa4nomwb4r2JYzzuOL/DV6MgT2Qc lhh+V2bO9uIoZ7N8LBDQRkOZHV1KS3sCEMjHY5BUvjeHceq8H1NOFDnZdOY7ZjxoIQyiP CGyhs2BrLTU5x+QqvIXNIxFeSe4H90vUwbxkAVJBAbWUFzyMvA+ert2ZG0iG1JZ/GNd53 rzzFEbMVPOtDZ8EdrEifSpe32f4gwLDHhsk74VNH+cxrpy0Jc7bvkbp5xWfwfveKvBw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gFX9gRpe; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E4F54606A31C for ; Wed, 11 Nov 2026 17:26:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gFX9gRpe Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49A9C1F00A05; Wed, 11 Nov 2026 17:26:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794418015; bh=Gna+NcqPvqPYHLK7g4j7zHFE6fsFd+qE5Y6PTDItBzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gFX9gRpeJ1SIZ1RBKKOAW57YuV2edC8kep6itZYS4Aml9svEhhNM0q4I/y8J0KdLN DTL5AMvj7YmwWDlch2h0VoCP0JFtAL76hbQ/O2TTUuQLbItKuSZRlAsTQCLEokwMRO QbFSy45LxoNst+tb1jjJ98r0qUrO7z2xT0X7Z6ABkNP++NT5XwwJd5GYr438ElopaJ ssGffYatEeGyl1Ai5XO6XBbO/8jP/zMcbLVA1AwY83TUptmZSACQX3fvv78mQ50c/j LtHPwyIwd+D4eXHqilGxpQ93qBrqwoIut7QlsEwANoFEVEihWW0FFDngsco9XoT6dn aVHxqu4+KmfuA== From: Sasha Levin To: stable@vger.kernel.org Cc: Antti Laakso , Sakari Ailus , Sasha Levin Subject: [PATCH 6.18.y 1/2] media: ipu6: Rename pointer to firmware context Date: Wed, 11 Nov 2026 12:26:53 -0500 Message-ID: <20261111172647.3568812-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261107050757-failed-6.18-d3d9bc694fe0@kernel.org> References: <20261107050757-failed-6.18-d3d9bc694fe0@kernel.org> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Antti Laakso [ Upstream commit ac1a76fdf7e1815445c76d90ef688eff85cbb012 ] The name fwcom is used to refer firmware communication context and firmware communication configuration. Try to avoid confusion and rename context variable. Signed-off-by: Antti Laakso Signed-off-by: Sakari Ailus Stable-dep-of: d3d9bc694fe0 ("media: ipu6: Fix firmware config leak on stream start") Signed-off-by: Sasha Levin --- drivers/media/pci/intel/ipu6/ipu6-fw-isys.c | 56 ++++++++++--------- .../media/pci/intel/ipu6/ipu6-isys-video.c | 4 +- drivers/media/pci/intel/ipu6/ipu6-isys.c | 6 +- drivers/media/pci/intel/ipu6/ipu6-isys.h | 5 +- 4 files changed, 36 insertions(+), 35 deletions(-) diff --git a/drivers/media/pci/intel/ipu6/ipu6-fw-isys.c b/drivers/media/pci/intel/ipu6/ipu6-fw-isys.c index 62ed92ff1d303..a65e9f1aa1042 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-fw-isys.c +++ b/drivers/media/pci/intel/ipu6/ipu6-fw-isys.c @@ -32,7 +32,7 @@ static int handle_proxy_response(struct ipu6_isys *isys, unsigned int req_id) struct ipu6_fw_isys_proxy_resp_info_abi *resp; int ret; - resp = ipu6_recv_get_token(isys->fwcom, IPU6_BASE_PROXY_RECV_QUEUES); + resp = ipu6_recv_get_token(isys->fwctx, IPU6_BASE_PROXY_RECV_QUEUES); if (!resp) return 1; @@ -42,7 +42,7 @@ static int handle_proxy_response(struct ipu6_isys *isys, unsigned int req_id) ret = req_id == resp->request_id ? 0 : -EIO; - ipu6_recv_put_token(isys->fwcom, IPU6_BASE_PROXY_RECV_QUEUES); + ipu6_recv_put_token(isys->fwctx, IPU6_BASE_PROXY_RECV_QUEUES); return ret; } @@ -52,7 +52,7 @@ int ipu6_fw_isys_send_proxy_token(struct ipu6_isys *isys, unsigned int index, unsigned int offset, u32 value) { - struct ipu6_fw_com_context *ctx = isys->fwcom; + struct ipu6_fw_com_context *ctx = isys->fwctx; struct device *dev = &isys->adev->auxdev.dev; struct ipu6_fw_proxy_send_queue_token *token; unsigned int timeout = 1000; @@ -96,7 +96,7 @@ int ipu6_fw_isys_complex_cmd(struct ipu6_isys *isys, dma_addr_t dma_mapped_buf, size_t size, u16 send_type) { - struct ipu6_fw_com_context *ctx = isys->fwcom; + struct ipu6_fw_com_context *ctx = isys->fwctx; struct device *dev = &isys->adev->auxdev.dev; struct ipu6_fw_send_queue_token *token; @@ -138,7 +138,7 @@ 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; + void *fwctx; int ret; /* @@ -148,9 +148,9 @@ int ipu6_fw_isys_close(struct ipu6_isys *isys) * 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; + ret = ipu6_fw_com_close(isys->fwctx); + fwctx = isys->fwctx; + isys->fwctx = NULL; spin_unlock_irqrestore(&isys->power_lock, flags); if (ret) dev_err(dev, "Device close failure: %d\n", ret); @@ -158,14 +158,14 @@ int ipu6_fw_isys_close(struct ipu6_isys *isys) /* release probably fails if the close failed. Let's try still */ do { usleep_range(400, 500); - ret = ipu6_fw_com_release(fwcom, 0); + ret = ipu6_fw_com_release(fwctx, 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; + isys->fwctx = fwctx; spin_unlock_irqrestore(&isys->power_lock, flags); } @@ -176,11 +176,11 @@ void ipu6_fw_isys_cleanup(struct ipu6_isys *isys) { int ret; - ret = ipu6_fw_com_release(isys->fwcom, 1); + ret = ipu6_fw_com_release(isys->fwctx, 1); if (ret < 0) dev_warn(&isys->adev->auxdev.dev, "Device busy, fw_com release failed."); - isys->fwcom = NULL; + isys->fwctx = NULL; } static void start_sp(struct ipu6_bus_device *adev) @@ -212,7 +212,7 @@ static int query_sp(struct ipu6_bus_device *adev) } static int ipu6_isys_fwcom_cfg_init(struct ipu6_isys *isys, - struct ipu6_fw_com_cfg *fwcom, + struct ipu6_fw_com_cfg *fwcom_cfg, unsigned int num_streams) { unsigned int max_send_queues, max_sram_blocks, max_devq_size; @@ -258,14 +258,16 @@ static int ipu6_isys_fwcom_cfg_init(struct ipu6_isys *isys, if (!output_queue_cfg) return -ENOMEM; - fwcom->input = input_queue_cfg; - fwcom->output = output_queue_cfg; + fwcom_cfg->input = input_queue_cfg; + fwcom_cfg->output = output_queue_cfg; - fwcom->num_input_queues = isys_fw_cfg->num_send_queues[type_proxy] + + fwcom_cfg->num_input_queues = + isys_fw_cfg->num_send_queues[type_proxy] + isys_fw_cfg->num_send_queues[type_dev] + isys_fw_cfg->num_send_queues[type_msg]; - fwcom->num_output_queues = isys_fw_cfg->num_recv_queues[type_proxy] + + fwcom_cfg->num_output_queues = + isys_fw_cfg->num_recv_queues[type_proxy] + isys_fw_cfg->num_recv_queues[type_dev] + isys_fw_cfg->num_recv_queues[type_msg]; @@ -280,7 +282,7 @@ static int ipu6_isys_fwcom_cfg_init(struct ipu6_isys *isys, isys_fw_cfg->buffer_partition.num_gda_pages[i] = 0; } - /* FW assumes proxy interface at fwcom queue 0 */ + /* FW assumes proxy interface at fwcom_cfg queue 0 */ for (i = 0; i < isys_fw_cfg->num_send_queues[type_proxy]; i++) { input_queue_cfg[i].token_size = sizeof(struct ipu6_fw_proxy_send_queue_token); @@ -314,9 +316,9 @@ static int ipu6_isys_fwcom_cfg_init(struct ipu6_isys *isys, IPU6_ISYS_SIZE_RECV_QUEUE; } - fwcom->dmem_addr = isys->pdata->ipdata->hw_variant.dmem_offset; - fwcom->specific_addr = isys_fw_cfg; - fwcom->specific_size = sizeof(*isys_fw_cfg); + fwcom_cfg->dmem_addr = isys->pdata->ipdata->hw_variant.dmem_offset; + fwcom_cfg->specific_addr = isys_fw_cfg; + fwcom_cfg->specific_size = sizeof(*isys_fw_cfg); return 0; } @@ -325,23 +327,23 @@ int ipu6_fw_isys_init(struct ipu6_isys *isys, unsigned int num_streams) { struct device *dev = &isys->adev->auxdev.dev; int retry = IPU6_ISYS_OPEN_RETRY; - struct ipu6_fw_com_cfg fwcom = { + struct ipu6_fw_com_cfg fwcom_cfg = { .cell_start = start_sp, .cell_ready = query_sp, .buttress_boot_offset = SYSCOM_BUTTRESS_FW_PARAMS_ISYS_OFFSET, }; int ret; - ipu6_isys_fwcom_cfg_init(isys, &fwcom, num_streams); + ipu6_isys_fwcom_cfg_init(isys, &fwcom_cfg, num_streams); - isys->fwcom = ipu6_fw_com_prepare(&fwcom, isys->adev, + isys->fwctx = ipu6_fw_com_prepare(&fwcom_cfg, isys->adev, isys->pdata->base); - if (!isys->fwcom) { + if (!isys->fwctx) { dev_err(dev, "isys fw com prepare failed\n"); return -EIO; } - ret = ipu6_fw_com_open(isys->fwcom); + ret = ipu6_fw_com_open(isys->fwctx); if (ret) { dev_err(dev, "isys fw com open failed %d\n", ret); return ret; @@ -349,7 +351,7 @@ int ipu6_fw_isys_init(struct ipu6_isys *isys, unsigned int num_streams) do { usleep_range(400, 500); - if (ipu6_fw_com_ready(isys->fwcom)) + if (ipu6_fw_com_ready(isys->fwctx)) break; retry--; } while (retry > 0); diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c index b96ae563b82f0..d9b67502dbd26 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c @@ -1116,7 +1116,7 @@ int ipu6_isys_fw_open(struct ipu6_isys *isys) */ ipu6_cleanup_fw_msg_bufs(isys); - if (isys->fwcom) { + if (isys->fwctx) { /* * Something went wrong in previous shutdown. As we are now * restarting isys we can safely delete old context. @@ -1149,7 +1149,7 @@ void ipu6_isys_fw_close(struct ipu6_isys *isys) isys->ref_count--; if (!isys->ref_count) { ipu6_fw_isys_close(isys); - if (isys->fwcom) { + if (isys->fwctx) { isys->need_reset = true; dev_warn(&isys->adev->auxdev.dev, "failed to close fw isys\n"); diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys.c b/drivers/media/pci/intel/ipu6/ipu6-isys.c index 9a9e245edc1a2..a0f209b8141de 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-isys.c +++ b/drivers/media/pci/intel/ipu6/ipu6-isys.c @@ -1227,10 +1227,10 @@ static int isys_isr_one(struct ipu6_bus_device *adev) u32 index; u64 ts; - if (!isys->fwcom) + if (!isys->fwctx) return 1; - resp = ipu6_fw_isys_get_resp(isys->fwcom, IPU6_BASE_MSG_RECV_QUEUES); + resp = ipu6_fw_isys_get_resp(isys->fwctx, IPU6_BASE_MSG_RECV_QUEUES); if (!resp) return 1; @@ -1339,7 +1339,7 @@ static int isys_isr_one(struct ipu6_bus_device *adev) ipu6_isys_put_stream(stream); leave: - ipu6_fw_isys_put_resp(isys->fwcom, IPU6_BASE_MSG_RECV_QUEUES); + ipu6_fw_isys_put_resp(isys->fwctx, IPU6_BASE_MSG_RECV_QUEUES); return 0; } diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys.h b/drivers/media/pci/intel/ipu6/ipu6-isys.h index 0e2c8b71edfc9..ed38decdd525b 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-isys.h +++ b/drivers/media/pci/intel/ipu6/ipu6-isys.h @@ -114,8 +114,7 @@ struct sensor_async_sd { * @csi2_rx_ctrl_cached: cached shared value between all CSI2 receivers * @streams_lock: serialise access to streams * @streams: streams per firmware stream ID - * @fwcom: fw communication layer private pointer - * or optional external library private pointer + * @fwctx: fw communication layer context pointer * @phy_termcal_val: the termination calibration value, only used for DWC PHY * @need_reset: Isys requires d0i0->i3 transition * @ref_count: total number of callers fw open @@ -136,7 +135,7 @@ struct ipu6_isys { spinlock_t streams_lock; struct ipu6_isys_stream streams[IPU6_ISYS_MAX_STREAMS]; int streams_ref_count[IPU6_ISYS_MAX_STREAMS]; - void *fwcom; + void *fwctx; u32 phy_termcal_val; bool need_reset; bool icache_prefetch; -- 2.53.0