From 737c9b6258c6e68714ae264ff36126eb5d382d6a Mon Sep 17 00:00:00 2001 From: Øyvind Harboe Date: Wed, 5 May 2010 15:08:34 +0200 Subject: flash: stop caching protection state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are a million reasons why cached protection state might be stale: power cycling of target, reset, code executing on the target, etc. The "flash protect_check" command is now gone. This is *always* executed when running a "flash info". As a bonus for more a more robust approach, lots of code could be deleted. Signed-off-by: Øyvind Harboe --- src/flash/nor/cfi.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/flash/nor/cfi.c') diff --git a/src/flash/nor/cfi.c b/src/flash/nor/cfi.c index 92b553b5..4ef41b9a 100644 --- a/src/flash/nor/cfi.c +++ b/src/flash/nor/cfi.c @@ -852,6 +852,17 @@ static int cfi_intel_protect(struct flash_bank *bank, int set, int first, int la */ if ((!set) && (!(pri_ext->feature_support & 0x20))) { + /* FIX!!! this code path is broken!!! + * + * The correct approach is: + * + * 1. read out current protection status + * + * 2. override read out protection status w/unprotected. + * + * 3. re-protect what should be protected. + * + */ for (i = 0; i < bank->num_sectors; i++) { if (bank->sectors[i].is_protected == 1) -- cgit v1.2.3-18-g5258