Hi Vijay,
On 27/07/2015 04:11, vijay.kil...@gmail.com wrote:
From: Vijaya Kumar K <vijaya.ku...@caviumnetworks.com>
Initialize physical ITS driver from GIC v3 driver
if LPIs are supported by hardware
Signed-off-by: Vijaya Kumar K <vijaya.ku...@caviumnetworks.com>
---
v5: Made check of its dt node availability before
setting lpi_supported flag
---
xen/arch/arm/gic-v3.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 8c7c5cf..23eb47c 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -714,6 +714,10 @@ static int __cpuinit gicv3_cpu_init(void)
if ( gicv3_enable_redist() )
return -ENODEV;
+ /* Give LPIs a spin */
+ if ( gicv3_info.lpi_supported )
+ its_cpu_init();
+
/* Set priority on PPI and SGI interrupts */
priority = (GIC_PRI_IPI << 24 | GIC_PRI_IPI << 16 | GIC_PRI_IPI << 8 |
GIC_PRI_IPI);
@@ -1323,11 +1327,18 @@ static int __init gicv3_init(void)
if ( gicv3_dist_supports_lpis() )
{
- gicv3_info.lpi_supported = 1;
- gicv3_info.nr_event_ids = its_get_nr_event_ids();
+ /*
+ * LPI support is enabled only if HW supports it and
+ * ITS dt node is available
+ */
+ if ( !its_init(&gicv3.rdist_data) )
+ {
+ gicv3_info.lpi_supported = 1;
+ gicv3_info.nr_event_ids = its_get_nr_event_ids();
+ }
+ else
+ gicv3_info.lpi_supported = 0;
I think this is wrong to use LPI supported to know whether ITS is
present or not.
AFAICT, most the usage of lpi_supported is only for vgic where you
should have a proper field in the vgic structure rather than using this
field.
For the rest, we may want to support LPIs without ITS at some point. So
we should keep 2 distincts field for this purpose. Although, I believe
that we can drop most of them.
}
- else
- gicv3_info.lpi_supported = 0;
Why did you drop the else? It was valid...
gicv3_dist_init();
res = gicv3_cpu_init();
Regards,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel