All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] irqchip: gic-v3: fix unmet dependency on ARM_PSCI_FW
@ 2026-08-01 21:22 Julian Braha
  2026-08-19 19:05 ` Thomas Gleixner
  0 siblings, 1 reply; 3+ messages in thread
From: Julian Braha @ 2026-08-01 21:22 UTC (permalink / raw)
  To: florian.fainelli, rjui, sbranden, linux, tglx, Frank.Li, s.hauer
  Cc: bcm-kernel-feedback-list, radu, kernel, festevam,
	linux-arm-kernel, linux-kernel, imx, arnd, Julian Braha

ARM_GIC_V3 selects HAVE_ARM_SMCCC_DISCOVERY without ensuring its
dependency, ARM_PSCI_FW is met. However, ARM_PSCI_FW should be
selected by the system type, so ARM_GIC_V3 should depend on ARM_PSCI_FW.

Additionally, the systems that select ARM_GIC_V3 (ARCH_BRCMSTB and
SOC_IMX8M) need to select its dependency, ARM_PSCI_FW, too.

This unmet dependency was found by kconfirm, a static analysis tool for
Kconfig.

Fixes: 35727af2b15d ("irqchip/gicv3: Workaround for NVIDIA erratum T241-FABRIC-4")
Signed-off-by: Julian Braha <julianbraha@gmail.com>
---
 arch/arm/mach-bcm/Kconfig | 1 +
 drivers/irqchip/Kconfig   | 1 +
 drivers/soc/imx/Kconfig   | 1 +
 3 files changed, 3 insertions(+)

diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
index 24bc6e18d806..ff7c161df1f1 100644
--- a/arch/arm/mach-bcm/Kconfig
+++ b/arch/arm/mach-bcm/Kconfig
@@ -184,6 +184,7 @@ config ARCH_BRCMSTB
 	depends on ARCH_MULTI_V7
 	select ARCH_HAS_RESET_CONTROLLER
 	select ARM_AMBA
+	select ARM_PSCI_FW
 	select ARM_GIC
 	select ARM_GIC_V3
 	select ARM_ERRATA_798181 if SMP
diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index 20b77fbc51ee..726804295545 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -35,6 +35,7 @@ config GIC_NON_BANKED
 
 config ARM_GIC_V3
 	bool
+	depends on ARM_PSCI_FW
 	select IRQ_DOMAIN_HIERARCHY
 	select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
 	select HAVE_ARM_SMCCC_DISCOVERY
diff --git a/drivers/soc/imx/Kconfig b/drivers/soc/imx/Kconfig
index 2a90ddd20104..9f0be8b66c4f 100644
--- a/drivers/soc/imx/Kconfig
+++ b/drivers/soc/imx/Kconfig
@@ -6,6 +6,7 @@ config SOC_IMX8M
 	depends on ARCH_MXC || COMPILE_TEST
 	default ARCH_MXC && ARM64
 	select SOC_BUS
+	select ARM_PSCI_FW if ARCH_MXC && ARCH_MULTI_V7
 	select ARM_GIC_V3 if ARCH_MXC && ARCH_MULTI_V7
 	help
 	  If you say yes here you get support for the NXP i.MX8M family
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] irqchip: gic-v3: fix unmet dependency on ARM_PSCI_FW
  2026-08-01 21:22 [PATCH] irqchip: gic-v3: fix unmet dependency on ARM_PSCI_FW Julian Braha
@ 2026-08-19 19:05 ` Thomas Gleixner
  2026-08-20  8:22   ` Marc Zyngier
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2026-08-19 19:05 UTC (permalink / raw)
  To: Julian Braha, florian.fainelli, rjui, sbranden, linux, Frank.Li,
	s.hauer
  Cc: bcm-kernel-feedback-list, radu, kernel, festevam,
	linux-arm-kernel, linux-kernel, imx, arnd, Julian Braha,
	Marc Zyngier

On Sat, Aug 01 2026 at 22:22, Julian Braha wrote:

> ARM_GIC_V3 selects HAVE_ARM_SMCCC_DISCOVERY without ensuring its
> dependency, ARM_PSCI_FW is met. However, ARM_PSCI_FW should be
> selected by the system type, so ARM_GIC_V3 should depend on ARM_PSCI_FW.
>
> Additionally, the systems that select ARM_GIC_V3 (ARCH_BRCMSTB and
> SOC_IMX8M) need to select its dependency, ARM_PSCI_FW, too.
>
> This unmet dependency was found by kconfirm, a static analysis tool for
> Kconfig.

Marc?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] irqchip: gic-v3: fix unmet dependency on ARM_PSCI_FW
  2026-08-19 19:05 ` Thomas Gleixner
