Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'acpi-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fix from Rafael Wysocki:
"Revert a recent commit related to memory management that turned out to
be problematic (Jia He)"

* tag 'acpi-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
Revert "ACPI: Add memory semantics to acpi_os_map_memory()"

+10 -43
-3
arch/arm64/include/asm/acpi.h
··· 50 50 void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size); 51 51 #define acpi_os_ioremap acpi_os_ioremap 52 52 53 - void __iomem *acpi_os_memmap(acpi_physical_address phys, acpi_size size); 54 - #define acpi_os_memmap acpi_os_memmap 55 - 56 53 typedef u64 phys_cpuid_t; 57 54 #define PHYS_CPUID_INVALID INVALID_HWID 58 55
+3 -16
arch/arm64/kernel/acpi.c
··· 273 273 return __pgprot(PROT_DEVICE_nGnRnE); 274 274 } 275 275 276 - static void __iomem *__acpi_os_ioremap(acpi_physical_address phys, 277 - acpi_size size, bool memory) 276 + void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) 278 277 { 279 278 efi_memory_desc_t *md, *region = NULL; 280 279 pgprot_t prot; ··· 299 300 * It is fine for AML to remap regions that are not represented in the 300 301 * EFI memory map at all, as it only describes normal memory, and MMIO 301 302 * regions that require a virtual mapping to make them accessible to 302 - * the EFI runtime services. Determine the region default 303 - * attributes by checking the requested memory semantics. 303 + * the EFI runtime services. 304 304 */ 305 - prot = memory ? __pgprot(PROT_NORMAL_NC) : 306 - __pgprot(PROT_DEVICE_nGnRnE); 305 + prot = __pgprot(PROT_DEVICE_nGnRnE); 307 306 if (region) { 308 307 switch (region->type) { 309 308 case EFI_LOADER_CODE: ··· 359 362 } 360 363 } 361 364 return __ioremap(phys, size, prot); 362 - } 363 - 364 - void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) 365 - { 366 - return __acpi_os_ioremap(phys, size, false); 367 - } 368 - 369 - void __iomem *acpi_os_memmap(acpi_physical_address phys, acpi_size size) 370 - { 371 - return __acpi_os_ioremap(phys, size, true); 372 365 } 373 366 374 367 /*
+7 -16
drivers/acpi/osl.c
··· 284 284 #define should_use_kmap(pfn) page_is_ram(pfn) 285 285 #endif 286 286 287 - static void __iomem *acpi_map(acpi_physical_address pg_off, unsigned long pg_sz, 288 - bool memory) 287 + static void __iomem *acpi_map(acpi_physical_address pg_off, unsigned long pg_sz) 289 288 { 290 289 unsigned long pfn; 291 290 ··· 294 295 return NULL; 295 296 return (void __iomem __force *)kmap(pfn_to_page(pfn)); 296 297 } else 297 - return memory ? acpi_os_memmap(pg_off, pg_sz) : 298 - acpi_os_ioremap(pg_off, pg_sz); 298 + return acpi_os_ioremap(pg_off, pg_sz); 299 299 } 300 300 301 301 static void acpi_unmap(acpi_physical_address pg_off, void __iomem *vaddr) ··· 309 311 } 310 312 311 313 /** 312 - * __acpi_os_map_iomem - Get a virtual address for a given physical address range. 314 + * acpi_os_map_iomem - Get a virtual address for a given physical address range. 313 315 * @phys: Start of the physical address range to map. 314 316 * @size: Size of the physical address range to map. 315 - * @memory: true if remapping memory, false if IO 316 317 * 317 318 * Look up the given physical address range in the list of existing ACPI memory 318 319 * mappings. If found, get a reference to it and return a pointer to it (its ··· 321 324 * During early init (when acpi_permanent_mmap has not been set yet) this 322 325 * routine simply calls __acpi_map_table() to get the job done. 323 326 */ 324 - static void __iomem __ref 325 - *__acpi_os_map_iomem(acpi_physical_address phys, acpi_size size, bool memory) 327 + void __iomem __ref 328 + *acpi_os_map_iomem(acpi_physical_address phys, acpi_size size) 326 329 { 327 330 struct acpi_ioremap *map; 328 331 void __iomem *virt; ··· 353 356 354 357 pg_off = round_down(phys, PAGE_SIZE); 355 358 pg_sz = round_up(phys + size, PAGE_SIZE) - pg_off; 356 - virt = acpi_map(phys, size, memory); 359 + virt = acpi_map(phys, size); 357 360 if (!virt) { 358 361 mutex_unlock(&acpi_ioremap_lock); 359 362 kfree(map); ··· 372 375 mutex_unlock(&acpi_ioremap_lock); 373 376 return map->virt + (phys - map->phys); 374 377 } 375 - 376 - void __iomem *__ref 377 - acpi_os_map_iomem(acpi_physical_address phys, acpi_size size) 378 - { 379 - return __acpi_os_map_iomem(phys, size, false); 380 - } 381 378 EXPORT_SYMBOL_GPL(acpi_os_map_iomem); 382 379 383 380 void *__ref acpi_os_map_memory(acpi_physical_address phys, acpi_size size) 384 381 { 385 - return (void *)__acpi_os_map_iomem(phys, size, true); 382 + return (void *)acpi_os_map_iomem(phys, size); 386 383 } 387 384 EXPORT_SYMBOL_GPL(acpi_os_map_memory); 388 385
-8
include/acpi/acpi_io.h
··· 14 14 } 15 15 #endif 16 16 17 - #ifndef acpi_os_memmap 18 - static inline void __iomem *acpi_os_memmap(acpi_physical_address phys, 19 - acpi_size size) 20 - { 21 - return ioremap_cache(phys, size); 22 - } 23 - #endif 24 - 25 17 extern bool acpi_permanent_mmap; 26 18 27 19 void __iomem __ref