mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
ARM cpufreq fixes for 6.15-rc
- Fix possible out-of-bound / null-ptr-deref in drivers (Andre Przywara and Henry Martin). - Fix Kconfig issues with compile-test (Johan Hovold and Krzysztof Kozlowski). - Fix invalid return value in .get() (Marc Zyngier). - Add SM8650 to cpufreq-dt-platdev blocklist (Pengyu Luo). -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEx73Crsp7f6M6scA70rkcPK6BEhwFAmgF9KgACgkQ0rkcPK6B EhwefQ/+ORtqeZPEZqDPrllIE18NsgLjML99BTK558Heq7ci1CFbh8/XsGEmnBrB Vzw/p8UkWu1Ifc7IilBvgN6FoXj1QzA+/vfMzboej29U0go5EIVfAp6yifolLI17 wcT7kcAS6CnxhFAYYnVuI8ninFa041SxXkbcW4V5fnOp5IUm2oKbFrAJAv999sKT 1Ds2RdgopLZ1yGARDYrLI9d0d3XdoUZBSc/MVwxbpK8LKmazENaEtbyAmOEksSCE wM58csyLH+OKYHuUuSBkpaNh+0jAOD4O/m/LhEERsFyKxgUoZWBWimpGRUji2yX7 4zXuakik+8OJkhLjgBe53MXQ/1Ev0t9dSpgq0XeIZwbIUKMsuc8siwoMehmou3Om vupqeLmmhgwGRRUiFk0q70QGLj3g6tl/M5mmHGku/vS/8wiTfP70J8djq7HiDaIV QnXt3qKXi9egZqQ+B6qNUgOet3VAj+RQS0SFQpbXWISWplvfuyJE6SCHna5Ald4I 41WX4swQ8Q0gruHNwFzehzKrOtIYchqt/zbTibxTBZjBDiN+eJVrpPd0yzWjP4xK QKwhwtpc7oNb8AfnSw1483w/LXJGztZNCtvmWaMjmbS8H+FdKu5BMuLpAFUtm2hk M6U2FMyttwK9I83afarPksuOr+rEGDtxevPL8pRoVPLXgDTqWNk= =PSnc -----END PGP SIGNATURE----- Merge tag 'cpufreq-arm-fixes-6.15-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Merge ARM cpufreq fixes for 6.15-rc from Viresh Kumar: "- Fix possible out-of-bound / null-ptr-deref in drivers (Andre Przywara and Henry Martin). - Fix Kconfig issues with compile-test (Johan Hovold and Krzysztof Kozlowski). - Fix invalid return value in .get() (Marc Zyngier). - Add SM8650 to cpufreq-dt-platdev blocklist (Pengyu Luo)." * tag 'cpufreq-arm-fixes-6.15-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/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
5786ef8ad8
|
|
@ -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