2015-02-12 05:25:42

by Stewart Smith

[permalink] [raw]
Subject: [PATCH 0/3] Silence "OPAL called with invalid token" errors

If OPAL firmware is called with an invalid token, that is, one that
the current running firmware does not support, it dumps an error into
its log. For three calls we were making in Linux, we were not adequately
checking that the current firmware supported them, so could get
this warning spuriously.

Stewart Smith (3):
powerpc/powernv: only register log if OPAL supports doing so
powerpc/powernv: only call OPAL_ELOG_RESEND if firmware supports it
powerpc/powernv: only call OPAL_RESEND_DUMP if firmware supports it

arch/powerpc/platforms/powernv/opal-dump.c | 3 ++-
arch/powerpc/platforms/powernv/opal-elog.c | 3 ++-
arch/powerpc/platforms/powernv/opal.c | 6 +++++-
3 files changed, 9 insertions(+), 3 deletions(-)

--
1.7.10.4


2015-02-12 05:25:43

by Stewart Smith

[permalink] [raw]
Subject: [PATCH 1/3] powerpc/powernv: only register log if OPAL supports doing so

Correct use of REGISTER/UNREGISTER is to check if the token exists
before calling. If we don't we get a "OPAL: Called with bad token 101 !"
error, which is harmless but may be alarming to some.

Signed-off-by: Stewart Smith <[email protected]>
---
arch/powerpc/platforms/powernv/opal.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index f10b9ec..84ff20c 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -665,6 +665,9 @@ static void __init opal_dump_region_init(void)
uint64_t size;
int rc;

+ if (!opal_check_token(OPAL_REGISTER_DUMP_REGION))
+ return;
+
/* Register kernel log buffer */
addr = log_buf_addr_get();
size = log_buf_len_get();
@@ -795,7 +798,8 @@ void opal_shutdown(void)
}

/* Unregister memory dump region */
- opal_unregister_dump_region(OPAL_DUMP_REGION_LOG_BUF);
+ if (opal_check_token(OPAL_UNREGISTER_DUMP_REGION))
+ opal_unregister_dump_region(OPAL_DUMP_REGION_LOG_BUF);
}

/* Export this so that test modules can use it */
--
1.7.10.4

2015-02-12 05:26:53

by Stewart Smith

[permalink] [raw]
Subject: [PATCH 2/3] powerpc/powernv: only call OPAL_ELOG_RESEND if firmware supports it

Otherwise firmware complains: "OPAL: Called with bad token 74 !"
as not all OPAL systems have the ability to resend error logs.

Signed-off-by: Stewart Smith <[email protected]>
---
arch/powerpc/platforms/powernv/opal-elog.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c
index 518fe95..38ce757 100644
--- a/arch/powerpc/platforms/powernv/opal-elog.c
+++ b/arch/powerpc/platforms/powernv/opal-elog.c
@@ -313,7 +313,8 @@ int __init opal_elog_init(void)
}

/* We are now ready to pull error logs from opal. */
- opal_resend_pending_logs();
+ if (opal_check_token(OPAL_ELOG_RESEND))
+ opal_resend_pending_logs();

return 0;
}
--
1.7.10.4

2015-02-12 05:25:55

by Stewart Smith

[permalink] [raw]
Subject: [PATCH 3/3] powerpc/powernv: only call OPAL_RESEND_DUMP if firmware supports it

Not all OPAL platforms support resending system dumps, so check
that current firmware supports it first. Otherwise we get firmware
complaining:
"OPAL: Called with bad token 91 !"

Signed-off-by: Stewart Smith <[email protected]>
---
arch/powerpc/platforms/powernv/opal-dump.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c
index 23260f7..5aa9c1c 100644
--- a/arch/powerpc/platforms/powernv/opal-dump.c
+++ b/arch/powerpc/platforms/powernv/opal-dump.c
@@ -452,5 +452,6 @@ void __init opal_platform_dump_init(void)
return;
}

- opal_dump_resend_notification();
+ if (opal_check_token(OPAL_DUMP_RESEND))
+ opal_dump_resend_notification();
}
--
1.7.10.4

2015-02-12 09:46:36

by Vasant Hegde

[permalink] [raw]
Subject: Re: [PATCH 1/3] powerpc/powernv: only register log if OPAL supports doing so

On 02/12/2015 10:55 AM, Stewart Smith wrote:
> Correct use of REGISTER/UNREGISTER is to check if the token exists
> before calling. If we don't we get a "OPAL: Called with bad token 101 !"
> error, which is harmless but may be alarming to some.
>
> Signed-off-by: Stewart Smith <[email protected]>

Acked-by: Vasant Hegde <[email protected]>

-Vasant

2015-02-12 09:47:51

by Vasant Hegde

[permalink] [raw]
Subject: Re: [PATCH 2/3] powerpc/powernv: only call OPAL_ELOG_RESEND if firmware supports it

On 02/12/2015 10:55 AM, Stewart Smith wrote:
> Otherwise firmware complains: "OPAL: Called with bad token 74 !"
> as not all OPAL systems have the ability to resend error logs.
>
> Signed-off-by: Stewart Smith <[email protected]>


Acked-by: Vasant Hegde <[email protected]>

-Vasant



> ---
> arch/powerpc/platforms/powernv/opal-elog.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c
> index 518fe95..38ce757 100644
> --- a/arch/powerpc/platforms/powernv/opal-elog.c
> +++ b/arch/powerpc/platforms/powernv/opal-elog.c
> @@ -313,7 +313,8 @@ int __init opal_elog_init(void)
> }
>
> /* We are now ready to pull error logs from opal. */
> - opal_resend_pending_logs();
> + if (opal_check_token(OPAL_ELOG_RESEND))
> + opal_resend_pending_logs();
>
> return 0;
> }
>

2015-02-12 09:48:28

by Vasant Hegde

[permalink] [raw]
Subject: Re: [PATCH 3/3] powerpc/powernv: only call OPAL_RESEND_DUMP if firmware supports it

On 02/12/2015 10:55 AM, Stewart Smith wrote:
> Not all OPAL platforms support resending system dumps, so check
> that current firmware supports it first. Otherwise we get firmware
> complaining:
> "OPAL: Called with bad token 91 !"
>
> Signed-off-by: Stewart Smith <[email protected]>


Acked-by: Vasant Hegde <[email protected]>

-Vasant