提交 19bfe37c 编写于 作者: D David Brownell 提交者: Linus Torvalds

workaround rtc-related acpi table bugs

This works around a bug seen in some RTC-related ACPI table entries, and
tweaks related diagnostics to follow the ACPI convention.

The bug prevents misleading boot-time messages: platforms affected by this
bug wrongly report they can support alarms up to one year in the future,
when in fact the longest alarm is just 24 hours.  That will surprise anyone
trying to use those extended alarms.
Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 f5f72b46
...@@ -316,13 +316,20 @@ static int __init acpi_rtc_init(void) ...@@ -316,13 +316,20 @@ static int __init acpi_rtc_init(void)
rtc_info.wake_on = rtc_wake_on; rtc_info.wake_on = rtc_wake_on;
rtc_info.wake_off = rtc_wake_off; rtc_info.wake_off = rtc_wake_off;
/* workaround bug in some ACPI tables */
if (acpi_gbl_FADT.month_alarm && !acpi_gbl_FADT.day_alarm) {
DBG("bogus FADT month_alarm\n");
acpi_gbl_FADT.month_alarm = 0;
}
rtc_info.rtc_day_alarm = acpi_gbl_FADT.day_alarm; rtc_info.rtc_day_alarm = acpi_gbl_FADT.day_alarm;
rtc_info.rtc_mon_alarm = acpi_gbl_FADT.month_alarm; rtc_info.rtc_mon_alarm = acpi_gbl_FADT.month_alarm;
rtc_info.rtc_century = acpi_gbl_FADT.century; rtc_info.rtc_century = acpi_gbl_FADT.century;
/* NOTE: S4_RTC_WAKE is NOT currently useful to Linux */ /* NOTE: S4_RTC_WAKE is NOT currently useful to Linux */
if (acpi_gbl_FADT.flags & ACPI_FADT_S4_RTC_WAKE) if (acpi_gbl_FADT.flags & ACPI_FADT_S4_RTC_WAKE)
printk("ACPI: RTC can wake from S4\n"); printk(PREFIX "RTC can wake from S4\n");
dev->platform_data = &rtc_info; dev->platform_data = &rtc_info;
...@@ -331,7 +338,7 @@ static int __init acpi_rtc_init(void) ...@@ -331,7 +338,7 @@ static int __init acpi_rtc_init(void)
put_device(dev); put_device(dev);
} else } else
pr_debug("ACPI: RTC unavailable?\n"); DBG("RTC unavailable?\n");
return 0; return 0;
} }
/* do this between RTC subsys_initcall() and rtc_cmos driver_initcall() */ /* do this between RTC subsys_initcall() and rtc_cmos driver_initcall() */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册