diff mbox series

hw/fsp: Fix GENERIC_FAILURE mailbox status code

Message ID 20200305065200.12009-1-oohall@gmail.com
State Accepted
Headers show
Series hw/fsp: Fix GENERIC_FAILURE mailbox status code | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (82aed17a5468aff6b600ee1694a10a60f942c018)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Oliver O'Halloran March 5, 2020, 6:52 a.m. UTC
The 0xEF return code is used to tell the hypervisor that the FSP was not
able to replicate an NVRAM write to the secondary FSP. The GENERIC_FAILURE
is using this code instead of the correct 0xFE code which indicates a
generic error condition.

We already have a FSP_STATUS_GENERIC_ERROR for 0xFE so convert the
existing users of FSP_STATUS_GENERIC_FAILURE to use GENERIC_ERROR
and remove the duplicate.

Cc: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 hw/prd.c                         | 4 ++--
 include/fsp.h                    | 3 +--
 platforms/ibm-fsp/hostservices.c | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

Comments

Vasant Hegde March 9, 2020, 3:44 p.m. UTC | #1
On 3/5/20 12:22 PM, Oliver O'Halloran wrote:
> The 0xEF return code is used to tell the hypervisor that the FSP was not
> able to replicate an NVRAM write to the secondary FSP. The GENERIC_FAILURE
> is using this code instead of the correct 0xFE code which indicates a
> generic error condition.
> 
> We already have a FSP_STATUS_GENERIC_ERROR for 0xFE so convert the
> existing users of FSP_STATUS_GENERIC_FAILURE to use GENERIC_ERROR
> and remove the duplicate.
> 
> Cc: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>

-Vasant
Oliver O'Halloran March 30, 2020, 6:32 a.m. UTC | #2
On Thu, Mar 5, 2020 at 5:52 PM Oliver O'Halloran <oohall@gmail.com> wrote:
>
> The 0xEF return code is used to tell the hypervisor that the FSP was not
> able to replicate an NVRAM write to the secondary FSP. The GENERIC_FAILURE
> is using this code instead of the correct 0xFE code which indicates a
> generic error condition.
>
> We already have a FSP_STATUS_GENERIC_ERROR for 0xFE so convert the
> existing users of FSP_STATUS_GENERIC_FAILURE to use GENERIC_ERROR
> and remove the duplicate.
>
> Cc: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

Merged as b776bb0fa86b31873007c7e4f677dfb7a70e54d2
diff mbox series

Patch

diff --git a/hw/prd.c b/hw/prd.c
index 2301dafd0c9f..a119b92cc716 100644
--- a/hw/prd.c
+++ b/hw/prd.c
@@ -119,7 +119,7 @@  static void prd_msg_consumed(void *data, int status)
 		if (status != 0) {
 			prlog(PR_DEBUG,
 			      "PRD: Failed to send FSP -> HBRT message\n");
-			notify_status = FSP_STATUS_GENERIC_FAILURE;
+			notify_status = FSP_STATUS_GENERIC_ERROR;
 		}
 		assert(platform.prd);
 		assert(platform.prd->msg_response);
@@ -372,7 +372,7 @@  int prd_hbrt_fsp_msg_notify(void *data, u32 dsize)
 {
 	struct prd_fw_msg *fw_notify;
 	int size, fw_notify_size;
-	int rc = FSP_STATUS_GENERIC_FAILURE;
+	int rc = FSP_STATUS_GENERIC_ERROR;
 
 	if (!prd_enabled || !prd_active) {
 		prlog(PR_NOTICE, "PRD: %s: PRD daemon is not ready\n",
diff --git a/include/fsp.h b/include/fsp.h
index 92f5459a5cd6..ec079a27461f 100644
--- a/include/fsp.h
+++ b/include/fsp.h
@@ -46,7 +46,6 @@ 
 #define FSP_STATUS_FLASH_INPROGRESS	0x61
 #define FSP_STATUS_FLASH_NOPROGRESS	0x62
 #define FSP_STATUS_FLASH_INVALID_SIDE	0x63
-#define FSP_STATUS_GENERIC_ERROR	0xfe
 #define FSP_STATUS_EOF_ERROR		0x02
 #define FSP_STATUS_DMA_ERROR		0x24
 #define FSP_STATUS_BUSY			0x3e
@@ -61,7 +60,7 @@ 
 #define FSP_STATUS_TOD_PERMANENT_ERROR	0xAF	/* Permanent error in TOD */
 #define FSP_STATUS_I2C_TRANS_ERROR	0xE4	/* I2C device / transmission error */
 #define FSP_STATUS_IND_PARTIAL_SUCCESS	0xE5	/* Indicator partial success */
-#define FSP_STATUS_GENERIC_FAILURE	0xEF	/* Generic Failure in execution */
+#define FSP_STATUS_GENERIC_ERROR	0xFE    /* Generic Failure in execution */
 
 /*
  * FSP registers
diff --git a/platforms/ibm-fsp/hostservices.c b/platforms/ibm-fsp/hostservices.c
index d93c4f6e6b5c..d61d58378268 100644
--- a/platforms/ibm-fsp/hostservices.c
+++ b/platforms/ibm-fsp/hostservices.c
@@ -883,7 +883,7 @@  static bool hservice_hbrt_msg_notify(uint32_t cmd_sub_mod, struct fsp_msg *msg)
 	}
 
 	if (prd_hbrt_fsp_msg_notify(buf, len)) {
-		hservice_hbrt_msg_response(FSP_STATUS_GENERIC_FAILURE);
+		hservice_hbrt_msg_response(FSP_STATUS_GENERIC_ERROR);
 		prlog(PR_NOTICE, "Unable to send FSP - HBRT message\n");
 	}