Commit e213cd8f authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files
Pull operating performance points (OPP) framework fixes for 5.10-rc2
from Viresh Kumar:

"- Don't remove the static OPPs erroneously.

 - Check for the right condition before making an early exit.

 - Avoid a lockdep by reducing the size of the critical section."

* 'opp/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm:
  opp: Reduce the size of critical section in _opp_table_kref_release()
  opp: Fix early exit from dev_pm_opp_register_set_opp_helper()
  opp: Don't always remove static OPPs in _of_add_opp_table_v1()
parents 3650b228 e0df59de
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -1181,6 +1181,10 @@ static void _opp_table_kref_release(struct kref *kref)
	struct opp_device *opp_dev, *temp;
	int i;

	/* Drop the lock as soon as we can */
	list_del(&opp_table->node);
	mutex_unlock(&opp_table_lock);

	_of_clear_opp_table(opp_table);

	/* Release clk */
@@ -1208,10 +1212,7 @@ static void _opp_table_kref_release(struct kref *kref)

	mutex_destroy(&opp_table->genpd_virt_dev_lock);
	mutex_destroy(&opp_table->lock);
	list_del(&opp_table->node);
	kfree(opp_table);

	mutex_unlock(&opp_table_lock);
}

void dev_pm_opp_put_opp_table(struct opp_table *opp_table)
@@ -1930,7 +1931,7 @@ struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev,
		return ERR_PTR(-EINVAL);

	opp_table = dev_pm_opp_get_opp_table(dev);
	if (!IS_ERR(opp_table))
	if (IS_ERR(opp_table))
		return opp_table;

	/* This should be called before OPPs are initialized */
+2 −0
Original line number Diff line number Diff line
@@ -944,6 +944,8 @@ static int _of_add_opp_table_v1(struct device *dev, struct opp_table *opp_table)
		nr -= 2;
	}

	return 0;

remove_static_opp:
	_opp_remove_all_static(opp_table);