From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AG47ELvCfhM7G6i5nnI9n6omwILtvOe22Xhj1FZc0YJDSaAtKsTn1dfGBt8VbvLxJlUcOL/fMWzJ ARC-Seal: i=1; a=rsa-sha256; t=1521051425; cv=none; d=google.com; s=arc-20160816; b=vdln0ic8iO4oL7Psu5F/7nrdendBboeWBD71k3/d5bMn77cCcWkeGAkQP2NaeRfTmy HRFxCZNWMaW70mpDbJRKTOjxmFxEJqpHPmKE6x4K8wVt9RuPYDMBjO0UHokHvBZl4e3Q s1t+sTUN7lJZCYpsldVkXyCMYy/56aXsarJYfSQNFY6C01hXYX4wvSpNeHRMx3Lyvx7g ZqRcy469s1un9OiAkIyjPZDKYTrYF3+Mj51m/jzybaGY7eQxRvLlv3W8EZGez+WjBo9m Z/w7NAHFa8yJt0s1zmuSwK7W5ow5+jESgWlIfid7XY+mysA9MmN8PlhmjWu48MAAx7bP KPrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:arc-authentication-results; bh=IRdoQU2X3fFqtBbJtRmrrHgarQO0Ff18T92nBAuoZBw=; b=YKkE37m5yErvY5cMwrPU0DcBEvwi2R9SuqliF+gz1ACBd9CAcxqatWGkpzJVDVE6KO K4MOctCrutOK5mA3OuY0oI44K0aJiTplCmoqM9FjGvUGscxW4vE6xMs7Dj5P88iYEzYx BI4w7GdQ91iYbR0OhPSXsHXysviz98eCKvwFF++nM7ON27E/HXdUUBVOi6DNILDMtPsN GmKCtIFQ5YPL7gF7mWlFmBn1Rap8+CD1bLBM2isziHpKXr4OOmQQ1HpyH0AMOQXuTZSe J5gVS7OqWBoxgkHktyIq45gCDa1zjGWhk3qpwnkiclimFULHDlEa5xs0J7jQZ1ET7DJa 4DAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of john.garry@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=john.garry@huawei.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of john.garry@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=john.garry@huawei.com From: John Garry To: , , , , , , , , , , , , , CC: , , , , , , , , , , , , , Subject: [PATCH v17 08/10] ACPI / scan: do not enumerate Indirect IO host children Date: Thu, 15 Mar 2018 02:15:57 +0800 Message-ID: <1521051359-34473-9-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1521051359-34473-1-git-send-email-john.garry@huawei.com> References: <1521051359-34473-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1594938018903038038?= X-GMAIL-MSGID: =?utf-8?q?1594938018903038038?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: Through the logical PIO framework systems which otherwise have no IO space access to legacy ISA/LPC devices may access these devices through so-called "indirect IO" method. In this, IO space accesses for non-PCI hosts are redirected to a host LLDD to manually generate the IO space (bus) accesses. Hosts are able to register a region in logical PIO space to map to its bus address range. Indirect IO child devices have an associated host-specific bus address. Special translation is required to map between a logical PIO address for a device and it's host bus address. Since in the ACPI tables the child device IO resources would be the host-specific values, it is required the ACPI scan code should not enumerate these devices, and that this should be the responsibility of the host driver so that it can "fixup" the resources so that they map to the appropriate logical PIO addresses. To avoid enumerating these child devices, we add a check from acpi_device_enumeration_by_parent() as to whether the parent for a device is a member of a known list of "indirect IO" hosts. For now, the HiSilicon LPC host controller ID is added. Signed-off-by: John Garry Acked-by: Rafael J. Wysocki Reviewed-by: Andy Shevchenko Tested-by: dann frazier --- drivers/acpi/scan.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index f9e7904..a4cbf3e 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1524,11 +1524,25 @@ static int acpi_check_serial_bus_slave(struct acpi_resource *ares, void *data) return -1; } +static bool acpi_is_indirect_io_slave(struct acpi_device *device) +{ + struct acpi_device *parent = device->parent; + const struct acpi_device_id indirect_io_hosts[] = { + {"HISI0191", 0}, + {} + }; + + return parent && !acpi_match_device_ids(parent, indirect_io_hosts); +} + static bool acpi_device_enumeration_by_parent(struct acpi_device *device) { struct list_head resource_list; bool is_serial_bus_slave = false; + if (acpi_is_indirect_io_slave(device)) + return true; + /* Macs use device properties in lieu of _CRS resources */ if (x86_apple_machine && (fwnode_property_present(&device->fwnode, "spiSclkPeriod") || -- 1.9.1