aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2016-04-01 14:43:18 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-04-01 14:43:18 +1100
commitd597168a0ea6958955a2a2fc845354059fd057c2 (patch)
treebdcbb0896d947f0bdd224f8a18c37edcf1c3a69b /core
parent482e8addf97b6f749b772eb0a99e9f2b6cb5faff (diff)
parent2636009a779160fa0f67cc0ccf19fe0fb0737115 (diff)
downloadskiboot-d597168a0ea6958955a2a2fc845354059fd057c2.zip
skiboot-d597168a0ea6958955a2a2fc845354059fd057c2.tar.gz
skiboot-d597168a0ea6958955a2a2fc845354059fd057c2.tar.bz2
Merge branch 'skiboot-5.1.x' into skiboot-5.2.x - partial HMI fix
Diffstat (limited to 'core')
-rw-r--r--core/hmi.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/core/hmi.c b/core/hmi.c
index 5d8020a..1817ab1 100644
--- a/core/hmi.c
+++ b/core/hmi.c
@@ -219,7 +219,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)
@@ -232,16 +232,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)