Re: [PATCH] genirq/test: Fix depth tests on architectures with NOREQUEST by default.

From: Brian Norris
Date: Mon Aug 18 2025 - 12:45:48 EST


On Sat, Aug 16, 2025 at 05:45:28PM +0800, David Gow wrote:
> The new irq KUnit tests fail on some architectures (notably PowerPC and
> 32-bit ARM), as the request_irq() call fails due to the
> ARCH_IRQ_INIT_FLAGS containing IRQ_NOREQUEST, yielding the following
> errors:
> [10:17:45] # irq_free_disabled_test: EXPECTATION FAILED at kernel/irq/irq_test.c:88
> [10:17:45] Expected ret == 0, but
> [10:17:45] ret == -22 (0xffffffffffffffea)
> [10:17:45] # irq_free_disabled_test: EXPECTATION FAILED at kernel/irq/irq_test.c:90
> [10:17:45] Expected desc->depth == 0, but
> [10:17:45] desc->depth == 1 (0x1)
> [10:17:45] # irq_free_disabled_test: EXPECTATION FAILED at kernel/irq/irq_test.c:93
> [10:17:45] Expected desc->depth == 1, but
> [10:17:45] desc->depth == 2 (0x2)
>
> If we clear IRQ_NOREQUEST from the desc, these tests now pass on arm and
> powerpc.
>
> Fixes: 66067c3c8a1e ("genirq: Add kunit tests for depth counts")
> Signed-off-by: David Gow <davidgow@xxxxxxxxxx>

I was about to send essentially the same patch. Works for me.

Reviewed-by: Brian Norris <briannorris@xxxxxxxxxxxx>
Tested-by: Brian Norris <briannorris@xxxxxxxxxxxx>

tools/testing/kunit/kunit.py run 'irq_test_cases*' --arch arm \
--qemu_args '-smp 2' --cross_compile arm-linux-gnueabi-
...
[09:44:15] Testing complete. Ran 4 tests: passed: 4