* [PATCH] irqchip/mvebu: Allow EBU irqchips to be compile-tested
@ 2026-05-10 19:50 Rosen Penev
2026-05-11 13:45 ` Thomas Gleixner
0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-05-10 19:50 UTC (permalink / raw)
To: linux-kernel
Cc: Thomas Gleixner, Andrew Lunn, Gregory Clement,
Sebastian Hesselbarth, Nathan Chancellor, Nick Desaulniers,
Bill Wendling, Justin Stitt,
moderated list:ARM/Marvell Kirkwood and Armada 370, 375, 38x,...,
open list:CLANG/LLVM BUILD SUPPORT:Keyword:b(?i:clang|llvm)b
The Marvell EBU interrupt controller Kconfig symbols are hidden and
selected only by platform code. This prevents build coverage for the
drivers on other architectures even though the code only needs OF and
MMIO support.
Add COMPILE_TEST prompts and the required dependencies for the GICP,
ICU, ODMI, PIC and SEI irqchips. While touching PIC for this coverage,
use GENMASK() and BIT() for its masks so that 32-bit platforms can
compile this safely without running into issues.
Tested: make LLVM=1 ARCH=s390 drivers/irqchip/
Assisted-by: Codex:GPT-5.5
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/irqchip/Kconfig | 31 ++++++++++++++++++++++++++-----
drivers/irqchip/irq-mvebu-pic.c | 8 ++++----
2 files changed, 30 insertions(+), 9 deletions(-)
diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index e7d559472790..cf3aea96866b 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -451,22 +451,43 @@ config MSCC_OCELOT_IRQ
select GENERIC_IRQ_CHIP
config MVEBU_GICP
+ bool "Marvell EBU GICP interrupt controller" if COMPILE_TEST
+ depends on OF
+ depends on HAS_IOMEM
select IRQ_MSI_LIB
- bool
+ help
+ Support the Marvell EBU GICP interrupt controller.
config MVEBU_ICU
- bool
+ bool "Marvell EBU ICU interrupt controller" if COMPILE_TEST
+ depends on OF
+ depends on HAS_IOMEM
+ select GENERIC_MSI_IRQ
+ help
+ Support the Marvell EBU ICU interrupt controller.
config MVEBU_ODMI
- bool
+ bool "Marvell EBU ODMI interrupt controller" if COMPILE_TEST
+ depends on OF
+ depends on HAS_IOMEM
select IRQ_MSI_LIB
select GENERIC_MSI_IRQ
+ help
+ Support the Marvell EBU ODMI interrupt controller.
config MVEBU_PIC
- bool
+ bool "Marvell EBU PIC interrupt controller" if COMPILE_TEST
+ depends on OF
+ depends on HAS_IOMEM
+ help
+ Support the Marvell EBU PIC interrupt controller.
config MVEBU_SEI
- bool
+ bool "Marvell EBU SEI interrupt controller" if COMPILE_TEST
+ depends on OF
+ depends on HAS_IOMEM
+ help
+ Support the Marvell EBU SEI interrupt controller.
config LS_EXTIRQ
bool "Freescale Layerscape external IRQ support" if COMPILE_TEST
diff --git a/drivers/irqchip/irq-mvebu-pic.c b/drivers/irqchip/irq-mvebu-pic.c
index 10b85128183a..95090d8efc06 100644
--- a/drivers/irqchip/irq-mvebu-pic.c
+++ b/drivers/irqchip/irq-mvebu-pic.c
@@ -24,7 +24,7 @@
#define PIC_MASK 0x4
#define PIC_MAX_IRQS 32
-#define PIC_MAX_IRQ_MASK ((1UL << PIC_MAX_IRQS) - 1)
+#define PIC_MAX_IRQ_MASK GENMASK(PIC_MAX_IRQS - 1, 0)
struct mvebu_pic {
void __iomem *base;
@@ -44,7 +44,7 @@ static void mvebu_pic_eoi_irq(struct irq_data *d)
{
struct mvebu_pic *pic = irq_data_get_irq_chip_data(d);
- writel(1 << d->hwirq, pic->base + PIC_CAUSE);
+ writel(BIT(d->hwirq), pic->base + PIC_CAUSE);
}
static void mvebu_pic_mask_irq(struct irq_data *d)
@@ -53,7 +53,7 @@ static void mvebu_pic_mask_irq(struct irq_data *d)
u32 reg;
reg = readl(pic->base + PIC_MASK);
- reg |= (1 << d->hwirq);
+ reg |= BIT(d->hwirq);
writel(reg, pic->base + PIC_MASK);
}
@@ -63,7 +63,7 @@ static void mvebu_pic_unmask_irq(struct irq_data *d)
u32 reg;
reg = readl(pic->base + PIC_MASK);
- reg &= ~(1 << d->hwirq);
+ reg &= ~BIT(d->hwirq);
writel(reg, pic->base + PIC_MASK);
}
--
2.54.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] irqchip/mvebu: Allow EBU irqchips to be compile-tested
2026-05-10 19:50 [PATCH] irqchip/mvebu: Allow EBU irqchips to be compile-tested Rosen Penev
@ 2026-05-11 13:45 ` Thomas Gleixner
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2026-05-11 13:45 UTC (permalink / raw)
To: Rosen Penev, linux-kernel
Cc: Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt,
moderated list:ARM/Marvell Kirkwood and Armada 370, 375, 38x,...,
open list:CLANG/LLVM BUILD SUPPORT:Keyword:b(?i:clang|llvm)b
On Sun, May 10 2026 at 12:50, Rosen Penev wrote:
> The Marvell EBU interrupt controller Kconfig symbols are hidden and
> selected only by platform code. This prevents build coverage for the
> drivers on other architectures even though the code only needs OF and
> MMIO support.
>
> Add COMPILE_TEST prompts and the required dependencies for the GICP,
> ICU, ODMI, PIC and SEI irqchips. While touching PIC for this coverage,
> use GENMASK() and BIT() for its masks so that 32-bit platforms can
> compile this safely without running into issues.
While touching PIC? That's related, but you want to prepare the PIC code
first in order to enable the compile test and not burry that change
within a gazillion lines of Kconfig muck.
> config MVEBU_GICP
> + bool "Marvell EBU GICP interrupt controller" if COMPILE_TEST
> + depends on OF
> + depends on HAS_IOMEM
depends on OF && HAS_IOMEM
> select IRQ_MSI_LIB
> - bool
> + help
> + Support the Marvell EBU GICP interrupt controller.
>
> config MVEBU_ICU
> - bool
> + bool "Marvell EBU ICU interrupt controller" if COMPILE_TEST
> + depends on OF
> + depends on HAS_IOMEM
> + select GENERIC_MSI_IRQ
> + help
> + Support the Marvell EBU ICU interrupt controller.
>
> config MVEBU_ODMI
> - bool
> + bool "Marvell EBU ODMI interrupt controller" if COMPILE_TEST
> + depends on OF
> + depends on HAS_IOMEM
> select IRQ_MSI_LIB
> select GENERIC_MSI_IRQ
So while at it you can mop up this too. IRQ_MSI_LIB already selects
GENERIC_MSI_IRQ
> + help
> + Support the Marvell EBU ODMI interrupt controller.
>
> config MVEBU_PIC
> - bool
> + bool "Marvell EBU PIC interrupt controller" if COMPILE_TEST
> + depends on OF
> + depends on HAS_IOMEM
> + help
> + Support the Marvell EBU PIC interrupt controller.
>
> config MVEBU_SEI
> - bool
> + bool "Marvell EBU SEI interrupt controller" if COMPILE_TEST
> + depends on OF
> + depends on HAS_IOMEM
> + help
> + Support the Marvell EBU SEI interrupt controller.
What ensures that IRQ_MSI_LIB is selected, when MVEBU_SEI is selected?
> config LS_EXTIRQ
> bool "Freescale Layerscape external IRQ support" if COMPILE_TEST
> diff --git a/drivers/irqchip/irq-mvebu-pic.c b/drivers/irqchip/irq-mvebu-pic.c
> index 10b85128183a..95090d8efc06 100644
> --- a/drivers/irqchip/irq-mvebu-pic.c
> +++ b/drivers/irqchip/irq-mvebu-pic.c
> @@ -24,7 +24,7 @@
> #define PIC_MASK 0x4
>
> #define PIC_MAX_IRQS 32
> -#define PIC_MAX_IRQ_MASK ((1UL << PIC_MAX_IRQS) - 1)
> +#define PIC_MAX_IRQ_MASK GENMASK(PIC_MAX_IRQS - 1, 0)
What guarantees that 'linux/bits.h' is included under all circumstances?
I'm really not impressed by this AI assisted slop at all.
Thanks,
tglx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-11 13:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-10 19:50 [PATCH] irqchip/mvebu: Allow EBU irqchips to be compile-tested Rosen Penev
2026-05-11 13:45 ` Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox