mpfs/mpfs_usb.c: Fix interrupt handling in SMP mode

The interrupt handler accesses the device as well as the driver's private
data. Thus, must take the big kernel lock in SMP mode to protect them.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This commit is contained in:
Ville Juven 2025-04-25 13:41:26 +03:00 committed by Xiang Xiao
parent 72bba3b2ee
commit 67b17cb4d7

View file

@ -3430,6 +3430,10 @@ static int mpfs_usb_interrupt(int irq, void *context, void *arg)
uint16_t pending_tx_ep;
int i;
#ifdef CONFIG_SMP
irqstate_t flags = enter_critical_section();
#endif
/* Get the device interrupts */
isr = getreg8(MPFS_USB_IRQ);
@ -3455,6 +3459,9 @@ static int mpfs_usb_interrupt(int irq, void *context, void *arg)
priv->usbdev.dualspeed = 1;
#endif
#ifdef CONFIG_SMP
leave_critical_section(flags);
#endif
return OK;
}
@ -3539,6 +3546,9 @@ static int mpfs_usb_interrupt(int irq, void *context, void *arg)
mpfs_resume(priv);
}
#ifdef CONFIG_SMP
leave_critical_section(flags);
#endif
return OK;
}