* [PATCH] media: microchip: isc: Initialize DMA lock before requesting IRQ
@ 2026-08-30 2:32 Runyu Xiao
2026-09-10 11:54 ` Hans Verkuil
0 siblings, 1 reply; 4+ messages in thread
From: Runyu Xiao @ 2026-08-30 2:32 UTC (permalink / raw)
To: ehristev
Cc: mchehab, linux-media, linux-kernel, stable, runyu.xiao, jianhao.xu
The ISC interrupt can run before asynchronous subdevice completion, but the DMA queue lock was initialized from isc_async_complete(). Initialize it in each SoC probe before requesting the auto-enabled IRQ and remove the late initialization from the asynchronous completion path.
Fixes: 91b4e487b0c6 ("media: microchip: add ISC driver as Microchip ISC")
Cc: stable@vger.kernel.org
Assisted-by: Codex:GPT-5
Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
---
drivers/media/platform/microchip/microchip-isc-base.c | 1 -
drivers/media/platform/microchip/microchip-sama5d2-isc.c | 2 ++
drivers/media/platform/microchip/microchip-sama7g5-isc.c | 2 ++
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/microchip/microchip-isc-base.c b/drivers/media/platform/microchip/microchip-isc-base.c
index a7cdc743f..a2534d8eb 100644
--- a/drivers/media/platform/microchip/microchip-isc-base.c
+++ b/drivers/media/platform/microchip/microchip-isc-base.c
@@ -1792,7 +1792,6 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier)
/* Init video dma queues */
INIT_LIST_HEAD(&isc->dma_queue);
- spin_lock_init(&isc->dma_queue_lock);
spin_lock_init(&isc->awb_lock);
ret = isc_set_default_fmt(isc);
diff --git a/drivers/media/platform/microchip/microchip-sama5d2-isc.c b/drivers/media/platform/microchip/microchip-sama5d2-isc.c
index 66d3d7891..f0f7ca47f 100644
--- a/drivers/media/platform/microchip/microchip-sama5d2-isc.c
+++ b/drivers/media/platform/microchip/microchip-sama5d2-isc.c
@@ -432,6 +432,8 @@ static int microchip_isc_probe(struct platform_device *pdev)
if (irq < 0)
return irq;
+ spin_lock_init(&isc->dma_queue_lock);
+
ret = devm_request_irq(dev, irq, microchip_isc_interrupt, 0,
"microchip-sama5d2-isc", isc);
if (ret < 0) {
diff --git a/drivers/media/platform/microchip/microchip-sama7g5-isc.c b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
index 7383341ec..b1aa3fe55 100644
--- a/drivers/media/platform/microchip/microchip-sama7g5-isc.c
+++ b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
@@ -421,6 +421,8 @@ static int microchip_xisc_probe(struct platform_device *pdev)
if (irq < 0)
return irq;
+ spin_lock_init(&isc->dma_queue_lock);
+
ret = devm_request_irq(dev, irq, microchip_isc_interrupt, 0,
"microchip-sama7g5-xisc", isc);
if (ret < 0) {
--
2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] media: microchip: isc: Initialize DMA lock before requesting IRQ
2026-08-30 2:32 [PATCH] media: microchip: isc: Initialize DMA lock before requesting IRQ Runyu Xiao
@ 2026-09-10 11:54 ` Hans Verkuil
2026-09-19 1:10 ` Runyu Xiao
0 siblings, 1 reply; 4+ messages in thread
From: Hans Verkuil @ 2026-09-10 11:54 UTC (permalink / raw)
To: Runyu Xiao, ehristev
Cc: mchehab, linux-media, linux-kernel, stable, jianhao.xu
On 30/08/2026 04:32, Runyu Xiao wrote:
> The ISC interrupt can run before asynchronous subdevice completion, but the DMA queue lock was initialized from isc_async_complete(). Initialize it in each SoC probe before requesting the auto-enabled IRQ and remove the late initialization from the asynchronous completion path.
Line is much too long.
>
> Fixes: 91b4e487b0c6 ("media: microchip: add ISC driver as Microchip ISC")
>
Spurious empty lines.
> Cc: stable@vger.kernel.org
>
> Assisted-by: Codex:GPT-5
> Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
> ---
> drivers/media/platform/microchip/microchip-isc-base.c | 1 -
> drivers/media/platform/microchip/microchip-sama5d2-isc.c | 2 ++
> drivers/media/platform/microchip/microchip-sama7g5-isc.c | 2 ++
> 3 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/microchip/microchip-isc-base.c b/drivers/media/platform/microchip/microchip-isc-base.c
> index a7cdc743f..a2534d8eb 100644
> --- a/drivers/media/platform/microchip/microchip-isc-base.c
> +++ b/drivers/media/platform/microchip/microchip-isc-base.c
> @@ -1792,7 +1792,6 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier)
>
> /* Init video dma queues */
> INIT_LIST_HEAD(&isc->dma_queue);
> - spin_lock_init(&isc->dma_queue_lock);
> spin_lock_init(&isc->awb_lock);
>
> ret = isc_set_default_fmt(isc);
> diff --git a/drivers/media/platform/microchip/microchip-sama5d2-isc.c b/drivers/media/platform/microchip/microchip-sama5d2-isc.c
> index 66d3d7891..f0f7ca47f 100644
> --- a/drivers/media/platform/microchip/microchip-sama5d2-isc.c
> +++ b/drivers/media/platform/microchip/microchip-sama5d2-isc.c
> @@ -432,6 +432,8 @@ static int microchip_isc_probe(struct platform_device *pdev)
> if (irq < 0)
> return irq;
>
> + spin_lock_init(&isc->dma_queue_lock);
It's dubious to just init dma_queue_lock here but not INIT_LIST_HEAD(&isc->dma_queue);
I think Eugen needs to look at this as well to see if this is actually a valid
issue at all.
In any case, this patch doesn't look right to me.
Regards,
Hans
> +
> ret = devm_request_irq(dev, irq, microchip_isc_interrupt, 0,
> "microchip-sama5d2-isc", isc);
> if (ret < 0) {
> diff --git a/drivers/media/platform/microchip/microchip-sama7g5-isc.c b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
> index 7383341ec..b1aa3fe55 100644
> --- a/drivers/media/platform/microchip/microchip-sama7g5-isc.c
> +++ b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
> @@ -421,6 +421,8 @@ static int microchip_xisc_probe(struct platform_device *pdev)
> if (irq < 0)
> return irq;
>
> + spin_lock_init(&isc->dma_queue_lock);
> +
> ret = devm_request_irq(dev, irq, microchip_isc_interrupt, 0,
> "microchip-sama7g5-xisc", isc);
> if (ret < 0) {
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] media: microchip: isc: Initialize DMA lock before requesting IRQ
2026-09-10 11:54 ` Hans Verkuil
@ 2026-09-19 1:10 ` Runyu Xiao
2026-09-23 18:44 ` Eugen Hristev
0 siblings, 1 reply; 4+ messages in thread
From: Runyu Xiao @ 2026-09-19 1:10 UTC (permalink / raw)
To: Hans Verkuil, Eugen Hristev
Cc: mchehab, linux-media, linux-kernel, stable, Runyu Xiao, Jianhao Xu
Hi Hans and Eugen,
Thanks for taking a look at this.
On Sun, 30 Aug 2026, I wrote:
> The ISC interrupt can run before asynchronous subdevice completion,
> but the DMA queue lock was initialized from isc_async_complete().
> Initialize it in each SoC probe before requesting the auto-enabled IRQ.
On Thu, 10 Sep 2026, Hans Verkuil wrote:
> It's dubious to just init dma_queue_lock here but not
> INIT_LIST_HEAD(&isc->dma_queue);
>
> I think Eugen needs to look at this as well to see if this is actually
> a valid issue at all.
>
> In any case, this patch doesn't look right to me.
You're right that moving dma_queue_lock alone is not enough. The interrupt
handler also accesses dma_queue, comp, and awb_work, which are initialized
later from isc_async_complete(). I also need to confirm whether an interrupt
can actually be pending at this point, and whether the required clocks and
hardware state are ready during probe.
I have not established that yet, so I'll drop this version for now rather
than send a v2 that only moves another initialization. Eugen, could you
please confirm the expected reset and interrupt state during probe? If there
is a real probe-time path, I'll revisit this with the complete ordering.
Thanks,
Runyu
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] media: microchip: isc: Initialize DMA lock before requesting IRQ
2026-09-19 1:10 ` Runyu Xiao
@ 2026-09-23 18:44 ` Eugen Hristev
0 siblings, 0 replies; 4+ messages in thread
From: Eugen Hristev @ 2026-09-23 18:44 UTC (permalink / raw)
To: Runyu Xiao, Hans Verkuil
Cc: mchehab, linux-media, linux-kernel, stable, Jianhao Xu,
Balakrishnan Sambath
On 9/19/26 04:10, Runyu Xiao wrote:
> Hi Hans and Eugen,
>
> Thanks for taking a look at this.
>
> On Sun, 30 Aug 2026, I wrote:
>> The ISC interrupt can run before asynchronous subdevice completion,
>> but the DMA queue lock was initialized from isc_async_complete().
>> Initialize it in each SoC probe before requesting the auto-enabled IRQ.
>
> On Thu, 10 Sep 2026, Hans Verkuil wrote:
>> It's dubious to just init dma_queue_lock here but not
>> INIT_LIST_HEAD(&isc->dma_queue);
>>
>> I think Eugen needs to look at this as well to see if this is actually
>> a valid issue at all.
>>
>> In any case, this patch doesn't look right to me.
>
> You're right that moving dma_queue_lock alone is not enough. The interrupt
> handler also accesses dma_queue, comp, and awb_work, which are initialized
> later from isc_async_complete(). I also need to confirm whether an interrupt
> can actually be pending at this point, and whether the required clocks and
> hardware state are ready during probe.
>
> I have not established that yet, so I'll drop this version for now rather
> than send a v2 that only moves another initialization. Eugen, could you
> please confirm the expected reset and interrupt state during probe? If there
> is a real probe-time path, I'll revisit this with the complete ordering.
Added Balakrishnan , he can test and review your patch.
Eugen>
> Thanks,
> Runyu
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-23 18:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-30 2:32 [PATCH] media: microchip: isc: Initialize DMA lock before requesting IRQ Runyu Xiao
2026-09-10 11:54 ` Hans Verkuil
2026-09-19 1:10 ` Runyu Xiao
2026-09-23 18:44 ` Eugen Hristev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®