From patchwork Tue Aug 1 12:10:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Wunner X-Patchwork-Id: 9874445 X-Patchwork-Delegate: rjw@sisk.pl 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 3C6DD60365 for ; Tue, 1 Aug 2017 12:11:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3558A286A0 for ; Tue, 1 Aug 2017 12:11:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A322286A1; Tue, 1 Aug 2017 12:11:42 +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 9B9C2286AC for ; Tue, 1 Aug 2017 12:11:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751910AbdHAMLe (ORCPT ); Tue, 1 Aug 2017 08:11:34 -0400 Received: from mailout2.hostsharing.net ([83.223.90.233]:44023 "EHLO mailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751809AbdHAMLe (ORCPT ); Tue, 1 Aug 2017 08:11:34 -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 D2E6210396E14; Tue, 1 Aug 2017 14:11:32 +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 A1658603DB52; Tue, 1 Aug 2017 14:11:31 +0200 (CEST) X-Mailbox-Line: From 4529edaf2ebe244052426ec10c42f805a343816c Mon Sep 17 00:00:00 2001 Message-Id: <4529edaf2ebe244052426ec10c42f805a343816c.1501570421.git.lukas@wunner.de> In-Reply-To: References: From: Lukas Wunner Date: Tue, 1 Aug 2017 14:10:41 +0200 Subject: [PATCH v4 2/5] ACPI / property: Don't evaluate objects for devices w/o handle To: "Rafael J. Wysocki" Cc: Ronald Tschalaer , Federico Lorenzi , Mika Westerberg , Andy Shevchenko , Leif Liddy , Daniel Roschka , Mark Brown , linux-acpi@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@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 a65c09cc223f..834e01bee015 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.