From patchwork Mon Feb 26 16:40:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 129691 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp3974914edc; Mon, 26 Feb 2018 07:51:28 -0800 (PST) X-Google-Smtp-Source: AH8x227YxPOyI4VFw+oZf29vmahm8a/rpuOHE1KZXEDHPAEAPikI6GbrK5Y2M+k0bcO5X4/+5SET X-Received: by 2002:a17:902:bf0a:: with SMTP id bi10-v6mr11046270plb.181.1519660288868; Mon, 26 Feb 2018 07:51:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519660288; cv=none; d=google.com; s=arc-20160816; b=Y8nQoEhA/mk2SsWXr3B2gXk0TRGjdtv84YvuC2/vhXOoDG1MQD7gFzu94DVj5Vq4jV wuY55JTinQpfjc8B7E3SGwvF9fvo3i/7Q1Si3hsttrnZR8nyHsvxxB1iKggmXcUdom/A yro6MzEw2Z0EHJ9+yJuZgZWofjZmLbzjCTPsCVUW2skKAoWiojJ1rdeL09iYHXXDk8S1 De8AEYRQUfOJ0/ADgfuBrydY3A7MuYyBBykUsPSvJ66KtcwbmdoYhfIW7vKSFkPRxgm3 ntmRfwY0GXD6NPZSToyzbk/VdF2vN55JQRvafovQRggLlTzG/6luNVoI5mp7OFShes4x xFNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=QX5KW62XWSE3YIiBXu+ldyU+8N3hBY76IQSb2rqWE74=; b=kse4kIWuZpfpMNpAClWjnPvs2IeEN5HkkFJxp3bBiZnflZkD/T+JspvFfXxnBdu/w1 01QbpVesL3LbmIgPYiISHbyfx4rbYB3brXCErpStr2dguXwi/0vxz8oKsVaCmRTnmAb3 LL4euhlBQNuKXfyFk7wj9DamiPQ07LAezmf65POk5wrHErGG+3jSKd+2wY/gGd3wmJZg 4AwCaUB7BWMUjZ5XdJe4B4scYrIWmXmqt/4UMddtKy/D7BlEecv8Z+ups/ZBePiLGty4 ERqSBlyYtzkh9BVjmTLN7724SgPxxYbLSb0C8UNY0TVAU/Ql4p6Y4qvW+wYf5znN6hRW 6R3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n27si6946683pfg.102.2018.02.26.07.51.28; Mon, 26 Feb 2018 07:51:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752364AbeBZPv1 (ORCPT + 6 others); Mon, 26 Feb 2018 10:51:27 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:49678 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752046AbeBZPuV (ORCPT ); Mon, 26 Feb 2018 10:50:21 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id CE84D24DC7D25; Mon, 26 Feb 2018 23:50:06 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.361.1; Mon, 26 Feb 2018 23:50:00 +0800 From: John Garry To: , , , , , , , , , , , , , CC: , , , , , , , , , , , , , Subject: [PATCH v15 7/9] ACPI / scan: do not enumerate Indirect IO host children Date: Tue, 27 Feb 2018 00:40:47 +0800 Message-ID: <1519663249-9850-8-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519663249-9850-1-git-send-email-john.garry@huawei.com> References: <1519663249-9850-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 check 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. To flag a device to not be enumerated, we reuse the existing serial bus slave flag. 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(+) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 8e63d93..c1a60852 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_is_serial_bus_slave(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") ||