[Skiboot] [PATCH 3/6] flash: Fix 39d9e14 fail to erase flash before write
Cyril Bur
cyrilbur at gmail.com
Wed Jul 27 17:43:11 AEST 2016
On Tue, 26 Jul 2016 13:49:32 +1000
Cyril Bur <cyril.bur at au1.ibm.com> wrote:
> This causes NVRAM writes to flash on OpenPOWER platforms to be
> unreliable.
>
> Fixes: 39d9e14 ("libflash: start using the blocklevel interface.")
> Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
Hi, I was reviewing the 64bit blocklevel series from Mikey and I've realised
that libflash.c registers flash_smart_write() as the handler for
blocklevel_write(). This actually means there is no bug here,
flash_smart_write() does the same thing as blocklevel_smart_write().
I'm pretty sure this is the case because 39d9e14 ("libflash: start using the
blocklevel interface.") predates blocklevel being smart.
Is it time to move 'smarts' out of the backends and trust blocklevel to do both
ECC and pre write erasing?
Sorry for the noise
> ---
> Let me know if theres anything you need from me to put this in stable
>
> core/flash.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/core/flash.c b/core/flash.c
> index d3bda65..ca9cca7 100644
> --- a/core/flash.c
> +++ b/core/flash.c
> @@ -138,7 +138,7 @@ static int flash_nvram_write(uint32_t dst, void *src, uint32_t len)
> rc = OPAL_PARAMETER;
> goto out;
> }
> - rc = blocklevel_write(nvram_flash->bl, nvram_offset + dst, src, len);
> + rc = blocklevel_smart_write(nvram_flash->bl, nvram_offset + dst, src, len);
>
> out:
> unlock(&flash_lock);
More information about the Skiboot
mailing list