[Skiboot] [PATCH] PHB3: Fix wrong PE number in error injection

Gavin Shan gwshan at linux.vnet.ibm.com
Wed Sep 23 16:44:14 AEST 2015


We disallow to inject error to reserved PE#, which is 255 instead
of 0 on PHB3. Otherwise, error OPAL_PARAM is returned when injecting
error to PE#0.

This fixes above issue by checking against the correct PE number 255.

Reported-by: Pradeep Ramanna <pramann2 at in.ibm.com>
Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>
---
 hw/phb3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/phb3.c b/hw/phb3.c
index 5fd0130..49b8e92 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -3057,8 +3057,8 @@ static int64_t phb3_err_inject(struct phb *phb, uint32_t pe_no,
 	if (!p->tbl_rtt)
 		return OPAL_HARDWARE;
 
-	/* We can't inject error to the reserved PE#0 */
-	if (pe_no == 0x0 || pe_no >= PHB3_MAX_PE_NUM)
+	/* We can't inject error to the reserved PE */
+	if (pe_no == PHB3_RESERVED_PE_NUM || pe_no >= PHB3_MAX_PE_NUM)
 		return OPAL_PARAMETER;
 
 	/* Clear leftover from last time */
-- 
2.1.0



More information about the Skiboot mailing list