Bug 10897 - Disabling irq balance in kernel prevents laptop power off by sysrq
Summary: Disabling irq balance in kernel prevents laptop power off by sysrq
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Off (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Zhang Rui
Depends on:
Reported: 2008-06-12 04:40 UTC by Rus
Modified: 2008-10-27 23:20 UTC (History)
1 user (show)

See Also:
Kernel Version: SMP
Regression: ---
Bisected commit-id:

patch: do sysrq power off in a thread (1.40 KB, application/octet-stream)
2008-06-24 23:00 UTC, Zhang Rui
Details oops (115.37 KB, image/jpeg)
2008-06-25 00:55 UTC, Rus
patch v2 (716 bytes, patch)
2008-06-25 01:48 UTC, Zhang Rui
Details | Diff
patch-01 (2.59 KB, patch)
2008-06-30 01:02 UTC, Zhang Rui
Details | Diff
patch -02 (882 bytes, application/octet-stream)
2008-06-30 01:03 UTC, Zhang Rui
patch-introduce-queue_work_on (2.64 KB, application/octet-stream)
2008-07-02 20:26 UTC, Zhang Rui
patch-run-sysrq-poweroff-on-boot-cpu (904 bytes, patch)
2008-07-02 20:31 UTC, Zhang Rui
Details | Diff

Description Rus 2008-06-12 04:40:28 UTC
Latest working kernel version: do not know
Earliest failing kernel version: do not know
Distribution: slackware-current
Hardware Environment: laptop acer ferrari 1100 (amd x2 / sb 600)
Software Environment: kernel sysrq
Problem Description: Disabling irq balance in kernel prevents laptop power off by sysrq

Steps to reproduce:

1. Compile kernel with irq balance enabled - sysrq-off is working
2. disable irq balance either with noirqbalance boot kernel option or in config (need recompiling) - sysrq-off do not works
Comment 1 Len Brown 2008-06-12 13:26:28 UTC
does this have any effect on 
# poweroff

or is this a sysrq specific issue?
do the other sysrq commands still work?
Comment 2 Rus 2008-06-12 20:11:02 UTC
poweroff still works, other sysrq commands works too.
Comment 3 ykzhao 2008-06-23 01:22:23 UTC
Hi, Rus
    Will you please get the output of dmesg through serial console in case of sysrq-off can't work?
Comment 4 Rus 2008-06-23 05:18:00 UTC
Sorry, my laptop has no serial port (acer ferrari 1100). Did you try to reproduce this bug ? If it is not reproducable on your hardware I can try to find one with the serial port.
Comment 5 Zhang Rui 2008-06-24 23:00:19 UTC
Created attachment 16613 [details]
patch: do sysrq power off in a thread

power off need to disable non boot cpus.
run this in a thread rather than in a work queue so that it can be scheduled to the boot processor when necessary.

please apply this patch to the latest kernel and see if it helps. :)
Comment 6 Rus 2008-06-25 00:54:42 UTC
Now I've got oopses in any sysrq power off case. Oops image attached, sorry for quality - old treo camera ;)
Comment 7 Rus 2008-06-25 00:55:51 UTC
Created attachment 16615 [details] oops
Comment 8 Zhang Rui 2008-06-25 01:48:00 UTC
Created attachment 16616 [details]
patch v2

do sysrq on cpu0
please give it a try
Comment 9 Rus 2008-06-25 04:57:57 UTC
Thanks, last patch works for me. Don't know if such big delay (1 sec) is needed before poweroff.
Comment 10 Zhang Rui 2008-06-25 19:08:51 UTC
Hi, rus,
the patch in comment #8 is not for upstream. It just help me verifies the problem.
I'll cook up an upstream patch some time next week as I'm really busy now. :)
is that okay?
Comment 11 Rus 2008-06-26 03:09:36 UTC
Ok, I can wait as long as needed.
Comment 12 Zhang Rui 2008-06-30 01:02:24 UTC
Created attachment 16660 [details]
Comment 13 Zhang Rui 2008-06-30 01:03:25 UTC
Created attachment 16661 [details]
patch -02

please apply these two patches and see if it can work for you. :)
Comment 14 Rus 2008-06-30 02:51:26 UTC
Thanks, it works too.
Comment 15 Zhang Rui 2008-07-02 20:26:35 UTC
Created attachment 16706 [details]
Comment 16 Zhang Rui 2008-07-02 20:31:32 UTC
Created attachment 16707 [details]

Hi, Rus,
please test these two patches,
I'll try to push them upstream if they work for you. :)
Comment 17 Rus 2008-07-03 00:52:28 UTC
This version works ok.
Comment 18 Len Brown 2008-10-27 23:20:36 UTC
shipped in linux-2.6.27-rc1

commit 2f15fc4bdf91eb399da3f47a09c55831d9f22826
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Wed Jul 23 21:28:40 2008 -0700

    pm: schedule sysrq poweroff on boot cpu

    schedule sysrq poweroff on boot cpu.

    sysrq poweroff needs to disable nonboot cpus, and we need to run this on boot
    cpu to avoid any recursion.  http://bugzilla.kernel.org/show_bug.cgi?id=10897

    [kosaki.motohiro@jp.fujitsu.com: build fix]
    Signed-off-by: Zhang Rui <rui.zhang@intel.com>
    Tested-by: Rus <harbour@sfinx.od.ua>
    Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
    Acked-by: Pavel Machek <pavel@ucw.cz>
    Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Note You need to log in before you can comment on or make changes to this bug.