diff mbox

Re: [RFT][PATCH] ACPI / init: Run acpi_early_init() before efi_enter_virtual_mode() (was: Re: [RFC PATCH 00/14] Support timezone of ACPI TAD and EFI TIME)

Message ID 1389672548.24105.252.camel@linux-s257.site
State Superseded
Headers show

Commit Message

joeyli Jan. 14, 2014, 4:09 a.m. UTC
於 日,2014-01-12 於 01:30 +0100,Rafael J. Wysocki 提到:
> OK
> 
> I don't see any adverse effects of the patch below on a couple of my
> test
> boxes, but (a) they are Intel-based and (b) they are non-EFI, so it
> would be
> good to give it a go on as many machines as reasonably possible.
> 
> Thanks,
> Rafael
> 
> ---
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Subject: ACPI / init: Run acpi_early_init() before
> efi_enter_virtual_mode()
> 
> According to Matt Fleming, if acpi_early_init() was executed befpre
> efi_enter_virtual_mode(), the EFI initialization could benefit from
> it, so make that happen.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  init/main.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-pm/init/main.c
> ===================================================================
> --- linux-pm.orig/init/main.c
> +++ linux-pm/init/main.c
> @@ -615,6 +615,7 @@ asmlinkage void __init start_kernel(void
>         calibrate_delay();
>         pidmap_init();
>         anon_vma_init();
> +       acpi_early_init();
>  #ifdef CONFIG_X86
>         if (efi_enabled(EFI_RUNTIME_SERVICES))
>                 efi_enter_virtual_mode();
> @@ -641,7 +642,6 @@ asmlinkage void __init start_kernel(void
>  
>         check_bugs();
>  
> -       acpi_early_init(); /* before LAPIC and SMP init */
>         sfi_init_late();
>  
>         if (efi_enabled(EFI_RUNTIME_SERVICES)) {
> 
> 
> 

This patch works to me on Acer Gateway Z5WT2 UEFI notebook and Intel
UEFI development board.

Does it possible move acpi_early_init() to before timekeeping_init()?
The position is also before efi_enter_virtual_mode() and that will be
useful for parsing ACPI TAD to set system clock:



Thanks a lot!
Joey Lee

Comments

Rafael J. Wysocki Jan. 14, 2014, 4:50 p.m. UTC | #1
On Tuesday, January 14, 2014 12:09:08 PM joeyli wrote:
> 於 日,2014-01-12 於 01:30 +0100,Rafael J. Wysocki 提到:
> > OK
> > 
> > I don't see any adverse effects of the patch below on a couple of my
> > test
> > boxes, but (a) they are Intel-based and (b) they are non-EFI, so it
> > would be
> > good to give it a go on as many machines as reasonably possible.
> > 
> > Thanks,
> > Rafael
> > 
> > ---
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > Subject: ACPI / init: Run acpi_early_init() before
> > efi_enter_virtual_mode()
> > 
> > According to Matt Fleming, if acpi_early_init() was executed befpre
> > efi_enter_virtual_mode(), the EFI initialization could benefit from
> > it, so make that happen.
> > 
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > ---
> >  init/main.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > Index: linux-pm/init/main.c
> > ===================================================================
> > --- linux-pm.orig/init/main.c
> > +++ linux-pm/init/main.c
> > @@ -615,6 +615,7 @@ asmlinkage void __init start_kernel(void
> >         calibrate_delay();
> >         pidmap_init();
> >         anon_vma_init();
> > +       acpi_early_init();
> >  #ifdef CONFIG_X86
> >         if (efi_enabled(EFI_RUNTIME_SERVICES))
> >                 efi_enter_virtual_mode();
> > @@ -641,7 +642,6 @@ asmlinkage void __init start_kernel(void
> >  
> >         check_bugs();
> >  
> > -       acpi_early_init(); /* before LAPIC and SMP init */
> >         sfi_init_late();
> >  
> >         if (efi_enabled(EFI_RUNTIME_SERVICES)) {
> > 
> > 
> > 
> 
> This patch works to me on Acer Gateway Z5WT2 UEFI notebook and Intel
> UEFI development board.
> 
> Does it possible move acpi_early_init() to before timekeeping_init()?

We can do that if it doesn't cause any problems to happen.

Please resubmit your patch with a changelog and we'll ask everyone to try it.

Thanks!

> The position is also before efi_enter_virtual_mode() and that will be
> useful for parsing ACPI TAD to set system clock:
> 
> diff --git a/init/main.c b/init/main.c
> index febc511..b6d93c8 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -565,6 +565,7 @@ asmlinkage void __init start_kernel(void)
>         init_timers();
>         hrtimers_init();
>         softirq_init();
> +       acpi_early_init();
>         timekeeping_init();
>         time_init();
>         sched_clock_postinit();
> @@ -641,7 +642,6 @@ asmlinkage void __init start_kernel(void)
>  
>         check_bugs();
>  
> -       acpi_early_init(); /* before LAPIC and SMP init */
>         sfi_init_late();
>  
>         if (efi_enabled(EFI_RUNTIME_SERVICES)) {
> 
> 
> Thanks a lot!
> Joey Lee
>
H. Peter Anvin Jan. 14, 2014, 6 p.m. UTC | #2
On 01/13/2014 08:09 PM, joeyli wrote:
> 
> This patch works to me on Acer Gateway Z5WT2 UEFI notebook and Intel
> UEFI development board.
> 
> Does it possible move acpi_early_init() to before timekeeping_init()?
> The position is also before efi_enter_virtual_mode() and that will be
> useful for parsing ACPI TAD to set system clock:
> 
> diff --git a/init/main.c b/init/main.c
> index febc511..b6d93c8 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -565,6 +565,7 @@ asmlinkage void __init start_kernel(void)
>         init_timers();
>         hrtimers_init();
>         softirq_init();
> +       acpi_early_init();
>         timekeeping_init();
>         time_init();
>         sched_clock_postinit();
> @@ -641,7 +642,6 @@ asmlinkage void __init start_kernel(void)
>  
>         check_bugs();
>  
> -       acpi_early_init(); /* before LAPIC and SMP init */
>         sfi_init_late();
>  
>         if (efi_enabled(EFI_RUNTIME_SERVICES)) {
> 

Hi Toshi,

Could you try this variant, too?  If this works as well then we end up
solving two problems in one patch...

	-hpa
Toshi Kani Jan. 14, 2014, 8:32 p.m. UTC | #3
On Tue, 2014-01-14 at 10:00 -0800, H. Peter Anvin wrote:
> On 01/13/2014 08:09 PM, joeyli wrote:
> > 
> > This patch works to me on Acer Gateway Z5WT2 UEFI notebook and Intel
> > UEFI development board.
> > 
> > Does it possible move acpi_early_init() to before timekeeping_init()?
> > The position is also before efi_enter_virtual_mode() and that will be
> > useful for parsing ACPI TAD to set system clock:
> > 
> > diff --git a/init/main.c b/init/main.c
> > index febc511..b6d93c8 100644
> > --- a/init/main.c
> > +++ b/init/main.c
> > @@ -565,6 +565,7 @@ asmlinkage void __init start_kernel(void)
> >         init_timers();
> >         hrtimers_init();
> >         softirq_init();
> > +       acpi_early_init();
> >         timekeeping_init();
> >         time_init();
> >         sched_clock_postinit();
> > @@ -641,7 +642,6 @@ asmlinkage void __init start_kernel(void)
> >  
> >         check_bugs();
> >  
> > -       acpi_early_init(); /* before LAPIC and SMP init */
> >         sfi_init_late();
> >  
> >         if (efi_enabled(EFI_RUNTIME_SERVICES)) {
> > 
> 
> Hi Toshi,
> 
> Could you try this variant, too?  If this works as well then we end up
> solving two problems in one patch...

Hi Peter,

Yes, this version works fine as well.

Tested-by: Toshi Kani <toshi.kani@hp.com>

Thanks,
-Toshi
joeyli Jan. 15, 2014, 7:18 a.m. UTC | #4
於 二,2014-01-14 於 13:32 -0700,Toshi Kani 提到:
> > > +       acpi_early_init();
> > >         timekeeping_init();
> > >         time_init();
> > >         sched_clock_postinit();
> > > @@ -641,7 +642,6 @@ asmlinkage void __init start_kernel(void)
> > >  
> > >         check_bugs();
> > >  
> > > -       acpi_early_init(); /* before LAPIC and SMP init */
> > >         sfi_init_late();
> > >  
> > >         if (efi_enabled(EFI_RUNTIME_SERVICES)) {
> > > 
> > 
> > Hi Toshi,
> > 
> > Could you try this variant, too?  If this works as well then we end
> up
> > solving two problems in one patch...
> 
> Hi Peter,
> 
> Yes, this version works fine as well.
> 
> Tested-by: Toshi Kani <toshi.kani@hp.com>
> 
> Thanks,
> -Toshi

Thanks a lot for your testing.

I will re-send a formal patch with changelog to everybody.

Regards
Joey Lee
diff mbox

Patch

diff --git a/init/main.c b/init/main.c
index febc511..b6d93c8 100644
--- a/init/main.c
+++ b/init/main.c
@@ -565,6 +565,7 @@  asmlinkage void __init start_kernel(void)
        init_timers();
        hrtimers_init();
        softirq_init();
+       acpi_early_init();
        timekeeping_init();
        time_init();
        sched_clock_postinit();
@@ -641,7 +642,6 @@  asmlinkage void __init start_kernel(void)
 
        check_bugs();
 
-       acpi_early_init(); /* before LAPIC and SMP init */
        sfi_init_late();
 
        if (efi_enabled(EFI_RUNTIME_SERVICES)) {