From patchwork Wed Mar 14 18:15:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 131701 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp153398ljb; Wed, 14 Mar 2018 11:18:51 -0700 (PDT) X-Google-Smtp-Source: AG47ELuasQM72HzOfIlN4pmygY//QKLrioy4vehgvV7oYZ6NeLBgK3Tn/Q3giFM+CAl0XX9n051g X-Received: by 2002:a17:902:7885:: with SMTP id q5-v6mr4838338pll.207.1521051531560; Wed, 14 Mar 2018 11:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521051531; cv=none; d=google.com; s=arc-20160816; b=0W02/iZ30aEfRP0MtoRs10jdH5If4PlDYBJquapRdkewnaNIjIOkwNZScEfq6wHM2p OW+LwOQMzqoAh4BTJvhCSVHZOEshIuuQyjjY/e9kBCAyfcAv/O16Xs15d187E9CAp/uM K2dUJawPYnZaUj7hICgDIs2M4ri9/aFqG8LqN/w6q58n0bKZy3rE8wnxxHBQu3gPte0o 855g2wt5CQdkOPC11TVXVCC9FAlijjB7AMQOPVMTtuTrL53KFEUzuPvgXbIbBiN44hj2 I9fSjjdzZqu1yHYMZZfRwXxMCQvbYAVXzEEilP636lQLr/qBwY3nbjT0LuK+DmYEpHI3 diiw== 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=IRdoQU2X3fFqtBbJtRmrrHgarQO0Ff18T92nBAuoZBw=; b=x/4gMc/UOVYe9YwCgBegiThKL/kxy3DoPmOkVRfokNU+/ufR6PatwKfZ8oe5XLrw7x 1a/oxjxrRLs3hz69wAbR5L2ABw83z93Qajzo4xnQHyVPDEjfPHmBCBOk8N/7NzArEtR+ xTzCtSn8ODrPZ4mb1Ldzz8X7jWHQQ6dTiRAs9LMp8AeU7vXsswEBBYV/fXRVW7TUoJKc 3dCowL0RlnDXKg/uPGchTCEx9UzXgPNpJ87AVJ7HLaZelT471IjGfIUrjABv87sFjOG9 WohsrJHGbH3ixXfKOdvAQpkM+nUnCSBogl2Neb+4YOr8LqEH75LdOwV/5SH39+aacSD7 Uz2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 z11-v6si2334779pln.732.2018.03.14.11.18.51; Wed, 14 Mar 2018 11:18:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752592AbeCNSSs (ORCPT + 28 others); Wed, 14 Mar 2018 14:18:48 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6640 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751470AbeCNSRI (ORCPT ); Wed, 14 Mar 2018 14:17:08 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 6A463EB43EB92; Thu, 15 Mar 2018 02:16:51 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.361.1; Thu, 15 Mar 2018 02:16:47 +0800 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 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 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(+) -- 1.9.1 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") ||