Bug 11481 - Suspend/Resume prevent kernel reboot
Summary: Suspend/Resume prevent kernel reboot
Status: CLOSED CODE_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Sleep-Wake (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: ykzhao
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-02 08:26 UTC by Alexey Kuznetsov
Modified: 2008-10-24 22:44 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.26.3
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
dmesg after suspend/resume (31.59 KB, text/plain)
2008-09-02 08:26 UTC, Alexey Kuznetsov
Details
acpidump (134.56 KB, application/octet-stream)
2008-09-03 06:38 UTC, Alexey Kuznetsov
Details
lpci (10.06 KB, text/plain)
2008-09-03 06:38 UTC, Alexey Kuznetsov
Details
use the attached tool to see whether the system can be restarted (2.47 KB, patch)
2008-09-03 07:15 UTC, ykzhao
Details | Diff
dmidecode (10.74 KB, application/octet-stream)
2008-09-03 08:26 UTC, Alexey Kuznetsov
Details
try the debug patch in which the ACPI reboot is used forcibly (1.38 KB, patch)
2008-09-03 19:07 UTC, ykzhao
Details | Diff
the updated patch( Add the DMI check table to support ACPI reboot) (2.14 KB, patch)
2008-09-08 19:25 UTC, ykzhao
Details | Diff
Ingore the RESET_REG_SUP bit when using the ACPI reboot mechanism (2.35 KB, patch)
2008-10-17 01:02 UTC, ykzhao
Details | Diff

Description Alexey Kuznetsov 2008-09-02 08:26:03 UTC
Latest working kernel version: never
Earliest failing kernel version: current
Distribution: fedora9
Hardware Environment: notebook m3n
Software Environment: fedora 9
Problem Description: after suspend/resume notebook prevent to reboot, i got full cpu usage and stuck after system "ready to reboot..." message.

without suspend everything going fine.

Steps to reproduce:

suspend/resume
try to reboot
Comment 1 Alexey Kuznetsov 2008-09-02 08:26:27 UTC
Created attachment 17577 [details]
dmesg after suspend/resume
Comment 2 ykzhao 2008-09-02 18:01:18 UTC
Will you please attach the output of acpidump, lspci -vxxx?

Will you please try the boot option of "reboot=a" on the latest kernel(2.6.27-rc4/5) and see whether the system can be rebooted after suspend/resume cycle?

Thanks.
Comment 3 Alexey Kuznetsov 2008-09-03 06:38:26 UTC
Created attachment 17591 [details]
acpidump
Comment 4 Alexey Kuznetsov 2008-09-03 06:38:42 UTC
Created attachment 17592 [details]
lpci
Comment 5 ykzhao 2008-09-03 07:15:37 UTC
Created attachment 17593 [details]
use the attached tool to see whether the system can be restarted

Will you please use the attached tool to see whether the system can be rebooted after it is resumed?( Write 0x06 to 0xCF9 I/O port address)
   ./iow --addr 0xCF9 --width 8 --value 0x6 
   
   If the system can be rebooted, please attach the output of dmidecode.
   Thanks.
Comment 6 Alexey Kuznetsov 2008-09-03 07:17:55 UTC
keep in mind acpidump and lspci log for kernel 2.6.26-3.

i not done with 2.6.27-rc5 yet.
Comment 7 Alexey Kuznetsov 2008-09-03 08:26:40 UTC
Created attachment 17596 [details]
dmidecode

for kernel.2.6.26.3
Comment 8 Alexey Kuznetsov 2008-09-03 08:37:07 UTC
/iow --addr 0xCF9 --width 8 --value 0x6

works well

kernel 2 26 27rc5 with reboot=a does not help.
Comment 9 ykzhao 2008-09-03 19:07:40 UTC
Created attachment 17606 [details]
try the debug patch in which the ACPI reboot is used forcibly

Will you please try the debug patch on 2.6.27-rc5 and see whether the system can be rebooted after it is resumed? Of course the boot option of "reboot=a" is also required.
   In this debug patch the ACPI reboot mechanism will be used forcibly regardless of ACPI_FADT_RESET_REGISTER bit flag. 

   Thanks.
Comment 10 Alexey Kuznetsov 2008-09-04 01:36:10 UTC
Finely rebooted. (2.6.27-rc5 + reboot_dmi.patch + reboot=a)
Comment 11 ykzhao 2008-09-04 23:49:18 UTC
Thanks for the test and it seems that the patch in comment #9 can make your laptop work well.
   In fact this issue is related with BIOS. From the acpidump we can know that RESET_REG is defined in FACP table although the FADT flag indicates that the system reset via RESET_REG is not supported. It will be better to fix this issue by BIOS update.(Of course the boot option of "reboot=a" is still needed).
   Anyway I will try to push the workaround patch.
   Now the patch is available and the bug will marked as resovled.

   thanks.
Comment 12 ykzhao 2008-09-08 19:25:29 UTC
Created attachment 17688 [details]
the updated patch( Add the DMI check table to support ACPI reboot)

The attached is the updated patch.
Add the DMI check table to support ACPI reboot in case of adding the boot option of "reboot=a".

There exists the same issue on the laptop of bug7299. So the dmidecode is also added to DMI check table.
Comment 13 Alexey Kuznetsov 2008-09-08 22:51:59 UTC
here is no way to avoid reboot=a option?
Comment 14 Len Brown 2008-10-16 17:02:16 UTC
i think with this patch "reboot=a" should not be necessary,
as that is already the default - this patch just lets the
default ignore the missing bit in your bios.

however, per the mailing list, this patch needs revision,
re-opening...
Comment 15 ykzhao 2008-10-16 20:01:19 UTC
The default reboot_type is BOOT_KBD. It works for most boxes. But for some boxes it can't work well after suspend/resume. So the ACPI reboot mechanim is used by adding the boot option of "reboot=a". 
   Maybe the reboot_type can be changed to BOOT_ACPI if the ACPI reboot mechanism is supported. But in such case the other reboot_type can't be used any more. If the default reboot_type is changed to BOOT_ACPI for your box by using DMI table, it seems ugly. IMO you can use the ACPI reboot mechanism by adding the boot option of "reboot=a".     

In fact there exist the other definitions of reboot_type . For example:
    >BOOT_TRIPLE = 't',
    >    BOOT_KBD = 'k',
#ifdef CONFIG_X86_32
    >    BOOT_BIOS = 'b',
#endif
    >   BOOT_ACPI = 'a',
    >   BOOT_EFI = 'e'

    What Lenb said in comment #14 is right. On your box the FADT flag bit indicates that ACPI reboot is not supported. But your box can be rebooted by writing the RESET_VALUE to ACPI_RESET_REG forcibly. And the patch in comment #12 is to ignore the missing bit in the BIOS.
   
   Thanks.

    
       
    
Comment 16 ykzhao 2008-10-17 01:02:32 UTC
Created attachment 18348 [details]
Ingore the RESET_REG_SUP bit when using the ACPI reboot mechanism

The attached is the updated patch.

In this patch when using ACPI reboot mechanism the RESET_REG_SUP bit is ignored. Instead the RESET_REG is checked.
  
Will you please try it again? (of course the boot option of "reboot=a" is still required).
Thanks.
Comment 17 Alexey Kuznetsov 2008-10-17 04:13:48 UTC
Your new patch in comment 16 work fine, also like i said it in comment 10. Why you ask me again to apply it, or i miss something?
Comment 18 Len Brown 2008-10-17 11:26:55 UTC
patch in comment #16 applied to acpi-test
report marked RESOLVED.
Comment 19 Len Brown 2008-10-24 22:44:26 UTC
shipped in linux-2.6.28-rc1
closed

commit 8fd145917fb62368a9b80db59562c20576238f5a
Author: Zhao Yakui <yakui.zhao@intel.com>
Date:   Fri Oct 17 14:22:27 2008 -0400

    ACPI: Ingore the RESET_REG_SUP bit when using ACPI reset mechanism

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