[Skiboot] [PATCH 2/5] external/common: arm: Don't error trying to wrprotect with MTD access

Cyril Bur cyril.bur at au1.ibm.com
Fri Oct 21 19:52:43 AEDT 2016


If the access method to the flash is PNOR_MTD or BMC_MTD then the
actual access is being done for us by the kernel. This means we don't
need to worry about wrprotecting. The arch level shouldn't be returning
an error, it should be fall though.

Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
Hi Stewart,

So this is the 'bug' I mentioned we may want to backport. OpenBMC are
going to want patch 5/5 of this series so they'll get this for free, I
don't see the point of backporting it for them. I don't know of anyone
else building this code from stable releases.


 external/common/arch_flash_arm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/external/common/arch_flash_arm.c b/external/common/arch_flash_arm.c
index 4e71dd9..0776436 100644
--- a/external/common/arch_flash_arm.c
+++ b/external/common/arch_flash_arm.c
@@ -324,6 +324,9 @@ int arch_flash_set_wrprotect(struct blocklevel_device *bl, int set)
 	if (!arch_data.init_bl || arch_data.init_bl != bl)
 		return -1;
 
+	if (arch_data.access == PNOR_MTD || arch_data.access == BMC_MTD)
+		return 0; /* Kernel looks after this for us */
+
 	if (!arch_data.flash_chip)
 		return -1;
 
-- 
2.10.0



More information about the Skiboot mailing list