From: Hari Bathini <hbathini@linux.vnet.ibm.com>
To: linuxppc-dev <linuxppc-dev@ozlabs.org>
Cc: sjitindarsingh@gmail.com, Michael Ellerman <mpe@ellerman.id.au>,
stable@vger.kernel.org#4.11+, Paul Mackerras <paulus@samba.org>,
ben@codiert.org,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: [PATCH 4/4] powerpc/prom: fix early parsing of 'disable_radix' parameter
Date: Thu, 03 Aug 2017 14:55:26 +0530 [thread overview]
Message-ID: <150175232638.9806.1165424950551046958.stgit@hbathini.in.ibm.com> (raw)
In-Reply-To: <150175227508.9806.17545018023658850483.stgit@hbathini.in.ibm.com>
Early cmdline parser looks for "disable_radix" substring in the cmdline
string but it could also succeed when cmdline string contains parameters
like 'x_disable_radix' or disable_radix_type=' or such causing undesired
actions. Add support to skip proceeding in such cases.
Fixes: 014d02cbf16b ("powerpc: Update to new option-vector-5 format for CAS")
Cc: stable@vger.kernel.org # 4.11+
Cc: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
---
arch/powerpc/kernel/prom_init.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 3057a32..169e32c 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -660,8 +660,16 @@ static void __init early_cmdline_parse(void)
opt = strstr(prom_cmd_line, "disable_radix");
if (opt) {
- prom_debug("Radix disabled from cmdline\n");
- prom_radix_disable = true;
+ /*
+ * Check if this is prefix or suffix of some other parameter
+ * before proceeding.
+ */
+ p = (char *)(opt + 13);
+ if ((*p == ' ' || *p == '"' || *p == '\0') &&
+ is_substring_param(prom_cmd_line, opt)) {
+ prom_debug("Radix disabled from cmdline\n");
+ prom_radix_disable = true;
+ }
}
}
next prev parent reply other threads:[~2017-08-03 9:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-03 9:24 [PATCH 1/4] powerpc/prom: avoid endian conversions for linux, memory-limit node Hari Bathini
2017-08-03 9:24 ` [PATCH 2/4] powerpc/prom: fix early parsing of parameters Hari Bathini
2017-08-06 8:36 ` kbuild test robot
2017-08-03 9:25 ` [PATCH 3/4] powerpc/prom: fix early parsing of 'mem=' parameter Hari Bathini
2017-08-03 9:25 ` Hari Bathini [this message]
2017-08-04 1:37 ` [PATCH 1/4] powerpc/prom: avoid endian conversions for linux, memory-limit node Benjamin Herrenschmidt
2017-08-04 1:47 ` Benjamin Herrenschmidt
2017-08-04 5:35 ` Hari Bathini
2017-08-04 3:51 ` Michael Ellerman
2017-08-04 5:32 ` Hari Bathini
2017-08-04 10:14 ` Michael Ellerman
2017-08-04 18:38 ` Hari Bathini
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=150175232638.9806.1165424950551046958.stgit@hbathini.in.ibm.com \
--to=hbathini@linux.vnet.ibm.com \
--cc=ben@codiert.org \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=sjitindarsingh@gmail.com \
--cc=stable@vger.kernel.org#4.11+ \
/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).