All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-4.12] xen/arm: gic-v2: deactivate interrupts during initialization
@ 2019-02-05 21:38 Stefano Stabellini
  2019-02-07  9:29 ` Julien Grall
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stefano Stabellini @ 2019-02-05 21:38 UTC (permalink / raw)
  To: xen-devel; +Cc: jgross, Stefano Stabellini, julien.grall, sstabellini, peng.fan

Interrupts could be ACTIVE at boot. Make sure to deactivate them during
initialization.

Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
CC: julien.grall@arm.com
CC: peng.fan@nxp.com
CC: jgross@suse.com
---
 xen/arch/arm/gic-v2.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index e9fb8a0..256988c 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -379,7 +379,10 @@ static void __init gicv2_dist_init(void)
 
     /* Disable all global interrupts */
     for ( i = 32; i < nr_lines; i += 32 )
+    {
         writel_gicd(~0x0, GICD_ICENABLER + (i / 32) * 4);
+        writel_gicd(~0x0, GICD_ICACTIVER + (i / 32) * 4);
+    }
 
     /* Turn on the distributor */
     writel_gicd(GICD_CTL_ENABLE, GICD_CTLR);
@@ -394,6 +397,7 @@ static void gicv2_cpu_init(void)
     /* The first 32 interrupts (PPI and SGI) are banked per-cpu, so
      * even though they are controlled with GICD registers, they must
      * be set up here with the other per-cpu state. */
+    writel_gicd(0xffffffff, GICD_ICACTIVER); /* Diactivate PPIs and SGIs */
     writel_gicd(0xffff0000, GICD_ICENABLER); /* Disable all PPI */
     writel_gicd(0x0000ffff, GICD_ISENABLER); /* Enable all SGI */
 
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH for-4.12] xen/arm: gic-v2: deactivate interrupts during initialization
  2019-02-05 21:38 [PATCH for-4.12] xen/arm: gic-v2: deactivate interrupts during initialization Stefano Stabellini
@ 2019-02-07  9:29 ` Julien Grall
  2019-02-07  9:36 ` Juergen Gross
  2019-02-08 10:59 ` Peng Fan
  2 siblings, 0 replies; 4+ messages in thread
From: Julien Grall @ 2019-02-07  9:29 UTC (permalink / raw)
  To: Stefano Stabellini, xen-devel; +Cc: jgross, Stefano Stabellini, peng.fan



On 2/5/19 9:38 PM, Stefano Stabellini wrote:
> Interrupts could be ACTIVE at boot. Make sure to deactivate them during
> initialization.
> 
> Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
> CC: julien.grall@arm.com
> CC: peng.fan@nxp.com
> CC: jgross@suse.com

Reviewed-by: Julien Grall <julien.grall@arm.com>

