From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukasz Majewski Date: Thu, 28 Dec 2017 15:25:58 +0100 Subject: [U-Boot] [PATCH 7/9] spl: Restart loading if load_image returns -EAGAIN In-Reply-To: <20171228120621.4039-8-marex@denx.de> References: <20171228120621.4039-1-marex@denx.de> <20171228120621.4039-8-marex@denx.de> Message-ID: <20171228152558.06af77ad@jawa> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Marek, > If the loader->load_image returns -EAGAIN, it is an indication > the loading process should restart the loading, possible due to > DTO being applied on the U-Boot's DT. Restart the loading until > the loader stops returning -EAGAIN. > > Signed-off-by: Marek Vasut > Cc: Pantelis Antoniou > Cc: Simon Glass > --- > common/spl/spl.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/common/spl/spl.c b/common/spl/spl.c > index 2444abbb08..27f44c27b0 100644 > --- a/common/spl/spl.c > +++ b/common/spl/spl.c > @@ -413,11 +413,16 @@ static int spl_load_image(struct spl_image_info > *spl_image, struct spl_image_loader *loader) > { > struct spl_boot_device bootdev; > + int ret; > > bootdev.boot_device = loader->boot_device; > bootdev.boot_device_name = NULL; > > - return loader->load_image(spl_image, &bootdev); > + do { > + ret = loader->load_image(spl_image, &bootdev); > + } while (ret == -EAGAIN); Maybe it would be good to have some counter or timeout (although, I doubt if any timer is set properly so early) to give the user some information if we fail? > + > + return ret; > } > > /** Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: