aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDikshita Agarwal <[email protected]>2025-05-09 08:38:52 +0000
committerHans Verkuil <[email protected]>2025-07-03 09:02:43 +0000
commit2781662dee7bbb9675e5440f5dff4e3991dc5624 (patch)
tree650981971fbafb0672282391d479daac50f12403
parentmedia: iris: Drop port check for session property response (diff)
downloadkernel-2781662dee7bbb9675e5440f5dff4e3991dc5624.tar.gz
kernel-2781662dee7bbb9675e5440f5dff4e3991dc5624.zip
media: iris: Prevent HFI queue writes when core is in deinit state
The current check only considers the core error state before allowing writes to the HFI queues. However, the core can also transition to the deinit state due to a system error triggered by the response thread. In such cases, writing to the HFI queues should not be allowed. Fix this by adding a check for the core deinit state, ensuring that writes are rejected when core is not in a valid state. Cc: [email protected] Fixes: fb583a214337 ("media: iris: introduce host firmware interface with necessary hooks") Acked-by: Vikash Garodia <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on SM8550-QRD Tested-by: Neil Armstrong <[email protected]> # on SM8550-HDK Tested-by: Neil Armstrong <[email protected]> # on SM8650-QRD Tested-by: Neil Armstrong <[email protected]> # on SM8650-HDK Signed-off-by: Dikshita Agarwal <[email protected]> Reviewed-by: Bryan O'Donoghue <[email protected]> Tested-by: Vikash Garodia <[email protected]> # on sa8775p-ride Signed-off-by: Bryan O'Donoghue <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
-rw-r--r--drivers/media/platform/qcom/iris/iris_hfi_queue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_queue.c b/drivers/media/platform/qcom/iris/iris_hfi_queue.c
index fac7df0c4d1a..221dcd09e1e1 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_queue.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_queue.c
@@ -113,7 +113,7 @@ int iris_hfi_queue_cmd_write_locked(struct iris_core *core, void *pkt, u32 pkt_s
{
struct iris_iface_q_info *q_info = &core->command_queue;
- if (core->state == IRIS_CORE_ERROR)
+ if (core->state == IRIS_CORE_ERROR || core->state == IRIS_CORE_DEINIT)
return -EINVAL;
if (!iris_hfi_queue_write(q_info, pkt, pkt_size)) {