Received: by 10.223.185.116 with SMTP id b49csp3976390wrg; Mon, 19 Feb 2018 08:58:16 -0800 (PST) X-Google-Smtp-Source: AH8x226/EvLM/6TvNKI1J+i3Abm4pzKSeNLZ+kKFe7BGbV2U0ERMWsFChZ3mr9Ue3VykEvO/T9iJ X-Received: by 10.99.125.19 with SMTP id y19mr9177955pgc.285.1519059496325; Mon, 19 Feb 2018 08:58:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519059496; cv=none; d=google.com; s=arc-20160816; b=HM7tq6VNJ+5dcGBYG/DShLqgjZHlLMBLsloxOGKT01J7rGEEC75Qfs172DnG2VNXxU k49486z9mLu5SigH2+HEdYzIaOWkZNQt01wY3uV8q/CJ77FgcZ2Ra3qrgYS8Ew9QkmIM bUAdyIrtWmAIU3gQ/Vt+1Mu57H0UHssN7PG89z10KrJdg9K4oJ/buFkPDL7ZoTAWXM8y UghGV+5x9Q2x25VVARciqYUzS8D14YNenyjcPvKHUk/7UlOt58eNlgb+iOV+H4AnZJKk Ch1OAIgVZWay7+IbiAjFbjjjRazKcLHVvrOwMcBkxCkJLVZG7oPEQFk0NdoV79SRaG4V a+vQ== 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=qdDbdjw08roUln0juECqTFuIy6VmbyiW/Pl1hiUgn6U=; b=XhgHl9Zc41//4+Zrq9NJ/wSsU43zrh8O1xwJJ7H3ix9+Kj0creKnhn3USG9otCbyGk Ow/0ZTqVBOzU4LebWhtzPhIg6z8vQeHHddQ38M21iO2jIK+SfbO/3haOnWKtPYCTC36w ynsLHcRMrBb7tHzDUxaW57rV6lkly3GsLOhqhZUPvIHG6c6cZLXwZJCQlnzpy0FzjDnO f/75cakPmnhjJ6iKpJp2ptCJmRRMJrA90Z1uyPNaYTIjGTXMVSqnaKkUxtbHfXCbSMj2 kj3aprclkP+cyNpXtGgJkS0uKaVaGm5w+IJ2GXyYs2NCVI4AYRsL0PNF8AO6q+qnH8q8 9EAw== 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 f3-v6si2837118plb.79.2018.02.19.08.58.02; Mon, 19 Feb 2018 08:58:16 -0800 (PST) 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 S1753382AbeBSQ5K (ORCPT + 99 others); Mon, 19 Feb 2018 11:57:10 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:45686 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753233AbeBSQ5D (ORCPT ); Mon, 19 Feb 2018 11:57:03 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 03CD792BFDAEE; Tue, 20 Feb 2018 00:56:48 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.361.1; Tue, 20 Feb 2018 00:56:42 +0800 From: John Garry To: , , , , , , , , , , , , CC: , , , , , , , , , Subject: [PATCH v14 7/9] ACPI / scan: do not enumerate Indirect IO host children Date: Tue, 20 Feb 2018 01:48:38 +0800 Message-ID: <1519062520-198902-8-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519062520-198902-1-git-send-email-john.garry@huawei.com> References: <1519062520-198902-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 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 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 --- drivers/acpi/scan.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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") || -- 1.9.1