diff mbox series

[2/5] pstore/ram: Move pmsg init earlier

Message ID 20221011200112.731334-3-keescook@chromium.org (mailing list archive)
State Mainlined
Commit 6daf4e82bd54ef004ace4dd6deed60a32c282a95
Headers show
Series Move internal definitions out of kernel-wide include | expand

Commit Message

Kees Cook Oct. 11, 2022, 8:01 p.m. UTC
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: Paramjit 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: Kees Cook <keescook@chromium.org>
---
 fs/pstore/ram.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Guilherme G. Piccoli Oct. 12, 2022, 7:45 p.m. UTC | #1
On 11/10/2022 17:01, Kees Cook wrote:
> 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: Paramjit 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: Kees Cook <keescook@chromium.org>
> ---

Reviewed: Guilherme G. Piccoli <gpiccoli@igalia.com>

Since I'm not using pmsg my tests are of limited scope here, so better
to consider I just reviewed the patch heh
Cheers,


Guilherme
diff mbox series

Patch

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 348820a3ce88..2f18563c8141 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -785,6 +785,11 @@  static int ramoops_probe(struct platform_device *pdev)
 	if (err)
 		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)
 				? nr_cpu_ids
 				: 1;
@@ -796,11 +801,6 @@  static int ramoops_probe(struct platform_device *pdev)
 	if (err)
 		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;
 	/*
 	 * Prepare frontend flags based on which areas are initialized.