Skip to content

Commit

Permalink
LoongArch: Remove the deprecated notifier hook mechanism
Browse files Browse the repository at this point in the history
[ Upstream commit 6b72cd9ef062702390fc96c469beea1729a5dffe ]

The notifier hook mechanism in proc and cpuinfo is actually unnecessary
for LoongArch because it's not used anywhere.

It was originally added to the MIPS code in commit d6d3c9a ("MIPS:
MT: proc: Add support for printing VPE and TC ids"), and LoongArch then
inherited it.

But as the kernel code stands now, this notifier hook mechanism doesn't
really make sense for either LoongArch or MIPS.

In addition, the seq_file forward declaration needs to be moved to its
proper place, as only the show_ipi_list() function in smp.c requires it.

Co-developed-by: Wentao Guan <[email protected]>
Signed-off-by: Wentao Guan <[email protected]>
Signed-off-by: Yuli Wang <[email protected]>
Signed-off-by: Huacai Chen <[email protected]>
[ Backport from v6.14-rc3 ]
Signed-off-by: WangYuli <[email protected]>
  • Loading branch information
Avenger-285714 committed Feb 17, 2025
1 parent 51aa499 commit 550800a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 43 deletions.
21 changes: 0 additions & 21 deletions arch/loongarch/include/asm/cpu-info.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,6 @@ extern const char *__cpu_full_name[];
#define cpu_family_string() __cpu_family[raw_smp_processor_id()]
#define cpu_full_name_string() __cpu_full_name[raw_smp_processor_id()]

struct seq_file;
struct notifier_block;

extern int register_proc_cpuinfo_notifier(struct notifier_block *nb);
extern int proc_cpuinfo_notifier_call_chain(unsigned long val, void *v);

#define proc_cpuinfo_notifier(fn, pri) \
({ \
static struct notifier_block fn##_nb = { \
.notifier_call = fn, \
.priority = pri \
}; \
\
register_proc_cpuinfo_notifier(&fn##_nb); \
})

struct proc_cpuinfo_notifier_args {
struct seq_file *m;
unsigned long n;
};

static inline bool cpus_are_siblings(int cpua, int cpub)
{
struct cpuinfo_loongarch *infoa = &cpu_data[cpua];
Expand Down
2 changes: 2 additions & 0 deletions arch/loongarch/include/asm/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ extern int __cpu_logical_map[NR_CPUS];
#define SMP_RESCHEDULE BIT(ACTION_RESCHEDULE)
#define SMP_CALL_FUNCTION BIT(ACTION_CALL_FUNCTION)

struct seq_file;

struct secondary_data {
unsigned long stack;
unsigned long thread_info;
Expand Down
22 changes: 0 additions & 22 deletions arch/loongarch/kernel/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,11 @@
#include <asm/processor.h>
#include <asm/time.h>

/*
* No lock; only written during early bootup by CPU 0.
*/
static RAW_NOTIFIER_HEAD(proc_cpuinfo_chain);

int __ref register_proc_cpuinfo_notifier(struct notifier_block *nb)
{
return raw_notifier_chain_register(&proc_cpuinfo_chain, nb);
}

int proc_cpuinfo_notifier_call_chain(unsigned long val, void *v)
{
return raw_notifier_call_chain(&proc_cpuinfo_chain, val, v);
}

static int show_cpuinfo(struct seq_file *m, void *v)
{
unsigned long n = (unsigned long) v - 1;
unsigned int version = cpu_data[n].processor_id & 0xff;
unsigned int fp_version = cpu_data[n].fpu_vers;
struct proc_cpuinfo_notifier_args proc_cpuinfo_notifier_args;

#ifdef CONFIG_SMP
if (!cpu_online(n))
Expand Down Expand Up @@ -93,12 +77,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
cpu_data[n].watch_ireg_count, cpu_data[n].watch_dreg_count);
}

proc_cpuinfo_notifier_args.m = m;
proc_cpuinfo_notifier_args.n = n;

raw_notifier_call_chain(&proc_cpuinfo_chain, 0,
&proc_cpuinfo_notifier_args);

seq_printf(m, "\n\n");

return 0;
Expand Down

0 comments on commit 550800a

Please sign in to comment.