All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Michal Simek <michal.simek@xilinx.com>
Cc: arm-soc <arm@kernel.org>, Rajan Vaja <rajan.vaja@xilinx.com>,
	Jolly Shah <jolly.shah@xilinx.com>,
	Tejas Patel <tejas.patel@xilinx.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drivers: soc: xilinx: fix firmware driver Kconfig dependency
Date: Thu, 9 Apr 2020 11:09:39 +0200	[thread overview]
Message-ID: <CAK8P3a3j7BLJZGsNFU2XLsnnBiP0x+qkPVxD0-L9Faq7+m2=BQ@mail.gmail.com> (raw)
In-Reply-To: <69e8b684-c314-d356-bf3e-e38676d07853@xilinx.com>

On Thu, Apr 9, 2020 at 8:37 AM Michal Simek <michal.simek@xilinx.com> wrote:
>
> On 08. 04. 20 17:52, Arnd Bergmann wrote:
> > The firmware driver is optional, but the power driver depends on it,
> > which needs to be reflected in Kconfig to avoid link errors:
> >
> > aarch64-linux-ld: drivers/soc/xilinx/zynqmp_power.o: in function `zynqmp_pm_isr':
> > zynqmp_power.c:(.text+0x284): undefined reference to `zynqmp_pm_invoke_fn'
> >
> > The firmware driver can probably be allowed for compile-testing as
> > well, so it's best to drop the dependency on the ZYNQ platform
> > here and allow building as long as the firmware code is built-in.
> >
> > Fixes: ab272643d723 ("drivers: soc: xilinx: Add ZynqMP PM driver")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  drivers/soc/xilinx/Kconfig | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/soc/xilinx/Kconfig b/drivers/soc/xilinx/Kconfig
> > index 223f1f9d0922..646512d7276f 100644
> > --- a/drivers/soc/xilinx/Kconfig
> > +++ b/drivers/soc/xilinx/Kconfig
> > @@ -19,7 +19,7 @@ config XILINX_VCU
> >
> >  config ZYNQMP_POWER
> >       bool "Enable Xilinx Zynq MPSoC Power Management driver"
> > -     depends on PM && ARCH_ZYNQMP
> > +     depends on PM && ZYNQMP_FIRMWARE
> >       default y
> >       select MAILBOX
> >       select ZYNQMP_IPI_MBOX
> > @@ -35,7 +35,7 @@ config ZYNQMP_POWER
> >  config ZYNQMP_PM_DOMAINS
> >       bool "Enable Zynq MPSoC generic PM domains"
> >       default y
> > -     depends on PM && ARCH_ZYNQMP && ZYNQMP_FIRMWARE
> > +     depends on PM && ZYNQMP_FIRMWARE
> >       select PM_GENERIC_DOMAINS
> >       help
> >         Say yes to enable device power management through PM domains
> >
>
> The same issue is likely with others drivers dependencies too which
> depends on ARCH_ZYNQMP.
>
> It means all drivers which includes "linux/firmware/xlnx-zynqmp.h" and
> call zynqmp_pm_get_eemi_ops() should depend on ZYNQMP_FIRMWARE instead
> of ARCH_ZYNQMP.

The only one I see that has a hard dependency on ARCH_ZYNQMP
without allowing compile-testing at the moment is drivers/edac/synopsys_edac.c
but that doesn't use the firmware interface.

What I see in the header are declarations for exported functions:

int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1,
                        u32 arg2, u32 arg3, u32 *ret_payload);
#if IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE)
const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void);
#else
static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
{
        return ERR_PTR(-ENODEV);
}
#endif

The second one already allows compile-testing by turning into an
inline stub, but zynqmp_pm_invoke_fn() does not, and this is the
one causing the problem here.

I still think my patch is a good fix for that issue, but if you want to
handle both interfaces the same way, we can also do that, either
removing the stub and using a proper dependency, or using
the same stub trick for both.

      Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Michal Simek <michal.simek@xilinx.com>
Cc: Tejas Patel <tejas.patel@xilinx.com>,
	Rajan Vaja <rajan.vaja@xilinx.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	arm-soc <arm@kernel.org>, Jolly Shah <jolly.shah@xilinx.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] drivers: soc: xilinx: fix firmware driver Kconfig dependency
