Skip to content

Commit

Permalink
Merge pull request #913 from Clouded/rpi-3.18.y-nonfiqusbfix
Browse files Browse the repository at this point in the history
Guard fiq_fsm_spin_lock with fiq_enable check
  • Loading branch information
popcornmix committed Mar 30, 2015
2 parents 7defc7b + 690158b commit 2e52974
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions drivers/usb/host/dwc_otg/dwc_otg_hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2e52974

Please sign in to comment.