lkml.org 
[lkml]   [2021]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] firmware: qcom_scm: Only compile legacy calls on ARM
On Thu, Apr 01, 2021 at 11:58:48PM -0700, Stephen Boyd wrote:
> Quoting Elliot Berman (2021-04-01 18:12:14)
> >
> > It might be a good idea to wrap these lines from qcom_scm_call with #if
> > IS_ENABLED(CONFIG_ARM), and the corresponding ones in qcom_scm_call_atomic:
> >
> > case SMC_CONVENTION_LEGACY:
> > return scm_legacy_call(dev, desc, res);
> >
> > If something is wrong with loaded firmware and LEGACY convention is
> > incorrectly selected, you would get a better hint about the problem:
> > "Unknown current SCM calling convention." You would still get the hint
> > earlier from __get_convention, but that may not be obvious to someone
> > unfamiliar with the SCM driver.
> >
> > I'll defer to your/Bjorn's preference:
> >
> > Acked-by: Elliot Berman <eberman@codeaurora.org>
> >
> > with or without modifying qcom_scm_call{_atomic}.
> >
>
> Maybe it would be better to catch that problem at the source and force
> arm64 calling convention to be safe? I'm thinking of this patch, but it
> could be even more fine tuned and probably the sc7180 check could be
> removed in the process if the rest of this email makes sense.
>
> If I understand correctly CONFIG_ARM64=y should never use legacy
> convention (and never the 32-bit one either?), so we can figure that out
> pretty easily and just force it to use 64-bit if the architecture is
> arm64. If only the 64-bit convention is supported on arm64 then we
> really don't even need to call into the firmware to figure it out on
> arm64. We can do this convention detection stuff on arm32 (CONFIG_ARM)
> and always assume 64-bit convention on CONFIG_ARM64. Is that right?
>

No, the detection is also needed on ARM64. On ARM32 there can be either
legacy or SMC32, but on ARM64 there can be either SMC32 or SMC64.
You cannot use SMC64 on 32-bit, but you can use SMC32 on ARM64 just
fine. SMC32 is used on MSM8916 for example.

Stephan

\
 
 \ /
  Last update: 2021-04-02 12:24    [W:0.079 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site