Date: Thu, 9 Apr 2020 11:09:39 +0200	[thread overview]
Message-ID: <CAK8P3a3j7BLJZGsNFU2XLsnnBiP0x+qkPVxD0-L9Faq7+m2=BQ@mail.gmail.com> (raw)
In-Reply-To: <69e8b684-c314-d356-bf3e-e38676d07853@xilinx.com>

On Thu, Apr 9, 2020 at 8:37 AM Michal Simek <michal.simek@xilinx.com> wrote:
>
> On 08. 04. 20 17:52, Arnd Bergmann wrote:
> > The firmware driver is optional, but the power driver depends on it,
> > which needs to be reflected in Kconfig to avoid link errors:
> >
> > aarch64-linux-ld: drivers/soc/xilinx/zynqmp_power.o: in function `zynqmp_pm_isr':
> > zynqmp_power.c:(.text+0x284): undefined reference to `zynqmp_pm_invoke_fn'
> >
> > The firmware driver can probably be allowed for compile-testing as
> > well, so it's best to drop the dependency on the ZYNQ platform
> > here and allow building as long as the firmware code is built-in.
> >
> > Fixes: ab272643d723 ("drivers: soc: xilinx: Add ZynqMP PM driver")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  drivers/soc/xilinx/Kconfig | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/soc/xilinx/Kconfig b/drivers/soc/xilinx/Kconfig
> > index 223f1f9d0922..646512d7276f 100644
> > --- a/drivers/soc/xilinx/Kconfig
> > +++ b/drivers/soc/xilinx/Kconfig
> > @@ -19,7 +19,7 @@ config XILINX_VCU
> >
> >  config ZYNQMP_POWER
> >       bool "Enable Xilinx Zynq MPSoC Power Management driver"
> > -     depends on PM && ARCH_ZYNQMP
> > +     depends on PM && ZYNQMP_FIRMWARE
> >       default y
> >       select MAILBOX
> >       select ZYNQMP_IPI_MBOX
> > @@ -35,7 +35,7 @@ config ZYNQMP_POWER
> >  config ZYNQMP_PM_DOMAINS
> >       bool "Enable Zynq MPSoC generic PM domains"
> >       default y
> > -     depends on PM && ARCH_ZYNQMP && ZYNQMP_FIRMWARE
> > +     depends on PM && ZYNQMP_FIRMWARE
> >       select PM_GENERIC_DOMAINS
> >       help
> >         Say yes to enable device power management through PM domains
> >
>
> The same issue is likely with others drivers dependencies too which
> depends on ARCH_ZYNQMP.
>
> It means all drivers which includes "linux/firmware/xlnx-zynqmp.h" and
> call zynqmp_pm_get_eemi_ops() should depend on ZYNQMP_FIRMWARE instead
> of ARCH_ZYNQMP.

The only one I see that has a hard dependency on ARCH_ZYNQMP
without allowing compile-testing at the moment is drivers/edac/synopsys_edac.c
but that doesn't use the firmware interface.

What I see in the header are declarations for exported functions:

int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1,
                        u32 arg2, u32 arg3, u32 *ret_payload);
#if IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE)
const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void);
#else
static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
{
        return ERR_PTR(-ENODEV);
}
#endif

The second one already allows compile-testing by turning into an
inline stub, but zynqmp_pm_invoke_fn() does not, and this is the
one causing the problem here.

I still think my patch is a good fix for that issue, but if you want to
handle both interfaces the same way, we can also do that, either
removing the stub and using a proper dependency, or using
the same stub trick for both.

      Arnd

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

  reply	other threads:[~2020-04-09  9:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08 15:52 [PATCH] drivers: soc: xilinx: fix firmware driver Kconfig dependency Arnd Bergmann
2020-04-08 15:52 ` Arnd Bergmann
2020-04-09  6:37 ` Michal Simek
2020-04-09  6:37   ` Michal Simek
2020-04-09  9:09   ` Arnd Bergmann [this message]
2020-04-09  9:09     ` Arnd Bergmann
2020-04-09 10:43     ` Michal Simek
2020-04-09 10:43       ` Michal Simek
2020-04-15  6:16       ` Michal Simek
2020-04-15  6:16         ` Michal Simek

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='CAK8P3a3j7BLJZGsNFU2XLsnnBiP0x+qkPVxD0-L9Faq7+m2=BQ@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=arm@kernel.org \
    --cc=jolly.shah@xilinx.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=rajan.vaja@xilinx.com \
    --cc=tejas.patel@xilinx.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.