Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bbc17bb8 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branch 'pm-devfreq'

* pm-devfreq:
  devfreq: rk3399_dmc: Don't use OPP structures outside of RCU locks
  devfreq: rk3399_dmc: Remove dangling rcu_read_unlock()
  devfreq: exynos: Don't use OPP structures outside of RCU locks
  PM / devfreq: rk3399_dmc: Use the resource-managed function to add devfreq dev
  PM / devfreq: correct comment typo.
  PM / devfreq: exynos-ppmu: Remove unused mutex from struct exynos_ppmu
  PM / devfreq: exynos-ppmu: ppmu_events array should not be NULL terminated
  PM / devfreq: exynos-ppmu: Fix module autoload
  PM / devfreq: rockchip-dfi: Fix module autoload
  PM / devfreq: exynos-nocp: Fix module autoload
  PM / devfreq: rk3399_dmc: Fix module autoload
parents 631ddaba e37d3508
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -850,7 +850,7 @@ int devfreq_add_governor(struct devfreq_governor *governor)
EXPORT_SYMBOL(devfreq_add_governor);

/**
 * devfreq_remove_device() - Remove devfreq feature from a device.
 * devfreq_remove_governor() - Remove devfreq feature from a device.
 * @governor:	the devfreq governor to be removed
 */
int devfreq_remove_governor(struct devfreq_governor *governor)
+1 −0
Original line number Diff line number Diff line
@@ -190,6 +190,7 @@ static const struct of_device_id exynos_nocp_id_match[] = {
	{ .compatible = "samsung,exynos5420-nocp", },
	{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, exynos_nocp_id_match);

static struct regmap_config exynos_nocp_regmap_config = {
	.reg_bits = 32,
+1 −5
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/suspend.h>
@@ -34,7 +33,6 @@ struct exynos_ppmu {
	unsigned int num_events;

	struct device *dev;
	struct mutex lock;

	struct exynos_ppmu_data ppmu;
};
@@ -90,8 +88,6 @@ struct __exynos_ppmu_events {
	PPMU_EVENT(d1-cpu),
	PPMU_EVENT(d1-general),
	PPMU_EVENT(d1-rt),

	{ /* sentinel */ },
};

static int exynos_ppmu_find_ppmu_id(struct devfreq_event_dev *edev)
@@ -351,6 +347,7 @@ static const struct of_device_id exynos_ppmu_id_match[] = {
	},
	{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, exynos_ppmu_id_match);

static struct devfreq_event_ops *exynos_bus_get_ops(struct device_node *np)
{
@@ -463,7 +460,6 @@ static int exynos_ppmu_probe(struct platform_device *pdev)
	if (!info)
		return -ENOMEM;

	mutex_init(&info->lock);
	info->dev = &pdev->dev;

	/* Parse dt data to get resource */
+1 −0
Original line number Diff line number Diff line
@@ -188,6 +188,7 @@ static const struct of_device_id rockchip_dfi_id_match[] = {
	{ .compatible = "rockchip,rk3399-dfi" },
	{ },
};
MODULE_DEVICE_TABLE(of, rockchip_dfi_id_match);

static int rockchip_dfi_probe(struct platform_device *pdev)
{
+14 −15
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ struct exynos_bus {
	unsigned int edev_count;
	struct mutex lock;

	struct dev_pm_opp *curr_opp;
	unsigned long curr_freq;

	struct regulator *regulator;
	struct clk *clk;
@@ -99,7 +99,7 @@ static int exynos_bus_target(struct device *dev, unsigned long *freq, u32 flags)
{
	struct exynos_bus *bus = dev_get_drvdata(dev);
	struct dev_pm_opp *new_opp;
	unsigned long old_freq, new_freq, old_volt, new_volt, tol;
	unsigned long old_freq, new_freq, new_volt, tol;
	int ret = 0;

	/* Get new opp-bus instance according to new bus clock */
@@ -113,8 +113,7 @@ static int exynos_bus_target(struct device *dev, unsigned long *freq, u32 flags)

	new_freq = dev_pm_opp_get_freq(new_opp);
	new_volt = dev_pm_opp_get_voltage(new_opp);
	old_freq = dev_pm_opp_get_freq(bus->curr_opp);
	old_volt = dev_pm_opp_get_voltage(bus->curr_opp);
	old_freq = bus->curr_freq;
	rcu_read_unlock();

	if (old_freq == new_freq)
@@ -146,7 +145,7 @@ static int exynos_bus_target(struct device *dev, unsigned long *freq, u32 flags)
			goto out;
		}
	}
	bus->curr_opp = new_opp;
	bus->curr_freq = new_freq;

	dev_dbg(dev, "Set the frequency of bus (%lukHz -> %lukHz)\n",
			old_freq/1000, new_freq/1000);
@@ -163,9 +162,7 @@ static int exynos_bus_get_dev_status(struct device *dev,
	struct devfreq_event_data edata;
	int ret;

	rcu_read_lock();
	stat->current_frequency = dev_pm_opp_get_freq(bus->curr_opp);
	rcu_read_unlock();
	stat->current_frequency = bus->curr_freq;

	ret = exynos_bus_get_event(bus, &edata);
	if (ret < 0) {
@@ -226,7 +223,7 @@ static int exynos_bus_passive_target(struct device *dev, unsigned long *freq,
	}

	new_freq = dev_pm_opp_get_freq(new_opp);
	old_freq = dev_pm_opp_get_freq(bus->curr_opp);
	old_freq = bus->curr_freq;
	rcu_read_unlock();

	if (old_freq == new_freq)
@@ -242,7 +239,7 @@ static int exynos_bus_passive_target(struct device *dev, unsigned long *freq,
	}

	*freq = new_freq;
	bus->curr_opp = new_opp;
	bus->curr_freq = new_freq;

	dev_dbg(dev, "Set the frequency of bus (%lukHz -> %lukHz)\n",
			old_freq/1000, new_freq/1000);
@@ -335,6 +332,7 @@ static int exynos_bus_parse_of(struct device_node *np,
			      struct exynos_bus *bus)
{
	struct device *dev = bus->dev;
	struct dev_pm_opp *opp;
	unsigned long rate;
	int ret;

@@ -352,22 +350,23 @@ static int exynos_bus_parse_of(struct device_node *np,
	}

	/* Get the freq and voltage from OPP table to scale the bus freq */
	rcu_read_lock();
	ret = dev_pm_opp_of_add_table(dev);
	if (ret < 0) {
		dev_err(dev, "failed to get OPP table\n");
		rcu_read_unlock();
		goto err_clk;
	}

	rate = clk_get_rate(bus->clk);
	bus->curr_opp = devfreq_recommended_opp(dev, &rate, 0);
	if (IS_ERR(bus->curr_opp)) {

	rcu_read_lock();
	opp = devfreq_recommended_opp(dev, &rate, 0);
	if (IS_ERR(opp)) {
		dev_err(dev, "failed to find dev_pm_opp\n");
		rcu_read_unlock();
		ret = PTR_ERR(bus->curr_opp);
		ret = PTR_ERR(opp);
		goto err_opp;
	}
	bus->curr_freq = dev_pm_opp_get_freq(opp);
	rcu_read_unlock();

	return 0;
Loading