Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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.

Link: https://lore.kernel.org/r/20201029093337.21170-1-t-kristo@ti.com
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>
Acked-by: Nishanth Menon <nm@ti.com>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Tero Kristo and committed by
Arnd Bergmann
3d696f42 01eea236

+1 -1
+1 -1
drivers/soc/ti/ti_sci_pm_domains.c
··· 91 91 struct genpd_onecell_data *genpd_data = data; 92 92 unsigned int idx = genpdspec->args[0]; 93 93 94 - if (genpdspec->args_count < 2) 94 + if (genpdspec->args_count != 1 && genpdspec->args_count != 2) 95 95 return ERR_PTR(-EINVAL); 96 96 97 97 if (idx >= genpd_data->num_domains) {