linux/drivers/net/irda
Herbert Xu 932ff279a4 [NET]: Add netif_tx_lock
Various drivers use xmit_lock internally to synchronise with their
transmission routines.  They do so without setting xmit_lock_owner.
This is fine as long as netpoll is not in use.

With netpoll it is possible for deadlocks to occur if xmit_lock_owner
isn't set.  This is because if a printk occurs while xmit_lock is held
and xmit_lock_owner is not set can cause netpoll to attempt to take
xmit_lock recursively.

While it is possible to resolve this by getting netpoll to use
trylock, it is suboptimal because netpoll's sole objective is to
maximise the chance of getting the printk out on the wire.  So
delaying or dropping the message is to be avoided as much as possible.

So the only alternative is to always set xmit_lock_owner.  The
following patch does this by introducing the netif_tx_lock family of
functions that take care of setting/unsetting xmit_lock_owner.

I renamed xmit_lock to _xmit_lock to indicate that it should not be
used directly.  I didn't provide irq versions of the netif_tx_lock
functions since xmit_lock is meant to be a BH-disabling lock.

This is pretty much a straight text substitution except for a small
bug fix in winbond.  It currently uses
netif_stop_queue/spin_unlock_wait to stop transmission.  This is
unsafe as an IRQ can potentially wake up the queue.  So it is safer to
use netif_tx_disable.

The hamradio bits used spin_lock_irq but it is unnecessary as
xmit_lock must never be taken in an IRQ handler.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-06-17 21:30:14 -07:00
..
act200l-sir.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
act200l.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
actisys-sir.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
actisys.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ali-ircc.c [IRDA]: ali-ircc: using device model power management 2006-06-17 21:26:22 -07:00
ali-ircc.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
au1k_ir.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
au1000_ircc.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
donauboe.c [IRDA]: pci_register_driver conversion 2006-03-20 19:00:27 -08:00
donauboe.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ep7211_ir.c [IRDA]: sti/cli removal from EP7211 IrDA driver 2006-03-20 19:00:04 -08:00
esi-sir.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
esi.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
girbil-sir.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
girbil.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
irda-usb.c [IRDA] irda-usb: use NULL instead of 0 2006-05-06 18:34:10 -07:00
irda-usb.h [IRDA]: Support for Sigmatel STIR421x chip 2006-04-09 22:25:31 -07:00
irport.c [PATCH] Remove MODULE_PARM 2006-03-25 08:22:52 -08:00
irport.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
irtty-sir.c [IRDA] sem2mutex: drivers/net/irda 2006-03-20 22:32:53 -08:00
irtty-sir.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Kconfig [IRDA]: Initial support for MCS7780 based dongles 2006-06-17 21:26:18 -07:00
litelink-sir.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
litelink.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ma600-sir.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ma600.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile [IRDA]: Initial support for MCS7780 based dongles 2006-06-17 21:26:18 -07:00
mcp2120-sir.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mcp2120.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mcs7780.c [IRDA]: Initial support for MCS7780 based dongles 2006-06-17 21:26:18 -07:00
mcs7780.h [IRDA]: Initial support for MCS7780 based dongles 2006-06-17 21:26:18 -07:00
nsc-ircc.c [PATCH] Typo fixes 2006-03-28 09:16:08 -08:00
nsc-ircc.h [IRDA]: nsc-ircc: PM update 2006-03-20 18:59:05 -08:00
old_belkin-sir.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
old_belkin.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
pxaficp_ir.c Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel 2005-10-31 07:32:56 -08:00
sa1100_ir.c BUG_ON() Conversion in drivers/net/ 2006-04-02 13:52:48 +02:00
sir_dev.c [IRDA]: Switching to a workqueue for the SIR work 2006-05-09 15:27:04 -07:00
sir_dongle.c [IRDA] sem2mutex: drivers/net/irda 2006-03-20 22:32:53 -08:00
sir-dev.h [IRDA]: Switching to a workqueue for the SIR work 2006-05-09 15:27:04 -07:00
smsc-ircc2.c [IRDA]: smsc-ircc: Minimal hotplug support. 2006-05-09 15:26:11 -07:00
smsc-ircc2.h [PATCH] smsc-ircc2: whitespace fixes 2005-09-07 16:57:57 -07:00
smsc-sio.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
stir4200.c [IRDA]: stir4200, switching to the kthread API 2006-06-17 21:26:20 -07:00
tekram-sir.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
tekram.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
toim3232-sir.c [IRDA]: remove MODULE_PARM() 2006-03-20 22:33:41 -08:00
via-ircc.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
via-ircc.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
vlsi_ir.c [NET]: Add netif_tx_lock 2006-06-17 21:30:14 -07:00
vlsi_ir.h [PATCH] Eliminate __attribute__ ((packed)) warnings for gcc-4.1 2006-01-08 20:14:07 -08:00
w83977af_ir.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
w83977af_ir.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
w83977af.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00