LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Li, Aubrey" <aubrey.li@linux.intel.com>
To: Ingo Molnar <mingo@kernel.org>, Arjan van de Ven <arjan@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>,
	"alan@linux.intel.com" <alan@linux.intel.com>,
	"H. Peter Anvin" <hpa@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.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: Thu, 05 Mar 2015 19:13:37 +0800	[thread overview]
Message-ID: <54F83A61.3090906@linux.intel.com> (raw)
In-Reply-To: <20150304201102.GA6530@gmail.com>

On 2015/3/5 4:11, Ingo Molnar wrote:
> 
> * Arjan van de Ven <arjan@linux.intel.com> wrote:
> 
>> On 3/4/2015 1:50 AM, Borislav Petkov wrote:
>>> On Wed, Mar 04, 2015 at 12:43:08AM -0800, Arjan van de Ven wrote:
>>>>>
>>>>> Using 'acpi_gbl_reduced_hardware' flag outside the ACPI code
>>>>> is a mistake.
>>>>
>>>> ideally, the presence of that flag in the firmware table will clear/set more global settings,
>>>> for example, having that flag should cause the 8042 input code to not probe for the 8042.
>>>>
>>>> for interrupts, there really ought to be a "apic first/only" mode, which is then used on
>>>> all modern systems (not just hw reduced).
>>>
>>> Do we need some sort of platform-specific querying interfaces now too,
>>> similar to cpu_has()? I.e., platform_has()...
>>>
>>> 	if (platform_has(X86_PLATFORM_REDUCED_HW))
>>> 		do stuff..
>>
>> more like
>>
>> platform_has(X86_PLATFORM_PIT)
>>
>> etc, one for each legacy io item
> 
> Precisely. The main problem is the generic, 'lumps everything 
> together' nature of the acpi_gbl_reduced_hardware flag.
> 
> (Like the big kernel lock lumped together all sorts of locking rules 
> and semantics.)
> 
> Properly split out, feature-ish or driver-ish interfaces for PIT and 
> other legacy details are the proper approach to 'turn them off'.
> 
>  - x86_platform is a function pointer driven, driver-ish interface.
> 
>  - platform_has(X86_PLATFORM_IT) is a flag driven, feature-flag-ish
>    interface.
> 
> Both are fine - for something as separate as the PIT (or the PIC) it 
> might make more sense to go towards a 'driver' interface though, as 
> modern drivers are (and will be) much different from the legacy PIT.
> 
> Whichever method is used, low level platforms can just switch them 
> on/off in their enumeration/detection routines, while the generic code 
> will have them enabled by default.

Whichever method is used, we will face a problem how to determine PIT
exists or not.

When we enabled Bay Trail-T platform at the beginning, we were trying to
make the code as generic as possible, and it works properly up to now.
So we don't have a SUBARCH like X86_SUBARCH_INTEL_MID to use the
platform specific functions. And for now I'm not quite sure it's a good
idea to create one.

If we make it as a flag driven, I don't know there is a flag in firmware
better than ACPI HW reduced flag(Of course it's not good enough to cover
all the cases). Or if we want to use platform info to turn on/off this
flag, we'll have to maintain a platform list, which may be longer and
more complicated than worth doing that.

Thanks,
-Aubrey
> 
>> so we can clear it on hw reduced, but also in other cases. hw 
>> reduced is one way, but I'd be surprised if there weren't other ways 
>> (like quirks) where we'd want to do the same things
> 
> Exactly. The key step is the proper, clean separation out of hardware 
> interfaces.
> 
> Thanks,
> 
> 	Ingo
> 
> 


  reply	other threads:[~2015-03-05 11:13 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
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 [this message]
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=54F83A61.3090906@linux.intel.com \
    --to=aubrey.li@linux.intel.com \
    --cc=Len.Brown@intel.com \
    --cc=alan@linux.intel.com \
    --cc=arjan@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=hpa@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@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).