All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wasim Khan <wasim.khan@nxp.com>
To: u-boot@lists.denx.de
Subject: [PATCHv2 3/9] board: lx2160a: Don't program the GIC RD tables if failed to reserve memory
Date: Tue, 21 Apr 2020 07:28:54 +0000	[thread overview]
Message-ID: <VE1PR04MB670241769B3B5362F68129C290D50@VE1PR04MB6702.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20200324081209.48449-4-Zhiqiang.Hou@nxp.com>



> -----Original Message-----
> From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Zhiqiang Hou
> Sent: Tuesday, March 24, 2020 1:42 PM
> To: u-boot at lists.denx.de; Priyanka Jain <priyanka.jain@nxp.com>; Biwen Li
> <biwen.li@nxp.com>
> Cc: Z.q. Hou <zhiqiang.hou@nxp.com>
> Subject: [PATCHv2 3/9] board: lx2160a: Don't program the GIC RD tables if failed
> to reserve memory
> 
> From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
> 
> Program the GIC redistributor tables only when succeeded to reserve memory
> for them, otherwise kernel will lose the chance to program them using allocated
> memory.
> 
> Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
> ---
> V2:
>  - The #4 of v1 patchset.
> 
>  board/freescale/lx2160a/lx2160a.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/board/freescale/lx2160a/lx2160a.c
> b/board/freescale/lx2160a/lx2160a.c
> index 595c774b42..7f22110dc6 100644
> --- a/board/freescale/lx2160a/lx2160a.c
> +++ b/board/freescale/lx2160a/lx2160a.c
> @@ -657,6 +657,7 @@ int ft_board_setup(void *blob, bd_t *bd)
>  	u64 mc_memory_size = 0;
>  	u16 total_memory_banks;
>  	u64 gic_lpi_base;
> +	int ret;
> 
>  	ft_cpu_setup(blob, bd);
> 
> @@ -678,8 +679,9 @@ int ft_board_setup(void *blob, bd_t *bd)
> 
>  #ifdef CONFIG_GIC_V3_ITS
>  	gic_lpi_base = gd->arch.resv_ram - GIC_LPI_SIZE;
> -	gic_lpi_tables_init(gic_lpi_base, cpu_numcores());
> -	fdt_fixup_gic_lpi_memory(blob, gic_lpi_base);
> +	ret = fdt_fixup_gic_lpi_memory(blob, gic_lpi_base);
> +	if (!ret && gic_lpi_tables_init(gic_lpi_base, cpu_numcores()))
> +		debug("%s: failed to init gic-lpi-tables\n", __func__);

Currently till this point, fdt_fixup_gic_lpi_memory return type is void , you may first you need to change fdt_fixup_gic_lpi_memory() to return something and then you can check for the errors. 
OR, no need for this patch, as in your later patches you are already doing error checking . 

>  #endif
> 
>  #ifdef CONFIG_RESV_RAM
> --
> 2.17.1

  reply	other threads:[~2020-04-21  7:28 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24  8:12 [PATCHv2 0/9] fsl: layerscape: Initialize the GIC redistributor Zhiqiang Hou
2020-03-24  8:12 ` [PATCHv2 1/9] board: lx2160a: Add header file cpu_func.h Zhiqiang Hou
2020-04-21  5:40   ` Wasim Khan
2020-04-25  8:18     ` Z.q. Hou
2020-03-24  8:12 ` [PATCHv2 2/9] arm64: fsl-layerscape: Assign addr to resv_ram if enabled RESV_RAM config Zhiqiang Hou
2020-04-15 10:27   ` Priyanka Jain
2020-04-15 14:39     ` Z.q. Hou
2020-04-21  7:27   ` Wasim Khan
2020-04-25  8:26     ` Z.q. Hou
2020-03-24  8:12 ` [PATCHv2 3/9] board: lx2160a: Don't program the GIC RD tables if failed to reserve memory Zhiqiang Hou
2020-04-21  7:28   ` Wasim Khan [this message]
2020-04-25  8:38     ` Z.q. Hou
2020-03-24  8:12 ` [PATCHv2 4/9] board: lx2160a: Make sure the RD tables address align to 64KB Zhiqiang Hou
2020-04-21  7:38   ` Wasim Khan
2020-04-25  8:39     ` Z.q. Hou
2020-04-25  8:40     ` Z.q. Hou
2020-03-24  8:12 ` [PATCHv2 5/9] fsl-layerscape: Kconfig: Select RESV_RAM config if GIC_V3_ITS is enabled Zhiqiang Hou
2020-04-21  7:34   ` Wasim Khan
2020-04-25  8:40     ` Z.q. Hou
2020-03-24  8:12 ` [PATCHv2 6/9] arm64: layerscape: Move GIC RD tables initialization to CPU setup function Zhiqiang Hou
2020-04-21  7:39   ` Wasim Khan
2020-04-25  8:41     ` Z.q. Hou
2020-03-24  8:12 ` [PATCHv2 7/9] configs: ls1088a: Enable GIC_V3_ITS config Zhiqiang Hou
2020-04-21  7:40   ` Wasim Khan
2020-04-25  8:41     ` Z.q. Hou
2020-03-24  8:12 ` [PATCHv2 8/9] configs: ls1028a: " Zhiqiang Hou
2020-04-21  8:02   ` Wasim Khan
2020-04-25  8:42     ` Z.q. Hou
2020-03-24  8:12 ` [PATCHv2 9/9] configs: ls208xa: " Zhiqiang Hou
2020-04-21  7:41   ` Wasim Khan
2020-04-25  8:42     ` Z.q. Hou

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=VE1PR04MB670241769B3B5362F68129C290D50@VE1PR04MB6702.eurprd04.prod.outlook.com \
    --to=wasim.khan@nxp.com \
    --cc=u-boot@lists.denx.de \
    /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.