mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
Power management fixes for 6.15-rc4
- Fix possible out-of-bound / NULL-ptr-deref in cpufreq drivers (Henry
Martin, Andre Przywara).
- Fix Kconfig issues with compile-test in cpufreq drivers (Krzysztof
Kozlowski, Johan Hovold).
- Fix invalid return value in .get() in the CPPC cpufreq driver (Marc
Zyngier).
- Add SM8650 to cpufreq-dt-platdev blocklist (Pengyu Luo).
-----BEGIN PGP SIGNATURE-----
iQFGBAABCAAwFiEEcM8Aw/RY0dgsiRUR7l+9nS/U47UFAmgLtCESHHJqd0Byand5
c29ja2kubmV0AAoJEO5fvZ0v1OO19J4H/1pKGr+VTZ4CUiorrP+3d2csd/bW/0d6
rOu91r2bl3+wHxuJpDGN/Fi/lWPL9wLN6qg2nyku66Kn5u+3H4nW9GbcraNIqty0
rwX1Zcp2ozPlgK4peZk/Ann+rpBOQlKjYs4vGqsgv4R9DSMaB7eXWpt7dxB8OsCq
4Xjs4ZqFZOuUyLzFCTeWnP/8h29Ru7welhgyWT2bo40Rft8qAcdIQXnrX0UZgJ15
W41yKxzpodFIwUyWQwVLop0po0r3Y+OLnkXNosELDUx7bp499i2roBhbTSySWvW1
1V8BT3oXv34NVkWH+9AUBTYmw5BXe3JoL6wjV5jmbAdDfY4wkQizzac=
=N3gH
-----END PGP SIGNATURE-----
Merge tag 'pm-6.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki:
"These are cpufreq driver fixes addressing multiple assorted issues:
- Fix possible out-of-bound / NULL-ptr-deref in cpufreq drivers
(Henry Martin, Andre Przywara)
- Fix Kconfig issues with compile-test in cpufreq drivers (Krzysztof
Kozlowski, Johan Hovold)
- Fix invalid return value in .get() in the CPPC cpufreq driver (Marc
Zyngier)
- Add SM8650 to cpufreq-dt-platdev blocklist (Pengyu Luo)"
* tag 'pm-6.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
cpufreq: fix compile-test defaults
cpufreq: cppc: Fix invalid return value in .get() callback
cpufreq: scpi: Fix null-ptr-deref in scpi_cpufreq_get_rate()
cpufreq: scmi: Fix null-ptr-deref in scmi_cpufreq_get_rate()
cpufreq: apple-soc: Fix null-ptr-deref in apple_soc_cpufreq_get_rate()
cpufreq: Do not enable by default during compile testing
cpufreq: Add SM8650 to cpufreq-dt-platdev blocklist
cpufreq: sun50i: prevent out-of-bounds access
This commit is contained in:
commit
6e3597f12d
|
|
@ -76,7 +76,7 @@ config ARM_VEXPRESS_SPC_CPUFREQ
|
|||
config ARM_BRCMSTB_AVS_CPUFREQ
|
||||
tristate "Broadcom STB AVS CPUfreq driver"
|
||||
depends on (ARCH_BRCMSTB && !ARM_SCMI_CPUFREQ) || COMPILE_TEST
|
||||
default y
|
||||
default y if ARCH_BRCMSTB && !ARM_SCMI_CPUFREQ
|
||||
help
|
||||
Some Broadcom STB SoCs use a co-processor running proprietary firmware
|
||||
("AVS") to handle voltage and frequency scaling. This driver provides
|
||||
|
|
@ -88,7 +88,7 @@ config ARM_HIGHBANK_CPUFREQ
|
|||
tristate "Calxeda Highbank-based"
|
||||
depends on ARCH_HIGHBANK || COMPILE_TEST
|
||||
depends on CPUFREQ_DT && REGULATOR && PL320_MBOX
|
||||
default m
|
||||
default m if ARCH_HIGHBANK
|
||||
help
|
||||
This adds the CPUFreq driver for Calxeda Highbank SoC
|
||||
based boards.
|
||||
|
|
@ -133,7 +133,7 @@ config ARM_MEDIATEK_CPUFREQ
|
|||
config ARM_MEDIATEK_CPUFREQ_HW
|
||||
tristate "MediaTek CPUFreq HW driver"
|
||||
depends on ARCH_MEDIATEK || COMPILE_TEST
|
||||
default m
|
||||
default m if ARCH_MEDIATEK
|
||||
help
|
||||
Support for the CPUFreq HW driver.
|
||||
Some MediaTek chipsets have a HW engine to offload the steps
|
||||
|
|
@ -181,7 +181,7 @@ config ARM_RASPBERRYPI_CPUFREQ
|
|||
config ARM_S3C64XX_CPUFREQ
|
||||
bool "Samsung S3C64XX"
|
||||
depends on CPU_S3C6410 || COMPILE_TEST
|
||||
default y
|
||||
default CPU_S3C6410
|
||||
help
|
||||
This adds the CPUFreq driver for Samsung S3C6410 SoC.
|
||||
|
||||
|
|
@ -190,7 +190,7 @@ config ARM_S3C64XX_CPUFREQ
|
|||
config ARM_S5PV210_CPUFREQ
|
||||
bool "Samsung S5PV210 and S5PC110"
|
||||
depends on CPU_S5PV210 || COMPILE_TEST
|
||||
default y
|
||||
default CPU_S5PV210
|
||||
help
|
||||
This adds the CPUFreq driver for Samsung S5PV210 and
|
||||
S5PC110 SoCs.
|
||||
|
|
@ -214,7 +214,7 @@ config ARM_SCMI_CPUFREQ
|
|||
config ARM_SPEAR_CPUFREQ
|
||||
bool "SPEAr CPUFreq support"
|
||||
depends on PLAT_SPEAR || COMPILE_TEST
|
||||
default y
|
||||
default PLAT_SPEAR
|
||||
help
|
||||
This adds the CPUFreq driver support for SPEAr SOCs.
|
||||
|
||||
|
|
@ -233,7 +233,7 @@ config ARM_TEGRA20_CPUFREQ
|
|||
tristate "Tegra20/30 CPUFreq support"
|
||||
depends on ARCH_TEGRA || COMPILE_TEST
|
||||
depends on CPUFREQ_DT
|
||||
default y
|
||||
default ARCH_TEGRA
|
||||
help
|
||||
This adds the CPUFreq driver support for Tegra20/30 SOCs.
|
||||
|
||||
|
|
@ -241,7 +241,7 @@ config ARM_TEGRA124_CPUFREQ
|
|||
bool "Tegra124 CPUFreq support"
|
||||
depends on ARCH_TEGRA || COMPILE_TEST
|
||||
depends on CPUFREQ_DT
|
||||
default y
|
||||
default ARCH_TEGRA
|
||||
help
|
||||
This adds the CPUFreq driver support for Tegra124 SOCs.
|
||||
|
||||
|
|
@ -256,14 +256,14 @@ config ARM_TEGRA194_CPUFREQ
|
|||
tristate "Tegra194 CPUFreq support"
|
||||
depends on ARCH_TEGRA_194_SOC || ARCH_TEGRA_234_SOC || (64BIT && COMPILE_TEST)
|
||||
depends on TEGRA_BPMP
|
||||
default y
|
||||
default ARCH_TEGRA_194_SOC || ARCH_TEGRA_234_SOC
|
||||
help
|
||||
This adds CPU frequency driver support for Tegra194 SOCs.
|
||||
|
||||
config ARM_TI_CPUFREQ
|
||||
bool "Texas Instruments CPUFreq support"
|
||||
depends on ARCH_OMAP2PLUS || ARCH_K3 || COMPILE_TEST
|
||||
default y
|
||||
default ARCH_OMAP2PLUS || ARCH_K3
|
||||
help
|
||||
This driver enables valid OPPs on the running platform based on
|
||||
values contained within the SoC in use. Enable this in order to
|
||||
|
|
|
|||
|
|
@ -134,11 +134,17 @@ static const struct of_device_id apple_soc_cpufreq_of_match[] __maybe_unused = {
|
|||
|
||||
static unsigned int apple_soc_cpufreq_get_rate(unsigned int cpu)
|
||||
{
|
||||
struct cpufreq_policy *policy = cpufreq_cpu_get_raw(cpu);
|
||||
struct apple_cpu_priv *priv = policy->driver_data;
|
||||
struct cpufreq_policy *policy;
|
||||
struct apple_cpu_priv *priv;
|
||||
struct cpufreq_frequency_table *p;
|
||||
unsigned int pstate;
|
||||
|
||||
policy = cpufreq_cpu_get_raw(cpu);
|
||||
if (unlikely(!policy))
|
||||
return 0;
|
||||
|
||||
priv = policy->driver_data;
|
||||
|
||||
if (priv->info->cur_pstate_mask) {
|
||||
u32 reg = readl_relaxed(priv->reg_base + APPLE_DVFS_STATUS);
|
||||
|
||||
|
|
|
|||
|
|
@ -747,7 +747,7 @@ static unsigned int cppc_cpufreq_get_rate(unsigned int cpu)
|
|||
int ret;
|
||||
|
||||
if (!policy)
|
||||
return -ENODEV;
|
||||
return 0;
|
||||
|
||||
cpu_data = policy->driver_data;
|
||||
|
||||
|
|
|
|||
|
|
@ -175,6 +175,7 @@ static const struct of_device_id blocklist[] __initconst = {
|
|||
{ .compatible = "qcom,sm8350", },
|
||||
{ .compatible = "qcom,sm8450", },
|
||||
{ .compatible = "qcom,sm8550", },
|
||||
{ .compatible = "qcom,sm8650", },
|
||||
|
||||
{ .compatible = "st,stih407", },
|
||||
{ .compatible = "st,stih410", },
|
||||
|
|
|
|||
|
|
@ -37,11 +37,17 @@ static struct cpufreq_driver scmi_cpufreq_driver;
|
|||
|
||||
static unsigned int scmi_cpufreq_get_rate(unsigned int cpu)
|
||||
{
|
||||
struct cpufreq_policy *policy = cpufreq_cpu_get_raw(cpu);
|
||||
struct scmi_data *priv = policy->driver_data;
|
||||
struct cpufreq_policy *policy;
|
||||
struct scmi_data *priv;
|
||||
unsigned long rate;
|
||||
int ret;
|
||||
|
||||
policy = cpufreq_cpu_get_raw(cpu);
|
||||
if (unlikely(!policy))
|
||||
return 0;
|
||||
|
||||
priv = policy->driver_data;
|
||||
|
||||
ret = perf_ops->freq_get(ph, priv->domain_id, &rate, false);
|
||||
if (ret)
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -29,9 +29,16 @@ static struct scpi_ops *scpi_ops;
|
|||
|
||||
static unsigned int scpi_cpufreq_get_rate(unsigned int cpu)
|
||||
{
|
||||
struct cpufreq_policy *policy = cpufreq_cpu_get_raw(cpu);
|
||||
struct scpi_data *priv = policy->driver_data;
|
||||
unsigned long rate = clk_get_rate(priv->clk);
|
||||
struct cpufreq_policy *policy;
|
||||
struct scpi_data *priv;
|
||||
unsigned long rate;
|
||||
|
||||
policy = cpufreq_cpu_get_raw(cpu);
|
||||
if (unlikely(!policy))
|
||||
return 0;
|
||||
|
||||
priv = policy->driver_data;
|
||||
rate = clk_get_rate(priv->clk);
|
||||
|
||||
return rate / 1000;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,7 +194,9 @@ static int sun50i_cpufreq_get_efuse(void)
|
|||
struct nvmem_cell *speedbin_nvmem;
|
||||
const struct of_device_id *match;
|
||||
struct device *cpu_dev;
|
||||
u32 *speedbin;
|
||||
void *speedbin_ptr;
|
||||
u32 speedbin = 0;
|
||||
size_t len;
|
||||
int ret;
|
||||
|
||||
cpu_dev = get_cpu_device(0);
|
||||
|
|
@ -217,14 +219,18 @@ static int sun50i_cpufreq_get_efuse(void)
|
|||
return dev_err_probe(cpu_dev, PTR_ERR(speedbin_nvmem),
|
||||
"Could not get nvmem cell\n");
|
||||
|
||||
speedbin = nvmem_cell_read(speedbin_nvmem, NULL);
|
||||
speedbin_ptr = nvmem_cell_read(speedbin_nvmem, &len);
|
||||
nvmem_cell_put(speedbin_nvmem);
|
||||
if (IS_ERR(speedbin))
|
||||
return PTR_ERR(speedbin);
|
||||
if (IS_ERR(speedbin_ptr))
|
||||
return PTR_ERR(speedbin_ptr);
|
||||
|
||||
ret = opp_data->efuse_xlate(*speedbin);
|
||||
if (len <= 4)
|
||||
memcpy(&speedbin, speedbin_ptr, len);
|
||||
speedbin = le32_to_cpu(speedbin);
|
||||
|
||||
kfree(speedbin);
|
||||
ret = opp_data->efuse_xlate(speedbin);
|
||||
|
||||
kfree(speedbin_ptr);
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user