Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] irqchip: gic-v3: fix unmet dependency on ARM_PSCI_FW
@ 2026-08-23 18:08 Julian Braha
  2026-08-24 16:07 ` Marc Zyngier
  0 siblings, 1 reply; 3+ messages in thread
From: Julian Braha @ 2026-08-23 18:08 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, maz, sudeep.holla,
	mark.rutland, lpieralisi, Julian Braha

ARM_GIC_V3 currently selects HAVE_ARM_SMCCC_DISCOVERY without ensuring its
dependency, ARM_PSCI_FW, is met. However, ARM_PSCI_FW is always enabled on
for arm64, and the GICv3 driver only uses HAVE_ARM_SMCCC_DISCOVERY to
identify the NVIDIA T241, which is arm64 anyway.

Also adds fallbacks for callers to avoid needing #ifdef guards when
HAVE_ARM_SMCCC_DISCOVERY is disabled (32bit arm).

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

Fixes: 35727af2b15d ("irqchip/gicv3: Workaround for NVIDIA erratum T241-FABRIC-4")
Suggested-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Julian Braha <julianbraha@gmail.com>
---
Changes since v1:
- remove select and dependency on ARM_PSCI_FW, 
- make the HAVE_ARM_SMCCC_DISCOVERY 'select' conditional on arm64
Link to v1: https://lore.kernel.org/all/20260801212235.2692694-1-julianbraha@gmail.com/
---
 drivers/irqchip/Kconfig   | 2 +-
 include/linux/arm-smccc.h | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index 20b77fbc51ee..dae023fed7d6 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 4de81848fe2e..248624c1af7c 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__
 
-- 
2.55.0



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

* Re: [PATCH v2] irqchip: gic-v3: fix unmet dependency on ARM_PSCI_FW
  2026-08-23 18:08 [PATCH v2] irqchip: gic-v3: fix unmet dependency on ARM_PSCI_FW Julian Braha
@ 2026-08-24 16:07 ` Marc Zyngier
  2026-08-24 19:00   ` Julian Braha
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Zyngier @ 2026-08-24 16:07 UTC (permalink / raw)
  To: Julian Braha
  Cc: florian.fainelli, rjui, sbranden, linux, tglx, Frank.Li, s.hauer,
	bcm-kernel-feedback-list, radu, kernel, festevam,
	linux-arm-kernel, linux-kernel, imx, arnd, sudeep.holla,
	mark.rutland, lpieralisi

On Sun, 23 Aug 2026 19:08:32 +0100,
Julian Braha <julianbraha@gmail.com> wrote:
> 
> ARM_GIC_V3 currently selects HAVE_ARM_SMCCC_DISCOVERY without ensuring its
> dependency, ARM_PSCI_FW, is met. However, ARM_PSCI_FW is always enabled on
> for arm64, and the GICv3 driver only uses HAVE_ARM_SMCCC_DISCOVERY to
> identify the NVIDIA T241, which is arm64 anyway.
> 
> Also adds fallbacks for callers to avoid needing #ifdef guards when
> HAVE_ARM_SMCCC_DISCOVERY is disabled (32bit arm).

What does this 'Also' tell you? That this part is in the wrong patch.

This should be split in two different patches, fixing different
problems.  One to allow graceful fallback of the SMCCC_DISCOVERY stuff
when it isn't selected, and another to only force the selection of
that option on arm64 when GICv3 is selected.

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

I'm not sure this is massively relevant here, but since the trend is
to turn commit messages into advertising billboards...

	M.

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


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

* Re: [PATCH v2] irqchip: gic-v3: fix unmet dependency on ARM_PSCI_FW
  2026-08-24 16:07 ` Marc Zyngier
@ 2026-08-24 19:00   ` Julian Braha
  0 siblings, 0 replies; 3+ messages in thread
From: Julian Braha @ 2026-08-24 19:00 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: florian.fainelli, rjui, sbranden, linux, tglx, Frank.Li, s.hauer,
	bcm-kernel-feedback-list, radu, kernel, festevam,
	linux-arm-kernel, linux-kernel, imx, arnd, sudeep.holla,
	mark.rutland, lpieralisi

Hi Marc,

On 8/24/26 17:07, Marc Zyngier wrote:
> On Sun, 23 Aug 2026 19:08:32 +0100,
> Julian Braha <julianbraha@gmail.com> wrote:
>>
>> ARM_GIC_V3 currently selects HAVE_ARM_SMCCC_DISCOVERY without ensuring its
>> dependency, ARM_PSCI_FW, is met. However, ARM_PSCI_FW is always enabled on
>> for arm64, and the GICv3 driver only uses HAVE_ARM_SMCCC_DISCOVERY to
>> identify the NVIDIA T241, which is arm64 anyway.
>>
>> Also adds fallbacks for callers to avoid needing #ifdef guards when
>> HAVE_ARM_SMCCC_DISCOVERY is disabled (32bit arm).
> 
> What does this 'Also' tell you? That this part is in the wrong patch.
> 
> This should be split in two different patches, fixing different
> problems.  One to allow graceful fallback of the SMCCC_DISCOVERY stuff
> when it isn't selected, and another to only force the selection of
> that option on arm64 when GICv3 is selected.
> 

Thank you for reviewing, will split out these changes.

- Julian Braha



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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-23 18:08 [PATCH v2] irqchip: gic-v3: fix unmet dependency on ARM_PSCI_FW Julian Braha
2026-08-24 16:07 ` Marc Zyngier
2026-08-24 19:00   ` Julian Braha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox