]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/base/power/opp/of.c
Merge branches 'pm-core', 'pm-qos', 'pm-domains' and 'pm-opp'
[linux.git] / drivers / base / power / opp / of.c
index 6a6e6e7846b3a0391ca5a9c90e1cf3f6fd107662..779428676f63c07e8f0e05982e6354d623b4a821 100644 (file)
@@ -28,7 +28,7 @@ static struct opp_table *_managed_opp(const struct device_node *np)
 
        mutex_lock(&opp_table_lock);
 
-       list_for_each_entry_rcu(opp_table, &opp_tables, node) {
+       list_for_each_entry(opp_table, &opp_tables, node) {
                if (opp_table->np == np) {
                        /*
                         * Multiple devices can point to the same OPP table and
@@ -235,12 +235,6 @@ static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev,
  * @dev:       device pointer used to lookup OPP table.
  *
  * Free OPPs created using static entries present in DT.
- *
- * Locking: The internal opp_table and opp structures are RCU protected.
- * Hence this function indirectly uses RCU updater strategy with mutex locks
- * to keep the integrity of the internal data structures. Callers should ensure
- * that this function is *NOT* called under RCU protection or in contexts where
- * mutex cannot be locked.
  */
 void dev_pm_opp_of_remove_table(struct device *dev)
 {
@@ -249,7 +243,7 @@ void dev_pm_opp_of_remove_table(struct device *dev)
 EXPORT_SYMBOL_GPL(dev_pm_opp_of_remove_table);
 
 /* Returns opp descriptor node for a device, caller must do of_node_put() */
-static struct device_node *_of_get_opp_desc_node(struct device *dev)
+struct device_node *dev_pm_opp_of_get_opp_desc_node(struct device *dev)
 {
        /*
         * There should be only ONE phandle present in "operating-points-v2"
@@ -258,6 +252,7 @@ static struct device_node *_of_get_opp_desc_node(struct device *dev)
 
        return of_parse_phandle(dev->of_node, "operating-points-v2", 0);
 }
+EXPORT_SYMBOL_GPL(dev_pm_opp_of_get_opp_desc_node);
 
 /**
  * _opp_add_static_v2() - Allocate static OPPs (As per 'v2' DT bindings)
@@ -269,12 +264,6 @@ static struct device_node *_of_get_opp_desc_node(struct device *dev)
  * opp can be controlled using dev_pm_opp_enable/disable functions and may be
  * removed by dev_pm_opp_remove.
  *
- * Locking: The internal opp_table and opp structures are RCU protected.
- * Hence this function internally uses RCU updater strategy with mutex locks
- * to keep the integrity of the internal data structures. Callers should ensure
- * that this function is *NOT* called under RCU protection or in contexts where
- * mutex cannot be locked.
- *
  * Return:
  * 0           On success OR
  *             Duplicate OPPs (both freq and volt are same) and opp->available
@@ -358,7 +347,7 @@ static int _opp_add_static_v2(struct opp_table *opp_table, struct device *dev,
         * Notify the changes in the availability of the operable
         * frequency/voltage list.
         */
-       srcu_notifier_call_chain(&opp_table->srcu_head, OPP_EVENT_ADD, new_opp);
+       blocking_notifier_call_chain(&opp_table->head, OPP_EVENT_ADD, new_opp);
        return 0;
 
 free_opp:
@@ -470,12 +459,6 @@ static int _of_add_opp_table_v1(struct device *dev)
  *
  * Register the initial OPP table with the OPP library for given device.
  *
- * Locking: The internal opp_table and opp structures are RCU protected.
- * Hence this function indirectly uses RCU updater strategy with mutex locks
- * to keep the integrity of the internal data structures. Callers should ensure
- * that this function is *NOT* called under RCU protection or in contexts where
- * mutex cannot be locked.
- *
  * Return:
  * 0           On success OR
  *             Duplicate OPPs (both freq and volt are same) and opp->available
@@ -496,7 +479,7 @@ int dev_pm_opp_of_add_table(struct device *dev)
         * OPPs have two version of bindings now. The older one is deprecated,
         * try for the new binding first.
         */
-       opp_np = _of_get_opp_desc_node(dev);
+       opp_np = dev_pm_opp_of_get_opp_desc_node(dev);
        if (!opp_np) {
                /*
                 * Try old-deprecated bindings for backward compatibility with
@@ -520,12 +503,6 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_of_add_table);
  *
  * This removes the OPP tables for CPUs present in the @cpumask.
  * This should be used only to remove static entries created from DT.
- *
- * Locking: The internal opp_table and opp structures are RCU protected.
- * Hence this function internally uses RCU updater strategy with mutex locks
- * to keep the integrity of the internal data structures. Callers should ensure
- * that this function is *NOT* called under RCU protection or in contexts where
- * mutex cannot be locked.
  */
 void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask)
 {
@@ -538,12 +515,6 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_of_cpumask_remove_table);
  * @cpumask:   cpumask for which OPP table needs to be added.
  *
  * This adds the OPP tables for CPUs present in the @cpumask.
- *
- * Locking: The internal opp_table and opp structures are RCU protected.
- * Hence this function internally uses RCU updater strategy with mutex locks
- * to keep the integrity of the internal data structures. Callers should ensure
- * that this function is *NOT* called under RCU protection or in contexts where
- * mutex cannot be locked.
  */
 int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask)
 {
@@ -591,12 +562,6 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_of_cpumask_add_table);
  * This updates the @cpumask with CPUs that are sharing OPPs with @cpu_dev.
  *
  * Returns -ENOENT if operating-points-v2 isn't present for @cpu_dev.
- *
- * Locking: The internal opp_table and opp structures are RCU protected.
- * Hence this function internally uses RCU updater strategy with mutex locks
- * to keep the integrity of the internal data structures. Callers should ensure
- * that this function is *NOT* called under RCU protection or in contexts where
- * mutex cannot be locked.
  */
 int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev,
                                   struct cpumask *cpumask)
@@ -606,7 +571,7 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev,
        int cpu, ret = 0;
 
        /* Get OPP descriptor node */
-       np = _of_get_opp_desc_node(cpu_dev);
+       np = dev_pm_opp_of_get_opp_desc_node(cpu_dev);
        if (!np) {
                dev_dbg(cpu_dev, "%s: Couldn't find opp node.\n", __func__);
                return -ENOENT;
@@ -631,7 +596,7 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev,
                }
 
                /* Get OPP descriptor node */
-               tmp_np = _of_get_opp_desc_node(tcpu_dev);
+               tmp_np = dev_pm_opp_of_get_opp_desc_node(tcpu_dev);
                if (!tmp_np) {
                        dev_err(tcpu_dev, "%s: Couldn't find opp node.\n",
                                __func__);