From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v5 17/22] xen/arm: ITS: Initialize physical ITS Date: Mon, 17 Aug 2015 12:00:45 -0700 Message-ID: <55D22F5D.5000901@citrix.com> References: <1437995524-19772-1-git-send-email-vijay.kilari@gmail.com> <1437995524-19772-18-git-send-email-vijay.kilari@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1437995524-19772-18-git-send-email-vijay.kilari@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: vijay.kilari@gmail.com, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, stefano.stabellini@citrix.com, tim@xen.org, xen-devel@lists.xen.org Cc: Prasun.Kapoor@caviumnetworks.com, manish.jaggi@caviumnetworks.com, Vijaya Kumar K List-Id: xen-devel@lists.xenproject.org Hi Vijay, On 27/07/2015 04:11, vijay.kilari@gmail.com wrote: > From: Vijaya Kumar K > > Initialize physical ITS driver from GIC v3 driver > if LPIs are supported by hardware > > Signed-off-by: Vijaya Kumar K > --- > 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