From: Stewart Smith <stewart@linux.vnet.ibm.com>
To: mpe@ellerman.id.au
Cc: Stewart Smith <stewart@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] powerpc/powernv: only register log if OPAL supports doing so
Date: Thu, 12 Feb 2015 16:25:27 +1100 [thread overview]
Message-ID: <1423718729-17992-2-git-send-email-stewart@linux.vnet.ibm.com> (raw)
In-Reply-To: <1423718729-17992-1-git-send-email-stewart@linux.vnet.ibm.com>
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 <stewart@linux.vnet.ibm.com>
---
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
next prev parent reply other threads:[~2015-02-12 5:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-12 5:25 [PATCH 0/3] Silence "OPAL called with invalid token" errors Stewart Smith
2015-02-12 5:25 ` Stewart Smith [this message]
2015-02-12 9:45 ` [PATCH 1/3] powerpc/powernv: only register log if OPAL supports doing so Vasant Hegde
2015-02-12 5:25 ` [PATCH 2/3] powerpc/powernv: only call OPAL_ELOG_RESEND if firmware supports it Stewart Smith
2015-02-12 9:46 ` Vasant Hegde
2015-02-12 5:25 ` [PATCH 3/3] powerpc/powernv: only call OPAL_RESEND_DUMP " Stewart Smith
2015-02-12 9:47 ` Vasant Hegde
-- strict thread matches above, loose matches on Subject: below --
2015-02-18 0:03 [PATCH 0/3] powerpc/powernv: Correctly detect optional OPAL calls Stewart Smith
2015-02-18 0:03 ` [PATCH 1/3] powerpc/powernv: only register log if OPAL supports doing so Stewart Smith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1423718729-17992-2-git-send-email-stewart@linux.vnet.ibm.com \
--to=stewart@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).