summaryrefslogtreecommitdiffstats
path: root/drivers/bus
diff options
context:
space:
mode:
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2016-09-23 09:09:07 -0400
committerSudeep Holla <sudeep.holla@arm.com>2016-10-17 09:27:54 -0400
commit801f33be8e902d8cea75cb7ac056d07c4fdd25f8 (patch)
tree94b019dec67854b8baa1b7aad43bfae338fb48b1 /drivers/bus
parent525d4015e633027c93645208a9bb9a6ce8d3f5a6 (diff)
drivers: cci: add missing CCI port availability firmware check
The CCI ports programming interface is available to the kernel only when booted in secure mode (or when firmware enables non-secure access to override CCI ports control). In both cases, firmware reports the CCI ports availability through the device tree CCI ports nodes, which must be parsed and their status checked by the kernel probing path. This check is currently missing and may cause the kernel to erroneously believe it is free to take control of CCI ports where in practice CCI ports control is forbidden. Add the missing CCI port availability check to the CCI driver in order to guarantee sane CCI usage. Cc: Liviu Dudau <liviu.dudau@arm.com> Cc: Suzuki K Poulose <suzuki.poulose@arm.com> Cc: Marc Zyngier <marc.zyngier@arm.com> Acked-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/arm-cci.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
index 890082315054..231633328dfa 100644
--- a/drivers/bus/arm-cci.c
+++ b/drivers/bus/arm-cci.c
@@ -2190,6 +2190,9 @@ static int cci_probe_ports(struct device_node *np)
2190 if (!of_match_node(arm_cci_ctrl_if_matches, cp)) 2190 if (!of_match_node(arm_cci_ctrl_if_matches, cp))
2191 continue; 2191 continue;
2192 2192
2193 if (!of_device_is_available(cp))
2194 continue;
2195
2193 i = nb_ace + nb_ace_lite; 2196 i = nb_ace + nb_ace_lite;
2194 2197
2195 if (i >= nb_cci_ports) 2198 if (i >= nb_cci_ports)
@@ -2232,6 +2235,13 @@ static int cci_probe_ports(struct device_node *np)
2232 ports[i].dn = cp; 2235 ports[i].dn = cp;
2233 } 2236 }
2234 2237
2238 /*
2239 * If there is no CCI port that is under kernel control
2240 * return early and report probe status.
2241 */
2242 if (!nb_ace && !nb_ace_lite)
2243 return -ENODEV;
2244
2235 /* initialize a stashed array of ACE ports to speed-up look-up */ 2245 /* initialize a stashed array of ACE ports to speed-up look-up */
2236 cci_ace_init_ports(); 2246 cci_ace_init_ports();
2237 2247