linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Mark Brown <broonie@kernel.org>,
	Ronald Tschalaer <ronald@innovation.ch>,
	Federico Lorenzi <florenzi@gmail.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Leif Liddy <leif.liddy@gmail.com>,
	Daniel Roschka <danielroschka@phoenitydawn.de>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	x86@kernel.org
Subject: Re: [PATCH v2 2/4] ACPI / property: Support Apple _DSM properties
Date: Sun, 2 Jul 2017 13:07:19 +0200	[thread overview]
Message-ID: <20170702110719.GA825@wunner.de> (raw)
In-Reply-To: <CAHp75VdjOcPkd0_g05_OW6amxHjf2zdJ9jKyH7q2AgzGMr-h4w@mail.gmail.com>

On Wed, Jun 28, 2017 at 09:53:49PM +0300, Andy Shevchenko wrote:
> On Wed, Jun 28, 2017 at 8:20 PM, Lukas Wunner <lukas@wunner.de> wrote:
> > While the rest of the world has standardized on _DSD as the way to store
> > device properties in AML (introduced with ACPI 5.1 in 2014), Apple has
> > been using a custom _DSM to achieve the same for much longer (ever since
> > they switched from DeviceTree-based PowerPC to Intel in 2005, verified
> > with MacOS X 10.4.11).
[snip]
> > +static void acpi_retrieve_apple_properties(struct acpi_device *adev)
> > +{
> > +       unsigned int i, j, newsize = 0, numprops, skipped = 0;
> > +       union acpi_object *props, *newprops;
> > +       void *free_space;
> > +
> > +       if (!IS_ENABLED(CONFIG_X86) || !dmi_match(DMI_SYS_VENDOR, "Apple Inc."))
> > +               return;
> 
> You are using this in few places, perhaps it makes sense to do in
> (maybe) header like
> drivers/acpi/apple.h
> 
> static inline bool is_apple_system(void)
> {
>    return IS_ENABLED(CONFIG_X86) && dmi_match(DMI_SYS_VENDOR, "Apple Inc.");
> }
> 
> I know this makes more LOCs, the rationale is to keep such
> deterministic things in one place (basically maintenance).

You mean like is_uv_system() for SGI UltraViolet?

I could add a global bool is_apple_system which is set early during boot,
then the DMI check would only have to be performed once.  The bool would
be #defined to false on non-x86 arches via a header file which would have
to live in include/linux/.  I could add an x86-specific config option
such as CONFIG_X86_APPLE which would allow removal of all Mac-specific
quirks and behaviour by likewise #defining is_apple_system to false.

I'm not sure if the x86 maintainers will approve of this.  Next thing
you know, someone wants to add the same thing for Dell or whatever.
OTOH the amount of code to deal with Apple quirks may justify it.
Adding x86 maintainers to cc.  Ingo, Thomas, Peter, any opinion?

My concern is that this series is bikeshedded / postponed indefinitely
if it is made to depend on such bigger changes.  (The discussion of
which is legitimate of course.)

Thanks,

Lukas

  reply	other threads:[~2017-07-02 11:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-28 17:20 [PATCH v2 0/4] Apple SPI properties Lukas Wunner
     [not found] ` <cover.1498636759.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2017-06-28 17:20   ` [PATCH v2 3/4] ACPI / scan: Recognize Apple SPI and I2C slaves Lukas Wunner
2017-06-29  7:34     ` Mika Westerberg
2017-06-29  8:46       ` Lukas Wunner
     [not found]         ` <20170629084604.swuzzxsdiiosqurz-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2017-06-29  9:22           ` Mika Westerberg
2017-06-28 17:20   ` [PATCH v2 1/4] ACPI / property: Don't evaluate objects for devices w/o handle Lukas Wunner
2017-06-29  7:30     ` Mika Westerberg
2017-06-28 17:20   ` [PATCH v2 4/4] spi: Use Apple device properties in absence of ACPI resources Lukas Wunner
2017-06-28 18:27     ` Mark Brown
     [not found]     ` <bca7fb9e406bbfa9ee7e8457cacd34418ef689be.1498636759.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2017-06-28 19:14       ` Andy Shevchenko
2017-06-29  7:54       ` Mika Westerberg
2017-06-28 17:20 ` [PATCH v2 2/4] ACPI / property: Support Apple _DSM properties Lukas Wunner
2017-06-28 18:53   ` Andy Shevchenko
2017-07-02 11:07     ` Lukas Wunner [this message]
     [not found]       ` <20170702110719.GA825-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2017-07-03 22:47         ` Rafael J. Wysocki
2017-06-29  7:45   ` Mika Westerberg

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=20170702110719.GA825@wunner.de \
    --to=lukas@wunner.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=danielroschka@phoenitydawn.de \
    --cc=florenzi@gmail.com \
    --cc=leif.liddy@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=ronald@innovation.ch \
    --cc=x86@kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).