linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Rob Herring <robh@kernel.org>, kbuild test robot <lkp@intel.com>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	Catalin Marinas <catalin.marinas@arm.com>,
	"Andrew F . Davis" <afd@ti.com>, Marc Zyngier <maz@kernel.org>,
	Russell King <rmk+kernel@arm.linux.org.uk>,
	linux-omap <linux-omap@vger.kernel.org>,
	Will Deacon <will@kernel.org>,
	Steven Price <steven.price@arm.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set
Date: Fri, 21 Feb 2020 12:15:42 -0800	[thread overview]
Message-ID: <20200221201542.GB37466@atomide.com> (raw)
In-Reply-To: <CAK8P3a2C6EV0En1hGuFxCRGzgf2t3-5DAPDUDQc5BmGHm1-t9w@mail.gmail.com>

* Arnd Bergmann <arnd@arndb.de> [200221 20:06]:
> On Fri, Feb 21, 2020 at 7:09 PM Tony Lindgren <tony@atomide.com> wrote:
> >
> > Recent omap changes added runtime checks to use omap_smccc_smc()
> > when optee is configured in dts. As the omap-secure code can be
> > built for ARMv6 only without ARMv7 and use custom smc calls, we
> > now get a build error:
> >
> > omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc'
> >
> > Let's just ifdef out omap_smccc_smc() unless the CPU has selected
> > CONFIG_HAVE_ARM_SMCCC. The other option discussed was to add an
> > inline function to arm-smccc.h, but we'd still also have to add
> > ifdef around omap_smccc_smc() to avoid a warning for uninitialized
> > value for struct arm_smccc_res in omap_smccc_smc(). And we probably
> > should not start initializing values in arm-smccc.h if disabled.
> >
> > Let's also warn on trying to use omap_smccc_smc() if disabled as
> > suggested by Andrew F. Davis <afd@ti.com>.
> >
> > +#ifdef CONFIG_HAVE_ARM_SMCCC
> >  void omap_smccc_smc(u32 fn, u32 arg)
> >  {
> >         struct arm_smccc_res res;
> > @@ -85,6 +86,12 @@ void omap_smccc_smc(u32 fn, u32 arg)
> >                       0, 0, 0, 0, 0, 0, &res);
> >         WARN(res.a0, "Secure function call 0x%08x failed\n", fn);
> >  }
> > +#else
> 
> Looking through the callers again, this can and is only called
> for ARMv7 CPUs, so can't you just avoid the #else path and
> turn it into a link error if we ever get callers on ARMv6-only builds?

Hmm yeah maybe. If ARMv6 machines (basically n8x0) is not using
omap-smc.S at all, it's unlike it would need omap-secure.c either.

Regards,

Tony

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-02-21 20:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21 18:09 [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set Tony Lindgren
2020-02-21 18:23 ` Andrew F. Davis
2020-02-21 20:05 ` Arnd Bergmann
2020-02-21 20:15   ` Tony Lindgren [this message]
2020-02-26 15:57     ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2020-02-26 15:57 Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200221201542.GB37466@atomide.com \
    --to=tony@atomide.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=afd@ti.com \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=maz@kernel.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=robh@kernel.org \
    --cc=steven.price@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).