[Skiboot] [PATCH 3/4] hw/occ: Tidy code and add error message

Nicholas Piggin npiggin at gmail.com
Mon Nov 18 00:33:48 AEDT 2024


The POWER10 init case is just a duplicate of POWER9 for now, so
consolidate it. Add an error message for unknown response type.

Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
 hw/occ.c | 51 +--------------------------------------------------
 1 file changed, 1 insertion(+), 50 deletions(-)

diff --git a/hw/occ.c b/hw/occ.c
index 0a02d8368..f7d8241c4 100644
--- a/hw/occ.c
+++ b/hw/occ.c
@@ -446,56 +446,6 @@ static bool wait_for_all_occ_init(void)
 			break;
 
 		case 0x90:
-			/*
-			 * OCC-OPAL interface version 0x90 has a
-			 * dynamic data section.  This has an
-			 * occ_state field whose values inform about
-			 * the state of the OCC.
-			 *
-			 * 0x00 = OCC not running. No communication
-			 *        allowed.
-			 *
-			 * 0x01 = Standby. No communication allowed.
-			 *
-			 * 0x02 = Observation State. Communication
-			 *        allowed and is command dependent.
-			 *
-			 * 0x03 = Active State. Communication allowed
-			 *        and is command dependent.
-			 *
-			 * 0x04 = Safe State. No communication
-			 *        allowed. Just like CPU throttle
-			 *        status, some failures will not allow
-			 *        for OCC to update state to safe.
-			 *
-			 * 0x05 = Characterization State.
-			 *        Communication allowed and is command
-			 *        dependent.
-			 *
-			 * We will error out if OCC is not in the
-			 * Active State.
-			 *
-			 * XXX : Should we error out only if no
-			 *       communication is allowed with the
-			 *       OCC ?
-			 */
-			occ_dyn_data = get_occ_dynamic_data(chip);
-			if (occ_dyn_data->occ_state != 0x3) {
-				/**
-				 * @fwts-label OCCInactive
-				 * @fwts-advice The OCC for a chip was not active.
-				 * This means that CPU frequency scaling will
-				 * not be functional. CPU may be set to a low,
-				 * safe frequency. This means that CPU idle
-				 * states and CPU frequency scaling may not be
-				 * functional.
-				 */
-				prlog(PR_ERR, "OCC: Chip: %x: OCC not active\n",
-				      chip->id);
-				return false;
-			}
-			break;
-
 		case 0xA0:
 			/*
 			 * OCC-OPAL interface version 0x90 has a
@@ -1423,6 +1373,7 @@ static int read_occ_rsp(struct occ_response_buffer *rsp)
 		prlog(PR_DEBUG, "OCC: Rsp status: OCC internal error\n");
 		break;
 	default:
+		prlog(PR_WARNING, "OCC: Rsp status: Unknown 0x%x\n", rsp->status);
 		break;
 	}
 
-- 
2.45.2



More information about the Skiboot mailing list