From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Sat, 26 Jan 2019 22:53:05 -0500 Subject: [U-Boot] [U-Boot, 1/2] env: common: Return specific error code on bad CRC In-Reply-To: <20190118191904.634-2-semen.protsenko@linaro.org> References: <20190118191904.634-2-semen.protsenko@linaro.org> Message-ID: <20190127035305.GA6906@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, Jan 18, 2019 at 09:19:03PM +0200, Sam Protsenko wrote: > Callers of env_import*() functions might want to check the case when we > have incorrect environment (with bad CRC). For example, when environment > location is being defined in env_load(), call chain may look like this: > > env_load() -> drv->load() = env_mmc_load() -> env_import() > > Return code will be passed from env_import() all way up to env_load(). > Right now both env_mmc_load() and env_import() return -EIO error code, > so env_load() can't differentiate between two cases: > 1. Driver reports the error, because device is not accessible > 2. Device is actually accessible, but environment is broken > > Let's return -ENOMSG in env_import(), so we can distinguish two cases > mentioned above. It will make it possible to continue working with "bad > CRC" environment (like doing "env save"), instead of considering it not > functional (implemented in subsequent patch). > > Signed-off-by: Sam Protsenko > Reviewed-by: Simon Goldschmidt Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: