mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-30 13:52:50 +01:00
The passed parameter to sysrq handlers is a key (a character). So change the type from 'int' to 'u8'. Let it specifically be 'u8' for two reasons: * unsigned: unsigned values come from the upper layers (devices) and the tty layer assumes unsigned on most places, and * 8-bit: as that what's supposed to be one day in all the layers built on the top of tty. (Currently, we use mostly 'unsigned char' and somewhere still only 'char'. (But that also translates to the former thanks to -funsigned-char.)) Signed-off-by: Jiri Slaby (SUSE) <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Matt Turner <[email protected]> Cc: Huacai Chen <[email protected]> Cc: WANG Xuerui <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Jason Wessel <[email protected]> Cc: Daniel Thompson <[email protected]> Cc: Douglas Anderson <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Len Brown <[email protected]> Cc: Pavel Machek <[email protected]> Cc: "Paul E. McKenney" <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Neeraj Upadhyay <[email protected]> Cc: Joel Fernandes <[email protected]> Cc: Josh Triplett <[email protected]> Cc: Boqun Feng <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Lai Jiangshan <[email protected]> Cc: Zqiang <[email protected]> Acked-by: Thomas Zimmermann <[email protected]> # DRM Acked-by: WANG Xuerui <[email protected]> # loongarch Acked-by: Paul E. McKenney <[email protected]> Acked-by: Daniel Thompson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
67 lines
1.3 KiB
C
67 lines
1.3 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* MIPS specific sysrq operations.
|
|
*
|
|
* Copyright (C) 2015 Imagination Technologies Ltd.
|
|
*/
|
|
#include <linux/init.h>
|
|
#include <linux/smp.h>
|
|
#include <linux/spinlock.h>
|
|
#include <linux/sysrq.h>
|
|
#include <linux/workqueue.h>
|
|
|
|
#include <asm/cpu-features.h>
|
|
#include <asm/mipsregs.h>
|
|
#include <asm/tlbdebug.h>
|
|
|
|
/*
|
|
* Dump TLB entries on all CPUs.
|
|
*/
|
|
|
|
static DEFINE_SPINLOCK(show_lock);
|
|
|
|
static void sysrq_tlbdump_single(void *dummy)
|
|
{
|
|
unsigned long flags;
|
|
|
|
spin_lock_irqsave(&show_lock, flags);
|
|
|
|
pr_info("CPU%d:\n", smp_processor_id());
|
|
dump_tlb_regs();
|
|
pr_info("\n");
|
|
dump_tlb_all();
|
|
pr_info("\n");
|
|
|
|
spin_unlock_irqrestore(&show_lock, flags);
|
|
}
|
|
|
|
#ifdef CONFIG_SMP
|
|
static void sysrq_tlbdump_othercpus(struct work_struct *dummy)
|
|
{
|
|
smp_call_function(sysrq_tlbdump_single, NULL, 0);
|
|
}
|
|
|
|
static DECLARE_WORK(sysrq_tlbdump, sysrq_tlbdump_othercpus);
|
|
#endif
|
|
|
|
static void sysrq_handle_tlbdump(u8 key)
|
|
{
|
|
sysrq_tlbdump_single(NULL);
|
|
#ifdef CONFIG_SMP
|
|
schedule_work(&sysrq_tlbdump);
|
|
#endif
|
|
}
|
|
|
|
static const struct sysrq_key_op sysrq_tlbdump_op = {
|
|
.handler = sysrq_handle_tlbdump,
|
|
.help_msg = "show-tlbs(x)",
|
|
.action_msg = "Show TLB entries",
|
|
.enable_mask = SYSRQ_ENABLE_DUMP,
|
|
};
|
|
|
|
static int __init mips_sysrq_init(void)
|
|
{
|
|
return register_sysrq_key('x', &sysrq_tlbdump_op);
|
|
}
|
|
arch_initcall(mips_sysrq_init);
|