* [PATCH, resend] x86: enable rtc-efi
@ 2012-05-15 12:08 Jan Beulich
2012-05-15 12:38 ` Matthew Garrett
0 siblings, 1 reply; 10+ messages in thread
From: Jan Beulich @ 2012-05-15 12:08 UTC (permalink / raw)
To: mingo, tglx, hpa; +Cc: dannf, matt.fleming, mjg, linux-kernel
Besides a Kconfig change this just requires creating a corresponding
platform device.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: dann frazier <dannf@dannf.org>
Cc: Matt Fleming <matt.fleming@intel.com>
Cc: Matthew Garrett <mjg@redhat.com>
---
arch/x86/platform/efi/efi.c | 19 +++++++++++++++++++
drivers/rtc/Kconfig | 2 +-
2 files changed, 20 insertions(+), 1 deletion(-)
--- 3.4-rc7/arch/x86/platform/efi/efi.c
+++ 3.4-rc7-EFI-RTC-platform-dev/arch/x86/platform/efi/efi.c
@@ -34,6 +34,7 @@
#include <linux/export.h>
#include <linux/bootmem.h>
#include <linux/memblock.h>
+#include <linux/platform_device.h>
#include <linux/spinlock.h>
#include <linux/uaccess.h>
#include <linux/time.h>
@@ -912,6 +913,24 @@ out:
kfree(new_memmap);
}
+static struct platform_device rtc_efi_dev = {
+ .name = "rtc-efi",
+ .id = -1,
+};
+
+static int __init rtc_init(void)
+{
+ if (!efi_enabled)
+ return -ENODEV;
+
+ if (platform_device_register(&rtc_efi_dev) < 0)
+ printk(KERN_ERR "unable to register EFI RTC device...\n");
+
+ /* not necessarily an error */
+ return 0;
+}
+arch_initcall(rtc_init);
+
/*
* Convenience functions to obtain memory types and attributes
*/
--- 3.4-rc7/drivers/rtc/Kconfig
+++ 3.4-rc7-EFI-RTC-platform-dev/drivers/rtc/Kconfig
@@ -563,7 +563,7 @@ config RTC_DRV_DA9052
config RTC_DRV_EFI
tristate "EFI RTC"
- depends on IA64
+ depends on EFI
help
If you say yes here you will get support for the EFI
Real Time Clock.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH, resend] x86: enable rtc-efi
2012-05-15 12:08 [PATCH, resend] x86: enable rtc-efi Jan Beulich
@ 2012-05-15 12:38 ` Matthew Garrett
2012-05-15 12:41 ` Matt Fleming
2012-05-15 13:08 ` Jan Beulich
0 siblings, 2 replies; 10+ messages in thread
From: Matthew Garrett @ 2012-05-15 12:38 UTC (permalink / raw)
To: Jan Beulich; +Cc: mingo, tglx, hpa, dannf, matt.fleming, linux-kernel
On Tue, May 15, 2012 at 01:08:22PM +0100, Jan Beulich wrote:
> Besides a Kconfig change this just requires creating a corresponding
> platform device.
I don't think this is a good idea yet - we completely fail to perform
timezone handling with the EFI clock, which violates platform
expectations. We should fix that up first.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH, resend] x86: enable rtc-efi
2012-05-15 12:38 ` Matthew Garrett
@ 2012-05-15 12:41 ` Matt Fleming
2012-05-15 12:50 ` Matthew Garrett
2012-05-15 13:08 ` Jan Beulich
1 sibling, 1 reply; 10+ messages in thread
From: Matt Fleming @ 2012-05-15 12:41 UTC (permalink / raw)
To: Matthew Garrett; +Cc: Jan Beulich, mingo, tglx, hpa, dannf, linux-kernel
On Tue, 2012-05-15 at 13:38 +0100, Matthew Garrett wrote:
> On Tue, May 15, 2012 at 01:08:22PM +0100, Jan Beulich wrote:
> > Besides a Kconfig change this just requires creating a corresponding
> > platform device.
>
> I don't think this is a good idea yet - we completely fail to perform
> timezone handling with the EFI clock, which violates platform
> expectations. We should fix that up first.
Last time I spoke to Thomas about this, the impression I got was that
the kernel didn't need to worry about handling the timezone for this
case.
Unless I'm missing something?
--
Matt Fleming, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH, resend] x86: enable rtc-efi
2012-05-15 12:41 ` Matt Fleming
@ 2012-05-15 12:50 ` Matthew Garrett
0 siblings, 0 replies; 10+ messages in thread
From: Matthew Garrett @ 2012-05-15 12:50 UTC (permalink / raw)
To: Matt Fleming; +Cc: Jan Beulich, mingo, tglx, hpa, dannf, linux-kernel
On Tue, May 15, 2012 at 01:41:17PM +0100, Matt Fleming wrote:
> Last time I spoke to Thomas about this, the impression I got was that
> the kernel didn't need to worry about handling the timezone for this
> case.
>
> Unless I'm missing something?
We always pass EFI_UNSPECIFIED_TIMEZONE which is really not how this is
meant to work.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH, resend] x86: enable rtc-efi
2012-05-15 12:38 ` Matthew Garrett
2012-05-15 12:41 ` Matt Fleming
@ 2012-05-15 13:08 ` Jan Beulich
2012-05-15 13:16 ` Matthew Garrett
1 sibling, 1 reply; 10+ messages in thread
From: Jan Beulich @ 2012-05-15 13:08 UTC (permalink / raw)
To: Matthew Garrett; +Cc: dannf, mingo, tglx, matt.fleming, linux-kernel, hpa
>>> On 15.05.12 at 14:38, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> On Tue, May 15, 2012 at 01:08:22PM +0100, Jan Beulich wrote:
>> Besides a Kconfig change this just requires creating a corresponding
>> platform device.
>
> I don't think this is a good idea yet - we completely fail to perform
> timezone handling with the EFI clock, which violates platform
> expectations. We should fix that up first.
So how is this driver okay on ia64 then? It's my understanding
that either it's entirely broken, or should be used universally.
That's the more that accessing the RTC directly isn't really being
permitted by the EFI spec (i.e. using this driver really is a
requirement, not an option).
Jan
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH, resend] x86: enable rtc-efi
2012-05-15 13:08 ` Jan Beulich
@ 2012-05-15 13:16 ` Matthew Garrett
2012-05-15 13:22 ` Jan Beulich
0 siblings, 1 reply; 10+ messages in thread
From: Matthew Garrett @ 2012-05-15 13:16 UTC (permalink / raw)
To: Jan Beulich; +Cc: dannf, mingo, tglx, matt.fleming, linux-kernel, hpa
On Tue, May 15, 2012 at 02:08:54PM +0100, Jan Beulich wrote:
> So how is this driver okay on ia64 then? It's my understanding
> that either it's entirely broken, or should be used universally.
> That's the more that accessing the RTC directly isn't really being
> permitted by the EFI spec (i.e. using this driver really is a
> requirement, not an option).
ia64 is basically never dual booted. If there's an RTC in the ACPI
tables then it's completely valid to use the legacy RTC.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH, resend] x86: enable rtc-efi
2012-05-15 13:16 ` Matthew Garrett
@ 2012-05-15 13:22 ` Jan Beulich
2012-05-15 13:26 ` Matthew Garrett
0 siblings, 1 reply; 10+ messages in thread
From: Jan Beulich @ 2012-05-15 13:22 UTC (permalink / raw)
To: Matthew Garrett; +Cc: dannf, mingo, tglx, matt.fleming, linux-kernel, hpa
>>> On 15.05.12 at 15:16, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> On Tue, May 15, 2012 at 02:08:54PM +0100, Jan Beulich wrote:
>
>> So how is this driver okay on ia64 then? It's my understanding
>> that either it's entirely broken, or should be used universally.
>> That's the more that accessing the RTC directly isn't really being
>> permitted by the EFI spec (i.e. using this driver really is a
>> requirement, not an option).
>
> ia64 is basically never dual booted. If there's an RTC in the ACPI
> tables then it's completely valid to use the legacy RTC.
I don't think so - the two drivers could end up manipulating the
same piece of hardware, without synchronization. rtc-cmos
really should bail when loaded on an EFI-enabled system.
Jan
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH, resend] x86: enable rtc-efi
2012-05-15 13:22 ` Jan Beulich
@ 2012-05-15 13:26 ` Matthew Garrett
2012-05-15 13:36 ` Jan Beulich
0 siblings, 1 reply; 10+ messages in thread
From: Matthew Garrett @ 2012-05-15 13:26 UTC (permalink / raw)
To: Jan Beulich; +Cc: dannf, mingo, tglx, matt.fleming, linux-kernel, hpa
On Tue, May 15, 2012 at 02:22:53PM +0100, Jan Beulich wrote:
> I don't think so - the two drivers could end up manipulating the
> same piece of hardware, without synchronization. rtc-cmos
> really should bail when loaded on an EFI-enabled system.
That's why we're taking the rtc lock.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH, resend] x86: enable rtc-efi
2012-05-15 13:26 ` Matthew Garrett
@ 2012-05-15 13:36 ` Jan Beulich
2012-05-15 13:40 ` Matthew Garrett
0 siblings, 1 reply; 10+ messages in thread
From: Jan Beulich @ 2012-05-15 13:36 UTC (permalink / raw)
To: Matthew Garrett; +Cc: dannf, mingo, tglx, matt.fleming, linux-kernel, hpa
>>> On 15.05.12 at 15:26, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> On Tue, May 15, 2012 at 02:22:53PM +0100, Jan Beulich wrote:
>
>> I don't think so - the two drivers could end up manipulating the
>> same piece of hardware, without synchronization. rtc-cmos
>> really should bail when loaded on an EFI-enabled system.
>
> That's why we're taking the rtc lock.
Which is completely bogus imo (i.e. it should be a goal to remove
this).
Jan
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH, resend] x86: enable rtc-efi
2012-05-15 13:36 ` Jan Beulich
@ 2012-05-15 13:40 ` Matthew Garrett
0 siblings, 0 replies; 10+ messages in thread
From: Matthew Garrett @ 2012-05-15 13:40 UTC (permalink / raw)
To: Jan Beulich; +Cc: dannf, mingo, tglx, matt.fleming, linux-kernel, hpa
On Tue, May 15, 2012 at 02:36:18PM +0100, Jan Beulich wrote:
> >>> On 15.05.12 at 15:26, Matthew Garrett <mjg59@srcf.ucam.org> wrote:
> > On Tue, May 15, 2012 at 02:22:53PM +0100, Jan Beulich wrote:
> >
> >> I don't think so - the two drivers could end up manipulating the
> >> same piece of hardware, without synchronization. rtc-cmos
> >> really should bail when loaded on an EFI-enabled system.
> >
> > That's why we're taking the rtc lock.
>
> Which is completely bogus imo (i.e. it should be a goal to remove
> this).
Sure, once we've fixed the EFI clock and made sure that there's no
lingering accesses to the old nvram.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-05-15 13:40 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-15 12:08 [PATCH, resend] x86: enable rtc-efi Jan Beulich
2012-05-15 12:38 ` Matthew Garrett
2012-05-15 12:41 ` Matt Fleming
2012-05-15 12:50 ` Matthew Garrett
2012-05-15 13:08 ` Jan Beulich
2012-05-15 13:16 ` Matthew Garrett
2012-05-15 13:22 ` Jan Beulich
2012-05-15 13:26 ` Matthew Garrett
2012-05-15 13:36 ` Jan Beulich
2012-05-15 13:40 ` Matthew Garrett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox