From: Hans de Goede <hdegoede@redhat.com>
To: "Rafael J . Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Darren Hart <dvhart@infradead.org>,
Wolfram Sang <wsa@the-dreams.de>
Cc: Hans de Goede <hdegoede@redhat.com>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
linux-acpi@vger.kernel.org, platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
John Garry <john.garry@huawei.com>,
linux-i2c@vger.kernel.org, stable@vger.kernel.org,
Bjorn Helgaas <bhelgaas@google.com>,
Dann Frazier <dann.frazier@canonical.com>
Subject: [PATCH v3 1/4] ACPI / scan: Fix acpi_is_indirect_io_slave() always returning false
Date: Tue, 7 Aug 2018 10:05:36 +0200 [thread overview]
Message-ID: <20180807080539.17811-2-hdegoede@redhat.com> (raw)
In-Reply-To: <20180807080539.17811-1-hdegoede@redhat.com>
Since commit 63347db0affa ("ACPI / scan: Use acpi_bus_get_status() to
initialize ACPI_TYPE_DEVICE devs") the status field of normal acpi_devices
gets set to 0 by acpi_bus_type_and_status() and filled with its actual
value later when acpi_add_single_object() calls acpi_bus_get_status().
This means that status is 0 when acpi_device_enumeration_by_parent()
gets called which makes the acpi_match_device_ids() call in
acpi_is_indirect_io_slave() always return -ENOENT.
This commit fixes this by making acpi_bus_type_and_status() set status to
ACPI_STA_DEFAULT until acpi_add_single_object() calls acpi_bus_get_status()
Fixes: dfda4492322e ("ACPI / scan: Do not enumerate Indirect IO host children")
Cc: stable@vger.kernel.org
Cc: John Garry <john.garry@huawei.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Dann Frazier <dann.frazier@canonical.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/acpi/scan.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 970dd87d347c..6799d00dd790 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1612,7 +1612,8 @@ static int acpi_add_single_object(struct acpi_device **child,
* Note this must be done before the get power-/wakeup_dev-flags calls.
*/
if (type == ACPI_BUS_TYPE_DEVICE)
- acpi_bus_get_status(device);
+ if (acpi_bus_get_status(device) < 0)
+ acpi_set_device_status(device, 0);
acpi_bus_get_power_flags(device);
acpi_bus_get_wakeup_device_flags(device);
@@ -1690,7 +1691,7 @@ static int acpi_bus_type_and_status(acpi_handle handle, int *type,
* acpi_add_single_object updates this once we've an acpi_device
* so that acpi_bus_get_status' quirk handling can be used.
*/
- *sta = 0;
+ *sta = ACPI_STA_DEFAULT;
break;
case ACPI_TYPE_PROCESSOR:
*type = ACPI_BUS_TYPE_PROCESSOR;
--
2.18.0
next prev parent reply other threads:[~2018-08-07 8:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-07 8:05 [PATCH v3 0/4] ACPI bugfix + i2c-multi-instantiate pseudo driver Hans de Goede
2018-08-07 8:05 ` Hans de Goede [this message]
2018-08-07 10:05 ` [PATCH v3 1/4] ACPI / scan: Fix acpi_is_indirect_io_slave() always returning false John Garry
2018-08-07 10:41 ` Hans de Goede
2018-08-07 8:05 ` [PATCH v3 2/4] ACPI / scan: Create platform device for fwnodes with multiple i2c devices Hans de Goede
2018-08-07 11:19 ` Andy Shevchenko
2018-08-07 11:29 ` Hans de Goede
2018-08-07 11:49 ` Andy Shevchenko
2018-08-08 8:07 ` Hans de Goede
2018-08-07 8:05 ` [PATCH v3 3/4] ACPI / x86-utils: Remove status workaround from acpi_device_always_present() Hans de Goede
2018-08-07 8:05 ` [PATCH v3 4/4] i2c: Add multi-instantiate pseudo driver Hans de Goede
2018-08-07 11:27 ` Wolfram Sang
2018-08-07 11:33 ` Hans de Goede
2018-08-07 11:45 ` Andy Shevchenko
2018-08-08 8:05 ` Hans de Goede
2018-08-07 12:46 ` John Garry
2018-08-08 8:08 ` 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=20180807080539.17811-2-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=dann.frazier@canonical.com \
--cc=dvhart@infradead.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=john.garry@huawei.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=stable@vger.kernel.org \
--cc=wsa@the-dreams.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).