[Skiboot] [PATCH] hw/imc: Fix opal_imc_counters_* return for unknown type

Madhavan Srinivasan maddy at linux.vnet.ibm.com
Wed Jan 9 19:20:30 AEDT 2019


Commit 7801be0fcf2a2 ('skiboot: Add opal calls to init/start/stop IMC devices')
added opal_imc_counters_* calls to program and control the In-Memory
Collection(IMC) counter feature of the Power9 system. These opal calls
take "type" as input parameter to differentiate the device or domain to
work with. Even though, is_imc_device_type_supported() and
check_imc_device_type() is called at boot to remove any unknown imc
devices in the device tree, it is still better to return "OPAL_PARAMETER"
in the opal_imc_counters_* for any unknown type value passed.

Fixes: 7801be0fcf2a2 ('skiboot: Add opal calls to init/start/stop IMC devices')
Signed-off-by: Madhavan Srinivasan <maddy at linux.vnet.ibm.com>
---
 hw/imc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/imc.c b/hw/imc.c
index 3392eaf10f19..0d7942f369ba 100644
--- a/hw/imc.c
+++ b/hw/imc.c
@@ -740,7 +740,7 @@ static int64_t opal_imc_counters_init(uint32_t type, uint64_t addr, uint64_t cpu
 		return OPAL_SUCCESS;
 	}
 
-	return OPAL_SUCCESS;
+	return OPAL_PARAMETER;
 }
 opal_call(OPAL_IMC_COUNTERS_INIT, opal_imc_counters_init, 3);
 
@@ -800,7 +800,7 @@ static int64_t opal_imc_counters_start(uint32_t type, uint64_t cpu_pir)
 		return OPAL_SUCCESS;
 	}
 
-	return OPAL_SUCCESS;
+	return OPAL_PARAMETER;
 }
 opal_call(OPAL_IMC_COUNTERS_START, opal_imc_counters_start, 2);
 
@@ -859,6 +859,6 @@ static int64_t opal_imc_counters_stop(uint32_t type, uint64_t cpu_pir)
 		return OPAL_SUCCESS;
 	}
 
-	return OPAL_SUCCESS;
+	return OPAL_PARAMETER;
 }
 opal_call(OPAL_IMC_COUNTERS_STOP, opal_imc_counters_stop, 2);
-- 
2.7.4



More information about the Skiboot mailing list