Bug 112091 - [Regression] [bisected] machine boots immediately after poweroff
Summary: [Regression] [bisected] machine boots immediately after poweroff
Status: RESOLVED INVALID
Alias: None
Product: Drivers
Classification: Unclassified
Component: Other (show other bugs)
Hardware: i386 Linux
: P1 normal
Assignee: drivers_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-07 09:24 UTC by Stefan Becker
Modified: 2016-02-25 18:22 UTC (History)
3 users (show)

See Also:
Kernel Version: >= 4.3.0
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Kernel config for 4.3.0 used in testing (120.72 KB, text/plain)
2016-02-11 03:33 UTC, Stefan Becker
Details
Kernel messages from 4.3.0 vanilla with initcall_debug (168.86 KB, text/plain)
2016-02-11 03:35 UTC, Stefan Becker
Details
Kernel messages from 4.3.0 vanilla+reverted with initcall_debug (170.06 KB, text/plain)
2016-02-11 03:36 UTC, Stefan Becker
Details
Kernel messages from 4.3.0 vanilla with initcall_debug (48.31 KB, text/plain)
2016-02-19 18:27 UTC, Stefan Becker
Details
Kernel messages from 4.3.0 vanilla+reverted with initcall_debug (47.81 KB, text/plain)
2016-02-19 18:28 UTC, Stefan Becker
Details
Kernel messages from 4.3.0 vanilla+reverted with initcall_debug (51.69 KB, text/plain)
2016-02-20 08:17 UTC, Stefan Becker
Details

Description Stefan Becker 2016-02-07 09:24:52 UTC
After upgrading from Fedora 23 kernel 4.2.8 to 4.3.x my Gigabyte GA-MA78GM-S2H board starts up immediately after poweroff (ACPI S5). As far as I can tell the RTC CMOS alarm timer is programmed incorrectly and causes the board to be woken up immediately.


Tested vanilla kernels:

GOOD: 4.2.0
BAD:  4.3.0, 4.4.0, 4.5.0-rc2+


When looking for poweroff and RTC related changes between 4.2 and 4.3 I found

commit 88b8d33b1c6aadba553c998db91c4b36be0fac52
Author: Adrian Huang <adrianhuang0701@gmail.com>
Date:   Mon Jul 6 12:19:12 2015 +0800

    rtc: cmos: Cancel alarm timer if alarm time is equal to now+1 seconds

    Steps to reproduce the problem:
        1) Enable RTC wake-up option in BIOS Setup
        2) Issue one of these commands in the OS: "poweroff"
           or "shutdown -h now"
        3) System will shut down and then reboot automatically
...

which sounds exactly how my board behaves *AFTER* switching to 4.3. Reverting this change did not solve my issue though. So I started a "git bisect 4.3 4.2" and it found

commit 52cdbdd49853dfa856082edb0f4c4c0249d9df07
Author: Grygorii Strashko <grygorii.strashko@ti.com>
Date:   Mon Jul 27 20:43:01 2015 +0300

    driver core: correct device's shutdown order
...

I built a kernel 4.3.0 + the above commit reverted and my issue is fixed.

The description of commit 52cdbdd49 sounds logical, so I wonder if there maybe is some unintended side effect with either ACPI or commit 88b8d33b1c6?


FYI: I also found bug #68331 which seems to be related (RTC alarm, similar motherboard with same chipset), but adding "hpet=disabled" to the kernel 4.3.0 boot command line does not fix my issue. Only reverting the above change does.
Comment 1 Stefan Becker 2016-02-11 03:33:59 UTC
Created attachment 203411 [details]
Kernel config for 4.3.0 used in testing

I used this configuration to compile my 4.3.0 test kernels (vanilla and vanilla+reverted). Generated from FC23 4.3.5-200 configuration using olddefconfig & localmodconfig
Comment 2 Stefan Becker 2016-02-11 03:35:00 UTC
Created attachment 203421 [details]
Kernel messages from 4.3.0 vanilla with initcall_debug
Comment 3 Stefan Becker 2016-02-11 03:36:20 UTC
Created attachment 203431 [details]
Kernel messages from 4.3.0 vanilla+reverted with initcall_debug
Comment 4 Stefan Becker 2016-02-19 18:27:10 UTC
Created attachment 203921 [details]
Kernel messages from 4.3.0 vanilla with initcall_debug

I've now access to the COM1 port on this HW and can now take kernel logs from serial console. Replacing the old "startup only" logs with "startup and shutdown -h" logs
Comment 5 Stefan Becker 2016-02-19 18:28:08 UTC
Created attachment 203931 [details]
Kernel messages from 4.3.0 vanilla+reverted with initcall_debug
Comment 6 Stefan Becker 2016-02-20 08:17:36 UTC
Created attachment 203981 [details]
Kernel messages from 4.3.0 vanilla+reverted with initcall_debug

Sorry, user asleep at keyboard. The log for 4.3.0+ was without initcall_debug. Fixed.

Comparing the two logs I see the following shutdown order difference between vanilla (shutdown not working):

[   98.084360] r8169 0000:02:00.0: shutdown
[   98.088746] pcieport 0000:00:0a.0: System wakeup enabled by ACPI
...
[  100.158794] rtc_cmos 00:02: shutdown

and vanilla+reverted (shutdown working):

[  112.318442] rtc_cmos 00:02: shutdown
...
[  112.337235] r8169 0000:02:00.0: shutdown
[  112.341454] pcieport 0000:00:0a.0: System wakeup enabled by ACPI

But that just may be related to WoL which is enabled on this machine too.
Comment 7 Stefan Becker 2016-02-25 18:22:51 UTC
Grygorii asked me to play around with the wakeup options in the BIOS.

Before doing that I looked around and tried to find the latest BIOS for my board. After updating from the original version F4 to the latest available F11 I'm no longer able to reproduce the issue.

Closing this as BIOS bug, i.e. INVALID.

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