Re: [PATCH] irqchip: gic-v3: fix unmet dependency on ARM_PSCI_FW

Julian Braha <[email protected]>
Newsgroups dev.linux.lists.imx,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Hi Marc,

On 8/20/26 09:22, Marc Zyngier wrote:

> [+ 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__
>  
> 

Thank you for explaining. From my tests, your version resolves the unmet
dependency well and doesn't introduce others.

- Julian Braha
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.