summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2018-06-21 16:43:17 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-08 16:30:46 +0300
commitf2e9a38558d8bbd670357922c3d06b845c8d92df (patch)
tree7c82146e0fbc9fdc9320b7a8394046b78970d4f4 /include
parent447294efb995181076c2c34e9c6bee1703c74a9a (diff)
downloadlinux-f2e9a38558d8bbd670357922c3d06b845c8d92df.tar.xz
acpi: Add helper for deactivating memory region
commit d2d2e3c46be5d6dd8001d0eebdf7cafb9bc7006b upstream. Sometimes memory resource may be overlapping with SystemMemory Operation Region by design, for example if the memory region is used as a mailbox for communication with a firmware in the system. One occasion of such mailboxes is USB Type-C Connector System Software Interface (UCSI). With regions like that, it is important that the driver is able to map the memory with the requirements it has. For example, the driver should be allowed to map the memory as non-cached memory. However, if the operation region has been accessed before the driver has mapped the memory, the memory has been marked as write-back by the time the driver is loaded. That means the driver will fail to map the memory if it expects non-cached memory. To work around the problem, introducing helper that the drivers can use to temporarily deactivate (unmap) SystemMemory Operation Regions that overlap with their IO memory. Fixes: 8243edf44152 ("usb: typec: ucsi: Add ACPI driver") Cc: stable@vger.kernel.org Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/acpi.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 502af53ec012..13c105121a18 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -441,6 +441,9 @@ 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