Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751901AbdHANL0 (ORCPT ); Tue, 1 Aug 2017 09:11:26 -0400 Received: from mga04.intel.com ([192.55.52.120]:16768 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751217AbdHANLY (ORCPT ); Tue, 1 Aug 2017 09:11:24 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,306,1498546800"; d="scan'208";a="885047804" Date: Tue, 1 Aug 2017 16:11:14 +0300 From: Mika Westerberg To: Lukas Wunner Cc: "Rafael J. Wysocki" , x86@kernel.org, Bjorn Helgaas , Matt Fleming , Ard Biesheuvel , Andreas Noever , Michael Jamet , Yehezkel Bernat , Ronald Tschalaer , Federico Lorenzi , Andy Shevchenko , Leif Liddy , Daniel Roschka , Mark Brown , linux-acpi@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Lv Zheng , Darren Hart Subject: Re: [PATCH v4 1/5] treewide: Consolidate Apple DMI checks Message-ID: <20170801131114.GM2369@lahna.fi.intel.com> References: <20f8b74b83ed45171583fe501182c93e5c6eb4d9.1501570421.git.lukas@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20f8b74b83ed45171583fe501182c93e5c6eb4d9.1501570421.git.lukas@wunner.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1884 Lines: 39 On Tue, Aug 01, 2017 at 02:10:41PM +0200, Lukas Wunner wrote: > We're about to amend ACPI bus scan with DMI checks whether we're running > on a Mac to support Apple device properties in AML. The DMI checks are > performed for every single device, adding overhead for everything x86 > that isn't Apple, which is the majority. Rafael and Andy therefore > request to perform the DMI match only once and cache the result. > > Outside of ACPI various other Apple DMI checks exist and it seems > reasonable to use the cached value there as well. Rafael, Andy and > Darren suggest performing the DMI check in arch code and making it > available with a header in include/linux/platform_data/x86/. > > To this end, add early_platform_quirks() to arch/x86/kernel/quirks.c > to perform the DMI check and invoke it from setup_arch(). Switch over > all existing Apple DMI checks, thereby fixing two deficiencies: > > * They are now #defined to false on non-x86 arches and can thus be > optimized away if they're located in cross-arch code. > > * Some of them only match "Apple Inc." but not "Apple Computer, Inc.", > which is used by BIOSes released between January 2006 (when the first > x86 Macs started shipping) and January 2007 (when the company name > changed upon introduction of the iPhone). > > Cc: Lv Zheng > Cc: Ingo Molnar > Cc: H. Peter Anvin > Cc: Thomas Gleixner > Cc: Bjorn Helgaas > Cc: Matt Fleming > Cc: Ard Biesheuvel > Cc: Andreas Noever > Cc: Michael Jamet > Cc: Yehezkel Bernat > Cc: Mika Westerberg For the thunderbolt bits: Acked-by: Mika Westerberg