From patchwork Thu Jul 13 22:36: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: 9839661 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 1B6FF603F3 for ; Thu, 13 Jul 2017 22:37:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D9B427F97 for ; Thu, 13 Jul 2017 22:37:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3297127F8F; Thu, 13 Jul 2017 22:37:41 +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=unavailable 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 E64A627FB0 for ; Thu, 13 Jul 2017 22:37:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752926AbdGMWhj (ORCPT ); Thu, 13 Jul 2017 18:37:39 -0400 Received: from mailout2.hostsharing.net ([83.223.90.233]:53199 "EHLO mailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752425AbdGMWhj (ORCPT ); Thu, 13 Jul 2017 18:37:39 -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 5B5F310171948; Fri, 14 Jul 2017 00:37:31 +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 2D773604DB6D; Fri, 14 Jul 2017 00:37:30 +0200 (CEST) X-Mailbox-Line: From 5bb94a3e70e38b5a40933878dc52d8b5deeb6ae6 Mon Sep 17 00:00:00 2001 Message-Id: <5bb94a3e70e38b5a40933878dc52d8b5deeb6ae6.1499983092.git.lukas@wunner.de> In-Reply-To: References: From: Lukas Wunner Date: Fri, 14 Jul 2017 00:36:19 +0200 Subject: [PATCH v3 3/6] ACPI / property: Don't evaluate objects for devices w/o handle To: "Rafael J. Wysocki" Cc: Ronald Tschalaer , Federico Lorenzi , Mika Westerberg , Andy Shevchenko , Lv Zheng , Leif Liddy , Daniel Roschka , Mark Brown , 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: Andy Shevchenko Acked-by: Mika Westerberg Signed-off-by: Lukas Wunner --- drivers/acpi/property.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index 9364398204e9..27a9294c843c 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -338,6 +338,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.