From patchwork Fri Jan 26 15:02:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 10186201 X-Patchwork-Delegate: bhelgaas@google.com 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 86353602C8 for ; Fri, 26 Jan 2018 15:03:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7495E29A80 for ; Fri, 26 Jan 2018 15:03:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6845729AB5; Fri, 26 Jan 2018 15:03: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 0ED5429894 for ; Fri, 26 Jan 2018 15:03:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753454AbeAZPDW (ORCPT ); Fri, 26 Jan 2018 10:03:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54330 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752828AbeAZPDQ (ORCPT ); Fri, 26 Jan 2018 10:03:16 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5189033A; Fri, 26 Jan 2018 15:03:16 +0000 (UTC) Received: from dhcp-44-202.space.revspace.nl.com (ovpn-117-96.ams2.redhat.com [10.36.117.96]) by smtp.corp.redhat.com (Postfix) with ESMTP id 353465D732; Fri, 26 Jan 2018 15:03:12 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" , Len Brown , Robert Moore , Erik Schmauss , Bjorn Helgaas Cc: Hans de Goede , linux-acpi@vger.kernel.org, devel@acpica.org, linux-pci@vger.kernel.org Subject: [PATCH v3 2/5] PCI: acpiphp_ibm: prepare for acpi_get_object_info() no longer returning status Date: Fri, 26 Jan 2018 16:02:57 +0100 Message-Id: <20180126150300.9691-2-hdegoede@redhat.com> In-Reply-To: <20180126150300.9691-1-hdegoede@redhat.com> References: <20180126150300.9691-1-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 26 Jan 2018 15:03:16 +0000 (UTC) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP acpi_get_object_info() is intended for early probe usage and as such should not call any methods which may rely on OpRegions, but it used to also call _STA to get the status, which on some systems does rely on OpRegions, this behavior and the acpi_device_info.current_status member are being removed. This commit prepares the acpiphp_ibm code for this by having it get the status itself using acpi_bus_get_status_handle(). Note no error handling is necessary on any errors acpi_bus_get_status_handle() leaves the value of the passed in current_status at its 0 initialization value. Acked-by: Bjorn Helgaas Signed-off-by: Hans de Goede --- Changes in v2: -Use () after function names in commit message -Add Bjorn's Acked-by --- drivers/pci/hotplug/acpiphp_ibm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c index 984c7e8cec5a..8472c4a27f70 100644 --- a/drivers/pci/hotplug/acpiphp_ibm.c +++ b/drivers/pci/hotplug/acpiphp_ibm.c @@ -399,6 +399,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle, u32 lvl, void *context, void **rv) { acpi_handle *phandle = (acpi_handle *)context; + unsigned long long current_status = 0; acpi_status status; struct acpi_device_info *info; int retval = 0; @@ -410,7 +411,9 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle, return retval; } - if (info->current_status && (info->valid & ACPI_VALID_HID) && + acpi_bus_get_status_handle(handle, ¤t_status); + + if (current_status && (info->valid & ACPI_VALID_HID) && (!strcmp(info->hardware_id.string, IBM_HARDWARE_ID1) || !strcmp(info->hardware_id.string, IBM_HARDWARE_ID2))) { pr_debug("found hardware: %s, handle: %p\n",