aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>2016-03-22 15:49:27 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-04-01 14:18:24 +1100
commit2636009a779160fa0f67cc0ccf19fe0fb0737115 (patch)
treec630af4f01aef136a8e2959cf6d0050e1074cf82
parent8ab4e5fa6b9c65b32d945fbe0eca32211a17023b (diff)
downloadskiboot-2636009a779160fa0f67cc0ccf19fe0fb0737115.zip
skiboot-2636009a779160fa0f67cc0ccf19fe0fb0737115.tar.gz
skiboot-2636009a779160fa0f67cc0ccf19fe0fb0737115.tar.bz2
hmi: Fix a bug where partial hmi event was reported to host.
The current code sends partial hmi event (4 * 64bits instead of 5 * 64bits) to host. The last 64 bits contains chip id/pir info for reporting checkstop events. This bug affects only checkstop events. Host console o/p without this patch: [ 305.628283] Fatal Hypervisor Maintenance interrupt [Not recovered] [ 305.628341] Error detail: Malfunction Alert [ 305.628388] HMER: 8040000000000000 [ 305.628423] CPU PIR: 00000000 [ 305.628458] [Unit: VSU] Logic core check stop Host console o/p with this patch: [ 200.122883] Fatal Hypervisor Maintenance interrupt [Not recovered] [ 200.122941] Error detail: Malfunction Alert [ 200.122986] HMER: 8040000000000000 [ 200.123021] CPU PIR: 000008e8 [ 200.123055] [Unit: VSU] Logic core check stop Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--core/hmi.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/core/hmi.c b/core/hmi.c
index d2cca90..a934438 100644
--- a/core/hmi.c
+++ b/core/hmi.c
@@ -217,7 +217,7 @@ static struct lock hmi_lock = LOCK_UNLOCKED;
static int queue_hmi_event(struct OpalHMIEvent *hmi_evt, int recover)
{
- uint64_t *hmi_data;
+ size_t num_params;
/* Don't queue up event if recover == -1 */
if (recover == -1)
@@ -230,16 +230,17 @@ static int queue_hmi_event(struct OpalHMIEvent *hmi_evt, int recover)
hmi_evt->disposition = OpalHMI_DISPOSITION_NOT_RECOVERED;
/*
- * V2 of struct OpalHMIEvent is of (4 * 64 bits) size and well packed
+ * V2 of struct OpalHMIEvent is of (5 * 64 bits) size and well packed
* structure. Hence use uint64_t pointer to pass entire structure
- * using 4 params in generic message format.
+ * using 5 params in generic message format. Instead of hard coding
+ * num_params divide the struct size by 8 bytes to get exact
+ * num_params value.
*/
- hmi_data = (uint64_t *)hmi_evt;
+ num_params = ALIGN_UP(sizeof(*hmi_evt), sizeof(u64)) / sizeof(u64);
/* queue up for delivery to host. */
- return opal_queue_msg(OPAL_MSG_HMI_EVT, NULL, NULL,
- hmi_data[0], hmi_data[1], hmi_data[2],
- hmi_data[3]);
+ return _opal_queue_msg(OPAL_MSG_HMI_EVT, NULL, NULL,
+ num_params, (uint64_t *)hmi_evt);
}
static int is_capp_recoverable(int chip_id)