From patchwork Wed Jun 21 18:05:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Wunner X-Patchwork-Id: 9802487 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 168F060329 for ; Wed, 21 Jun 2017 18:06:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6B0C26538 for ; Wed, 21 Jun 2017 18:06:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BAD362837D; Wed, 21 Jun 2017 18:06:52 +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 5EFF12821F for ; Wed, 21 Jun 2017 18:06:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752545AbdFUSGu (ORCPT ); Wed, 21 Jun 2017 14:06:50 -0400 Received: from mailout3.hostsharing.net ([176.9.242.54]:39285 "EHLO mailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752652AbdFUSGe (ORCPT ); Wed, 21 Jun 2017 14:06: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 mailout3.hostsharing.net (Postfix) with ESMTPS id 02F01101E3654; Wed, 21 Jun 2017 20:06:20 +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 E5CE5611D519; Wed, 21 Jun 2017 20:06:16 +0200 (CEST) X-Mailbox-Line: From 6bb1bb5ed13c03610da3458c35c3a658f868019b Mon Sep 17 00:00:00 2001 Message-Id: <6bb1bb5ed13c03610da3458c35c3a658f868019b.1498044532.git.lukas@wunner.de> In-Reply-To: References: From: Lukas Wunner Date: Wed, 21 Jun 2017 20:05:53 +0200 Subject: [PATCH 1/3] 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-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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 --- 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.