All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] efirtc: replace 1998 with EFI_RTC_EPOCH
@ 2015-11-02 14:49 Geliang Tang
  2015-11-02 14:49 ` [PATCH 2/2] efirtc: add efi_enabled check in efi_rtc_init Geliang Tang
  0 siblings, 1 reply; 5+ messages in thread
From: Geliang Tang @ 2015-11-02 14:49 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman; +Cc: Geliang Tang, linux-kernel

EFI_RTC_EPOCH macre has been defined. So I replace 1998 with it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/char/efirtc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/char/efirtc.c b/drivers/char/efirtc.c
index dc62568..5323d8c 100644
--- a/drivers/char/efirtc.c
+++ b/drivers/char/efirtc.c
@@ -82,8 +82,9 @@ compute_wday(efi_time_t *eft)
 	int y;
 	int ndays = 0;
 
-	if ( eft->year < 1998 ) {
-		printk(KERN_ERR "efirtc: EFI year < 1998, invalid date\n");
+	if ( eft->year < EFI_RTC_EPOCH ) {
+		printk(KERN_ERR "efirtc: EFI year < %d, invalid date\n",
+				EFI_RTC_EPOCH);
 		return -1;
 	}
 
-- 
2.4.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] efirtc: add efi_enabled check in efi_rtc_init
  2015-11-02 14:49 [PATCH 1/2] efirtc: replace 1998 with EFI_RTC_EPOCH Geliang Tang
@ 2015-11-02 14:49 ` Geliang Tang
  2015-11-02 15:37   ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Geliang Tang @ 2015-11-02 14:49 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman; +Cc: Geliang Tang, linux-kernel

Add efi_enabled check in efi_rtc_init() to make sure that efi is enabled.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/char/efirtc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/char/efirtc.c b/drivers/char/efirtc.c
index 5323d8c..80058bd 100644
--- a/drivers/char/efirtc.c
+++ b/drivers/char/efirtc.c
@@ -378,6 +378,9 @@ efi_rtc_init(void)
 	int ret;
 	struct proc_dir_entry *dir;
 
+	if (!efi_enabled(EFI_RUNTIME_SERVICES))
+		return 0;
+
 	printk(KERN_INFO "EFI Time Services Driver v%s\n", EFI_RTC_VERSION);
 
 	ret = misc_register(&efi_rtc_dev);
-- 
2.4.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] efirtc: add efi_enabled check in efi_rtc_init
  2015-11-02 14:49 ` [PATCH 2/2] efirtc: add efi_enabled check in efi_rtc_init Geliang Tang
@ 2015-11-02 15:37   ` Arnd Bergmann
  2015-11-04 14:45     ` Geliang Tang
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2015-11-02 15:37 UTC (permalink / raw)
  To: Geliang Tang; +Cc: Greg Kroah-Hartman, linux-kernel, Tony Luck, Fenghua Yu

On Monday 02 November 2015 22:49:01 Geliang Tang wrote:
> diff --git a/drivers/char/efirtc.c b/drivers/char/efirtc.c
> index 5323d8c..80058bd 100644
> --- a/drivers/char/efirtc.c
> +++ b/drivers/char/efirtc.c
> @@ -378,6 +378,9 @@ efi_rtc_init(void)
>         int ret;
>         struct proc_dir_entry *dir;
>  
> +       if (!efi_enabled(EFI_RUNTIME_SERVICES))
> +               return 0;
> 

Are there any Itanium machines that don't enable runtime services?
This seems a little redundant otherwise.

Are you trying to run the ancient driver on non-Itanium systems?

	Arnd

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] efirtc: add efi_enabled check in efi_rtc_init
  2015-11-02 15:37   ` Arnd Bergmann
@ 2015-11-04 14:45     ` Geliang Tang
  2015-11-04 14:51       ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Geliang Tang @ 2015-11-04 14:45 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Greg Kroah-Hartman, linux-kernel

On Mon, Nov 02, 2015 at 04:37:51PM +0100, Arnd Bergmann wrote:
> On Monday 02 November 2015 22:49:01 Geliang Tang wrote:
> > diff --git a/drivers/char/efirtc.c b/drivers/char/efirtc.c
> > index 5323d8c..80058bd 100644
> > --- a/drivers/char/efirtc.c
> > +++ b/drivers/char/efirtc.c
> > @@ -378,6 +378,9 @@ efi_rtc_init(void)
> >         int ret;
> >         struct proc_dir_entry *dir;
> >  
> > +       if (!efi_enabled(EFI_RUNTIME_SERVICES))
> > +               return 0;
> > 
> 
> Are there any Itanium machines that don't enable runtime services?
> This seems a little redundant otherwise.
> 
> Are you trying to run the ancient driver on non-Itanium systems?

Yes. I did run this driver on a EFI-based X86_64 machine.

Geliang Tang


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] efirtc: add efi_enabled check in efi_rtc_init
  2015-11-04 14:45     ` Geliang Tang
@ 2015-11-04 14:51       ` Arnd Bergmann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2015-11-04 14:51 UTC (permalink / raw)
  To: Geliang Tang; +Cc: Greg Kroah-Hartman, linux-kernel

On Wednesday 04 November 2015 22:45:42 Geliang Tang wrote:
> On Mon, Nov 02, 2015 at 04:37:51PM +0100, Arnd Bergmann wrote:
> > On Monday 02 November 2015 22:49:01 Geliang Tang wrote:
> > > diff --git a/drivers/char/efirtc.c b/drivers/char/efirtc.c
> > > index 5323d8c..80058bd 100644
> > > --- a/drivers/char/efirtc.c
> > > +++ b/drivers/char/efirtc.c
> > > @@ -378,6 +378,9 @@ efi_rtc_init(void)
> > >         int ret;
> > >         struct proc_dir_entry *dir;
> > >  
> > > +       if (!efi_enabled(EFI_RUNTIME_SERVICES))
> > > +               return 0;
> > > 
> > 
> > Are there any Itanium machines that don't enable runtime services?
> > This seems a little redundant otherwise.
> > 
> > Are you trying to run the ancient driver on non-Itanium systems?
> 
> Yes. I did run this driver on a EFI-based X86_64 machine.

There should already be a Kconfig dependency that prevents you from
doing this. Just use the normal rtc-efi driver instead of the
old efirtc driver.

	Arnd

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-04 14:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-02 14:49 [PATCH 1/2] efirtc: replace 1998 with EFI_RTC_EPOCH Geliang Tang
2015-11-02 14:49 ` [PATCH 2/2] efirtc: add efi_enabled check in efi_rtc_init Geliang Tang
2015-11-02 15:37   ` Arnd Bergmann
2015-11-04 14:45     ` Geliang Tang
2015-11-04 14:51       ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.