Skip to content
Permalink
Browse files

Guard fiq_fsm_spin_lock with fiq_enable check

  • Loading branch information
Clouded committed Mar 30, 2015
1 parent 7defc7b commit 690158b7490ffc8fc49941792d299071a99b283a
Showing with 12 additions and 4 deletions.
  1. +12 −4 drivers/usb/host/dwc_otg/dwc_otg_hcd.c
@@ -1414,17 +1414,25 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh)
dwc_otg_hc_init(hcd->core_if, hc);

local_irq_save(flags);
local_fiq_disable();
fiq_fsm_spin_lock(&hcd->fiq_state->lock);

if (fiq_enable) {
local_fiq_disable();
fiq_fsm_spin_lock(&hcd->fiq_state->lock);
}

/* Enable the top level host channel interrupt. */
intr_enable = (1 << hc->hc_num);
DWC_MODIFY_REG32(&hcd->core_if->host_if->host_global_regs->haintmsk, 0, intr_enable);

/* Make sure host channel interrupts are enabled. */
gintmsk.b.hcintr = 1;
DWC_MODIFY_REG32(&hcd->core_if->core_global_regs->gintmsk, 0, gintmsk.d32);
fiq_fsm_spin_unlock(&hcd->fiq_state->lock);
local_fiq_enable();

if (fiq_enable) {
fiq_fsm_spin_unlock(&hcd->fiq_state->lock);
local_fiq_enable();
}

local_irq_restore(flags);
hc->qh = qh;
}

0 comments on commit 690158b

Please sign in to comment.
You can’t perform that action at this time.