All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Michael Walle <michael@walle.cc>
Cc: u-boot@lists.denx.de, Vladimir Oltean <vladimir.oltean@nxp.com>,
	Hou Zhiqiang <Zhiqiang.Hou@nxp.com>,
	Bharat Gooty <bharat.gooty@broadcom.com>,
	Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>,
	Simon Glass <sjg@chromium.org>,
	Priyanka Jain <priyanka.jain@nxp.com>,
	Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH 2/2] Revert "arch: arm: use dt and UCLASS_SYSCON to get gic lpi details"
Date: Fri, 29 Oct 2021 13:00:28 +0100	[thread overview]
Message-ID: <87ilxg9h2b.wl-maz@kernel.org> (raw)
In-Reply-To: <9ecafe6c05395d5e382a91c292362e0b@walle.cc>

Michael,

On Fri, 29 Oct 2021 12:49:21 +0100,
Michael Walle <michael@walle.cc> wrote:
> 
> Hi,
> 
> thanks for the review, as Tom already mentioned this is just
> a revert. I'm still unsure wether I should care or not. Actually,
> NXP or Broadcom should. OTOH it would be nice if the kontron_sl28
> can do kexec also with booti (and not just bootefi). Anyway, I
> still have some remarks.
> 
> Am 2021-10-28 23:09, schrieb Marc Zyngier:
> > On Wed, 27 Oct 2021 17:54:54 +0100,
> > Michael Walle <michael@walle.cc> wrote:
> >> 
> >> Stop using the device tree as a source for ad-hoc information.
> >> 
> >> This reverts commit 2ae7adc659f7fca9ea65df4318e5bca2b8274310.
> >> 
> >> Signed-off-by: Michael Walle <michael@walle.cc>
> >> ---
> 
> >>  int ls_gic_rd_tables_init(void *blob)
> >>  {
> >> +	u64 gic_lpi_base;
> >>  	int ret;
> >> 
> >> -	ret = gic_lpi_tables_init();
> >> +	gic_lpi_base = ALIGN(gd->arch.resv_ram - GIC_LPI_SIZE, SZ_64K);
> >> +	ret = fdt_add_resv_mem_gic_rd_tables(blob, gic_lpi_base,
> >> GIC_LPI_SIZE);
> >> +	if (ret)
> >> +		return ret;
> >> +
> >> +	ret = gic_lpi_tables_init(gic_lpi_base, cpu_numcores());
> > 
> > This really should fetch the number of CPUs from the DT rather then
> > some SoC specific black magic...
> 
> Remember that this is the bootloader. There might be a chicken egg
> problem. I guess, usually the bootloader will fixup the number of cores
> in the DT. Therefore, if we rely on the DT here, it has to be fixed up
> before this code is run.

I appreciate that. However...

> 
> Conceptually, I'm unsure if this should actually be a driver
> (UCLASS_IRQ). It's just setting up the interrupt controller, it doesn't
> provide any ops. So it might well be called from somewhere else instead
> of binding as a driver to the gic.
> 
> If it will be a driver, then the call to gic_lpi_tables_init() should
> go away. Instead the driver should just set the tables up.
> 
> If its not a driver, then gic_lpi_tables_init() (maybe renamed to
> gic_v3_lpi_tables_init()) should work without anything else and
> it should scan the device tree for the compatible node and fetch
> all needed information to set up the tables.

Exactly. This thing doesn't provide *any* service to u-boot itself. It
just grabs some memory, point a couple of registers at it, and flip a
bit. There is no actual ITS driver, so nothing makes use of it.

So this can be run as late as you want, long after you have worked out
how many CPUs you really have. Which means this can be done in a
SoC-agnostic way.

> In any case, all this code should be guarded by a Kconfig option which
> clearly states *why* this is needed.

Even more: if it is selected, it should be possible to disable this at
runtime (environment variable?) and leave the OS in charge of it. This
really should an opt-in, instead of being forced on the users.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2021-10-29 12:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 16:54 [PATCH 0/2] arch: arm: gic-v3-its: stop abusing the device tree Michael Walle
2021-10-27 16:54 ` [PATCH 1/2] Revert "arm64: Layerscape: Survive LPI one-way reset workaround" Michael Walle
2021-10-28 21:11   ` Marc Zyngier
2021-10-31 16:23   ` Tom Rini
2021-10-27 16:54 ` [PATCH 2/2] Revert "arch: arm: use dt and UCLASS_SYSCON to get gic lpi details" Michael Walle
2021-10-28 21:09   ` Marc Zyngier
2021-10-28 21:35     ` Tom Rini
2021-10-29 11:49     ` Michael Walle
2021-10-29 12:00       ` Marc Zyngier [this message]
2021-10-31 16:45     ` Z.Q. Hou
2021-10-31 16:58       ` Michael Walle
2021-11-01  9:38       ` Marc Zyngier
2021-10-31 16:24   ` Tom Rini
2021-10-28  9:01 ` [PATCH 0/2] arch: arm: gic-v3-its: stop abusing the device tree Marc Zyngier
2021-10-28  9:20   ` Bharat Gooty
2021-10-28  9:49     ` Marc Zyngier
2021-10-28 10:27       ` Bharat Gooty
2021-10-28 14:39         ` Marc Zyngier
2021-10-28 11:21     ` Michael Walle
2021-10-28 11:35       ` Bharat Gooty
2021-10-28 12:09         ` Michael Walle
2021-10-28 14:42       ` Marc Zyngier
2021-10-28 12:31   ` Tom Rini
2021-10-28 13:38     ` Marc Zyngier
2021-10-28 13:51       ` Tom Rini
2021-10-28 22:36 ` Simon Glass
2021-10-29 11:54   ` Michael Walle
2021-10-29 21:17     ` Simon Glass

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=87ilxg9h2b.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=Zhiqiang.Hou@nxp.com \
    --cc=bharat.gooty@broadcom.com \
    --cc=michael@walle.cc \
    --cc=priyanka.jain@nxp.com \
    --cc=rayagonda.kokatanur@broadcom.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vladimir.oltean@nxp.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.