aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ibm
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2013-10-29 19:50:38 -0400
committerDavid S. Miller <davem@davemloft.net>2013-10-29 22:57:42 -0400
commit32663b8b8948cc05f812ab82c1c7db2db3ddf717 (patch)
tree7eeb59bbaf203cc541ff11b68473fd6c4c13de77 /drivers/net/ethernet/ibm
parentb4dfd326c29c241c2bb8463167217eb2438b7c3d (diff)
ibm emac: Fix locking for enable/disable eob irq
Calls to mal_enable_eob_irq perform a read-write-modify of a dcr to enable device irqs which is protected by a spin lock. However calls to mal_disable_eob_irq do not take the corresponding lock. This patch resolves the problem by ensuring that calls to mal_disable_eob_irq also take the lock. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ibm')
-rw-r--r--drivers/net/ethernet/ibm/emac/mal.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ibm/emac/mal.c b/drivers/net/ethernet/ibm/emac/mal.c
index 909f9b6698b5..e7847510eda2 100644
--- a/drivers/net/ethernet/ibm/emac/mal.c
+++ b/drivers/net/ethernet/ibm/emac/mal.c
@@ -263,7 +263,9 @@ static inline void mal_schedule_poll(struct mal_instance *mal)
263{ 263{
264 if (likely(napi_schedule_prep(&mal->napi))) { 264 if (likely(napi_schedule_prep(&mal->napi))) {
265 MAL_DBG2(mal, "schedule_poll" NL); 265 MAL_DBG2(mal, "schedule_poll" NL);
266 spin_lock(&mal->lock);
266 mal_disable_eob_irq(mal); 267 mal_disable_eob_irq(mal);
268 spin_unlock(&mal->lock);
267 __napi_schedule(&mal->napi); 269 __napi_schedule(&mal->napi);
268 } else 270 } else
269 MAL_DBG2(mal, "already in poll" NL); 271 MAL_DBG2(mal, "already in poll" NL);
@@ -445,7 +447,9 @@ static int mal_poll(struct napi_struct *napi, int budget)
445 if (!napi_reschedule(napi)) 447 if (!napi_reschedule(napi))
446 goto more_work; 448 goto more_work;
447 449
450 spin_lock_irqsave(&mal->lock, flags);
448 mal_disable_eob_irq(mal); 451 mal_disable_eob_irq(mal);
452 spin_unlock_irqrestore(&mal->lock, flags);
449 goto again; 453 goto again;
450 } 454 }
451 mc->ops->poll_tx(mc->dev); 455 mc->ops->poll_tx(mc->dev);