Skip to content

Commit fb2826b

Browse files
Shinya Kuribayashiralfbaechle
authored andcommitted
MIPS: Mark Eins: Fix cascading interrupt dispatcher
* Fix mis-calculated IRQ bitshift on cascading interrupts * Prevent cascading interrupt from being processed afterward Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 47c969e commit fb2826b

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • arch/mips/emma/markeins

‎arch/mips/emma/markeins/irq.c‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,7 @@ void emma2rh_irq_dispatch(void)
213213
emma2rh_in32(EMMA2RH_BHIF_INT_EN_0);
214214

215215
#ifdef EMMA2RH_SW_CASCADE
216-
if (intStatus &
217-
(1 << ((EMMA2RH_SW_CASCADE - EMMA2RH_IRQ_INT0) & (32 - 1)))) {
216+
if (intStatus & (1UL << EMMA2RH_SW_CASCADE)) {
218217
u32 swIntStatus;
219218
swIntStatus = emma2rh_in32(EMMA2RH_BHIF_SW_INT)
220219
& emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN);
@@ -225,6 +224,8 @@ void emma2rh_irq_dispatch(void)
225224
}
226225
}
227226
}
227+
/* Skip S/W interrupt */
228+
intStatus &= ~(1UL << EMMA2RH_SW_CASCADE);
228229
#endif
229230

230231
for (i = 0, bitmask = 1; i < 32; i++, bitmask <<= 1) {
@@ -238,8 +239,7 @@ void emma2rh_irq_dispatch(void)
238239
emma2rh_in32(EMMA2RH_BHIF_INT_EN_1);
239240

240241
#ifdef EMMA2RH_GPIO_CASCADE
241-
if (intStatus &
242-
(1 << ((EMMA2RH_GPIO_CASCADE - EMMA2RH_IRQ_INT0) & (32 - 1)))) {
242+
if (intStatus & (1UL << (EMMA2RH_GPIO_CASCADE % 32))) {
243243
u32 gpioIntStatus;
244244
gpioIntStatus = emma2rh_in32(EMMA2RH_GPIO_INT_ST)
245245
& emma2rh_in32(EMMA2RH_GPIO_INT_MASK);
@@ -250,6 +250,8 @@ void emma2rh_irq_dispatch(void)
250250
}
251251
}
252252
}
253+
/* Skip GPIO interrupt */
254+
intStatus &= ~(1UL << (EMMA2RH_GPIO_CASCADE % 32));
253255
#endif
254256

255257
for (i = 32, bitmask = 1; i < 64; i++, bitmask <<= 1) {

0 commit comments

Comments
 (0)