@ 2026-08-20  8:22   ` Marc Zyngier
  0 siblings, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2026-08-20  8:22 UTC (permalink / raw)
  To: Julian Braha, Thomas Gleixner
  Cc: florian.fainelli, rjui, sbranden, linux, Frank.Li, s.hauer,
	bcm-kernel-feedback-list, radu, kernel, festevam,
	linux-arm-kernel, linux-kernel, imx, arnd, Sudeep Holla,
	Mark Rutland, Lorenzo Pieralisi

On Wed, 19 Aug 2026 20:05:55 +0100,
Thomas Gleixner <tglx@kernel.org> wrote:
> 
> On Sat, Aug 01 2026 at 22:22, Julian Braha wrote:
> 
> > ARM_GIC_V3 selects HAVE_ARM_SMCCC_DISCOVERY without ensuring its
> > dependency, ARM_PSCI_FW is met. However, ARM_PSCI_FW should be
> > selected by the system type, so ARM_GIC_V3 should depend on ARM_PSCI_FW.
> >
> > Additionally, the systems that select ARM_GIC_V3 (ARCH_BRCMSTB and
> > SOC_IMX8M) need to select its dependency, ARM_PSCI_FW, too.
> >
> > This unmet dependency was found by kconfirm, a static analysis tool for
> > Kconfig.
> 
> Marc?
> 

[+ SMCCC folks]

Thanks for roping me in.

This looks like the wrong fix altogether. Whatever the Broadcom stuff
depends on is irrelevant, and has nothing to do with GICv3. Same thing
for the NXP contraptions.

If there is something to do *for the GIC driver*, it is to make sure
it compiles/links correctly when the platform does not select options
that are not required. Why would NXP and Broadcom care about an
erratum that is specific to NVIDIA?

I also disagree with what the commit message asserts, ARM_PSCI_FW is
selected *globally* on arm64, not on a per platform basis (TFFT!).
The NVIDIA machine being an arm64 platform, the correct dependency fix
is to select HAVE_ARM_SMCCC_DISCOVERY on arm64.

The overall issue is that there is no fallback to do something
sensible when HAVE_ARM_SMCCC_DISCOVERY is not selected. Random drivers
should not have to guess or add random #ifdefs all over the shop.

I came up with the following hack, which compiles correctly on 32bit
ARM without PSCI at all. YMMV.

Thanks,

	M.

diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index 42f2278a702d0..937f17ec93a2e 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -37,7 +37,7 @@ config ARM_GIC_V3
 	bool
 	select IRQ_DOMAIN_HIERARCHY
 	select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
-	select HAVE_ARM_SMCCC_DISCOVERY
+	select HAVE_ARM_SMCCC_DISCOVERY if ARM64
 	select IRQ_MSI_IOMMU
 
 config ARM_GIC_ITS_PARENT
diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
index 4de81848fe2ee..75f9d3f1723b5 100644
--- a/include/linux/arm-smccc.h
+++ b/include/linux/arm-smccc.h
@@ -324,6 +324,7 @@ enum arm_smccc_conduit {
 	SMCCC_CONDUIT_HVC,
 };
 
+#ifdef CONFIG_HAVE_ARM_SMCCC_DISCOVERY
 /**
  * arm_smccc_1_1_get_conduit()
  *
@@ -363,6 +364,12 @@ s32 arm_smccc_get_soc_id_version(void);
  * When ARM_SMCCC_ARCH_SOC_ID is not present, returns SMCCC_RET_NOT_SUPPORTED.
  */
 s32 arm_smccc_get_soc_id_revision(void);
+#else   /* CONFIG_HAVE_ARM_SMCCC_DISCOVERY */
+#define arm_smccc_1_1_get_conduit()	SMCCC_CONDUIT_NONE
+#define arm_smccc_get_version()		0
+#define arm_smccc_get_soc_id_version()	SMCCC_RET_NOT_SUPPORTED
+#define arm_smccc_get_soc_id_revision()	SMCCC_RET_NOT_SUPPORTED
+#endif	/* CONFIG_HAVE_ARM_SMCCC_DISCOVERY */
 
 #ifndef __ASSEMBLY__
 

-- 
Jazz isn't dead. It just smells funny.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-20  8:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-01 21:22 [PATCH] irqchip: gic-v3: fix unmet dependency on ARM_PSCI_FW Julian Braha
2026-08-19 19:05 ` Thomas Gleixner
2026-08-20  8:22   ` Marc Zyngier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.