Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46042
b: refs/heads/master
c: a608ab9
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro authored and Jeff Garzik committed Jan 31, 2007
1 parent cf8c108 commit 8263781
Show file tree
Hide file tree
Showing 44 changed files with 308 additions and 398 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a1864222425ece571886ec0216b3e7056496514
refs/heads/master: a608ab9cb6a5050394498b2520c6e7c162f4e2cf
66 changes: 31 additions & 35 deletions trunk/Documentation/sysrq.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Linux Magic System Request Key Hacks
Documentation for sysrq.c
Last update: 2007-JAN-06
Documentation for sysrq.c version 1.15
Last update: $Date: 2001/01/28 10:15:59 $

* What is the magic SysRq key?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -35,7 +35,7 @@ You can set the value in the file by the following command:

Note that the value of /proc/sys/kernel/sysrq influences only the invocation
via a keyboard. Invocation of any operation via /proc/sysrq-trigger is always
allowed (by a user with admin privileges).
allowed.

* How do I use the magic SysRq key?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -58,7 +58,7 @@ On PowerPC - Press 'ALT - Print Screen (or F13) - <command key>,
On other - If you know of the key combos for other architectures, please
let me know so I can add them to this section.

On all - write a character to /proc/sysrq-trigger. e.g.:
On all - write a character to /proc/sysrq-trigger. eg:

echo t > /proc/sysrq-trigger

Expand All @@ -74,8 +74,6 @@ On all - write a character to /proc/sysrq-trigger. e.g.:

'c' - Will perform a kexec reboot in order to take a crashdump.

'd' - Shows all locks that are held.

'o' - Will shut your system off (if configured and supported).

's' - Will attempt to sync all mounted filesystems.
Expand All @@ -89,43 +87,38 @@ On all - write a character to /proc/sysrq-trigger. e.g.:

'm' - Will dump current memory info to your console.

'n' - Used to make RT tasks nice-able

'v' - Dumps Voyager SMP processor info to your console.

'w' - Dumps tasks that are in uninterruptable (blocked) state.

'x' - Used by xmon interface on ppc/powerpc platforms.

'0'-'9' - Sets the console log level, controlling which kernel messages
will be printed to your console. ('0', for example would make
it so that only emergency messages like PANICs or OOPSes would
make it to your console.)

'f' - Will call oom_kill to kill a memory hog process.
'f' - Will call oom_kill to kill a memory hog process

'e' - Send a SIGTERM to all processes, except for init.

'g' - Used by kgdb on ppc platforms.

'i' - Send a SIGKILL to all processes, except for init.

'h' - Will display help (actually any other key than those listed
'l' - Send a SIGKILL to all processes, INCLUDING init. (Your system
will be non-functional after this.)

'h' - Will display help ( actually any other key than those listed
above will display help. but 'h' is easy to remember :-)

* Okay, so what can I use them for?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Well, un'R'aw is very handy when your X server or a svgalib program crashes.

sa'K' (Secure Access Key) is useful when you want to be sure there is no
trojan program running at console which could grab your password
when you would try to login. It will kill all programs on given console,
thus letting you make sure that the login prompt you see is actually
sa'K' (Secure Access Key) is useful when you want to be sure there are no
trojan program is running at console and which could grab your password
when you would try to login. It will kill all programs on given console
and thus letting you make sure that the login prompt you see is actually
the one from init, not some trojan program.
IMPORTANT: In its true form it is not a true SAK like the one in a :IMPORTANT
IMPORTANT: c2 compliant system, and it should not be mistaken as :IMPORTANT
IMPORTANT: such. :IMPORTANT
It seems others find it useful as (System Attention Key) which is
It seems other find it useful as (System Attention Key) which is
useful when you want to exit a program that will not let you switch consoles.
(For example, X or a svgalib program.)

Expand All @@ -146,8 +139,8 @@ OK or Done message...)
Again, the unmount (remount read-only) hasn't taken place until you see the
"OK" and "Done" message appear on the screen.

