Skip to content

Commit

Permalink
deepin: arm64: acpi: hisi: Revert disallow AML memory opregions to ac…
Browse files Browse the repository at this point in the history
…cess kernel memory

If we have a buggy bios,and we have no bios update for it,
we cannot access the _OSC map,
so the CPPC cpufreq driver will not probed in some case.
example: Kunpeng 920  8 core Desktop Board

Log:
ACPI CPPC: Failed to ioremap PCC comm region mem for 0
ACPI CPPC: Failed to find PCC channel for subspace 0
ACPI CPPC: Failed to find PCC channel for subspace 0
ACPI CPPC: Failed to find PCC channel for subspace 0
ACPI CPPC: Failed to find PCC channel for subspace 0
ACPI CPPC: Failed to find PCC channel for subspace 0
ACPI CPPC: Failed to find PCC channel for subspace 0
ACPI CPPC: Failed to find PCC channel for subspace 0

Link:https://gitee.com/openeuler/kernel/issues/I39AN0
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
  • Loading branch information
opsiff authored and Avenger-285714 committed Dec 11, 2024
1 parent e0aa40a commit 300c593
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions arch/arm64/kernel/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,20 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr)

void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
{
#ifdef CONFIG_ARM64
if (read_cpuid_implementor() == ARM_CPU_IMP_HISI) {
/* For normal memory we already have a cacheable mapping. */
if (memblock_is_map_memory(phys))
return (void __iomem *)__phys_to_virt(phys);

/*
* We should still honor the memory's attribute here because
* crash dump kernel possibly excludes some ACPI (reclaim)
* regions from memblock list.
*/
return ioremap_prot(phys, size, pgprot_val(__acpi_get_mem_attribute(phys)));
}
#endif
efi_memory_desc_t *md, *region = NULL;
pgprot_t prot;

Expand Down

0 comments on commit 300c593

Please sign in to comment.