Disable all interrupts during warm irqchip init.
authorAtish Patra <atish.patra@wdc.com>
Sat, 22 Dec 2018 05:31:12 +0000 (21:31 -0800)
committerAtish Patra <atish.patra@wdc.com>
Sat, 22 Dec 2018 06:11:21 +0000 (22:11 -0800)
M mode is not expected to recieve any interrupts.
S mode interrupts shouldn't be enabled in M mode.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
platform/common/irqchip/plic.c

index ece86a7..61a6bd0 100644 (file)
@@ -80,11 +80,16 @@ int plic_warm_irqchip_init(u32 target_hart,
 
        if (plic_hart_count <= target_hart)
                return -1;
+       
+       if (m_cntx_id > -1) {
+               for (i = 0; i < ie_words; i++)
+                       plic_set_ie(m_cntx_id, i, 0);
+       }
 
        /* By default, enable all IRQs for S-mode of target HART */
        if (s_cntx_id > -1) {
                for (i = 0; i < ie_words; i++)
-                       plic_set_ie(s_cntx_id, i, -1);
+                       plic_set_ie(s_cntx_id, i, 0);
        }
 
        /* By default, enable M-mode threshold */