Herbert Xu a98ce5c6fe Fix synchronize_irq races with IRQ handler
As it is some callers of synchronize_irq rely on memory barriers
to provide synchronisation against the IRQ handlers.  For example,
the tg3 driver does

	tp->irq_sync = 1;
	smp_mb();
	synchronize_irq();

and then in the IRQ handler:

	if (!tp->irq_sync)
		netif_rx_schedule(dev, &tp->napi);

Unfortunately memory barriers only work well when they come in
pairs.  Because we don't actually have memory barriers on the
IRQ path, the memory barrier before the synchronize_irq() doesn't
actually protect us.

In particular, synchronize_irq() may return followed by the
result of netif_rx_schedule being made visible.

This patch (mostly written by Linus) fixes this by using spin
locks instead of memory barries on the synchronize_irq() path.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-23 09:01:31 -07:00
..
2007-10-20 02:26:04 +02:00
2007-10-18 14:37:24 -07:00
2007-10-21 02:37:45 -04:00
2007-10-21 02:37:45 -04:00
2007-10-21 02:37:45 -04:00
2007-10-21 02:37:45 -04:00
2007-10-18 14:37:24 -07:00
2007-10-19 11:53:56 -07:00
2007-10-19 11:53:56 -07:00
2007-10-18 14:37:26 -07:00
2007-10-19 11:53:54 -07:00
2007-10-19 11:53:49 -07:00
2007-10-16 09:43:10 -07:00
2007-10-21 02:37:45 -04:00
2007-10-19 11:53:54 -07:00
2007-10-19 11:53:54 -07:00
2007-10-11 22:11:12 +02:00
2007-10-19 11:53:34 -07:00
2007-10-19 11:53:41 -07:00
2007-10-18 14:37:24 -07:00
2007-10-17 16:55:11 +02:00
2007-10-15 17:00:13 +02:00
2007-10-22 19:15:59 -07:00
2007-10-18 14:37:24 -07:00