* Re: 2.4.22 ACPI power off via sysrq not working
[not found] <1065168778.1740.10.camel@highscreen.suse.lists.linux.kernel>
@ 2003-10-03 8:24 ` Andi Kleen
2003-10-03 18:13 ` Sylvain Pasche
2003-10-07 0:30 ` Marcelo Tosatti
0 siblings, 2 replies; 4+ messages in thread
From: Andi Kleen @ 2003-10-03 8:24 UTC (permalink / raw)
To: Sylvain Pasche; +Cc: linux-kernel
Sylvain Pasche <sylvain_pasche@yahoo.fr> writes:
> Hi,
>
> If I want to halt the system using sys-rq - o key, I get an oops instead
> of a power down.
> Inside pm.c:159, there is:
>
> if (in_interrupt())
> BUG();
>
> But if we look at the trace, we are in the interrupt of the keyboard
> handler.
> One fix would be to comment out the BUG line, but there's certainly "a
> better way to do it".
Use this patch.
diff -u linux/drivers/acpi/system.c-o linux/drivers/acpi/system.c
--- linux/drivers/acpi/system.c-o 2003-09-07 16:20:44.000000000 +0200
+++ linux/drivers/acpi/system.c 2003-09-08 21:04:46.000000000 +0200
@@ -1192,11 +1192,21 @@
#if defined(CONFIG_MAGIC_SYSRQ) && defined(CONFIG_PM)
+static int po_cb_active;
+
+static void acpi_po_tramp(void *x)
+{
+ acpi_power_off();
+}
+
/* Simple wrapper calling power down function. */
static void acpi_sysrq_power_off(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty)
-{
- acpi_power_off();
+{
+ static struct tq_struct tq = { .routine = acpi_po_tramp };
+ if (po_cb_active++)
+ return;
+ schedule_task(&tq);
}
struct sysrq_key_op sysrq_acpi_poweroff_op = {
-Andi
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: 2.4.22 ACPI power off via sysrq not working
2003-10-03 8:24 ` 2.4.22 ACPI power off via sysrq not working Andi Kleen
@ 2003-10-03 18:13 ` Sylvain Pasche
2003-10-07 0:30 ` Marcelo Tosatti
1 sibling, 0 replies; 4+ messages in thread
From: Sylvain Pasche @ 2003-10-03 18:13 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-kernel
Le ven 03/10/2003 à 10:24, Andi Kleen a écrit :
> Sylvain Pasche <sylvain_pasche@yahoo.fr> writes:
> > If I want to halt the system using sys-rq - o key, I get an oops instead
> > of a power down.
> Use this patch.
>
> diff -u linux/drivers/acpi/system.c-o linux/drivers/acpi/system.c
> --- linux/drivers/acpi/system.c-o 2003-09-07 16:20:44.000000000 +0200
> +++ linux/drivers/acpi/system.c 2003-09-08 21:04:46.000000000 +0200
> @@ -1192,11 +1192,21 @@
>
> #if defined(CONFIG_MAGIC_SYSRQ) && defined(CONFIG_PM)
>
> +static int po_cb_active;
> +
> +static void acpi_po_tramp(void *x)
> +{
> + acpi_power_off();
> +}
> +
> /* Simple wrapper calling power down function. */
> static void acpi_sysrq_power_off(int key, struct pt_regs *pt_regs,
> struct kbd_struct *kbd, struct tty_struct *tty)
> -{
> - acpi_power_off();
> +{
> + static struct tq_struct tq = { .routine = acpi_po_tramp };
> + if (po_cb_active++)
> + return;
> + schedule_task(&tq);
> }
>
> struct sysrq_key_op sysrq_acpi_poweroff_op = {
>
>
> -Andi
Yes, it works perfectly with it, thanks.
Do you forward it to the acpi maintainer ?
Cheers,
Sylvain
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: 2.4.22 ACPI power off via sysrq not working
2003-10-03 8:24 ` 2.4.22 ACPI power off via sysrq not working Andi Kleen
2003-10-03 18:13 ` Sylvain Pasche
@ 2003-10-07 0:30 ` Marcelo Tosatti
1 sibling, 0 replies; 4+ messages in thread
From: Marcelo Tosatti @ 2003-10-07 0:30 UTC (permalink / raw)
To: Andi Kleen; +Cc: Sylvain Pasche, linux-kernel
On 3 Oct 2003, Andi Kleen wrote:
> Sylvain Pasche <sylvain_pasche@yahoo.fr> writes:
>
> > Hi,
> >
> > If I want to halt the system using sys-rq - o key, I get an oops instead
> > of a power down.
> > Inside pm.c:159, there is:
> >
> > if (in_interrupt())
> > BUG();
> >
> > But if we look at the trace, we are in the interrupt of the keyboard
> > handler.
> > One fix would be to comment out the BUG line, but there's certainly "a
> > better way to do it".
>
> Use this patch.
>
> diff -u linux/drivers/acpi/system.c-o linux/drivers/acpi/system.c
> --- linux/drivers/acpi/system.c-o 2003-09-07 16:20:44.000000000 +0200
> +++ linux/drivers/acpi/system.c 2003-09-08 21:04:46.000000000 +0200
> @@ -1192,11 +1192,21 @@
>
> #if defined(CONFIG_MAGIC_SYSRQ) && defined(CONFIG_PM)
>
> +static int po_cb_active;
> +
> +static void acpi_po_tramp(void *x)
> +{
> + acpi_power_off();
> +}
> +
> /* Simple wrapper calling power down function. */
> static void acpi_sysrq_power_off(int key, struct pt_regs *pt_regs,
> struct kbd_struct *kbd, struct tty_struct *tty)
> -{
> - acpi_power_off();
> +{
> + static struct tq_struct tq = { .routine = acpi_po_tramp };
> + if (po_cb_active++)
> + return;
> + schedule_task(&tq);
> }
>
> struct sysrq_key_op sysrq_acpi_poweroff_op = {
Fix applied to 2.4 mainline.
^ permalink raw reply [flat|nested] 4+ messages in thread
* 2.4.22 ACPI power off via sysrq not working
@ 2003-10-03 8:12 Sylvain Pasche
0 siblings, 0 replies; 4+ messages in thread
From: Sylvain Pasche @ 2003-10-03 8:12 UTC (permalink / raw)
To: linux-kernel
Hi,
If I want to halt the system using sys-rq - o key, I get an oops instead
of a power down.
Inside pm.c:159, there is:
if (in_interrupt())
BUG();
But if we look at the trace, we are in the interrupt of the keyboard
handler.
One fix would be to comment out the BUG line, but there's certainly "a
better way to do it".
Sylvain
kernel BUG at pm.c:159!
invalid operand: 0000
CPU: 0
EIP: 0010:[<c012880e>] Not tainted
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010002
eax: 00000001 ebx: f7a9cb20 ecx: 00000000 edx: 00000002
esi: 00000001 edi: 00000003 ebp: c02f6808 esp: c0337e68
ds: 0018 es: 0018 ss: 0018
Process swapper (pid: 0, stackpage=c0337000)
Stack: 0000000b 00002a8d c011a795 f7a9cb3c f7a9cb20 00000005 c0128958
f7a9cb20
00000002 00000003 00000000 00000005 00000005 0000006f c01fa60e
00000002
00000003 c02fd208 0000006f c01fa725 00000005 c02fd208 0000006f
00000007
Call Trace: [<c011a795>] [<c0128958>] [<c01fa60e>] [<c01fa725>]
[<c01fa59b>]
[<c021864b>] [<c02185a9>] [<c02164b6>] [<c02175b7>] [<c02175cf>]
[<c010a6a5>]
[<c010a824>] [<c0107080>] [<c010cfa8>] [<c0107080>] [<c01070a3>]
[<c0107132>]
[<c0105000>]
Code: 0f 0b 9f 00 6f 37 2b c0 83 fa 01 77 45 8b 73 14 39 fe 74 34
>>EIP; c012880e <pm_send+2e/a0> <=====
>>ebx; f7a9cb20 <_end+3770bfb4/385784f4>
>>ebp; c02f6808 <pm_devs_lock+0/10>
>>esp; c0337e68 <init_task_union+1e68/2000>
Trace; c011a795 <call_console_drivers+65/120>
Trace; c0128958 <pm_send_all+78/b0>
Trace; c01fa60e <acpi_system_save_state+16/91>
Trace; c01fa725 <acpi_suspend+5e/9d>
Trace; c01fa59b <acpi_power_off+7/9>
Trace; c021864b <__handle_sysrq_nolock+7b/f0>
Trace; c02185a9 <handle_sysrq+59/80>
Trace; c02164b6 <handle_scancode+276/310>
Trace; c02175b7 <handle_kbd_event+b7/c0>
Trace; c02175cf <keyboard_interrupt+f/20>
Trace; c010a6a5 <handle_IRQ_event+45/70>
Trace; c010a824 <do_IRQ+64/a0>
Trace; c0107080 <default_idle+0/40>
Trace; c010cfa8 <call_do_IRQ+5/d>
Trace; c0107080 <default_idle+0/40>
Trace; c01070a3 <default_idle+23/40>
Trace; c0107132 <cpu_idle+52/70>
Trace; c0105000 <_stext+0/0>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-10-07 0:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1065168778.1740.10.camel@highscreen.suse.lists.linux.kernel>
2003-10-03 8:24 ` 2.4.22 ACPI power off via sysrq not working Andi Kleen
2003-10-03 18:13 ` Sylvain Pasche
2003-10-07 0:30 ` Marcelo Tosatti
2003-10-03 8:12 Sylvain Pasche
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox