Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1485272pxk; Fri, 4 Sep 2020 10:27:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc5smTm7bIGMBLlHL8qvLyO3FHkIxQzG0UV+4rf05K+w5LgbSJYXVZuVmgedMiECIKZO2K X-Received: by 2002:aa7:dd4b:: with SMTP id o11mr3799568edw.251.1599240449018; Fri, 04 Sep 2020 10:27:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599240449; cv=none; d=google.com; s=arc-20160816; b=Uo+qQcJ2fm8qNaijJxo18f9LNHQmz84aWjC6De0bfXDWaGahCPvXOHmaBW+18Tp9FL 8/sJTtOkuyjFEgNlrhzPUekFrjJ/NZbm2Pt8iSH2OC1AkfdYFMyzlbTRYPD3rdDE6H72 CwWGgjQLBSx642hAeEOIElZa8G3EWmdF3MjCE3DmXZSeCkauVoJ8qJByZE7cdJxb37io Sd7j6fsDGd48/9SdxdBKSZKes/+OWhDwR6HydHgNX7Zd3FHTvuKbuLtjgUSC2mJS2USo VFw2APVsMSessKXmFtnAXyxlMJHql5llxQ7+gHWFdQXYIwb3i7pMHDGRviieMA0H8qQ/ 9HYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=SQxl3BOT1GGK1pcnzyI530rV5OFy4TuimkAaVpDNJfo=; b=lH5BjgagTd+Vx8Hq34PJwveZmo7JRjS3FyXyKqR219tSmhTkFxTdv6taM8kBEornKU kZdKGTNS9GZW0iN3MWaZLvnibjyehuYA2svDwT2Cyl6fgM7zf0J761RJqj1SVTNbghtF criTS8Qm3oBXuyIQyc6rysRrt0N32g/vPa8pZuT9LGNUkv60zJFLc8881ms1znrwEMH7 vCMp1DgU9n1s54Q0aXV7jxu1NBhBFHfP4722LA9xzJ9aOngncELdFFwYwGqYQM8drlgY 7vK/ec0ut8Z6QtQMJOEbznBXQpjeLzS0hdU4AMfpmIrlaxPHlmHGnWvodTxaX+ocx2jX P5sQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l7si5033493edv.419.2020.09.04.10.26.59; Fri, 04 Sep 2020 10:27:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727103AbgIDR0O (ORCPT + 99 others); Fri, 4 Sep 2020 13:26:14 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:57984 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725984AbgIDR0N (ORCPT ); Fri, 4 Sep 2020 13:26:13 -0400 Received: from 89-64-89-131.dynamic.chello.pl (89.64.89.131) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.468) id ca0f1db468709f69; Fri, 4 Sep 2020 19:26:10 +0200 From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Erik Kaneda , Bob Moore Subject: [PATCH 6/6] ACPI: OSL: Make ACPICA use logical addresses of GPE blocks Date: Fri, 04 Sep 2020 19:25:29 +0200 Message-ID: <8097951.ATsSJIO6Si@kreacher> In-Reply-To: <1748021.N9i9sLPJ40@kreacher> References: <1748021.N9i9sLPJ40@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Rafael J. Wysocki" Define ACPI_GPE_USE_LOGICAL_ADDRESSES in aclinux.h and modify acpi_os_initialize() to store the logical addresses of the FADT GPE blocks 0 and 1 in acpi_gbl_xgpe0_block_logical_address and acpi_gbl_xgpe1_block_logical_address, respectively, so as to allow ACPICA to use them for accessing GPE registers in system memory, instead of using their physical addresses and looking up the corresponding logical addresses on every access attempt, which is inefficient. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/osl.c | 12 ++++++++++-- include/acpi/platform/aclinux.h | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 3a50d8fa310b..0002973fbcde 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -1744,8 +1744,12 @@ acpi_status __init acpi_os_initialize(void) { acpi_os_map_generic_address(&acpi_gbl_FADT.xpm1a_event_block); acpi_os_map_generic_address(&acpi_gbl_FADT.xpm1b_event_block); - acpi_os_map_generic_address(&acpi_gbl_FADT.xgpe0_block); - acpi_os_map_generic_address(&acpi_gbl_FADT.xgpe1_block); + + acpi_gbl_xgpe0_block_logical_address = + acpi_os_map_generic_address(&acpi_gbl_FADT.xgpe0_block); + acpi_gbl_xgpe1_block_logical_address = + acpi_os_map_generic_address(&acpi_gbl_FADT.xgpe1_block); + if (acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER) { /* * Use acpi_os_map_generic_address to pre-map the reset @@ -1783,8 +1787,12 @@ acpi_status acpi_os_terminate(void) acpi_os_unmap_generic_address(&acpi_gbl_FADT.xgpe1_block); acpi_os_unmap_generic_address(&acpi_gbl_FADT.xgpe0_block); + acpi_gbl_xgpe0_block_logical_address = NULL; + acpi_gbl_xgpe1_block_logical_address = NULL; + acpi_os_unmap_generic_address(&acpi_gbl_FADT.xpm1b_event_block); acpi_os_unmap_generic_address(&acpi_gbl_FADT.xpm1a_event_block); + if (acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER) acpi_os_unmap_generic_address(&acpi_gbl_FADT.reset_register); diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 987e2af7c335..4151c76141fa 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -118,6 +118,10 @@ #define USE_NATIVE_ALLOCATE_ZEROED +/* Use logical addresses for accessing GPE registers in system memory */ + +#define ACPI_GPE_USE_LOGICAL_ADDRESSES + /* * Overrides for in-kernel ACPICA */ -- 2.26.2