The loglevels '0'-'9' are useful when your console is being flooded with
kernel messages you do not want to see. Selecting '0' will prevent all but
The loglevel'0'-'9' is useful when your console is being flooded with
kernel messages you do not want to see. Setting '0' will prevent all but
the most urgent kernel messages from reaching your console. (They will
still be logged if syslogd/klogd are alive, though.)

Expand All @@ -159,7 +152,7 @@ processes.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
That happens to me, also. I've found that tapping shift, alt, and control
on both sides of the keyboard, and hitting an invalid sysrq sequence again
will fix the problem. (i.e., something like alt-sysrq-z). Switching to another
will fix the problem. (ie, something like alt-sysrq-z). Switching to another
virtual console (ALT+Fn) and then back again should also help.

* I hit SysRq, but nothing seems to happen, what's wrong?
Expand All @@ -181,24 +174,27 @@ handler function you will use, B) a help_msg string, that will print when SysRQ
prints help, and C) an action_msg string, that will print right before your
handler is called. Your handler must conform to the prototype in 'sysrq.h'.

After the sysrq_key_op is created, you can call the kernel function
register_sysrq_key(int key, struct sysrq_key_op *op_p); this will
register the operation pointed to by 'op_p' at table key 'key',
if that slot in the table is blank. At module unload time, you must call
the function unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which
After the sysrq_key_op is created, you can call the macro
register_sysrq_key(int key, struct sysrq_key_op *op_p) that is defined in
sysrq.h, this will register the operation pointed to by 'op_p' at table
key 'key', if that slot in the table is blank. At module unload time, you must
call the macro unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which
will remove the key op pointed to by 'op_p' from the key 'key', if and only if
it is currently registered in that slot. This is in case the slot has been
overwritten since you registered it.

The Magic SysRQ system works by registering key operations against a key op
lookup table, which is defined in 'drivers/char/sysrq.c'. This key table has
a number of operations registered into it at compile time, but is mutable,
and 2 functions are exported for interface to it:
register_sysrq_key and unregister_sysrq_key.
Of course, never ever leave an invalid pointer in the table. I.e., when
your module that called register_sysrq_key() exits, it must call
unregister_sysrq_key() to clean up the sysrq key table entry that it used.
Null pointers in the table are always safe. :)
and 4 functions are exported for interface to it: __sysrq_lock_table,
__sysrq_unlock_table, __sysrq_get_key_op, and __sysrq_put_key_op. The
functions __sysrq_swap_key_ops and __sysrq_swap_key_ops_nolock are defined
in the header itself, and the REGISTER and UNREGISTER macros are built from
these. More complex (and dangerous!) manipulations of the table are possible
using these functions, but you must be careful to always lock the table before
you read or write from it, and to unlock it again when you are done. (And of
course, to never ever leave an invalid pointer in the table). Null pointers in
the table are always safe :)

If for some reason you feel the need to call the handle_sysrq function from
within a function called by handle_sysrq, you must be aware that you are in
Expand Down
14 changes: 7 additions & 7 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,8 @@ W: http://linux-atm.sourceforge.net
S: Maintained

ATMEL MACB ETHERNET DRIVER
P: Atmel AVR32 Support Team
M: avr32@atmel.com
P: Haavard Skinnemoen
M: hskinnemoen@atmel.com
S: Supported
Expand All @@ -618,6 +620,8 @@ T: git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git
S: Maintained

AVR32 ARCHITECTURE
P: Atmel AVR32 Support Team
M: avr32@atmel.com
P: Haavard Skinnemoen
M: hskinnemoen@atmel.com
W: http://www.atmel.com/products/AVR32/
Expand All @@ -626,6 +630,8 @@ W: http://avrfreaks.net/
S: Supported

AVR32/AT32AP MACHINE SUPPORT
P: Atmel AVR32 Support Team
M: avr32@atmel.com
P: Haavard Skinnemoen
M: hskinnemoen@atmel.com
S: Supported
Expand Down Expand Up @@ -2282,7 +2288,7 @@ P: Jozsef Kadlecsik
P: Patrick McHardy
M: kaber@trash.net
L: netfilter-devel@lists.netfilter.org
L: netfilter@lists.netfilter.org (subscribers-only)
L: netfilter@lists.netfilter.org
L: coreteam@netfilter.org
W: http://www.netfilter.org/
W: http://www.iptables.org/
Expand Down Expand Up @@ -3593,12 +3599,6 @@ M: ysato@users.sourceforge.jp
W: http://uclinux-h8.sourceforge.jp/
S: Supported

UFS FILESYSTEM
P: Evgeniy Dushistov
M: dushistov@mail.ru
L: linux-kernel@vger.kernel.org
S: Maintained

USB DIAMOND RIO500 DRIVER
P: Cesar Miquel
M: miquel@df.uba.ar
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/i386/boot/compressed/relocs.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ static int is_safe_abs_reloc(const char* sym_name)
/* Match found */
return 1;
}
if (strncmp(sym_name, "__crc_", 6) == 0)
return 1;
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/i386/kernel/cpu/cyrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static void __cpuinit geode_configure(void)
ccr4 = getCx86(CX86_CCR4);
ccr4 |= 0x38; /* FPU fast, DTE cache, Mem bypass */

setCx86(CX86_CCR3, ccr3);
setCx86(CX86_CCR4, ccr4);

set_cx86_memwb();
set_cx86_reorder();
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/i386/mach-default/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void __init time_init_hook(void)
* along the MCA bus. Use this to hook into that chain if you will need
* it.
**/
void mca_nmi_hook(void)
void __init mca_nmi_hook(void)
{
/* If I recall correctly, there's a whole bunch of other things that
* we can do to check for NMI problems, but that's all I know about
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/sparc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ int setup_profiling_timer(unsigned int multiplier)

void __init smp_prepare_cpus(unsigned int max_cpus)
{
extern void __init smp4m_boot_cpus(void);
extern void __init smp4d_boot_cpus(void);
extern void smp4m_boot_cpus(void);
extern void smp4d_boot_cpus(void);
int i, cpuid, extra;

printk("Entering SMP Mode...\n");
Expand Down Expand Up @@ -375,8 +375,8 @@ void __init smp_prepare_boot_cpu(void)

int __cpuinit __cpu_up(unsigned int cpu)
{
extern int __cpuinit smp4m_boot_one_cpu(int);
extern int __cpuinit smp4d_boot_one_cpu(int);
extern int smp4m_boot_one_cpu(int);
extern int smp4d_boot_one_cpu(int);
int ret=0;

switch(sparc_cpu_model) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sparc/kernel/sun4d_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void __init smp4d_boot_cpus(void)
local_flush_cache_all();
}

int __cpuinit smp4d_boot_one_cpu(int i)
int smp4d_boot_one_cpu(int i)
{
extern unsigned long sun4d_cpu_startup;
unsigned long *entry = &sun4d_cpu_startup;
Expand Down
20 changes: 9 additions & 11 deletions trunk/drivers/char/sysrq.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static void sysrq_handle_showstate_blocked(int key, struct tty_struct *tty)
}
static struct sysrq_key_op sysrq_showstate_blocked_op = {
.handler = sysrq_handle_showstate_blocked,
.help_msg = "shoW-blocked-tasks",
.help_msg = "showBlockedTasks",
.action_msg = "Show Blocked State",
.enable_mask = SYSRQ_ENABLE_DUMP,
};
Expand Down Expand Up @@ -315,16 +315,15 @@ static struct sysrq_key_op *sysrq_key_table[36] = {
&sysrq_loglevel_op, /* 9 */

/*
* a: Don't use for system provided sysrqs, it is handled specially on
* sparc and will never arrive.
* Don't use for system provided sysrqs, it is handled specially on
* sparc and will never arrive
*/
NULL, /* a */
&sysrq_reboot_op, /* b */
&sysrq_crashdump_op, /* c & ibm_emac driver debug */
&sysrq_crashdump_op, /* c */
&sysrq_showlocks_op, /* d */
&sysrq_term_op, /* e */
&sysrq_moom_op, /* f */
/* g: May be registered by ppc for kgdb */
NULL, /* g */
NULL, /* h */
&sysrq_kill_op, /* i */
Expand All @@ -333,19 +332,18 @@ static struct sysrq_key_op *sysrq_key_table[36] = {
NULL, /* l */
&sysrq_showmem_op, /* m */
&sysrq_unrt_op, /* n */
/* o: This will often be registered as 'Off' at init time */
/* This will often be registered as 'Off' at init time */
NULL, /* o */
&sysrq_showregs_op, /* p */
NULL, /* q */
&sysrq_unraw_op, /* r */
&sysrq_unraw_op, /* r */
&sysrq_sync_op, /* s */
&sysrq_showstate_op, /* t */
&sysrq_mountro_op, /* u */
/* v: May be registered at init time by SMP VOYAGER */
/* May be assigned at init time by SMP VOYAGER */
NULL, /* v */
&sysrq_showstate_blocked_op, /* w */
/* x: May be registered on ppc/powerpc for xmon */
NULL, /* x */
NULL, /* w */
&sysrq_showstate_blocked_op, /* x */
NULL, /* y */
NULL /* z */
};
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/ide/ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -1781,9 +1781,9 @@ static int __init ide_setup(char *s)
return 1;
}

