-
Notifications
You must be signed in to change notification settings - Fork 63
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] hwmon: (k10temp) Check return value of hygon_read_temp() #411
[Deepin-Kernel-SIG] [linux-6.6.y] [deepin] hwmon: (k10temp) Check return value of hygon_read_temp() #411
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
fbc4554
to
4e19b29
Compare
de98c30
to
aaeb2c2
Compare
Check the return value of amd_smn_read() before saving a value. This ensures invalid values aren't saved or used. There are three cases here with slightly different behavior. 1) read_tempreg_nb_zen(): This is a function pointer which does not include a return code. In this case, set the register value to 0 on failure. This enforces Read-as-Zero behavior. 2) k10temp_read_temp(): This function does have return codes, so return the error code from the failed register read. Continued operation is not necessary, since there is no valid data from the register. Furthermore, if the register value was set to 0, then the following operation would underflow. 3) k10temp_get_ccd_support(): This function reads the same register from multiple CCD instances in a loop. And a bitmask is formed if a specific bit is set in each register instance. The loop should continue on a failed register read, skipping the bit check. WangYuli: When check amd_smn_read(), don't forget Hygon. Thanks for code review from Hygon. Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.11-rc6&id=c2d79cc5455c891de6c93e1e0c73d806e299c54f Link: deepin-community@d693d4a Signed-off-by: WangYuli <wangyuli@uniontech.com>
…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>
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
aaeb2c2
to
fdc7d5d
Compare
deepin pr auto review关键摘要:
|
e11dfa1
into
deepin-community:linux-6.6.y
Check the return value of amd_smn_read() before saving a value. This ensures invalid values aren't saved or used.
There are three cases here with slightly different behavior.
read_tempreg_nb_zen():
This is a function pointer which does not include a return code.
In this case, set the register value to 0 on failure. This
enforces Read-as-Zero behavior.
k10temp_read_temp():
This function does have return codes, so return the error code
from the failed register read. Continued operation is not
necessary, since there is no valid data from the register.
Furthermore, if the register value was set to 0, then the
following operation would underflow.
k10temp_get_ccd_support():
This function reads the same register from multiple CCD
instances in a loop. And a bitmask is formed if a specific bit
is set in each register instance. The loop should continue on a
failed register read, skipping the bit check.
WangYuli:
When check amd_smn_read(), don't forget Hygon.
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.11-rc6&id=c2d79cc5455c891de6c93e1e0c73d806e299c54f
Link: d693d4a