Skip to content

Commit

Permalink
ibm emac: Fix locking for enable/disable eob irq
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alistair Popple authored and David S. Miller committed Oct 30, 2013
1 parent b4dfd32 commit 32663b8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/ethernet/ibm/emac/mal.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ static inline void mal_schedule_poll(struct mal_instance *mal)
{
if (likely(napi_schedule_prep(&mal->napi))) {
MAL_DBG2(mal, "schedule_poll" NL);
spin_lock(&mal->lock);
mal_disable_eob_irq(mal);
spin_unlock(&mal->lock);
__napi_schedule(&mal->napi);
} else
MAL_DBG2(mal, "already in poll" NL);
Expand Down Expand Up @@ -445,7 +447,9 @@ static int mal_poll(struct napi_struct *napi, int budget)
if (!napi_reschedule(napi))
goto more_work;

spin_lock_irqsave(&mal->lock, flags);
mal_disable_eob_irq(mal);
spin_unlock_irqrestore(&mal->lock, flags);
goto again;
}
mc->ops->poll_tx(mc->dev);
Expand Down

0 comments on commit 32663b8

Please sign in to comment.