> ---
>   xen/arch/arm/gic-v2.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
> index e9fb8a0..256988c 100644
> --- a/xen/arch/arm/gic-v2.c
> +++ b/xen/arch/arm/gic-v2.c
> @@ -379,7 +379,10 @@ static void __init gicv2_dist_init(void)
>   
>       /* Disable all global interrupts */
>       for ( i = 32; i < nr_lines; i += 32 )
> +    {
>           writel_gicd(~0x0, GICD_ICENABLER + (i / 32) * 4);
> +        writel_gicd(~0x0, GICD_ICACTIVER + (i / 32) * 4);
> +    }
>   
>       /* Turn on the distributor */
>       writel_gicd(GICD_CTL_ENABLE, GICD_CTLR);
> @@ -394,6 +397,7 @@ static void gicv2_cpu_init(void)
>       /* The first 32 interrupts (PPI and SGI) are banked per-cpu, so
>        * even though they are controlled with GICD registers, they must
>        * be set up here with the other per-cpu state. */
> +    writel_gicd(0xffffffff, GICD_ICACTIVER); /* Diactivate PPIs and SGIs */
>       writel_gicd(0xffff0000, GICD_ICENABLER); /* Disable all PPI */
>       writel_gicd(0x0000ffff, GICD_ISENABLER); /* Enable all SGI */
>   
> 

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH for-4.12] xen/arm: gic-v2: deactivate interrupts during initialization
  2019-02-05 21:38 [PATCH for-4.12] xen/arm: gic-v2: deactivate interrupts during initialization Stefano Stabellini
  2019-02-07  9:29 ` Julien Grall
@ 2019-02-07  9:36 ` Juergen Gross
  2019-02-08 10:59 ` Peng Fan
  2 siblings, 0 replies; 4+ messages in thread
From: Juergen Gross @ 2019-02-07  9:36 UTC (permalink / raw)
  To: Stefano Stabellini, xen-devel; +Cc: Stefano Stabellini, julien.grall, peng.fan

On 05/02/2019 22:38, Stefano Stabellini wrote:
> Interrupts could be ACTIVE at boot. Make sure to deactivate them during
> initialization.
> 
> Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>

Release-acked-by: Juergen Gross <jgross@suse.com>


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH for-4.12] xen/arm: gic-v2: deactivate interrupts during initialization
  2019-02-05 21:38 [PATCH for-4.12] xen/arm: gic-v2: deactivate interrupts during initialization Stefano Stabellini
  2019-02-07  9:29 ` Julien Grall
  2019-02-07  9:36 ` Juergen Gross
@ 2019-02-08 10:59 ` Peng Fan
  2 siblings, 0 replies; 4+ messages in thread
From: Peng Fan @ 2019-02-08 10:59 UTC (permalink / raw)
  To: Stefano Stabellini, xen-devel; +Cc: jgross, Stefano Stabellini, julien.grall



> -----Original Message-----
> From: Stefano Stabellini [mailto:sstabellini@kernel.org]
> Sent: 2019年2月6日 5:39
> To: xen-devel@lists.xenproject.org
> Cc: sstabellini@kernel.org; Stefano Stabellini <stefanos@xilinx.com>;
> julien.grall@arm.com; Peng Fan <peng.fan@nxp.com>; jgross@suse.com
> Subject: [PATCH for-4.12] xen/arm: gic-v2: deactivate interrupts during
> initialization
> 
> Interrupts could be ACTIVE at boot. Make sure to deactivate them during
> initialization.
> 
> Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
> CC: julien.grall@arm.com
> CC: peng.fan@nxp.com
> CC: jgross@suse.com
> ---
>  xen/arch/arm/gic-v2.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c index
> e9fb8a0..256988c 100644
> --- a/xen/arch/arm/gic-v2.c
> +++ b/xen/arch/arm/gic-v2.c
> @@ -379,7 +379,10 @@ static void __init gicv2_dist_init(void)
> 
>      /* Disable all global interrupts */
>      for ( i = 32; i < nr_lines; i += 32 )
> +    {
>          writel_gicd(~0x0, GICD_ICENABLER + (i / 32) * 4);
> +        writel_gicd(~0x0, GICD_ICACTIVER + (i / 32) * 4);
> +    }
> 
>      /* Turn on the distributor */
>      writel_gicd(GICD_CTL_ENABLE, GICD_CTLR); @@ -394,6 +397,7 @@
> static void gicv2_cpu_init(void)
>      /* The first 32 interrupts (PPI and SGI) are banked per-cpu, so
>       * even though they are controlled with GICD registers, they must
>       * be set up here with the other per-cpu state. */
> +    writel_gicd(0xffffffff, GICD_ICACTIVER); /* Diactivate PPIs and
> + SGIs */
>      writel_gicd(0xffff0000, GICD_ICENABLER); /* Disable all PPI */
>      writel_gicd(0x0000ffff, GICD_ISENABLER); /* Enable all SGI */
> 
> --

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> 1.9.1

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-08 10:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-05 21:38 [PATCH for-4.12] xen/arm: gic-v2: deactivate interrupts during initialization Stefano Stabellini
2019-02-07  9:29 ` Julien Grall
2019-02-07  9:36 ` Juergen Gross
2019-02-08 10:59 ` Peng Fan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.