net/sfc/base: precheck and verify flash writes
authorAndy Moreton <amoreton@solarflare.com>
Thu, 16 Nov 2017 08:04:00 +0000 (08:04 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jan 2018 17:47:49 +0000 (18:47 +0100)
commit38210840313caac070115ee3ce4e474193e758e9
tree3a7b9746f6177678bcbdb4f152ca76bd6c0e1b83
parent2620f47aa7a54ed21844355ef026b49b6f1e4255
net/sfc/base: precheck and verify flash writes

Read existing flash content before writing, so the flash write can be
avoided if the existing partition content matches the new image. This
avoids unnecessary write cycles for the flash device, and may also be
faster. If the flash does need to be updated, verify the content after
writing.

Note that reading the flash content after writing but before calling
efx_nvram-rw_finish() avoids firmware bug68170, which can lead to
signed image updates failing on Medford.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
drivers/net/sfc/base/ef10_impl.h
drivers/net/sfc/base/ef10_nvram.c
drivers/net/sfc/base/efx.h
drivers/net/sfc/base/efx_impl.h
drivers/net/sfc/base/efx_nvram.c