From: Michael Neuling <hidden> Date: 2014-08-19 04:48:04
Currently there is no way to generically check if an OPAL call exists or not
from the host kernel.
This adds an OPAL call opal_check_token() which tells you if the given token is
present in OPAL or not.
Signed-off-by: Michael Neuling <redacted>
---
arch/powerpc/include/asm/opal.h | 7 +++++++
arch/powerpc/platforms/powernv/opal-wrappers.S | 1 +
2 files changed, 8 insertions(+)
From: Michael Neuling <hidden> Date: 2014-08-19 04:48:05
Check that the OPAL_RTC_READ token exists before we use the OPAL RTC.
Refactors the code a little to merge error paths.
This avoids littering the OPAL console with:
"OPAL: Called with bad token 3".
Signed-off-by: Michael Neuling <redacted>
---
arch/powerpc/platforms/powernv/opal-rtc.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
From: Michael Neuling <hidden> Date: 2014-08-19 04:48:06
Check that the OPAL_ELOG_READ token exists before initalising the elog
infrastructure.
This avoids littering the OPAL console with:
"OPAL: Called with bad token 74"
Signed-off-by: Michael Neuling <redacted>
---
arch/powerpc/platforms/powernv/opal-elog.c | 4 ++++
1 file changed, 4 insertions(+)
@@ -295,6 +295,10 @@ int __init opal_elog_init(void){intrc=0;+/* ELOG not supported by firmware */+if(!opal_check_token(OPAL_ELOG_READ))+return-1;+elog_kset=kset_create_and_add("elog",NULL,opal_kobj);if(!elog_kset){pr_warn("%s: failed to create elog kset\n",__func__);
From: Michael Neuling <hidden> Date: 2014-08-19 04:48:07
Check that the OPAL_DUMP_READ token exists before initalising the elog
infrastructure.
This avoids littering the OPAL console with:
"OPAL: Called with bad token 91"
Signed-off-by: Michael Neuling <redacted>
---
arch/powerpc/platforms/powernv/opal-dump.c | 4 ++++
1 file changed, 4 insertions(+)
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2014-09-15 03:10:24
On Tue, 2014-08-19 at 14:47 +1000, Michael Neuling wrote:
quoted hunk
Currently there is no way to generically check if an OPAL call exists or not
from the host kernel.
This adds an OPAL call opal_check_token() which tells you if the given token is
present in OPAL or not.
Signed-off-by: Michael Neuling <redacted>
---
arch/powerpc/include/asm/opal.h | 7 +++++++
arch/powerpc/platforms/powernv/opal-wrappers.S | 1 +
2 files changed, 8 insertions(+)
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2014-09-15 03:13:22
On Tue, 2014-08-19 at 14:48 +1000, Michael Neuling wrote:
quoted hunk
Check that the OPAL_ELOG_READ token exists before initalising the elog
infrastructure.
This avoids littering the OPAL console with:
"OPAL: Called with bad token 74"
Signed-off-by: Michael Neuling <redacted>
---
arch/powerpc/platforms/powernv/opal-elog.c | 4 ++++
1 file changed, 4 insertions(+)
=20
I don't see this used anywhere?
=20
And NoCamelCase !
We can probably just delete the enum since we are just doing this in
code anyway:
if (!opal_check_token(OPAL_RTC_READ))
goto out;
OK? Or would you prefer the usage to read:
if (opal_check_token(OPAL_RTC_READ) =3D=3D OPAL_TOKEN_ABSENT)
goto out;
Yes I know there's lots in that file, but I didn't merge that :)
Fickle bloody maintainers. I thought I never say this but... I want our
crazy Frenchman back! :-P
Mikey
I don't see this used anywhere?
And NoCamelCase !
Yes I know there's lots in that file, but I didn't merge that :)
The original OPAL APIs were like that and I chose to not "fix" them
because I've been aiming at reconciling the Linux and the FW versions
of the file, which I haven't had a chance to do yet (Cyril & Sam have
some WIP in that area afaik).
We could de-camelify them both but I'd rather do the reunification
first.
Cheers,
Ben.
From: Stewart Smith <hidden> Date: 2014-10-07 04:37:01
Michael Neuling [off-list ref] writes:
Currently there is no way to generically check if an OPAL call exists or not
from the host kernel.
This adds an OPAL call opal_check_token() which tells you if the given token is
present in OPAL or not.
Signed-off-by: Michael Neuling <redacted>
(checked the firmware code)
Reviewed-by: Stewart Smith <redacted>
(although should we be checking if the call returns OPAL_PARAMETER?
The opal call will return that if booting on firmware without
OPAL_CHECK_TOKEN.. which granted, is pretty old firmware that I don't
*think* we had leave the lab... or at least not to too many places)