extern void __init pnpide_init(void);
extern void __exit pnpide_exit(void);
extern void __init h8300_ide_init(void);
extern void pnpide_init(void);
extern void pnpide_exit(void);
extern void h8300_ide_init(void);

/*
* probe_for_hwifs() finds/initializes "known" IDE interfaces
Expand Down Expand Up @@ -2088,7 +2088,7 @@ int __init init_module (void)
return ide_init();
}

void __exit cleanup_module (void)
void cleanup_module (void)
{
int index;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ide/pci/via82cxxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static struct via_isa_bridge {
u8 rev_max;
u16 flags;
} via_isa_bridges[] = {
{ "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
{ "cx7000", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
{ "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
{ "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
{ "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,8 +1116,6 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)

if (rdmsr_safe(index, &data_low, &data_high) < 0)
continue;
if (wrmsr_safe(index, data_low, data_high) < 0)
continue;
data = data_low | ((u64)data_high << 32);
vcpu->host_msrs[j].index = index;
vcpu->host_msrs[j].reserved = 0;
Expand Down
14 changes: 2 additions & 12 deletions trunk/drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@

#define DRV_MODULE_NAME "bnx2"
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "1.5.5"
#define DRV_MODULE_RELDATE "February 1, 2007"
#define DRV_MODULE_VERSION "1.5.4"
#define DRV_MODULE_RELDATE "January 24, 2007"

#define RUN_AT(x) (jiffies + (x))

Expand Down Expand Up @@ -1356,14 +1356,6 @@ bnx2_init_copper_phy(struct bnx2 *bp)
bnx2_write_phy(bp, 0x18, 0x0400);
}

if (bp->phy_flags & PHY_DIS_EARLY_DAC_FLAG) {
bnx2_write_phy(bp, MII_BNX2_DSP_ADDRESS,
MII_BNX2_DSP_EXPAND_REG | 0x8);
bnx2_read_phy(bp, MII_BNX2_DSP_RW_PORT, &val);
val &= ~(1 << 8);
bnx2_write_phy(bp, MII_BNX2_DSP_RW_PORT, val);
}

if (bp->dev->mtu > 1500) {
/* Set extended packet length bit */
bnx2_write_phy(bp, 0x18, 0x7);
Expand Down Expand Up @@ -5926,8 +5918,6 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
} else if (CHIP_NUM(bp) == CHIP_NUM_5706 ||
CHIP_NUM(bp) == CHIP_NUM_5708)
bp->phy_flags |= PHY_CRC_FIX_FLAG;
else if (CHIP_ID(bp) == CHIP_ID_5709_A0)
bp->phy_flags |= PHY_DIS_EARLY_DAC_FLAG;

if ((CHIP_ID(bp) == CHIP_ID_5708_A0) ||
(CHIP_ID(bp) == CHIP_ID_5708_B0) ||
Expand Down
Loading

0 comments on commit 8263781

Please sign in to comment.