Re: [PATCH] spi/acpi: fix incorrect ACPI parent check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/19/19 2:59 PM, Ard Biesheuvel wrote:
On Wed, 19 Jun 2019 at 13:58, Jarkko Nikula
<jarkko.nikula@xxxxxxxxxxxxxxx> 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@xxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Cc: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>

Acked-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>

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.

--
Jarkko



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux