Commit 20df0961 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'pm-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
 "These fix some issues and clean up code in ARM cpufreq drivers.

  Specifics:

   - Fix module loading in the Tegra124 cpufreq driver (Jon Hunter)

   - Fix memory leak and update to read-only region in the qcom cpufreq
     driver (Fabien Parent)

   - Miscellaneous minor cleanups to cpufreq drivers (Fabien Parent,
     Yang Yingliang)"

* tag 'pm-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: sun50i: Switch to use dev_err_probe() helper
  cpufreq: qcom-nvmem: Switch to use dev_err_probe() helper
  cpufreq: imx6q: Switch to use dev_err_probe() helper
  cpufreq: dt: Switch to use dev_err_probe() helper
  cpufreq: qcom: remove unused parameter in function definition
  cpufreq: qcom: fix writes in read-only memory region
  cpufreq: qcom: fix memory leak in error path
  cpufreq: tegra194: Fix module loading
parents 9d6e681d a6991d62
...@@ -222,10 +222,8 @@ static int dt_cpufreq_early_init(struct device *dev, int cpu) ...@@ -222,10 +222,8 @@ static int dt_cpufreq_early_init(struct device *dev, int cpu)
if (reg_name[0]) { if (reg_name[0]) {
priv->opp_token = dev_pm_opp_set_regulators(cpu_dev, reg_name); priv->opp_token = dev_pm_opp_set_regulators(cpu_dev, reg_name);
if (priv->opp_token < 0) { if (priv->opp_token < 0) {
ret = priv->opp_token; ret = dev_err_probe(cpu_dev, priv->opp_token,
if (ret != -EPROBE_DEFER) "failed to set regulators\n");
dev_err(cpu_dev, "failed to set regulators: %d\n",
ret);
goto free_cpumask; goto free_cpumask;
} }
} }
......
...@@ -396,9 +396,7 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) ...@@ -396,9 +396,7 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
ret = imx6q_opp_check_speed_grading(cpu_dev); ret = imx6q_opp_check_speed_grading(cpu_dev);
} }
if (ret) { if (ret) {
if (ret != -EPROBE_DEFER) dev_err_probe(cpu_dev, ret, "failed to read ocotp\n");
dev_err(cpu_dev, "failed to read ocotp: %d\n",
ret);
goto out_free_opp; goto out_free_opp;
} }
......
...@@ -64,7 +64,7 @@ static struct platform_device *cpufreq_dt_pdev, *cpufreq_pdev; ...@@ -64,7 +64,7 @@ static struct platform_device *cpufreq_dt_pdev, *cpufreq_pdev;
static void get_krait_bin_format_a(struct device *cpu_dev, static void get_krait_bin_format_a(struct device *cpu_dev,
int *speed, int *pvs, int *pvs_ver, int *speed, int *pvs, int *pvs_ver,
struct nvmem_cell *pvs_nvmem, u8 *buf) u8 *buf)
{ {
u32 pte_efuse; u32 pte_efuse;
...@@ -95,7 +95,7 @@ static void get_krait_bin_format_a(struct device *cpu_dev, ...@@ -95,7 +95,7 @@ static void get_krait_bin_format_a(struct device *cpu_dev,
static void get_krait_bin_format_b(struct device *cpu_dev, static void get_krait_bin_format_b(struct device *cpu_dev,
int *speed, int *pvs, int *pvs_ver, int *speed, int *pvs, int *pvs_ver,
struct nvmem_cell *pvs_nvmem, u8 *buf) u8 *buf)
{ {
u32 pte_efuse, redundant_sel; u32 pte_efuse, redundant_sel;
...@@ -213,6 +213,7 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev, ...@@ -213,6 +213,7 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev,
int speed = 0, pvs = 0, pvs_ver = 0; int speed = 0, pvs = 0, pvs_ver = 0;
u8 *speedbin; u8 *speedbin;
size_t len; size_t len;
int ret = 0;
speedbin = nvmem_cell_read(speedbin_nvmem, &len); speedbin = nvmem_cell_read(speedbin_nvmem, &len);
...@@ -222,15 +223,16 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev, ...@@ -222,15 +223,16 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev,
switch (len) { switch (len) {
case 4: case 4:
get_krait_bin_format_a(cpu_dev, &speed, &pvs, &pvs_ver, get_krait_bin_format_a(cpu_dev, &speed, &pvs, &pvs_ver,
speedbin_nvmem, speedbin); speedbin);
break; break;
case 8: case 8:
get_krait_bin_format_b(cpu_dev, &speed, &pvs, &pvs_ver, get_krait_bin_format_b(cpu_dev, &speed, &pvs, &pvs_ver,
speedbin_nvmem, speedbin); speedbin);
break; break;
default: default:
dev_err(cpu_dev, "Unable to read nvmem data. Defaulting to 0!\n"); dev_err(cpu_dev, "Unable to read nvmem data. Defaulting to 0!\n");
return -ENODEV; ret = -ENODEV;
goto len_error;
} }
snprintf(*pvs_name, sizeof("speedXX-pvsXX-vXX"), "speed%d-pvs%d-v%d", snprintf(*pvs_name, sizeof("speedXX-pvsXX-vXX"), "speed%d-pvs%d-v%d",
...@@ -238,8 +240,9 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev, ...@@ -238,8 +240,9 @@ static int qcom_cpufreq_krait_name_version(struct device *cpu_dev,
drv->versions = (1 << speed); drv->versions = (1 << speed);
len_error:
kfree(speedbin); kfree(speedbin);
return 0; return ret;
} }
static const struct qcom_cpufreq_match_data match_data_kryo = { static const struct qcom_cpufreq_match_data match_data_kryo = {
...@@ -262,7 +265,8 @@ static int qcom_cpufreq_probe(struct platform_device *pdev) ...@@ -262,7 +265,8 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
struct nvmem_cell *speedbin_nvmem; struct nvmem_cell *speedbin_nvmem;
struct device_node *np; struct device_node *np;
struct device *cpu_dev; struct device *cpu_dev;
char *pvs_name = "speedXX-pvsXX-vXX"; char pvs_name_buffer[] = "speedXX-pvsXX-vXX";
char *pvs_name = pvs_name_buffer;
unsigned cpu; unsigned cpu;
const struct of_device_id *match; const struct of_device_id *match;
int ret; int ret;
...@@ -295,11 +299,8 @@ static int qcom_cpufreq_probe(struct platform_device *pdev) ...@@ -295,11 +299,8 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
if (drv->data->get_version) { if (drv->data->get_version) {
speedbin_nvmem = of_nvmem_cell_get(np, NULL); speedbin_nvmem = of_nvmem_cell_get(np, NULL);
if (IS_ERR(speedbin_nvmem)) { if (IS_ERR(speedbin_nvmem)) {
if (PTR_ERR(speedbin_nvmem) != -EPROBE_DEFER) ret = dev_err_probe(cpu_dev, PTR_ERR(speedbin_nvmem),
dev_err(cpu_dev, "Could not get nvmem cell\n");
"Could not get nvmem cell: %ld\n",
PTR_ERR(speedbin_nvmem));
ret = PTR_ERR(speedbin_nvmem);
goto free_drv; goto free_drv;
} }
......
...@@ -56,12 +56,9 @@ static int sun50i_cpufreq_get_efuse(u32 *versions) ...@@ -56,12 +56,9 @@ static int sun50i_cpufreq_get_efuse(u32 *versions)
speedbin_nvmem = of_nvmem_cell_get(np, NULL); speedbin_nvmem = of_nvmem_cell_get(np, NULL);
of_node_put(np); of_node_put(np);
if (IS_ERR(speedbin_nvmem)) { if (IS_ERR(speedbin_nvmem))
if (PTR_ERR(speedbin_nvmem) != -EPROBE_DEFER) return dev_err_probe(cpu_dev, PTR_ERR(speedbin_nvmem),
pr_err("Could not get nvmem cell: %ld\n", "Could not get nvmem cell\n");
PTR_ERR(speedbin_nvmem));
return PTR_ERR(speedbin_nvmem);
}
speedbin = nvmem_cell_read(speedbin_nvmem, &len); speedbin = nvmem_cell_read(speedbin_nvmem, &len);
nvmem_cell_put(speedbin_nvmem); nvmem_cell_put(speedbin_nvmem);
......
...@@ -589,6 +589,7 @@ static const struct of_device_id tegra194_cpufreq_of_match[] = { ...@@ -589,6 +589,7 @@ static const struct of_device_id tegra194_cpufreq_of_match[] = {
{ .compatible = "nvidia,tegra239-ccplex-cluster", .data = &tegra239_cpufreq_soc }, { .compatible = "nvidia,tegra239-ccplex-cluster", .data = &tegra239_cpufreq_soc },
{ /* sentinel */ } { /* sentinel */ }
}; };
MODULE_DEVICE_TABLE(of, tegra194_cpufreq_of_match);
static struct platform_driver tegra194_ccplex_driver = { static struct platform_driver tegra194_ccplex_driver = {
.driver = { .driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment