[platform][zynq][gem] hold the gem spinlock across the entire irq handler

Change-Id: Ifc88db88f60e1f6381a9d7195cfea6bffa02fa7a
This commit is contained in:
Travis Geiselbrecht
2015-06-01 19:08:11 -07:00
parent 2362022970
commit bb15480a66

View File

@@ -202,6 +202,8 @@ enum handler_return gem_int_handler(void *arg) {
intr_status = gem.regs->intr_status;
spin_lock(&lock);
while (intr_status) {
// clear any pending status
gem.regs->intr_status = intr_status;
@@ -243,10 +245,7 @@ enum handler_return gem_int_handler(void *arg) {
/* The controller has processed packets until it hit a buffer owned by the driver */
if (intr_status & INTR_TX_USED_READ) {
spin_lock_saved_state_t irqstate;
spin_lock_irqsave(&lock, irqstate);
queue_pkts_in_tx_tbl();
spin_unlock_irqrestore(&lock, irqstate);
gem.regs->tx_status |= TX_STATUS_USED_READ;
}
@@ -254,6 +253,8 @@ enum handler_return gem_int_handler(void *arg) {
intr_status = gem.regs->intr_status;
}
spin_unlock(&lock);
return (resched) ? INT_RESCHEDULE : INT_NO_RESCHEDULE;
}