Skip to content

Commit

Permalink
Fix USB/FIQ lock-ups
Browse files Browse the repository at this point in the history
What I did - no rocket science [1]:

* Applied RT-patches 4.19.72-rt26 on top of rpi-4.19.y / 4.19.79 (most recent
  version applying rt-patch properly)
* Applied a slightly rebased version of the original (4.14) fiq-patch [2]
* grepped for 'fiq_fsm_spin_lock(' and 'fiq_fsm_spin_unlock(' and added missing
  rt-specific replacements
* rebased changes back to rpi-4.19.y-rt

What this patch does:

* add one missing pair of fiq_fsm_spin_lock/fiq_fsm_spin_unlock replacements

With builds of [1] Rapsi3 is running without a singe issue for two weeks now
and it was stressed by

* moving gigabytes from USB-Stick to SDCard
* several usb-midi-keyboard jam sessions

Addresses [3]

[1] https://github.com/schnitzeltony/meta-raspi-light/tree/master/recipes-kernel/linux
[2] raspberrypi/linux@05dd5c4
[3] raspberrypi/linux#2943

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
  • Loading branch information
schnitzeltony authored and l1k committed Apr 9, 2020
1 parent ffeae4e commit 69e6a22
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,7 @@ static inline uint32_t dwc_otg_read_common_intr(dwc_otg_core_if_t * core_if, gin
#ifdef CONFIG_USB_DWC_OTG_LPM
gintmsk_common.b.lpmtranrcvd = 1;
#endif
unsigned long flags;
gintmsk_common.b.restoredone = 1;
if(dwc_otg_is_device_mode(core_if))
{
Expand All @@ -1345,17 +1346,15 @@ static inline uint32_t dwc_otg_read_common_intr(dwc_otg_core_if_t * core_if, gin
gintmsk_common.b.portintr = 1;
}
if(fiq_enable) {
local_fiq_disable();
fiq_fsm_spin_lock(&hcd->fiq_state->lock);
fiq_fsm_spin_lock_irqsave(&hcd->fiq_state->lock, flags);
gintsts.d32 = DWC_READ_REG32(&core_if->core_global_regs->gintsts);
gintmsk.d32 = DWC_READ_REG32(&core_if->core_global_regs->gintmsk);
/* Pull in the interrupts that the FIQ has masked */
gintmsk.d32 |= ~(hcd->fiq_state->gintmsk_saved.d32);
gintmsk.d32 |= gintmsk_common.d32;
/* for the upstairs function to reenable - have to read it here in case FIQ triggers again */
reenable_gintmsk->d32 = gintmsk.d32;
fiq_fsm_spin_unlock(&hcd->fiq_state->lock);
local_fiq_enable();
fiq_fsm_spin_unlock_irqrestore(&hcd->fiq_state->lock, flags);
} else {
gintsts.d32 = DWC_READ_REG32(&core_if->core_global_regs->gintsts);
gintmsk.d32 = DWC_READ_REG32(&core_if->core_global_regs->gintmsk);
Expand Down

0 comments on commit 69e6a22

Please sign in to comment.