[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260122-sklug-v6-16-topic-dw100-v3-1-dev-v2-3-ea1e29f18cf1@ideasonboard.com>
Date: Thu, 22 Jan 2026 15:44:58 +0100
From: Stefan Klug <stefan.klug@...asonboard.com>
To: Xavier Roumegue <xavier.roumegue@....nxp.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Clark Williams <clrkwllms@...nel.org>, Steven Rostedt <rostedt@...dmis.org>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-rt-devel@...ts.linux.dev, Nicolas Dufresne <nicolas@...fresne.ca>,
Stefan Klug <stefan.klug@...asonboard.com>
Subject: [PATCH v2 3/3] media: dw100: Fix kernel oops with PREEMPT_RT
enabled
On kernels with PREEMPT_RT enabled, a "BUG: scheduling while atomic"
kernel oops occurs inside dw100_irq_handler -> vb2_buffer_done. This is
because vb2_buffer_done takes a spinlock which is not allowed within
interrupt context on PREEMPT_RT.
Fix that by dropping the IRQF_ONESHOT flag. There was only a hard
interrupt handler specified anyways, so IRQF_ONESHOT didn't have any
effect on non PREEMPT_RT systems. On PREEMPT_RT systems the interrupt
handler is automatically changed to threaded and the IRQF_ONESHOT flag
get's set internally.
There is one caveat though: During development regular "dw100
32e30000.dwe: Interrupt error: 0x1" errors occurred due to
DW100_INTERRUPT_STATUS_INT_ERR_TIME_OUT being set. This only happened on
non PREEMPT_RT setups when the interrupt handler was manually forced to
be threaded. On PREEMPT_RT systems (where the interrupt handler is now
implicitly threaded) this error was never seen.
Signed-off-by: Stefan Klug <stefan.klug@...asonboard.com>
---
Changes in v2:
- Dropped the IRQF_ONESHOT instead of making the interrupt handler
threaded to fix the issue.
- I didn't keep the r-by tag from Nicolas as the solution is now a
different one.
---
drivers/media/platform/nxp/dw100/dw100.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/nxp/dw100/dw100.c b/drivers/media/platform/nxp/dw100/dw100.c
index d2b1c62b52db47ea1d2242caaf334fff30c6f366..4c8be66f87519b36b2273ecf3f34eab03c5e6738 100644
--- a/drivers/media/platform/nxp/dw100/dw100.c
+++ b/drivers/media/platform/nxp/dw100/dw100.c
@@ -1593,7 +1593,7 @@ static int dw100_probe(struct platform_device *pdev)
pm_runtime_put_sync(&pdev->dev);
- ret = devm_request_irq(&pdev->dev, irq, dw100_irq_handler, IRQF_ONESHOT,
+ ret = devm_request_irq(&pdev->dev, irq, dw100_irq_handler, 0,
dev_name(&pdev->dev), dw_dev);
if (ret < 0) {
dev_err(&pdev->dev, "Failed to request irq: %d\n", ret);
--
2.51.0
Powered by blists - more mailing lists