Skip to contentSkip to conversation

powerpc/powernv: Pass buffer size to OPAL validate flash call

PATCH New Vasant Hegde 1 participant 1 message Jun 5, 2014 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/powernv: Pass buffer size to OPAL validate flash call

We pass actual buffer size to opal_validate_flash() OPAL API call and in return it contains output buffer size.

Commit cc146d1d (Fix little endian issues) missed to set the size param before making OPAL call. So firmware image validation fails.

This patch sets size variable before making OPAL call.

---
 arch/powerpc/platforms/powernv/opal-flash.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/platforms/powernv/opal-flash.c +2 -1
index dc487ff..4e541e6 100644
@@ -130,7 +130,8 @@ static inline void opal_flash_validate(void)
 {
 	long ret;
 	void *buf = validate_flash_data.buf;
-	__be32 size, result;
+	__be32 size = cpu_to_be32(validate_flash_data.buf_size);
+	__be32 result;
 
 	ret = opal_validate_flash(__pa(buf), &size, &result);