Correction of the abnormal looping in SJA1000P ISR reported by Tomas Kupilik.
authorppisa <ppisa>
Thu, 19 Jan 2006 18:42:20 +0000 (18:42 +0000)
committerppisa <ppisa>
Thu, 19 Jan 2006 18:42:20 +0000 (18:42 +0000)
lincan/src/sja1000p.c

index 7b5a96a..36319a1 100644 (file)
@@ -816,11 +816,15 @@ int sja1000p_irq_handler(int irq, struct canchip_t *chip)
                }
 
                irq_register=can_read_reg(chip,SJAIR);
-       
+
                status=can_read_reg(chip,SJASR);
 
-       } while((irq_register & (sjaIR_BEI|sjaIR_EPI|sjaIR_DOI|sjaIR_EI|sjaIR_TI|sjaIR_RI)) ||
-               ((status & sjaSR_TBS) && can_msgobj_test_fl(obj,TX_PENDING)) ||
+               if(((status & sjaSR_TBS) && can_msgobj_test_fl(obj,TX_PENDING)) ||
+                  (irq_register & sjaIR_TI))
+                        can_msgobj_set_fl(obj,TX_REQUEST);
+
+       } while((irq_register & (sjaIR_BEI|sjaIR_EPI|sjaIR_DOI|sjaIR_EI|sjaIR_RI)) ||
+               (can_msgobj_test_fl(obj,TX_PENDING) && !can_msgobj_test_fl(obj,TX_LOCK)) ||
                (status & sjaSR_RBS));
 
        return CANCHIP_IRQ_HANDLED;