mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	PM / Domains: Ignore domain-idle-states that are not compatible
domain-idle-states property may have phandles to idle state bindings that may not be compatible with idle state definition defined in [1]. Such phandles would just be ignored and not throw and error when read by the domain core. Signed-off-by: Lina Iyer <lina.iyer@linaro.org> Acked-by: Rob Herring <robh@kernel.org> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
		
							parent
							
								
									075c37d59e
								
							
						
					
					
						commit
						b539cc82d4
					
				
					 2 changed files with 12 additions and 8 deletions
				
			
		| 
						 | 
					@ -31,7 +31,9 @@ Optional properties:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- domain-idle-states : A phandle of an idle-state that shall be soaked into a
 | 
					- domain-idle-states : A phandle of an idle-state that shall be soaked into a
 | 
				
			||||||
                generic domain power state. The idle state definitions are
 | 
					                generic domain power state. The idle state definitions are
 | 
				
			||||||
                compatible with domain-idle-state specified in [1].
 | 
					                compatible with domain-idle-state specified in [1]. phandles
 | 
				
			||||||
 | 
					                that are not compatible with domain-idle-state will be
 | 
				
			||||||
 | 
					                ignored.
 | 
				
			||||||
  The domain-idle-state property reflects the idle state of this PM domain and
 | 
					  The domain-idle-state property reflects the idle state of this PM domain and
 | 
				
			||||||
  not the idle states of the devices or sub-domains in the PM domain. Devices
 | 
					  not the idle states of the devices or sub-domains in the PM domain. Devices
 | 
				
			||||||
  and sub-domains have their own idle-states independent of the parent
 | 
					  and sub-domains have their own idle-states independent of the parent
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2093,11 +2093,6 @@ static int genpd_parse_state(struct genpd_power_state *genpd_state,
 | 
				
			||||||
	int err;
 | 
						int err;
 | 
				
			||||||
	u32 residency;
 | 
						u32 residency;
 | 
				
			||||||
	u32 entry_latency, exit_latency;
 | 
						u32 entry_latency, exit_latency;
 | 
				
			||||||
	const struct of_device_id *match_id;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	match_id = of_match_node(idle_state_match, state_node);
 | 
					 | 
				
			||||||
	if (!match_id)
 | 
					 | 
				
			||||||
		return -EINVAL;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err = of_property_read_u32(state_node, "entry-latency-us",
 | 
						err = of_property_read_u32(state_node, "entry-latency-us",
 | 
				
			||||||
						&entry_latency);
 | 
											&entry_latency);
 | 
				
			||||||
| 
						 | 
					@ -2146,6 +2141,7 @@ int of_genpd_parse_idle_states(struct device_node *dn,
 | 
				
			||||||
	int err, ret;
 | 
						int err, ret;
 | 
				
			||||||
	int count;
 | 
						int count;
 | 
				
			||||||
	struct of_phandle_iterator it;
 | 
						struct of_phandle_iterator it;
 | 
				
			||||||
 | 
						const struct of_device_id *match_id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	count = of_count_phandle_with_args(dn, "domain-idle-states", NULL);
 | 
						count = of_count_phandle_with_args(dn, "domain-idle-states", NULL);
 | 
				
			||||||
	if (count <= 0)
 | 
						if (count <= 0)
 | 
				
			||||||
| 
						 | 
					@ -2158,6 +2154,9 @@ int of_genpd_parse_idle_states(struct device_node *dn,
 | 
				
			||||||
	/* Loop over the phandles until all the requested entry is found */
 | 
						/* Loop over the phandles until all the requested entry is found */
 | 
				
			||||||
	of_for_each_phandle(&it, err, dn, "domain-idle-states", NULL, 0) {
 | 
						of_for_each_phandle(&it, err, dn, "domain-idle-states", NULL, 0) {
 | 
				
			||||||
		np = it.node;
 | 
							np = it.node;
 | 
				
			||||||
 | 
							match_id = of_match_node(idle_state_match, np);
 | 
				
			||||||
 | 
							if (!match_id)
 | 
				
			||||||
 | 
								continue;
 | 
				
			||||||
		ret = genpd_parse_state(&st[i++], np);
 | 
							ret = genpd_parse_state(&st[i++], np);
 | 
				
			||||||
		if (ret) {
 | 
							if (ret) {
 | 
				
			||||||
			pr_err
 | 
								pr_err
 | 
				
			||||||
| 
						 | 
					@ -2169,8 +2168,11 @@ int of_genpd_parse_idle_states(struct device_node *dn,
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	*n = count;
 | 
						*n = i;
 | 
				
			||||||
	*states = st;
 | 
						if (!i)
 | 
				
			||||||
 | 
							kfree(st);
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							*states = st;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue