ACPI: processor: reduce CPUFREQ thermal reduction pctg for Tegra241
Subsystems (4)
PATCH v7 1/1 ACPI: processor: reduce CPUFREQ thermal reduction pctg for Tegra241
From: Srikar Srimath Tirumala <[email protected]>
Current implementation of processor_thermal performs software throttling in fixed steps of "20%" which can be too coarse for some platforms. We observed some performance gain after reducing the throttle percentage. Change the CPUFREQ thermal reduction percentage and maximum thermal steps to be configurable. Also, update the default values of both for Nvidia Tegra241 (Grace) SoC. The thermal reduction percentage is reduced to "5%" and accordingly the maximum number of thermal steps are increased as they are derived from the reduction percentage.
---
Sending this patch separately as the other patch in the series is applied by Rafael in v6[1]. Revision history before this version is in the cover letter of v6[1].
Please review and provide ACK if looks fine.
v6[6] -> 7:
- Patch 2: remove CONFIG_HAVE_ARM_SMCCC_DISCOVERY ifdef check [Sudeep]. : replace SMCC macro with CONFIG_ARM64 in internal.h [Sudeep].
[1] https://lore.kernel.org/lkml/[email protected]/
drivers/acpi/arm64/Makefile | 1 + drivers/acpi/arm64/thermal_cpufreq.c | 20 ++++++++++++ drivers/acpi/internal.h | 9 +++++ drivers/acpi/processor_thermal.c | 49 +++++++++++++++++++++++----- 4 files changed, 70 insertions(+), 9 deletions(-) create mode 100644 drivers/acpi/arm64/thermal_cpufreq.c
drivers/acpi/arm64/Makefile +1 -0
@@ -5,3 +5,4 @@ obj-$(CONFIG_ACPI_GTDT) += gtdt.o obj-$(CONFIG_ACPI_APMT) += apmt.o obj-$(CONFIG_ARM_AMBA) += amba.o obj-y += dma.o init.o +obj-y += thermal_cpufreq.o
drivers/acpi/arm64/thermal_cpufreq.c new file +20 -0
@@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-only +#include <linux/acpi.h> + +#include "../internal.h" + +#define SMCCC_SOC_ID_T241 0x036b0241 + +int acpi_arch_thermal_cpufreq_pctg (void ) +{ +s32 soc_id =arm_smccc_get_soc_id_version (); + +/* +* Check JEP106 code for NVIDIA Tegra241 chip (036b:0241) and +* reduce the CPUFREQ Thermal reduction percentage to 5%. +*/ +if (soc_id ==SMCCC_SOC_ID_T241 ) +return 5 ; + +return 0 ; +}
drivers/acpi/internal.h +9 -0
@@ -90,6 +90,15 @@ int acpi_passive_trip_temp(struct acpi_device *adev, int *ret_temp);int acpi_hot_trip_temp (struct acpi_device *adev,int *ret_temp);int acpi_critical_trip_temp (struct acpi_device *adev,int *ret_temp); +#ifdef CONFIG_ARM64 +int acpi_arch_thermal_cpufreq_pctg (void ); +#else +static inline int acpi_arch_thermal_cpufreq_pctg (void ) +{ +return 0 ; +} +#endif +/* -------------------------------------------------------------------------- Device Node Initialization / Removal -------------------------------------------------------------------------- */
drivers/acpi/processor_thermal.c +40 -9
103 lines not on this page · raw message
Signature · 1 line
2.17.1
Quoted 14 lines · Sumit Gupta
From: Srikar Srimath Tirumala <[email protected]>
Current implementation of
processor_thermalperforms software throttling in fixed steps of "20%" which can be too coarse for some platforms. We observed some performance gain after reducing the throttle percentage. Change the CPUFREQ thermal reduction percentage and maximum thermal steps to be configurable. Also, update the default values of both for Nvidia Tegra241 (Grace) SoC. The thermal reduction percentage is reduced to "5%" and accordingly the maximum number of thermal steps are increased as they are derived from the reduction percentage.Signed-off-by Srikar Srimath Tirumala <[email protected]>Co-developed-by Sumit Gupta <[email protected]>Signed-off-by Sumit Gupta <[email protected]>
Quoted 8 lines
---
Sending this patch separately as the other patch in the series is applied by Rafael in v6[1]. Revision history before this version is in the cover letter of v6[1].
Please review and provide ACK if looks fine.
For arm64 specific changes(a minor nit below though),
[...]
drivers/acpi/arm64/thermal_cpufreq.c line 7
Quoted 13 lines
drivers/acpi/arm64/thermal_cpufreq.c new file +7
-0@@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-only +#include <linux/acpi.h> + +#include "../internal.h" + +#define SMCCC_SOC_ID_T241 0x036b0241 +
[nit] We really need to find better place to define this globally and not locally at each usage site like this. We already have it in GICv3 driver. But that can come as a cleanup later if it causes issue for merging this change.
Signature · 2 lines
Regards, Sudeep
Quoted 27 lines · Sudeep Holla
External email: Use caution opening links or attachments
Quoted 14 lines · Sumit Gupta
From: Srikar Srimath Tirumala <[email protected]>
Current implementation of
processor_thermalperforms software throttling in fixed steps of "20%" which can be too coarse for some platforms. We observed some performance gain after reducing the throttle percentage. Change the CPUFREQ thermal reduction percentage and maximum thermal steps to be configurable. Also, update the default values of both for Nvidia Tegra241 (Grace) SoC. The thermal reduction percentage is reduced to "5%" and accordingly the maximum number of thermal steps are increased as they are derived from the reduction percentage.Signed-off-by Srikar Srimath Tirumala <[email protected]>Co-developed-by Sumit Gupta <[email protected]>Signed-off-by Sumit Gupta <[email protected]>Quoted 8 lines
---
Sending this patch separately as the other patch in the series is applied by Rafael in v6[1]. Revision history before this version is in the cover letter of v6[1].
Please review and provide ACK if looks fine.
Quoted 7 lines
For arm64 specific changes(a minor nit below though),
Acked-by Sudeep Holla <[email protected]>[...]
Thank you.
Quoted 19 lines
drivers/acpi/arm64/thermal_cpufreq.c line 7
Quoted 13 lines
drivers/acpi/arm64/thermal_cpufreq.c new file +7
-0@@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-only +#include <linux/acpi.h> + +#include "../internal.h" + +#define SMCCC_SOC_ID_T241 0x036b0241 +[nit] We really need to find better place to define this globally and not locally at each usage site like this. We already have it in GICv3 driver. But that can come as a cleanup later if it causes issue for merging this change.
Quoted 3 lines
--
Regards,
Sudeep
Sure, will check and send a separate patch later on top.
Best Regards,
Sumit Gupta
Quoted 41 lines · Sudeep Holla
Quoted 14 lines · Sumit Gupta
From: Srikar Srimath Tirumala <[email protected]>
Current implementation of
processor_thermalperforms software throttling in fixed steps of "20%" which can be too coarse for some platforms. We observed some performance gain after reducing the throttle percentage. Change the CPUFREQ thermal reduction percentage and maximum thermal steps to be configurable. Also, update the default values of both for Nvidia Tegra241 (Grace) SoC. The thermal reduction percentage is reduced to "5%" and accordingly the maximum number of thermal steps are increased as they are derived from the reduction percentage.Signed-off-by Srikar Srimath Tirumala <[email protected]>Co-developed-by Sumit Gupta <[email protected]>Signed-off-by Sumit Gupta <[email protected]>Quoted 8 lines
---
Sending this patch separately as the other patch in the series is applied by Rafael in v6[1]. Revision history before this version is in the cover letter of v6[1].
Please review and provide ACK if looks fine.
For arm64 specific changes(a minor nit below though),
Acked-by Sudeep Holla <[email protected]>[...]
Quoted 10 lines
drivers/acpi/arm64/thermal_cpufreq.c new file +4
-0@@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-only +#include <linux/acpi.h> + +#include "../internal.h"
Quoted 8 lines
drivers/acpi/arm64/thermal_cpufreq.c line 7
Quoted 3 lines
drivers/acpi/arm64/thermal_cpufreq.c new file +3
-0+ +#define SMCCC_SOC_ID_T241 0x036b0241 +[nit] We really need to find better place to define this globally and not locally at each usage site like this. We already have it in GICv3 driver. But that can come as a cleanup later if it causes issue for merging this change.
Agreed.
Looks good to me as well.
Thanks
Hanjun
Quoted 50 lines
Quoted 41 lines
Quoted 15 lines
From: Srikar Srimath Tirumala <[email protected]>
Current implementation of
processor_thermalperforms software throttling in fixed steps of "20%" which can be too coarse for some platforms. We observed some performance gain after reducing the throttle percentage. Change the CPUFREQ thermal reduction percentage and maximum thermal steps to be configurable. Also, update the default values of both for Nvidia Tegra241 (Grace) SoC. The thermal reduction percentage is reduced to "5%" and accordingly the maximum number of thermal steps are increased as they are derived from the reduction percentage.Signed-off-by Srikar Srimath Tirumala <[email protected]>Co-developed-by Sumit Gupta <[email protected]>Signed-off-by Sumit Gupta <[email protected]>Quoted 8 lines
---
Sending this patch separately as the other patch in the series is applied by Rafael in v6[1]. Revision history before this version is in the cover letter of v6[1].
Please review and provide ACK if looks fine.
For arm64 specific changes(a minor nit below though),
Acked-by Sudeep Holla <[email protected]>[...]
Quoted 10 lines
drivers/acpi/arm64/thermal_cpufreq.c new file +4
-0@@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-only +#include <linux/acpi.h> + +#include "../internal.h" Quoted 8 lines
drivers/acpi/arm64/thermal_cpufreq.c line 7
Quoted 3 lines
drivers/acpi/arm64/thermal_cpufreq.c new file +3
-0+ +#define SMCCC_SOC_ID_T241 0x036b0241 +[nit] We really need to find better place to define this globally and not locally at each usage site like this. We already have it in GICv3 driver. But that can come as a cleanup later if it causes issue for merging this change.
Quoted 6 lines
Agreed.
Looks good to me as well.
Acked-by Hanjun Guo <[email protected]>
Hi Rafael,
If the change seems fine, could you please apply this patch?
Thanks,
Sumit
Quoted 23 lines · Hanjun Guo
Quoted 21 lines · Sudeep Holla
Quoted 20 lines · Sumit Gupta
From: Srikar Srimath Tirumala <[email protected]>
Current implementation of
processor_thermalperforms software throttling in fixed steps of "20%" which can be too coarse for some platforms. We observed some performance gain after reducing the throttle percentage. Change the CPUFREQ thermal reduction percentage and maximum thermal steps to be configurable. Also, update the default values of both for Nvidia Tegra241 (Grace) SoC. The thermal reduction percentage is reduced to "5%" and accordingly the maximum number of thermal steps are increased as they are derived from the reduction percentage.Signed-off-by Srikar Srimath Tirumala <[email protected]>Co-developed-by Sumit Gupta <[email protected]>Signed-off-by Sumit Gupta <[email protected]>---
Sending this patch separately as the other patch in the series is applied by Rafael in v6[1]. Revision history before this version is in the cover letter of v6[1].
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
Please review and provide ACK if looks fine.
For arm64 specific changes(a minor nit below though),
Acked-by Sudeep Holla <[email protected]>
Applied as 6.8 material, thanks!