diff mbox

[v2] ACPI / LPSS: Don't abort acpi scan on missing mem resource.

Message ID 1502266542-19268-1-git-send-email-ronald@innovation.ch (mailing list archive)
State Accepted, archived
Delegated to: Rafael Wysocki
Headers show

Commit Message

Life is hard, and then you die Aug. 9, 2017, 8:15 a.m. UTC
The keyboard and touchpad on MacBook's from 2015 onwards are connected
via an SPI bus. On MacBook8's (2015) the ACPI device for the SPI master
for this bus has _CID "INT33C1", and hence the acpi-lpss handler here is
triggered for it. However, the DSDT lists no memory resources for this
device, resulting in an error being returned by the attach callback and
therefore the SPI master device being ignored. This prevents us from
being able to register the keyboard and touchpad driver.

Furthermore, the controller (a Wildcat Point-LP controller) does not
appear to need the functionality provided by the apci-lpss handler.
Therefore we now just skip the handler if no memory resources are found
and let the ACPI scan complete successfully for this device.

All of this is not an issue on later MacBook(Pro)'s because their ACPI
SPI devices don't have any _CID and therefore no attempt is made to attach
this handler.

Returning an error was introduced in commit d3e13ff3c1aa - this restores
the original behaviour.

Link: https://github.com/cb22/macbook12-spi-driver
Signed-off-by: Ronald Tschalär <ronald@innovation.ch>
---
Changes V2:
  Expanded commit message to give more context and details.

 drivers/acpi/acpi_lpss.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Mika Westerberg Aug. 9, 2017, 9:28 a.m. UTC | #1
On Wed, Aug 09, 2017 at 01:15:42AM -0700, Ronald Tschalär wrote:
> The keyboard and touchpad on MacBook's from 2015 onwards are connected
> via an SPI bus. On MacBook8's (2015) the ACPI device for the SPI master
> for this bus has _CID "INT33C1", and hence the acpi-lpss handler here is
> triggered for it. However, the DSDT lists no memory resources for this
> device, resulting in an error being returned by the attach callback and
> therefore the SPI master device being ignored. This prevents us from
> being able to register the keyboard and touchpad driver.
> 
> Furthermore, the controller (a Wildcat Point-LP controller) does not
> appear to need the functionality provided by the apci-lpss handler.
> Therefore we now just skip the handler if no memory resources are found
> and let the ACPI scan complete successfully for this device.
> 
> All of this is not an issue on later MacBook(Pro)'s because their ACPI
> SPI devices don't have any _CID and therefore no attempt is made to attach
> this handler.
> 
> Returning an error was introduced in commit d3e13ff3c1aa - this restores
> the original behaviour.
> 
> Link: https://github.com/cb22/macbook12-spi-driver
> Signed-off-by: Ronald Tschalär <ronald@innovation.ch>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafael J. Wysocki Aug. 10, 2017, 11:09 p.m. UTC | #2
On Wednesday, August 9, 2017 11:28:15 AM CEST Mika Westerberg wrote:
> On Wed, Aug 09, 2017 at 01:15:42AM -0700, Ronald Tschalär wrote:
> > The keyboard and touchpad on MacBook's from 2015 onwards are connected
> > via an SPI bus. On MacBook8's (2015) the ACPI device for the SPI master
> > for this bus has _CID "INT33C1", and hence the acpi-lpss handler here is
> > triggered for it. However, the DSDT lists no memory resources for this
> > device, resulting in an error being returned by the attach callback and
> > therefore the SPI master device being ignored. This prevents us from
> > being able to register the keyboard and touchpad driver.
> > 
> > Furthermore, the controller (a Wildcat Point-LP controller) does not
> > appear to need the functionality provided by the apci-lpss handler.
> > Therefore we now just skip the handler if no memory resources are found
> > and let the ACPI scan complete successfully for this device.
> > 
> > All of this is not an issue on later MacBook(Pro)'s because their ACPI
> > SPI devices don't have any _CID and therefore no attempt is made to attach
> > this handler.
> > 
> > Returning an error was introduced in commit d3e13ff3c1aa - this restores
> > the original behaviour.
> > 
> > Link: https://github.com/cb22/macbook12-spi-driver
> > Signed-off-by: Ronald Tschalär <ronald@innovation.ch>
> 
> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Applied, thanks!

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index f88caf5aab76..032ae44710e5 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -465,7 +465,8 @@  static int acpi_lpss_create_device(struct acpi_device *adev,
 	acpi_dev_free_resource_list(&resource_list);
 
 	if (!pdata->mmio_base) {
-		ret = -ENOMEM;
+		/* Skip the device, but continue the namespace scan. */
+		ret = 0;
 		goto err_out;
 	}