[FOSS_TLK]platform: tegra: fix incorrect usage of CPU_IER regs
Matt Craighead [Wed, 14 Jan 2015 20:58:40 +0000 (14:58 -0600)]
Change-Id: I8a6705d61c10f5f28b787c949d6d04245fc4c4a6
Reviewed-on: http://git-master/r/715772
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Tested-by: Varun Wadekar <vwadekar@nvidia.com>

platform/tegra/common/interrupts.c

index 641859d..660571c 100644 (file)
@@ -80,11 +80,7 @@ static uint32_t ictlr_reg_base[] = {
 status_t mask_interrupt(unsigned int vector)
 {
        uint32_t base = ictlr_reg_base[vectorToController(vector)];
-       uint32_t ictlr_ier_clr = *REG32(base + ICTLR_CPU_IER_CLR);
-
-       ictlr_ier_clr |= vector;
-       *REG32(base + ICTLR_CPU_IER_CLR) = ictlr_ier_clr;
-
+       *REG32(base + ICTLR_CPU_IER_CLR) = 1 << (vector & 31);
        return NO_ERROR;
 }
 
@@ -99,14 +95,9 @@ void platform_mask_irqs(void)
 status_t unmask_interrupt(unsigned int vector)
 {
        uint32_t base = ictlr_reg_base[vectorToController(vector)];
-       uint32_t ictlr_ier_set = *REG32(base + ICTLR_CPU_IER_SET);
-
        if (vector >= NR_IRQS)
                return ERR_INVALID_ARGS;
-
-       ictlr_ier_set |= vector;
-       *REG32(base + ICTLR_CPU_IER_SET) = ictlr_ier_set;
-
+       *REG32(base + ICTLR_CPU_IER_SET) = 1 << (vector & 31);
        return NO_ERROR;
 }