]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
bus: omap_l3_noc: ignore masked out unclearable targets
authorAfzal Mohammed <afzal@ti.com>
Fri, 25 Apr 2014 22:38:11 +0000 (17:38 -0500)
committerNishanth Menon <nm@ti.com>
Mon, 5 May 2014 19:34:03 +0000 (14:34 -0500)
Errors that cannot be cleared (determined by reading REGERR register)
are currently handled by masking it. Documentation states that REGERR
"Checks which application/debug error sources are active" - it does not
indicate that this is "interrupt status" - masked out status represented
eventually in the irq line to MPU.
For example:

Lets say module 0 bit 8(0x100) was unclearable, we do the mask it from
generating further errors. However in the following cases:
a) bit 9 of Module 0
OR
b) any bit of Module 1+
occur, the interrupt handler wrongly assumes that the raw interrupt
status of module 0 bit 8 is the root cause of the interrupt, and
returns. This causes unhandled interrupt and resultant infinite
interrupts.

Fix this scenario by storing the events we masked out and masking raw
status with masked ones before identifying and handling the error.

Reported-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Afzal Mohammed <afzal@ti.com>
Tested-by: Vaibhav Hiremath <hvaibhav@gmail.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Tested-by: Sekhar Nori <nsekhar@ti.com>
drivers/bus/omap_l3_noc.c
drivers/bus/omap_l3_noc.h

index 0691e6d9c1e4c4ae244784c1df9dc9964790e658..00e4fed4a39b3c347eda2c21d9af64abb8bc2990 100644 (file)
@@ -169,6 +169,9 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3)
                err_reg = readl_relaxed(base + flag_mux->offset +
                                        L3_FLAGMUX_REGERR0 + (inttype << 3));
 
+               err_reg &= ~(inttype ? flag_mux->mask_app_bits :
+                               flag_mux->mask_dbg_bits);
+
                /* Get the corresponding error and analyse */
                if (err_reg) {
                        /* Identify the source from control status register */
@@ -193,6 +196,12 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3)
                                mask_val = readl_relaxed(mask_reg);
                                mask_val &= ~(1 << err_src);
                                writel_relaxed(mask_val, mask_reg);
+
+                               /* Mark these bits as to be ignored */
+                               if (inttype)
+                                       flag_mux->mask_app_bits |= 1 << err_src;
+                               else
+                                       flag_mux->mask_dbg_bits |= 1 << err_src;
                        }
 
                        /* Error found so break the for loop */
index ea2f51c984f1fb14ec04e77e8c14d4372ebf4898..4e18307470f65f1c6e2862950894cc128035f5d8 100644 (file)
@@ -66,11 +66,15 @@ struct l3_target_data {
  *             target data. unsupported ones are marked with
  *             L3_TARGET_NOT_SUPPORTED
  * @num_targ_data: number of entries in target data
+ * @mask_app_bits: ignore these from raw application irq status
+ * @mask_dbg_bits: ignore these from raw debug irq status
  */
 struct l3_flagmux_data {
        u32 offset;
        struct l3_target_data *l3_targ;
        u8 num_targ_data;
+       u32 mask_app_bits;
+       u32 mask_dbg_bits;
 };