Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Deepin-Kernel-SIG] [linux-6.6.y] [deepin] workaround 920 desktop cpufreq #409

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

opsiff
Copy link
Member

@opsiff opsiff commented Sep 6, 2024

workaround由于BIOS bug 导致 桌面版本 鲲鹏920 不能使能cppc-cpufreq的问题。

@@ -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. */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)

@@ -681,7 +681,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
acpi_status status;
int ret = -ENODATA;

if (!osc_sb_cppc2_support_acked) {
if (read_cpuid_implementor() != ARM_CPU_IMP_HISI && !osc_sb_cppc2_support_acked) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)

@opsiff opsiff marked this pull request as draft September 6, 2024 19:30
…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]>
If we have a buggy bios,and we have no bios update for it,
we cannot acked CPPCv2.
so the CPPC cpufreq driver will not probed in some case.
example: Kunpeng 920  8 core Desktop Board

Test result: cpu freq can from 200Mhz to 2.6Ghz.

Log:
cppc_acpi:acpi_cppc_processor_probe: ACPI CPPC: CPPC v2 _OSC not acked
cppc_acpi:acpi_cppc_processor_probe: ACPI CPPC: CPPC v2 _OSC not acked
cppc_acpi:acpi_cppc_processor_probe: ACPI CPPC: CPPC v2 _OSC not acked
cppc_acpi:acpi_cppc_processor_probe: ACPI CPPC: CPPC v2 _OSC not acked
cppc_acpi:acpi_cppc_processor_probe: ACPI CPPC: CPPC v2 _OSC not acked
cppc_acpi:acpi_cppc_processor_probe: ACPI CPPC: CPPC v2 _OSC not acked
cppc_acpi:acpi_cppc_processor_probe: ACPI CPPC: CPPC v2 _OSC not acked
cppc_acpi:acpi_cppc_processor_probe: ACPI CPPC: CPPC v2 _OSC not acked
@@ -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)
{
#ifdef CONFIG_ARM64
if (read_cpuid_implementor() == ARM_CPU_IMP_HISI) {
/* For normal memory we already have a cacheable mapping. */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)

@@ -681,7 +681,11 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
acpi_status status;
int ret = -ENODATA;

#ifdef CONFIG_ARM64
if (read_cpuid_implementor() != ARM_CPU_IMP_HISI && !osc_sb_cppc2_support_acked) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from opsiff. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Avenger-285714 Avenger-285714 marked this pull request as ready for review September 9, 2024 07:33
@Avenger-285714 Avenger-285714 merged commit cce573f into linux-6.6.y Sep 9, 2024
5 of 10 checks passed
@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • acpi_os_ioremap函数中,对memblock_is_map_memory(phys)的检查可能不准确,因为它依赖于phys地址的内存属性。如果phys地址的内存属性与__acpi_get_mem_attribute(phys)不匹配,可能会导致问题。
  • acpi_cppc_processor_probe函数中,使用read_cpuid_implementor()来检查CPU架构是否为Hisi,但没有考虑到不同架构的兼容性。如果其他架构也支持CPPc2,那么这个检查可能会导致不正确的结果。
  • acpi_cppc_processor_probe函数中,osc_sb_cppc2_support_acked变量被检查,但没有考虑到这个变量的作用域。如果这个变量在其他地方被修改,那么这个检查可能会导致问题。

是否建议立即修改:

@opsiff opsiff deleted the opsiff-kp920-fixes-cpufreq branch September 16, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants