Received: by 2002:a05:6a10:5594:0:0:0:0 with SMTP id ee20csp306413pxb; Mon, 25 Apr 2022 10:17:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwS3PMmysFQDyFBbyKSkomZO5u8SE/8dvpMkrB4o/k2Fvh+s2kDPnNdeB+6Bz7qpxQGXrsc X-Received: by 2002:a65:5c48:0:b0:382:2c7:28e9 with SMTP id v8-20020a655c48000000b0038202c728e9mr16273404pgr.472.1650907075020; Mon, 25 Apr 2022 10:17:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650907075; cv=none; d=google.com; s=arc-20160816; b=Od6yg1gVwuNT6/+8XwYdf+bgaBpV/0U27h2ELi0S38OLiUEdDKR755LQclziXzqs5Z ZUTX6OgaxfMhXWfYNiKpOYUp4MifQrMcvid3Qp4c30yfnEYOZsR+kr1fKtWCCDkKVvhQ F/cG7BuWX/nkopPhU5hCUMQXV67PRXuo6YBQ8afV2IraAE0IU7hqiyAQPMoribMPFIzz 9MrogAhf07VFGjn/uCnZXF0VRMhV9RPft8Dhlgg6U68DVO2iAgHj9yYTfO1jwfRyXmH+ 2Ps/ckFB9I5nroNs4ssshzqDAQkqqGv9hiNaIFlvTukfiKA5/YtzEWbNuzQlIfxaibd+ KfYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CafX0FAbsaMEyx+MOHdq0/CUIB5UKzOFr3QBQJSIV1c=; b=cvdDWfFcC8rBhR+smxBkfkBTDUVEu7siK/L7tN3Ieznb79JgsIdA6MkNlda3Anxw3k 0E71Y6jE1n612RE6uwUW2+1Ed2WE/oUmOYYGoht4xTKBQlpMFJDK0EkRGtrReJnLIkfa MFbADLspG4FbgSdHSe/VwIdskKzbu9lbyfVdO83FVnCruT7FOcCFyDjIHtrzp+KnV24b HYikmS1nnB37uGfPpxptPX6JzCUfAlvfwTXqnm2GuMylTN+b98Rhx0IugeXdOsY5KJ6A JRHClayJYuT5e4lQ+MPKE7vUphlwO7A+3sJ6drbg85wpaZkSAf0bXv5l1a5QZIPDehqL aWqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=O6fvJyLX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r21-20020a632b15000000b0039dbae3eba8si15395196pgr.367.2022.04.25.10.17.37; Mon, 25 Apr 2022 10:17:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=O6fvJyLX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232955AbiDYLu2 (ORCPT + 99 others); Mon, 25 Apr 2022 07:50:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241762AbiDYLtJ (ORCPT ); Mon, 25 Apr 2022 07:49:09 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0519403E9; Mon, 25 Apr 2022 04:45:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650887150; x=1682423150; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0uWssjamdHsdBJb0mJxNHp980sMj8oaZK4dFrIaGODA=; b=O6fvJyLX/LoP7NVXhrlrrRvoULxfnINf9BTfFIO3U+mdX/rggeYr4wRp mkUPJ/1Tps6z0Wo2zYnbhFhreGUBbG0PppiRQSFzfMYBpY2sp+s6mJ2Og Ex8YEznGNE+1hzdv5DOpfT3hm2YAeXidhPecuNkd1LZ3q+YztKhG+ooMR uRzQg1OAuiaHJbWSAFMJz/nNs50vzyeamXfeB7yFNrGF7uKoGZiGDnMto LqKC8T5TXLvz9MjkXXwr/HkBDhmtqfRjYYJt598eXPMdc2X4yBccAOXR/ f8Cb6frdEo3CuswDlZXBGqBVgcWb1NWbMTbfLbXPlIRxuRaGcMAJ95297 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10327"; a="264075351" X-IronPort-AV: E=Sophos;i="5.90,288,1643702400"; d="scan'208";a="264075351" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2022 04:45:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,288,1643702400"; d="scan'208";a="704526088" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 25 Apr 2022 04:45:48 -0700 From: Heikki Krogerus To: "Rafael J. Wysocki" Cc: Greg Kroah-Hartman , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH v1 2/2] acpi: Remove the helper for deactivating memory region Date: Mon, 25 Apr 2022 14:45:44 +0300 Message-Id: <20220425114544.37595-3-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220425114544.37595-1-heikki.krogerus@linux.intel.com> References: <20220425114544.37595-1-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are no more users for acpi_release_memory(). Signed-off-by: Heikki Krogerus --- drivers/acpi/osl.c | 86 -------------------------------------------- include/linux/acpi.h | 3 -- 2 files changed, 89 deletions(-) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 7a70c4bfc23c6..3269a888fb7a9 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -36,7 +36,6 @@ #include #include "acpica/accommon.h" -#include "acpica/acnamesp.h" #include "internal.h" /* Definitions for ACPI_DEBUG_PRINT() */ @@ -1496,91 +1495,6 @@ int acpi_check_region(resource_size_t start, resource_size_t n, } EXPORT_SYMBOL(acpi_check_region); -static acpi_status acpi_deactivate_mem_region(acpi_handle handle, u32 level, - void *_res, void **return_value) -{ - struct acpi_mem_space_context **mem_ctx; - union acpi_operand_object *handler_obj; - union acpi_operand_object *region_obj2; - union acpi_operand_object *region_obj; - struct resource *res = _res; - acpi_status status; - - region_obj = acpi_ns_get_attached_object(handle); - if (!region_obj) - return AE_OK; - - handler_obj = region_obj->region.handler; - if (!handler_obj) - return AE_OK; - - if (region_obj->region.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) - return AE_OK; - - if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) - return AE_OK; - - region_obj2 = acpi_ns_get_secondary_object(region_obj); - if (!region_obj2) - return AE_OK; - - mem_ctx = (void *)®ion_obj2->extra.region_context; - - if (!(mem_ctx[0]->address >= res->start && - mem_ctx[0]->address < res->end)) - return AE_OK; - - status = handler_obj->address_space.setup(region_obj, - ACPI_REGION_DEACTIVATE, - NULL, (void **)mem_ctx); - if (ACPI_SUCCESS(status)) - region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE); - - return status; -} - -/** - * acpi_release_memory - Release any mappings done to a memory region - * @handle: Handle to namespace node - * @res: Memory resource - * @level: A level that terminates the search - * - * Walks through @handle and unmaps all SystemMemory Operation Regions that - * overlap with @res and that have already been activated (mapped). - * - * This is a helper that allows drivers to place special requirements on memory - * region that may overlap with operation regions, primarily allowing them to - * safely map the region as non-cached memory. - * - * The unmapped Operation Regions will be automatically remapped next time they - * are called, so the drivers do not need to do anything else. - */ -acpi_status acpi_release_memory(acpi_handle handle, struct resource *res, - u32 level) -{ - acpi_status status; - - if (!(res->flags & IORESOURCE_MEM)) - return AE_TYPE; - - status = acpi_walk_namespace(ACPI_TYPE_REGION, handle, level, - acpi_deactivate_mem_region, NULL, - res, NULL); - if (ACPI_FAILURE(status)) - return status; - - /* - * Wait for all of the mappings queued up for removal by - * acpi_deactivate_mem_region() to actually go away. - */ - synchronize_rcu(); - rcu_barrier(); - flush_scheduled_work(); - - return AE_OK; -} -EXPORT_SYMBOL_GPL(acpi_release_memory); - /* * Let drivers know whether the resource checks are effective */ diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d7136d13aa442..fadda404bcc9b 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -520,9 +520,6 @@ int acpi_check_resource_conflict(const struct resource *res); int acpi_check_region(resource_size_t start, resource_size_t n, const char *name); -acpi_status acpi_release_memory(acpi_handle handle, struct resource *res, - u32 level); - int acpi_resources_are_enforced(void); #ifdef CONFIG_HIBERNATION -- 2.35.1