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 <[email protected]>
  • Loading branch information
opsiff committed Sep 6, 2024
1 parent 590f816 commit cab4dcc
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 @@ -269,6 +269,20 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr)

void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
{

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)));
}

efi_memory_desc_t *md, *region = NULL;
pgprot_t prot;

Expand Down

0 comments on commit cab4dcc

Please sign in to comment.