Skip to content

Commit

Permalink
powerpc/powernv: Fix the hmi event version check.
Browse files Browse the repository at this point in the history
The current HMI event structure is an ABI and carries a version field to
accommodate future changes without affecting/rearranging current structure
members that are valid for previous versions.

The current version check "if (hmi_evt->version != OpalHMIEvt_V1)"
doesn't accomodate the fact that the version number may change in
future.

If firmware starts returning an HMI event with version > 1, this check
will fail and no HMI information will be printed on older kernels.

This patch fixes this issue.

Cc: stable@vger.kernel.org # 3.17+
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
[mpe: Reword changelog]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Mahesh Salgaonkar authored and Michael Ellerman committed Nov 26, 2014
1 parent d7ce437 commit 6acbc5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/powernv/opal-hmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static void print_hmi_event_info(struct OpalHMIEvent *hmi_evt)
};

/* Print things out */
if (hmi_evt->version != OpalHMIEvt_V1) {
if (hmi_evt->version < OpalHMIEvt_V1) {
pr_err("HMI Interrupt, Unknown event version %d !\n",
hmi_evt->version);
return;
Expand Down

0 comments on commit 6acbc5a

Please sign in to comment.