diff options
-rw-r--r-- | drivers/staging/ipack/bridges/tpci200.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/staging/ipack/bridges/tpci200.c b/drivers/staging/ipack/bridges/tpci200.c index 24e2a119dd16..9ce577ab9437 100644 --- a/drivers/staging/ipack/bridges/tpci200.c +++ b/drivers/staging/ipack/bridges/tpci200.c | |||
@@ -132,10 +132,11 @@ static irqreturn_t tpci200_interrupt(int irq, void *dev_id) | |||
132 | 132 | ||
133 | if (status_reg & TPCI200_SLOT_INT_MASK) { | 133 | if (status_reg & TPCI200_SLOT_INT_MASK) { |
134 | /* callback to the IRQ handler for the corresponding slot */ | 134 | /* callback to the IRQ handler for the corresponding slot */ |
135 | rcu_read_lock(); | ||
135 | for (i = 0; i < TPCI200_NB_SLOT; i++) { | 136 | for (i = 0; i < TPCI200_NB_SLOT; i++) { |
136 | if (!(status_reg & ((TPCI200_A_INT0 | TPCI200_A_INT1) << (2*i)))) | 137 | if (!(status_reg & ((TPCI200_A_INT0 | TPCI200_A_INT1) << (2*i)))) |
137 | continue; | 138 | continue; |
138 | slot_irq = tpci200->slots[i].irq; | 139 | slot_irq = rcu_dereference(tpci200->slots[i].irq); |
139 | if (slot_irq) { | 140 | if (slot_irq) { |
140 | ret = tpci200_slot_irq(slot_irq); | 141 | ret = tpci200_slot_irq(slot_irq); |
141 | } else { | 142 | } else { |
@@ -147,6 +148,7 @@ static irqreturn_t tpci200_interrupt(int irq, void *dev_id) | |||
147 | TPCI200_INT0_EN | TPCI200_INT1_EN); | 148 | TPCI200_INT0_EN | TPCI200_INT1_EN); |
148 | } | 149 | } |
149 | } | 150 | } |
151 | rcu_read_unlock(); | ||
150 | } | 152 | } |
151 | 153 | ||
152 | return ret; | 154 | return ret; |
@@ -303,9 +305,9 @@ static int tpci200_free_irq(struct ipack_device *dev) | |||
303 | 305 | ||
304 | __tpci200_free_irq(tpci200, dev); | 306 | __tpci200_free_irq(tpci200, dev); |
305 | slot_irq = tpci200->slots[dev->slot].irq; | 307 | slot_irq = tpci200->slots[dev->slot].irq; |
306 | tpci200->slots[dev->slot].irq = NULL; | 308 | RCU_INIT_POINTER(tpci200->slots[dev->slot].irq, NULL); |
309 | synchronize_rcu(); | ||
307 | kfree(slot_irq); | 310 | kfree(slot_irq); |
308 | |||
309 | mutex_unlock(&tpci200->mutex); | 311 | mutex_unlock(&tpci200->mutex); |
310 | return 0; | 312 | return 0; |
311 | } | 313 | } |
@@ -490,7 +492,7 @@ static int tpci200_request_irq(struct ipack_device *dev, int vector, | |||
490 | slot_irq->arg = arg; | 492 | slot_irq->arg = arg; |
491 | slot_irq->holder = dev; | 493 | slot_irq->holder = dev; |
492 | 494 | ||
493 | tpci200->slots[dev->slot].irq = slot_irq; | 495 | rcu_assign_pointer(tpci200->slots[dev->slot].irq, slot_irq); |
494 | res = __tpci200_request_irq(tpci200, dev); | 496 | res = __tpci200_request_irq(tpci200, dev); |
495 | 497 | ||
496 | out_unlock: | 498 | out_unlock: |