* [patch 2.6.21-rc6-git] workaround rtc-related acpi table bugs
@ 2007-04-12 21:14 David Brownell
2007-04-18 3:10 ` Len Brown
0 siblings, 1 reply; 3+ messages in thread
From: David Brownell @ 2007-04-12 21:14 UTC (permalink / raw)
To: Linux Kernel list; +Cc: linux-acpi, Andrew Morton
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>
---
glue.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
--- g26.orig/drivers/acpi/glue.c 2007-04-12 10:56:35.000000000 -0700
+++ g26/drivers/acpi/glue.c 2007-04-12 10:56:35.000000000 -0700
@@ -316,13 +316,19 @@ static int __init acpi_rtc_init(void)
rtc_info.wake_on = rtc_wake_on;
rtc_info.wake_off = rtc_wake_off;
+ 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_mon_alarm = acpi_gbl_FADT.month_alarm;
rtc_info.rtc_century = acpi_gbl_FADT.century;
/* NOTE: S4_RTC_WAKE is NOT currently useful to Linux */
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;
@@ -331,7 +337,7 @@ static int __init acpi_rtc_init(void)
put_device(dev);
} else
- pr_debug("ACPI: RTC unavailable?\n");
+ DBG("RTC unavailable?\n");
return 0;
}
/* do this between RTC subsys_initcall() and rtc_cmos driver_initcall() */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch 2.6.21-rc6-git] workaround rtc-related acpi table bugs
2007-04-12 21:14 [patch 2.6.21-rc6-git] workaround rtc-related acpi table bugs David Brownell
@ 2007-04-18 3:10 ` Len Brown
2007-04-18 4:41 ` David Brownell
0 siblings, 1 reply; 3+ messages in thread
From: Len Brown @ 2007-04-18 3:10 UTC (permalink / raw)
To: David Brownell; +Cc: Linux Kernel list, linux-acpi, Andrew Morton
On Thursday 12 April 2007 17:14, David Brownell wrote:
> 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>
> ---
> glue.c | 10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)
>
> --- g26.orig/drivers/acpi/glue.c 2007-04-12 10:56:35.000000000 -0700
> +++ g26/drivers/acpi/glue.c 2007-04-12 10:56:35.000000000 -0700
> @@ -316,13 +316,19 @@ static int __init acpi_rtc_init(void)
> rtc_info.wake_on = rtc_wake_on;
> rtc_info.wake_off = rtc_wake_off;
probably worth a comment right here that this clause is a BIOS workaround.
Unclear what value the DBG statement adds, since only somebody
editing this file will ever enable it.
-Len
> + 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_mon_alarm = acpi_gbl_FADT.month_alarm;
> rtc_info.rtc_century = acpi_gbl_FADT.century;
>
> /* NOTE: S4_RTC_WAKE is NOT currently useful to Linux */
> 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;
>
> @@ -331,7 +337,7 @@ static int __init acpi_rtc_init(void)
>
> put_device(dev);
> } else
> - pr_debug("ACPI: RTC unavailable?\n");
> + DBG("RTC unavailable?\n");
> return 0;
> }
> /* do this between RTC subsys_initcall() and rtc_cmos driver_initcall() */
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch 2.6.21-rc6-git] workaround rtc-related acpi table bugs
2007-04-18 3:10 ` Len Brown
@ 2007-04-18 4:41 ` David Brownell
0 siblings, 0 replies; 3+ messages in thread
From: David Brownell @ 2007-04-18 4:41 UTC (permalink / raw)
To: Len Brown; +Cc: Linux Kernel list, linux-acpi, Andrew Morton
On Tuesday 17 April 2007 8:10 pm, Len Brown wrote:
> On Thursday 12 April 2007 17:14, David Brownell wrote:
> > --- g26.orig/drivers/acpi/glue.c 2007-04-12 10:56:35.000000000 -0700
> > +++ g26/drivers/acpi/glue.c 2007-04-12 10:56:35.000000000 -0700
> > @@ -316,13 +316,19 @@ static int __init acpi_rtc_init(void)
> > rtc_info.wake_on = rtc_wake_on;
> > rtc_info.wake_off = rtc_wake_off;
>
> probably worth a comment right here that this clause is a BIOS workaround.
Done, see the appended.
> Unclear what value the DBG statement adds, since only somebody
> editing this file will ever enable it.
Um, it should come automagically when ACPI debug is enabled, right?
Just like when any other subsystem's debug tools are enabled.
... AH, I see, "glue" is a separate debug category not affected by
Kconfig. Buglike. :)
- Dave
> -Len
>
> > + if (acpi_gbl_FADT.month_alarm && !acpi_gbl_FADT.day_alarm) {
> > + DBG("bogus FADT month_alarm\n");
> > + acpi_gbl_FADT.month_alarm = 0;
> > + }
> ...
=============== CUT HERE
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>
---
drivers/acpi/glue.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
--- g26.orig/drivers/acpi/glue.c 2007-04-17 17:46:47.000000000 -0700
+++ g26/drivers/acpi/glue.c 2007-04-17 21:31:27.000000000 -0700
@@ -316,13 +316,20 @@ static int __init acpi_rtc_init(void)
rtc_info.wake_on = rtc_wake_on;
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_mon_alarm = acpi_gbl_FADT.month_alarm;
rtc_info.rtc_century = acpi_gbl_FADT.century;
/* NOTE: S4_RTC_WAKE is NOT currently useful to Linux */
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;
@@ -331,7 +338,7 @@ static int __init acpi_rtc_init(void)
put_device(dev);
} else
- pr_debug("ACPI: RTC unavailable?\n");
+ DBG("RTC unavailable?\n");
return 0;
}
/* do this between RTC subsys_initcall() and rtc_cmos driver_initcall() */
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-04-18 4:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-12 21:14 [patch 2.6.21-rc6-git] workaround rtc-related acpi table bugs David Brownell
2007-04-18 3:10 ` Len Brown
2007-04-18 4:41 ` David Brownell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox