diff mbox series

[1/2] firmware: smccc: Stub out get_conduit()

Message ID ab0476382e3342161beda94a45ddadb49b026dcd.1747760015.git.robin.murphy@arm.com
State New
Headers show
Series [1/2] firmware: smccc: Stub out get_conduit() | expand

Commit Message

Robin Murphy May 20, 2025, 5:10 p.m. UTC
Various callers use arm_smccc_1_1_get_conduit() to guard their
arm_smccc_smc() calls - since the latter is already stubbed out to
support optional usage in !HAVE_ARM_SMCCC configs, do the equivalent
for the former as well to make life easier.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 include/linux/arm-smccc.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Ulf Hansson May 21, 2025, 11:28 a.m. UTC | #1
On Tue, 20 May 2025 at 19:10, Robin Murphy <robin.murphy@arm.com> wrote:
>
> Various callers use arm_smccc_1_1_get_conduit() to guard their
> arm_smccc_smc() calls - since the latter is already stubbed out to
> support optional usage in !HAVE_ARM_SMCCC configs, do the equivalent
> for the former as well to make life easier.
>
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  include/linux/arm-smccc.h | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
> index a3863da1510e..97dc4d47c664 100644
> --- a/include/linux/arm-smccc.h
> +++ b/include/linux/arm-smccc.h
> @@ -315,7 +315,14 @@ enum arm_smccc_conduit {
>   *
>   * When SMCCCv1.1 is not present, returns SMCCC_CONDUIT_NONE.
>   */
> +#ifdef CONFIG_HAVE_ARM_SMCCC_DISCOVERY
>  enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void);
> +#else
> +static inline enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void)
> +{
> +       return SMCCC_CONDUIT_NONE;
> +}
> +#endif
>
>  /**
>   * arm_smccc_get_version()
> --
> 2.39.2.101.g768bb238c484.dirty
>
>
Robin Murphy May 21, 2025, 11:57 a.m. UTC | #2
On 2025-05-21 12:41 pm, Ulf Hansson wrote:
> On Tue, 20 May 2025 at 20:38, Heiko Stuebner <heiko@sntech.de> wrote:
>>
>> Am Dienstag, 20. Mai 2025, 19:10:17 Mitteleuropäische Sommerzeit schrieb Robin Murphy:
>>> Most 32-bit Rockchip platforms do not use PSCI, so having to select
>>> ARM_PSCI to satisfy a dependency chain to retain working power domain
>>> support is a bit weird and non-obvious. Now that the offending SMCCC API
>>> is properly stubbed out for optional usage, we can relax this again.
>>>
>>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
>>
>>
>> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
>>
>> Of course this needs patch1 of this series to get applied
>> first.
>>
>> I think for bisectability, doing this directly in patch1 might
>> be less dangerous though?
>>
> 
> If it helps, I can pick both patches via my pmdomain tree, to make
> sure patch1 really gets applied prior to patch2.

Perhaps I should have been less lazy and written a brief cover letter, 
but indeed, given the dependency my hope was for these to both go 
together through the same tree - it's just an open question of which 
tree that should be :)

Cheers,
Robin.

> Mark, Sudeep, Lorenzo do you see any problems with this?
> 
> [...]
> 
> Kind regards
> Uffe
diff mbox series

Patch

diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
index a3863da1510e..97dc4d47c664 100644
--- a/include/linux/arm-smccc.h
+++ b/include/linux/arm-smccc.h
@@ -315,7 +315,14 @@  enum arm_smccc_conduit {
  *
  * When SMCCCv1.1 is not present, returns SMCCC_CONDUIT_NONE.
  */
+#ifdef CONFIG_HAVE_ARM_SMCCC_DISCOVERY
 enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void);
+#else
+static inline enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void)
+{
+	return SMCCC_CONDUIT_NONE;
+}
+#endif
 
 /**
  * arm_smccc_get_version()