Re: [PATCH] spi: rockchip: Use plain request_irq()
From: Shawn Lin <shawn.lin@rock-chips.com>
Date: 2026-01-17 02:15:28
Also in:
linux-rockchip, linux-spi, lkml
+ Xuhui from rockchip who may keep an eye on spi-rockchip related topic 在 2026/01/16 星期五 23:37, Mark Brown 写道:
On Fri, Jan 16, 2026 at 11:19:39PM +0800, Shawn Lin wrote:quoted
在 2026/01/16 星期五 21:23, Mark Brown 写道:quoted
quoted
The Rockchip driver has since interrupt support was added used request_threaded_irq() but not actually supplied a threaded handler, handling everything in the primary handler. This is equivalent to just using a plain request_irq(), and since aef30c8d569c (genirq: Warn about using IRQF_ONESHOT without a threaded handler) the current behaviour has triggered a WARN_ON(). Convert to use request_irq().quoted
Is it preferred to use threaded version if latency is not a critical concern ? I guess the original intention was to usequoted
ret = devm_request_threaded_irq(&pdev->dev, ret, NULL, rockchip_spi_isr, IRQF_ONESHOT, dev_name(&pdev->dev), ctlr); ?TBH it looked to me more like there'd been some deferral of more complex work at some point but that didn't make it into the final code. In
Ah, indeed,rockchip_spi_isr() directly performs R/W pio in hardirq context which doesn't seem advisable, so probably some better improvement is needed in the furture. Anyway, fix the warning right now as $subject patch looks sensible: Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com> - Thanks.
general it's better to handle things in hardirq context if they are appropriate for that, and for a SPI controller the end requirements are coming from the device so you have to assume they're going to need things to complete promptly. There's overhead from scheduling a task so no point in incurring it if it doesn't buy you anything.