Re: [PATCH v2 2/4] media: atomisp: queue: remove unused local queue support
From: Andy Shevchenko
Date: Fri Oct 23 2026 - 10:20:52 EST
On Wed, Oct 14, 2026 at 11:12:11AM +0000, Rareș-Mihai Vladu wrote:
> ia_css_queue_local_init() has no callers, so no queue is ever created
> as local. ia_css_queue_uninit() only handles local queues and has no
> callers either.
>
> All queue handles are in the static css_queues in bufq.c, and
> ia_css_bufq_init() sets up each of them with ia_css_queue_remote_init().
> This happens in ia_css_start_sp(), before the host sets
> host_sp_queues_initialized for the firmware, and css_queues is not
> cleared afterwards. Before that, the old code would have taken the local
> path with a NULL cb_local.desc and hit OP___assert(), so the handles do
> not seem to be used before initialization.
>
> With only remote queues left, the queue type no longer serves a purpose.
> Remove the local queue code together with IA_CSS_QUEUE_TYPE_REMOTE, the
> type field and the type checks.
>
> struct ia_css_queue appears to be host-only: it is not copied to SP or
> ISP memory, and the firmware uses struct host_sp_queues, whose addresses
> the handle stores. Removing the union member keeps the struct size on
> 32-bit and reduces it on 64-bit, where cb_local held two pointers.
I'm wondering if you use --histogram diff algo when preparing patches.
If not, use it next time.
...
> -int ia_css_queue_uninit(ia_css_queue_t *qhandle)
> +int ia_css_queue_enqueue(ia_css_queue_t *qhandle, uint32_t item)
This change is hard to read. Can you make an intermediate patch to just move
the "remote" branches to the helper functions first and in this patch actually
kill the local case altogether? Try to make it so that the ± statistics is
minimum for the changed lines. It means that create new helpers as they should
appear after this patch alone (just with different names). Example (ideal case):
// AFTER the mentioned intermediate change
static ia_css_queue_enqueue_remote()
{
...
}
// in old function
static ia_css_queue_enqueue()
{
if (LOCAL) {
...
return ...
}
ia_css_queue_enqueue_remote()
}
// In THIS change
-static ia_css_queue_enqueue_remote()
+static ia_css_queue_enqueue()
...
-static ia_css_queue_enqueue()
-{
-...
-}
Repeat the same for all affected functions.
--
With Best Regards,
Andy Shevchenko