[Skiboot] [PATCH] hdat: fix parsing of P8 hdat

Stewart Smith stewart at linux.vnet.ibm.com
Mon Sep 18 12:25:23 AEST 2017


Also fixes hdat_to_dt test cases.

Fixes: ad484081ef8a51811e7902aec436fa8f1ca9604a
Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 hdata/iohub.c      | 7 ++-----
 hdata/test/stubs.c | 2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/hdata/iohub.c b/hdata/iohub.c
index 567ab5971231..4c4178da2d35 100644
--- a/hdata/iohub.c
+++ b/hdata/iohub.c
@@ -798,8 +798,6 @@ static void io_parse_slots(const void *sp_iohubs, int hub_id)
 	const struct slot_map_entry *entry;
 	unsigned int i, count;
 
-	dt_slots = get_slot_node();
-
 	ioslot_arr = HDIF_child_arr(sp_iohubs, CECHUB_CHILD_IOSLOTS);
 	if (!ioslot_arr)
 		return;
@@ -808,6 +806,8 @@ static void io_parse_slots(const void *sp_iohubs, int hub_id)
 	if (!count)
 		return;
 
+	dt_slots = get_slot_node();
+
 	prlog(PR_DEBUG, "CEC: Found slot map for IOHUB %d\n", hub_id);
 	if (count > 1)
 		prerror("CEC: Multiple IOSLOTs found for IO HUB %d\n", hub_id);
@@ -846,9 +846,6 @@ static void io_parse_fru(const void *sp_iohubs)
 		unsigned int size, hub_id;
 		uint32_t chip_id;
 
-		if(i > 0)
-			break;
-
 		hub = HDIF_get_iarray_item(sp_iohubs, CECHUB_FRU_IO_HUBS,
 					   i, &size);
 		if (!hub || size < CECHUB_IOHUB_MIN_SIZE) {
diff --git a/hdata/test/stubs.c b/hdata/test/stubs.c
index cb166f97516c..abeb832d2abc 100644
--- a/hdata/test/stubs.c
+++ b/hdata/test/stubs.c
@@ -97,7 +97,6 @@ STUB(op_display);
 STUB(fsp_preload_lid);
 STUB(fsp_wait_lid_loaded);
 STUB(fsp_adjust_lid_side);
-STUB(backtrace);
 
 /* Add HW specific stubs here */
 static bool true_stub(void) { return true; }
@@ -117,4 +116,5 @@ NOOP_STUB(mem_reserve_fw);
 NOOP_STUB(mem_reserve_hwbuf);
 NOOP_STUB(add_chip_dev_associativity);
 NOOP_STUB(enable_mambo_console);
+NOOP_STUB(backtrace);
 
-- 
2.13.5



More information about the Skiboot mailing list