LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: "Li, Aubrey" <aubrey.li@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	arjan@linux.intel.com, "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len.Brown@intel.com, x86@kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86: Bypass legacy PIC and PIT on ACPI hardware reduced platform
Date: Wed, 4 Mar 2015 06:08:58 +0100	[thread overview]
Message-ID: <20150304050858.GB5158@gmail.com> (raw)
In-Reply-To: <54F67ACC.3010500@linux.intel.com>


* Li, Aubrey <aubrey.li@linux.intel.com> wrote:

> On ACPI hardware reduced platform, the legacy PIC and PIT may not be
> initialized even though they may be present in silicon. Touching
> these legacy components causes unexpected result on system.
> 
> On Bay Trail-T(ASUS-T100) platform, touching these legacy components
> blocks platform hardware low idle power state(S0ix) during system suspend.
> So we should bypass them on ACPI hardware reduced platform.
> 
> Suggested-by: Arjan van de Ven <arjan@linux.intel.com>
> Signed-off-by: Li Aubrey <aubrey.li@linux.intel.com>
> Cc: Len Brown <len.brown@intel.com>
> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  arch/x86/kernel/irqinit.c | 6 +++++-
>  arch/x86/kernel/time.c    | 3 ++-
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
> index 70e181e..9a64cc3 100644
> --- a/arch/x86/kernel/irqinit.c
> +++ b/arch/x86/kernel/irqinit.c
> @@ -75,7 +75,11 @@ void __init init_ISA_irqs(void)
>  #if defined(CONFIG_X86_64) || defined(CONFIG_X86_LOCAL_APIC)
>  	init_bsp_APIC();
>  #endif
> -	legacy_pic->init(0);
> +	if (acpi_gbl_reduced_hardware) {
> +		pr_info("Using NULL legacy PIC\n");
> +		legacy_pic = &null_legacy_pic;
> +	} else
> +		legacy_pic->init(0);
>  
>  	for (i = 0; i < nr_legacy_irqs(); i++)
>  		irq_set_chip_and_handler(i, chip, handle_level_irq);
> diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c
> index 25adc0e..5ba94fa 100644
> --- a/arch/x86/kernel/time.c
> +++ b/arch/x86/kernel/time.c
> @@ -14,6 +14,7 @@
>  #include <linux/i8253.h>
>  #include <linux/time.h>
>  #include <linux/export.h>
> +#include <linux/acpi.h>
>  
>  #include <asm/vsyscall.h>
>  #include <asm/x86_init.h>
> @@ -76,7 +77,7 @@ void __init setup_default_timer_irq(void)
>  /* Default timer init function */
>  void __init hpet_time_init(void)
>  {
> -	if (!hpet_enable())
> +	if (!hpet_enable() && !acpi_gbl_reduced_hardware)
>  		setup_pit_timer();
>  	setup_default_timer_irq();
>  }

So the whole acpi_gbl_reduced_hardware flaggery sucks as it mixes 
various hardware drivers that have little relation to each other...

Instead of having a proper platform init this flag hooks into various 
drivers and generic code, such as the efi reboot and shutdown code, 
and now the generic irq init code.

For this IRQ init problem, why not add a proper callback to 
x86_platform_ops, define your own IRQ init function, initialize it in 
your platform init sequence and let it be called? That solves it 
without creating an ugly mix of different platform methods.

For the EFI shutdown case, what's wrong with setting your own 
pm_power_off handler like most of the other platforms are doing? Plus 
the EFI code in drivers/firmware/efi/reboot.c should probably only set 
the shutdown handler if pm_power_off is still NULL.

Thanks,

	Ingo

  reply	other threads:[~2015-03-04  5:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04  3:23 Li, Aubrey
2015-03-04  5:08 ` Ingo Molnar [this message]
2015-03-04  5:26   ` Li, Aubrey
2015-03-04  5:31     ` Ingo Molnar
2015-03-04  6:04       ` Li, Aubrey
2015-03-04  7:37         ` Ingo Molnar
2015-03-04  8:43           ` Arjan van de Ven
2015-03-04  9:50             ` Borislav Petkov
2015-03-04 14:16               ` Rafael J. Wysocki
2015-03-04 14:05                 ` Borislav Petkov
2015-03-04 14:38                   ` Rafael J. Wysocki
2015-03-04 20:21                   ` Alan Cox
2015-03-04 21:52                     ` Rafael J. Wysocki
2015-03-05 11:26                       ` Li, Aubrey
2015-03-05 16:05                       ` Alan Cox
2015-03-04 14:36               ` Arjan van de Ven
2015-03-04 20:11                 ` Ingo Molnar
2015-03-05 11:13                   ` Li, Aubrey
2015-03-05 11:36                     ` Ingo Molnar
2015-03-05 12:42                       ` Li, Aubrey
2015-03-05 16:06                         ` Alan Cox
2015-03-09 23:26                         ` Li, Aubrey
2015-03-10  8:06                           ` Ingo Molnar
2015-03-11  4:14                             ` Li, Aubrey
2015-03-04 20:18               ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150304050858.GB5158@gmail.com \
    --to=mingo@kernel.org \
    --cc=Len.Brown@intel.com \
    --cc=arjan@linux.intel.com \
    --cc=aubrey.li@linux.intel.com \
    --cc=hpa@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --subject='Re: [PATCH] x86: Bypass legacy PIC and PIT on ACPI hardware reduced platform' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).