Message ID | 20240914082532.344456-1-ruanjinjie@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [-next,RESEND] soc: ti: knav_qmss_queue: Use IRQF_NO_AUTOEN flag in request_irq() | expand |
Hi Jinjie Ruan, On Sat, 14 Sep 2024 16:25:32 +0800, Jinjie Ruan wrote: > As commit cbe16f35bee6 ("genirq: Add IRQF_NO_AUTOEN for request_irq/nmi()") > said, reqeust_irq() and then disable_irq() is unsafe. In the small time gap > between request_irq() and disable_irq(), interrupts can still come. > > IRQF_NO_AUTOEN flag can be used by drivers to request_irq(). It prevents > the automatic enabling of the requested interrupt in the same > safe way. With that the usage can be simplified and corrected. > > [...] I have applied the following to branch ti-drivers-soc-next on [1]. Thank you! [1/1] soc: ti: knav_qmss_queue: Use IRQF_NO_AUTOEN flag in request_irq() commit: 10b8a0cc84d28decb75bfc91f4395e176228a4ff All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent up the chain during the next merge window (or sooner if it is a relevant bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. [1] https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index f2055a76f84c..9c8d2f13b947 100644 --- a/drivers/soc/ti/knav_qmss_queue.c +++ b/drivers/soc/ti/knav_qmss_queue.c @@ -119,11 +119,10 @@ static int knav_queue_setup_irq(struct knav_range_info *range, if (range->flags & RANGE_HAS_IRQ) { irq = range->irqs[queue].irq; - ret = request_irq(irq, knav_queue_int_handler, 0, - inst->irq_name, inst); + ret = request_irq(irq, knav_queue_int_handler, IRQF_NO_AUTOEN, + inst->irq_name, inst); if (ret) return ret; - disable_irq(irq); if (range->irqs[queue].cpu_mask) { ret = irq_set_affinity_hint(irq, range->irqs[queue].cpu_mask); if (ret) {
As commit cbe16f35bee6 ("genirq: Add IRQF_NO_AUTOEN for request_irq/nmi()") said, reqeust_irq() and then disable_irq() is unsafe. In the small time gap between request_irq() and disable_irq(), interrupts can still come. IRQF_NO_AUTOEN flag can be used by drivers to request_irq(). It prevents the automatic enabling of the requested interrupt in the same safe way. With that the usage can be simplified and corrected. Compile-tested only. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> --- v1 -> RESEND: - Remove the fix tag. - Update the commit message. --- drivers/soc/ti/knav_qmss_queue.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)