linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
	linux-spi@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	kbuild test robot <lkp@intel.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Masahisa Kojima <masahisa.kojima@linaro.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Lukas Wunner <lukas@wunner.de>
Subject: Re: [PATCH] spi/acpi: fix incorrect ACPI parent check
Date: Wed, 19 Jun 2019 15:58:38 +0200	[thread overview]
Message-ID: <CAKv+Gu9fafXNrAYAgUuqMPVjZm2bWJmzg_aPz9WD1skemQme8A@mail.gmail.com> (raw)
In-Reply-To: <c96afe71-c7bd-d30f-ef37-0c6eeb726f67@linux.intel.com>

On Wed, 19 Jun 2019 at 15:21, Jarkko Nikula
<jarkko.nikula@linux.intel.com> wrote:
>
> On 6/19/19 2:59 PM, Ard Biesheuvel wrote:
> > On Wed, 19 Jun 2019 at 13:58, Jarkko Nikula
> > <jarkko.nikula@linux.intel.com> wrote:
> >>
> >> On 6/19/19 1:16 PM, Mika Westerberg wrote:
> >>> On Wed, Jun 19, 2019 at 11:52:54AM +0200, Ard Biesheuvel wrote:
> >>>> The ACPI device object parsing code for SPI slaves enumerates the
> >>>> entire ACPI namespace to look for devices that refer to the master
> >>>> in question via the 'resource_source' field in the 'SPISerialBus'
> >>>> resource. If that field does not refer to a valid ACPI device or
> >>>> if it refers to the wrong SPI master, we should disregard the
> >>>> device.
> >>>>
> >>>> Current, the valid device check is wrong, since it gets the
> >>>> polarity of 'status' wrong. This could cause issues if the
> >>>> 'resource_source' field is bogus but parent_handle happens to
> >>>> refer to the correct master (which is not entirely imaginary
> >>>> since this code runs in a loop)
> >>>>
> >>>> So test for ACPI_FAILURE() instead, to make the code more
> >>>> self explanatory.
> >>>>
> >>>> Fixes: 4c3c59544f33 ("spi/acpi: enumerate all SPI slaves in the namespace")
> >>>> Reported-by: kbuild test robot <lkp@intel.com>
> >>>> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> >>>> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> >>>
> >>> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> >>>
> >> I hit yesterday a regression caused by 4c3c59544f33. I've a custom ACPI
> >> tables defining I2C gpio expanders (gpio-pca953x.c as INT3491) and a
> >> spidev test device (SPT0001).
> >>
> >> Both stopped enumerating after 4c3c59544f33. With this fix spidev device
> >> enumerates but still get confused with I2C GPIO expanders (INT3491):
> >>
> >
> > Could you share the decomplied D/SSDT please?
> >
> It's Intel Edison with tables from Mika's sample ACPI tables. The
> interesting parts here are these two:
>
> https://github.com/westeri/meta-acpi/blob/master/recipes-bsp/acpi-tables/samples/edison/spidev.asl
>
> https://github.com/westeri/meta-acpi/blob/master/recipes-bsp/acpi-tables/samples/edison/gpioexp.asli
>
> The full tables are of course larger but I think those two above are
> relevant here. I build SSDT from arduino-all.asl below which includes
> bunch of other files and with above spidev.asl.
>
> https://github.com/westeri/meta-acpi/blob/master/recipes-bsp/acpi-tables/samples/edison/arduino-all.asl
>
> Let me know if you need full dump.
>

So can you explain how exactly the I2C GPIO expander is failing? I
struggle to understand how the SPI slave probing could be related to
that.

  reply	other threads:[~2019-06-19 13:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19  9:52 [PATCH] spi/acpi: fix incorrect ACPI parent check Ard Biesheuvel
2019-06-19 10:16 ` Mika Westerberg
2019-06-19 11:58   ` Jarkko Nikula
2019-06-19 11:59     ` Ard Biesheuvel
2019-06-19 13:21       ` Jarkko Nikula
2019-06-19 13:58         ` Ard Biesheuvel [this message]
2019-06-19 14:17           ` Jarkko Nikula
2019-06-19 14:42             ` Mika Westerberg
2019-06-20 10:33               ` Ard Biesheuvel
2019-06-20 10:41                 ` Mika Westerberg
2019-06-20 11:19                   ` Mark Brown
2019-06-20 11:51                     ` Ard Biesheuvel
2019-06-20 12:21                 ` Jarkko Nikula
2019-06-20 12:25                   ` Ard Biesheuvel

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=CAKv+Gu9fafXNrAYAgUuqMPVjZm2bWJmzg_aPz9WD1skemQme8A@mail.gmail.com \
    --to=ard.biesheuvel@linaro.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=lukas@wunner.de \
    --cc=masahisa.kojima@linaro.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rjw@rjwysocki.net \
    /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).