mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julian Braha <julianbraha@gmail.com>
To: maddy@linux.ibm.com
Cc: mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org,
	ritesh.list@gmail.com, sshegde@linux.ibm.com,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Julian Braha <julianbraha@gmail.com>
Subject: [PATCH] powerpc/powernv: cleanup dead opal-tracepoints.c
Date: Thu,  3 Dec 2026 18:43:04 +0000	[thread overview]
Message-ID: <20261203184304.2549750-1-julianbraha@gmail.com> (raw)

opal-tracepoints.c is currently dead code.

Commit 75d9fc7fd94e ("powerpc/powernv: move OPAL call wrapper tracing
and interrupt handling to C") removed the Makefile rule to build this
target, but missed the file itself.

Let's remove this dead code.

Signed-off-by: Julian Braha <julianbraha@gmail.com>
---
 .../platforms/powernv/opal-tracepoints.c      | 87 -------------------
 1 file changed, 87 deletions(-)
 delete mode 100644 arch/powerpc/platforms/powernv/opal-tracepoints.c

diff --git a/arch/powerpc/platforms/powernv/opal-tracepoints.c b/arch/powerpc/platforms/powernv/opal-tracepoints.c
deleted file mode 100644
index 91b36541b9e5..000000000000
--- a/arch/powerpc/platforms/powernv/opal-tracepoints.c
+++ /dev/null
@@ -1,87 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include <linux/percpu.h>
-#include <linux/jump_label.h>
-#include <asm/trace.h>
-
-#ifdef CONFIG_JUMP_LABEL
-struct static_key opal_tracepoint_key = STATIC_KEY_INIT;
-
-int opal_tracepoint_regfunc(void)
-{
-	static_key_slow_inc(&opal_tracepoint_key);
-	return 0;
-}
-
-void opal_tracepoint_unregfunc(void)
-{
-	static_key_slow_dec(&opal_tracepoint_key);
-}
-#else
-/*
- * We optimise OPAL calls by placing opal_tracepoint_refcount
- * directly in the TOC so we can check if the opal tracepoints are
- * enabled via a single load.
- */
-
-/* NB: reg/unreg are called while guarded with the tracepoints_mutex */
-extern long opal_tracepoint_refcount;
-
-int opal_tracepoint_regfunc(void)
-{
-	opal_tracepoint_refcount++;
-	return 0;
-}
-
-void opal_tracepoint_unregfunc(void)
-{
-	opal_tracepoint_refcount--;
-}
-#endif
-
-/*
- * Since the tracing code might execute OPAL calls we need to guard against
- * recursion.
- */
-static DEFINE_PER_CPU(unsigned int, opal_trace_depth);
-
-void __trace_opal_entry(unsigned long opcode, unsigned long *args)
-{
-	unsigned long flags;
-	unsigned int *depth;
-
-	local_irq_save(flags);
-
-	depth = this_cpu_ptr(&opal_trace_depth);
-
-	if (*depth)
-		goto out;
-
-	(*depth)++;
-	preempt_disable();
-	trace_opal_entry(opcode, args);
-	(*depth)--;
-
-out:
-	local_irq_restore(flags);
-}
-
-void __trace_opal_exit(long opcode, unsigned long retval)
-{
-	unsigned long flags;
-	unsigned int *depth;
-
-	local_irq_save(flags);
-
-	depth = this_cpu_ptr(&opal_trace_depth);
-
-	if (*depth)
-		goto out;
-
-	(*depth)++;
-	trace_opal_exit(opcode, retval);
-	preempt_enable();
-	(*depth)--;
-
-out:
-	local_irq_restore(flags);
-}
-- 
2.56.1


                 reply	other threads:[~2026-12-03 18:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261203184304.2549750-1-julianbraha@gmail.com \
    --to=julianbraha@gmail.com \
    --cc=chleroy@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=ritesh.list@gmail.com \
    --cc=sshegde@linux.ibm.com \
    /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

all inboxes | Powered by JetHome®