diff options
author | David Brownell <david-b@pacbell.net> | 2007-05-08 03:34:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:18 -0400 |
commit | 19bfe37caa8184768ecc15269302f42036625259 (patch) | |
tree | 01d1722ab64dab22712af4c40bb35fd7d7333df5 /drivers/acpi | |
parent | f5f72b46c349fefcfd4421b2213c6ffb324c5e56 (diff) |
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: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/glue.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index 83768e9cf296..41427a41f620 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c | |||
@@ -316,13 +316,20 @@ static int __init acpi_rtc_init(void) | |||
316 | rtc_info.wake_on = rtc_wake_on; | 316 | rtc_info.wake_on = rtc_wake_on; |
317 | rtc_info.wake_off = rtc_wake_off; | 317 | rtc_info.wake_off = rtc_wake_off; |
318 | 318 | ||
319 | /* workaround bug in some ACPI tables */ | ||
320 | if (acpi_gbl_FADT.month_alarm && !acpi_gbl_FADT.day_alarm) { | ||
321 | DBG("bogus FADT month_alarm\n"); | ||
322 | acpi_gbl_FADT.month_alarm = 0; | ||
323 | } | ||
324 | |||
319 | rtc_info.rtc_day_alarm = acpi_gbl_FADT.day_alarm; | 325 | rtc_info.rtc_day_alarm = acpi_gbl_FADT.day_alarm; |
320 | rtc_info.rtc_mon_alarm = acpi_gbl_FADT.month_alarm; | 326 | rtc_info.rtc_mon_alarm = acpi_gbl_FADT.month_alarm; |
321 | rtc_info.rtc_century = acpi_gbl_FADT.century; | 327 | rtc_info.rtc_century = acpi_gbl_FADT.century; |
322 | 328 | ||
323 | /* NOTE: S4_RTC_WAKE is NOT currently useful to Linux */ | 329 | /* NOTE: S4_RTC_WAKE is NOT currently useful to Linux */ |
324 | if (acpi_gbl_FADT.flags & ACPI_FADT_S4_RTC_WAKE) | 330 | if (acpi_gbl_FADT.flags & ACPI_FADT_S4_RTC_WAKE) |
325 | printk("ACPI: RTC can wake from S4\n"); | 331 | printk(PREFIX "RTC can wake from S4\n"); |
332 | |||
326 | 333 | ||
327 | dev->platform_data = &rtc_info; | 334 | dev->platform_data = &rtc_info; |
328 | 335 | ||
@@ -331,7 +338,7 @@ static int __init acpi_rtc_init(void) | |||
331 | 338 | ||
332 | put_device(dev); | 339 | put_device(dev); |
333 | } else | 340 | } else |
334 | pr_debug("ACPI: RTC unavailable?\n"); | 341 | DBG("RTC unavailable?\n"); |
335 | return 0; | 342 | return 0; |
336 | } | 343 | } |
337 | /* do this between RTC subsys_initcall() and rtc_cmos driver_initcall() */ | 344 | /* do this between RTC subsys_initcall() and rtc_cmos driver_initcall() */ |