All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] cmd: pxe: Use internal FDT if retrieving from FDTDIR fails
Date: Tue, 3 Sep 2019 10:18:30 -0600	[thread overview]
Message-ID: <3ed343ac-7727-ff83-e271-5f1699098f7e@wwwdotorg.org> (raw)
In-Reply-To: <20190903075224.9404-1-scileont@gmail.com>

On 9/3/19 1:52 AM, Anton Leontiev wrote:
> From: Anton Leontiev <aleontiev@elvees.com>
> 
> As FDTDIR label doesn't specify exact file to be loaded, it should
> not fail if no file exists in the directory. In this case try to boot
> with internal FDT if it exists.
> 
> Signed-off-by: Anton Leontiev <aleontiev@elvees.com>
> ---
>   cmd/pxe.c | 21 ++++++++++++++-------
>   1 file changed, 14 insertions(+), 7 deletions(-)
> 
> diff --git a/cmd/pxe.c b/cmd/pxe.c
> index 2059975446..1eec6d29bf 100644
> --- a/cmd/pxe.c
> +++ b/cmd/pxe.c
> @@ -727,11 +727,14 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
>   
>   	/*
>   	 * fdt usage is optional:
> -	 * It handles the following scenarios. All scenarios are exclusive
> +	 * It handles the following scenarios.
>   	 *
> -	 * Scenario 1: If fdt_addr_r specified and "fdt" label is defined in
> -	 * pxe file, retrieve fdt blob from server. Pass fdt_addr_r to bootm,
> -	 * and adjust argc appropriately.
> +	 * Scenario 1: If fdt_addr_r specified and "fdt" or "fdtdir" label is
> +	 * defined in pxe file, retrieve fdt blob from server. Pass fdt_addr_r to
> +	 * bootm, and adjust argc appropriately.
> +	 *
> +	 * If retrieve fails and no exact fdt blob is specified in pxe file with
> +	 * "fdt" label, try Scenario 2.

Is it possible/sensible to distinguish between "file not found" and 
"error during retrieval"? "File not found" indicates the case you care 
about, and continuing to use a built-in DT makes sense here. "Error 
during retrieval" indicates that the file was found, and hence really 
should be use, yet couldn't be due to download failure. In this case, I 
wonder if we shouldn't outright fail this boot option, just like the 
existing code does?

But either way, I suppose this patch is reasonable.

>   	 * Scenario 2: If there is an fdt_addr specified, pass it along to
>   	 * bootm, and adjust argc appropriately.
> @@ -795,9 +798,13 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
>   			int err = get_relfile_envaddr(cmdtp, fdtfile, "fdt_addr_r");
>   			free(fdtfilefree);
>   			if (err < 0) {
> -				printf("Skipping %s for failure retrieving fdt\n",
> -						label->name);
> -				goto cleanup;
> +				bootm_argv[3] = NULL;
> +
> +				if (label->fdt) {
> +					printf("Skipping %s for failure retrieving FDT\n",
> +					       label->name);
> +					goto cleanup;
> +				}
>   			}
>   		} else {
>   			bootm_argv[3] = NULL;
> 

  reply	other threads:[~2019-09-03 16:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23 14:40 [U-Boot] [PATCH] cmd: pxe: Use internal FDT if external one cannot be retrieved Anton Leontiev
2019-08-26 15:59 ` Stephen Warren
2019-08-29 11:20   ` Anton Leontiev
2019-08-29 20:35     ` Stephen Warren
2019-08-31 19:52       ` Anton Leontiev
2019-09-03 16:16         ` Stephen Warren
2019-09-03  7:52 ` [U-Boot] [PATCH v2] cmd: pxe: Use internal FDT if retrieving from FDTDIR fails Anton Leontiev
2019-09-03 16:18   ` Stephen Warren [this message]
2019-09-17  6:07     ` Anton Leontiev
2019-10-15  5:59   ` Anton Leontiev
2020-12-02 21:21   ` Tom Rini

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=3ed343ac-7727-ff83-e271-5f1699098f7e@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --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.