Bug 10010 - Spurious RTC wakeup at 00:00 - linux-2.6.24 regression
Summary: Spurious RTC wakeup at 00:00 - linux-2.6.24 regression
Status: CLOSED PATCH_ALREADY_AVAILABLE
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Off (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: ykzhao
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-17 06:11 UTC by David Flater
Modified: 2008-06-12 01:33 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.24 ... 2.6.25.3
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
2.6.24.2 config to reproduce problem (43.41 KB, application/octet-stream)
2008-02-17 06:12 UTC, David Flater
Details
Requested info #1 (132.84 KB, application/octet-stream)
2008-02-18 06:24 UTC, David Flater
Details
Requested info #2 (21.22 KB, application/octet-stream)
2008-02-19 17:25 UTC, David Flater
Details
try the debug patch (1.07 KB, patch)
2008-04-28 02:13 UTC, ykzhao
Details | Diff
try the update patch (1.36 KB, patch)
2008-05-12 18:37 UTC, ykzhao
Details | Diff

Description David Flater 2008-02-17 06:11:33 UTC
Hardware Environment:
Intel 865PE chipset
Prescott CPU

Software Environment:
Wake on RTC is disabled in BIOS.
RTC wakeup time is unset, still at default 00:00.

Problem Description:
After ACPI shutdown in Linux, computer turns itself back on at the RTC wakeup time (00:00) even though RTC wakeup is disabled in BIOS and not otherwise requested.

Previously it appeared that enabling the kernel config option "Enhanced Real Time Clock Support" solved this problem.  However, since upgrading to mainline kernel 2.6.24.2, the problem occurs even though this option is enabled.

Steps to reproduce:
1.  Install kernel using the attached config.
2.  hwclock --set --date="2/17/2008 23:58"
3.  shutdown -t 1 -h now
4.  Wait 2 minutes

Workaround 1:
Disable ACPI.

Workaround 2:
Revert to kernel 2.6.23.9 and ensure that the kernel option "Enhanced Real Time Clock Support" is enabled.

History:  bug 4835, bug 4896, bug 5694.
Comment 1 David Flater 2008-02-17 06:12:27 UTC
Created attachment 14875 [details]
2.6.24.2 config to reproduce problem
Comment 2 ykzhao 2008-02-17 18:54:47 UTC
Will you please attach the output of acpidump?
It will be great if you can add the boot option of "acpi.debug_layer=0x04 acpi.debug_level=0x08000017" and attach the output of dmesg.
Comment 3 Zhang Rui 2008-02-17 19:13:59 UTC
what do you get if you cat /proc/acpi/alarm?
Comment 4 David Flater 2008-02-18 06:24:16 UTC
Created attachment 14886 [details]
Requested info #1

Requested info attached in debug.tar.bz2.  /proc/acpi/alarm is incriminating.

I thought the 00:00 alarm time was coming from the BIOS, but it's not.  See BIOS.jpg in debug.tar.bz2.
Comment 5 ykzhao 2008-02-18 21:39:10 UTC
Hi, David
    Thanks for the info.
    According to the description there are two issues about your laptop.
    1. Although Wake on RTC is disabled in BIOS and RTC wakeup time is unset, the /proc/acpi/alarm still display at default 00:00. 
       This problem won't break anything. After the system is booted with acpi enabled, OS will create the file of /proc/acpi/alarm .  Catting /proc/acpi/alarm will read the alarm info from RTC port. If RTC wakeup time is unset, /proc/acpi/alarm will display the default value stored in RTC alarm region.(hour, minute, second will be zero). 
    
    2. After ACPI shutdown in Linux, computer turns itself back on at the RTC wakeup time (00:00) even though RTC wakeup is disabled in BIOS and not otherwise
requested. 
   It seems that this is a regression.Will you please enable the kernel configuration of "enhanced RTC" and do the following test ?
      a. boot the system with the option of "acpi.debug_laeyr=0x04 acpi.debug_level=0x08000017"
      b.  cat /proc/acpi/alarm  and cat /proc/driver/rtc
      c.  hwclock --set --date="2/17/2008 23:58"
      d.  shutdown -t 1 -h now
   Both the failing kernel(2.6.24.2) and working kernel(2.6.23.12) are required.
   
   Thanks.
   
    
Comment 6 David Flater 2008-02-19 17:25:10 UTC
Created attachment 14908 [details]
Requested info #2

Requested info attached.  The working version is 2.6.23.9.  The affected computer is ATX not laptop.
Comment 7 Zhang Rui 2008-02-27 18:43:20 UTC
Could you narrow down the problem to a specific kernel release please?
As this is a regression, it would be much easier for us to debug if we can find out which kernel version this regression appears.
Comment 8 David Flater 2008-02-28 08:48:53 UTC
2.6.23.17 is good.  2.6.24 is bad.  2.6.24.3 is still bad.

FWIW, I verified that enabling Device Drivers -> Real Time Clock -> PC-style 'CMOS' in 2.6.24.3 does not help.  Diff of dmesg (before and after) shows:
> ACPI: RTC can wake from S4
> rtc_cmos: probe of 00:04 failed with error -16
> drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
Comment 9 Zhang Rui 2008-04-24 01:04:20 UTC
Does it still happen if you override the value in /proc/acpi/wakeup?

run "echo +0000-00-00 00:00:20 > /proc/acpi/wakeup",
what do you see in /proc/acpi/wakeup?
you should receive an ACPI interrupt after 20 seconds,
and the laptop should not wakeup at 00:00
Comment 10 David Flater 2008-04-24 19:35:09 UTC
sh-3.1# cat /proc/acpi/wakeup
Device  S-state   Status   Sysfs node
USB1      S3     disabled  pci:0000:00:1d.0
USB2      S3     disabled  pci:0000:00:1d.1
USB3      S3     disabled  pci:0000:00:1d.2
USB4      S3     disabled  pci:0000:00:1d.3
EHCI      S3     disabled  pci:0000:00:1d.7
ICHB      S4     disabled  pci:0000:00:1e.0
PS2K      S4     disabled  pnp:00:07
MC9       S4     disabled
sh-3.1# echo +0000-00-00 00:00:20 > /proc/acpi/wakeup
sh-3.1# cat /proc/acpi/wakeup
Device  S-state   Status   Sysfs node
USB1      S3     disabled  pci:0000:00:1d.0
USB2      S3     disabled  pci:0000:00:1d.1
USB3      S3     disabled  pci:0000:00:1d.2
USB4      S3     disabled  pci:0000:00:1d.3
EHCI      S3     disabled  pci:0000:00:1d.7
ICHB      S4     disabled  pci:0000:00:1e.0
PS2K      S4     disabled  pnp:00:07
MC9       S4     disabled

Nothing noticeable happened after 20 seconds (no log messages).
Computer woke up at 00:00 same as before.
Comment 11 ykzhao 2008-04-28 02:13:14 UTC
Created attachment 15947 [details]
try the debug patch

Will you please try the debug patch and see whether the problem still exists?
Thanks.
Comment 12 David Flater 2008-05-12 18:04:44 UTC
The patch worked.

Built mainline linux-2.6.25.3 with gcc 4.3.0.
Wakeup problem reproduced.
Applied the debug patch and retried.
Wakeup problem would not reproduce.
Comment 13 ykzhao 2008-05-12 18:37:12 UTC
Created attachment 16119 [details]
try the update patch

Thanks for the test. It seems that the desktop can work well after applying the patch in comment #11.
Will you please try the updated patch and see whether the system can work well.
Thanks.
Comment 14 David Flater 2008-05-13 19:45:28 UTC
The updated patch also works.
Comment 15 Len Brown 2008-05-13 21:32:58 UTC
patch applied to acpi-test tree
Comment 16 Adrian Bunk 2008-06-12 01:33:43 UTC
fix is now in Linus' tree as commit e1094bfa26e5e94af2fea79e004614dbce42b008

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