diff mbox series

soc: ti: ti_sci_pm_domains: check for proper args count in xlate

Message ID 20201028141700.10510-1-t-kristo@ti.com
State New, archived
Headers show
Series soc: ti: ti_sci_pm_domains: check for proper args count in xlate | expand

Commit Message

Tero Kristo Oct. 28, 2020, 2:17 p.m. UTC
K2G devices still only use single parameter for power-domains property,
so check for this properly in the driver. Without this, every peripheral
fails to probe resulting in boot failure.

Fixes: efa5c01cd7ee ("soc: ti: ti_sci_pm_domains: switch to use multiple genpds instead of one")
Reported-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 drivers/soc/ti/ti_sci_pm_domains.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nishanth Menon Oct. 28, 2020, 9:43 p.m. UTC | #1
On 16:17-20201028, Tero Kristo wrote:
> K2G devices still only use single parameter for power-domains property,
> so check for this properly in the driver. Without this, every peripheral
> fails to probe resulting in boot failure.
> 
> Fixes: efa5c01cd7ee ("soc: ti: ti_sci_pm_domains: switch to use multiple genpds instead of one")
> Reported-by: Nishanth Menon <nm@ti.com>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
>  drivers/soc/ti/ti_sci_pm_domains.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/ti/ti_sci_pm_domains.c b/drivers/soc/ti/ti_sci_pm_domains.c
> index af2126d2b2ff..8afb3f45d263 100644
> --- a/drivers/soc/ti/ti_sci_pm_domains.c
> +++ b/drivers/soc/ti/ti_sci_pm_domains.c
> @@ -91,7 +91,7 @@ static struct generic_pm_domain *ti_sci_pd_xlate(
>  	struct genpd_onecell_data *genpd_data = data;
>  	unsigned int idx = genpdspec->args[0];
>  
> -	if (genpdspec->args_count < 2)
> +	if (genpdspec->args_count != 1 && genpdspec->args_count != 2)
>  		return ERR_PTR(-EINVAL);
>  
>  	if (idx >= genpd_data->num_domains) {


Thanks Tero.

Acked-by: Nishanth Menon <nm@ti.com>

Santosh: can we queue this one for 5.10? - I am trying to track and get
all platforms booting and functional in 5.10
santosh.shilimkar@oracle.com Oct. 28, 2020, 11:17 p.m. UTC | #2
On 10/28/20 2:43 PM, Nishanth Menon wrote:
> On 16:17-20201028, Tero Kristo wrote:
>> K2G devices still only use single parameter for power-domains property,
>> so check for this properly in the driver. Without this, every peripheral
>> fails to probe resulting in boot failure.
>>
>> Fixes: efa5c01cd7ee ("soc: ti: ti_sci_pm_domains: switch to use multiple genpds instead of one")
>> Reported-by: Nishanth Menon <nm@ti.com>
>> Signed-off-by: Tero Kristo <t-kristo@ti.com>
>> ---
>>   drivers/soc/ti/ti_sci_pm_domains.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/soc/ti/ti_sci_pm_domains.c b/drivers/soc/ti/ti_sci_pm_domains.c
>> index af2126d2b2ff..8afb3f45d263 100644
>> --- a/drivers/soc/ti/ti_sci_pm_domains.c
>> +++ b/drivers/soc/ti/ti_sci_pm_domains.c
>> @@ -91,7 +91,7 @@ static struct generic_pm_domain *ti_sci_pd_xlate(
>>   	struct genpd_onecell_data *genpd_data = data;
>>   	unsigned int idx = genpdspec->args[0];
>>   
>> -	if (genpdspec->args_count < 2)
>> +	if (genpdspec->args_count != 1 && genpdspec->args_count != 2)
>>   		return ERR_PTR(-EINVAL);
>>   
>>   	if (idx >= genpd_data->num_domains) {
> 
> 
> Thanks Tero.
> 
> Acked-by: Nishanth Menon <nm@ti.com>
> 
> Santosh: can we queue this one for 5.10? - I am trying to track and get
> all platforms booting and functional in 5.10
> 
Sure. Can you re-post with my ack to soc@kernel.org and copy me ?
Will try to get this one applied.

Regards,
Santosh
diff mbox series

Patch

diff --git a/drivers/soc/ti/ti_sci_pm_domains.c b/drivers/soc/ti/ti_sci_pm_domains.c
index af2126d2b2ff..8afb3f45d263 100644
--- a/drivers/soc/ti/ti_sci_pm_domains.c
+++ b/drivers/soc/ti/ti_sci_pm_domains.c
@@ -91,7 +91,7 @@  static struct generic_pm_domain *ti_sci_pd_xlate(
 	struct genpd_onecell_data *genpd_data = data;
 	unsigned int idx = genpdspec->args[0];
 
-	if (genpdspec->args_count < 2)
+	if (genpdspec->args_count != 1 && genpdspec->args_count != 2)
 		return ERR_PTR(-EINVAL);
 
 	if (idx >= genpd_data->num_domains) {