From: Anup Patel Date: Tue, 18 Feb 2020 06:07:16 +0000 (+0530) Subject: lib: Don't check MIDELEG and MEDELEG at end of delegate_traps() X-Git-Tag: v1.3~879 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bc874e34cecbd1e024ae7be4ec2f34d9cb1fbecb;p=platform%2Fkernel%2Fopensbi-spacemit.git lib: Don't check MIDELEG and MEDELEG at end of delegate_traps() The MIDELEG and MEDELEG CSR checks at end of delegate_traps() were added for initial bring-up on SiFive Unleashed and QEMU. These checks are not required any more and in-future these checks can cause failures because some of the MIDELEG/MEDELEG bits will be hard-wired to 0 or 1. For related discussion, refer github issue: https://github.com/riscv/opensbi/issues/157 Signed-off-by: Anup Patel Reviewed-by: Bin Meng Reviewed-by: Atish Patra --- diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index dd2f99e..d83008f 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -104,11 +104,6 @@ static int delegate_traps(struct sbi_scratch *scratch, u32 hartid) csr_write(CSR_MIDELEG, interrupts); csr_write(CSR_MEDELEG, exceptions); - if ((csr_read(CSR_MIDELEG) & interrupts) != interrupts) - return SBI_EFAIL; - if ((csr_read(CSR_MEDELEG) & exceptions) != exceptions) - return SBI_EFAIL; - return 0; }