All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: "Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>,
	Robert Moore <robert.moore@intel.com>,
	Lv Zheng <lv.zheng@intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org,
	devel@acpica.org
Subject: [PATCH v2 2/5] PCI: acpiphp_ibm: prepare for acpi_get_object_info() no longer returning status
Date: Mon, 22 Jan 2018 09:51:32 +0100	[thread overview]
Message-ID: <20180122085135.16732-3-hdegoede@redhat.com> (raw)
In-Reply-To: <20180122085135.16732-1-hdegoede@redhat.com>

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 <bhelgaas@google.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
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, &current_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",
-- 
2.14.3


  parent reply	other threads:[~2018-01-22  8:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-22  8:51 [PATCH v2 0/5] ACPI: Do not call _STA on battery devices with unmet dependencies Hans de Goede
2018-01-22  8:51 ` [PATCH v2 1/5] ACPI: export acpi_bus_get_status_handle() Hans de Goede
2018-01-22 23:55   ` Rafael J. Wysocki
2018-01-22 23:55     ` [Devel] " Rafael J. Wysocki
2018-01-26 14:50     ` Hans de Goede
2018-01-22  8:51 ` Hans de Goede [this message]
2018-01-22  8:51 ` [PATCH v2 3/5] ACPI / bus: Do not call _STA on battery devices with unmet dependencies Hans de Goede
2018-01-22  8:51 ` [PATCH v2 4/5] ACPI / scan: Use acpi_bus_get_status for initial status of ACPI_TYPE_DEVICE devs Hans de Goede
2018-01-22  8:51 ` [PATCH v2 5/5] ACPICA: Remove calling of _STA from acpi_get_object_info Hans de Goede
2018-02-08  9:57 ` [PATCH v2 0/5] ACPI: Do not call _STA on battery devices with unmet dependencies Rafael J. Wysocki
2018-02-08  9:57   ` [Devel] " Rafael J. Wysocki
2018-02-08 12:19   ` Hans de Goede
2018-02-08 17:34     ` Moore, Robert
2018-02-08 17:34       ` [Devel] " Moore, Robert
2018-02-08 17:34       ` Moore, Robert
2018-02-14 10:33       ` Hans de Goede
2018-02-14 15:28         ` Moore, Robert
2018-02-14 15:28           ` [Devel] " Moore, Robert
2018-02-14 15:28           ` Moore, Robert
2018-02-26  8:42           ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180122085135.16732-3-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=devel@acpica.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=robert.moore@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.