Skip to contentSkip to conversation

ppc/pnv: PNOR cleanups

PATCH Applied Cédric Le Goater 3 participants 5 messages Jan 8, 2020 – Jan 9, 2020

lore
Share & tools
lore
#0 lore raw

cover ppc/pnv: PNOR cleanups

Hello,

Here are small cleanups of the PnvPNOR model.

Thanks,

C.

Cédric Le Goater (2):
ppc/pnv: use QEMU unit definition MiB
ppc/pnv: improve error logging when a PNOR update fails

 hw/ppc/pnv_pnor.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
2.21.1
#1 lore raw

PATCH 1/2 ppc/pnv: use QEMU unit definition MiB

---
 hw/ppc/pnv_pnor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/ppc/pnv_pnor.c +2 -1
index b061106d1c0c..08ea3e381f2b 100644
@@ -11,6 +11,7 @@
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/log.h"
+#include "qemu/units.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "hw/loader.h"
@@ -111,7 +112,7 @@ static void pnv_pnor_realize(DeviceState *dev, Error **errp)
 }
 
 static Property pnv_pnor_properties[] = {
-    DEFINE_PROP_INT64("size", PnvPnor, size, 128 << 20),
+    DEFINE_PROP_INT64("size", PnvPnor, size, 128 * MiB),
     DEFINE_PROP_DRIVE("drive", PnvPnor, blk),
     DEFINE_PROP_END_OF_LIST(),
 };
Signature · 1 line
2.21.1
#2 lore raw

PATCH 2/2 ppc/pnv: improve error logging when a PNOR update fails

In reply to Cédric Le Goater

Print out the offset at which the error occured.

---
 hw/ppc/pnv_pnor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/ppc/pnv_pnor.c +2 -1
index 08ea3e381f2b..2ab35b797b58 100644
@@ -47,7 +47,8 @@ static void pnv_pnor_update(PnvPnor *s, int offset, int size)
     ret = blk_pwrite(s->blk, offset, s->storage + offset,
                      offset_end - offset, 0);
     if (ret < 0) {
-        error_report("Could not update PNOR: %s", strerror(-ret));
+        error_report("Could not update PNOR offset=0x%" PRIx32" : %s", offset,
+                     strerror(-ret));
     }
 }
 
Signature · 1 line
2.21.1
Reviewed-by on the v1 series
#3 lore raw
In reply to Cédric Le Goater
Quoted 6 lines · Cédric Le Goater

Hello,

Here are small cleanups of the PnvPNOR model.

Thanks,

Quoted 8 lines

C.

Cédric Le Goater (2):
ppc/pnv: use QEMU unit definition MiB
ppc/pnv: improve error logging when a PNOR update fails

  hw/ppc/pnv_pnor.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)

Thanks for the respin.

Series:

Applied
#4 lore raw
In reply to Cédric Le Goater
Quoted 3 lines · Cédric Le Goater

Hello,

Here are small cleanups of the PnvPNOR model.

Applied to ppc-for-5.0, thanks.

Quoted 12 lines

Thanks,

C.

Cédric Le Goater (2):
ppc/pnv: use QEMU unit definition MiB
ppc/pnv: improve error logging when a PNOR update fails

 hw/ppc/pnv_pnor.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson