Commit 6daf4e82 authored by Kees Cook's avatar Kees Cook

pstore/ram: Move pmsg init earlier

Since the ftrace area can vary in size based on CPU count, move pmsg
initialization earlier so it will have a stable location.
Suggested-by: default avatarParamjit Oberoi <pso@chromium.org>
Cc: Anton Vorontsov <anton@enomsg.org>
Cc: Colin Cross <ccross@android.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Reviewed: Guilherme G. Piccoli <gpiccoli@igalia.com>
Link: https://lore.kernel.org/r/20221011200112.731334-3-keescook@chromium.org
parent 3219122b
...@@ -785,6 +785,11 @@ static int ramoops_probe(struct platform_device *pdev) ...@@ -785,6 +785,11 @@ static int ramoops_probe(struct platform_device *pdev)
if (err) if (err)
goto fail_init; goto fail_init;
err = ramoops_init_prz("pmsg", dev, cxt, &cxt->mprz, &paddr,
cxt->pmsg_size, 0);
if (err)
goto fail_init;
cxt->max_ftrace_cnt = (cxt->flags & RAMOOPS_FLAG_FTRACE_PER_CPU) cxt->max_ftrace_cnt = (cxt->flags & RAMOOPS_FLAG_FTRACE_PER_CPU)
? nr_cpu_ids ? nr_cpu_ids
: 1; : 1;
...@@ -796,11 +801,6 @@ static int ramoops_probe(struct platform_device *pdev) ...@@ -796,11 +801,6 @@ static int ramoops_probe(struct platform_device *pdev)
if (err) if (err)
goto fail_init; goto fail_init;
err = ramoops_init_prz("pmsg", dev, cxt, &cxt->mprz, &paddr,
cxt->pmsg_size, 0);
if (err)
goto fail_init;
cxt->pstore.data = cxt; cxt->pstore.data = cxt;
/* /*
* Prepare frontend flags based on which areas are initialized. * Prepare frontend flags based on which areas are initialized.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment