From patchwork Wed Jun 28 17:20:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Wunner X-Patchwork-Id: 9814937 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A217B60383 for ; Wed, 28 Jun 2017 17:40:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C03328634 for ; Wed, 28 Jun 2017 17:40:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8082D2863B; Wed, 28 Jun 2017 17:40:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07A0B28639 for ; Wed, 28 Jun 2017 17:40:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751544AbdF1Rks (ORCPT ); Wed, 28 Jun 2017 13:40:48 -0400 Received: from mailout2.hostsharing.net ([83.223.90.233]:47799 "EHLO mailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751501AbdF1Rkr (ORCPT ); Wed, 28 Jun 2017 13:40:47 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout2.hostsharing.net (Postfix) with ESMTPS id A360510168164; Wed, 28 Jun 2017 19:40:40 +0200 (CEST) Received: from localhost (5-38-90-81.adsl.cmo.de [81.90.38.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by h08.hostsharing.net (Postfix) with ESMTPSA id E396861BAB73; Wed, 28 Jun 2017 19:40:43 +0200 (CEST) X-Mailbox-Line: From f3596c7e5add8803a6022c04cedbaace11d70288 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: References: From: Lukas Wunner Date: Wed, 28 Jun 2017 19:20:19 +0200 Subject: [PATCH v2 1/4] ACPI / property: Don't evaluate objects for devices w/o handle To: "Rafael J. Wysocki" , Mark Brown , Ronald Tschalaer , Federico Lorenzi Cc: Mika Westerberg , Andy Shevchenko , Leif Liddy , Daniel Roschka , linux-acpi@vger.kernel.org, linux-spi@vger.kernel.org Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fabricated devices such as LNXPWRBN lack a handle, causing evaluation of _CCA and _DSD to always fail with AE_BAD_PARAMETER. While that is merely a (negligible) waste of processing power, evaluating a _DSM for them (such as Apple's device properties _DSM which we're about to add) results in an ugly error: ACPI: \: failed to evaluate _DSM (0x1001) Avoid by not evaluating _DSD and the upcoming _DSM for devices without handle. Cc: Rafael J. Wysocki Cc: Mika Westerberg Cc: Andy Shevchenko Signed-off-by: Lukas Wunner Acked-by: Mika Westerberg --- drivers/acpi/property.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index 917c789f953d..116bfc1937b5 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -339,6 +339,9 @@ void acpi_init_properties(struct acpi_device *adev) INIT_LIST_HEAD(&adev->data.subnodes); + if (!adev->handle) + return; + /* * Check if ACPI_DT_NAMESPACE_HID is present and inthat case we fill in * Device Tree compatible properties for this device.