Messages in this thread | | | Date | Wed, 20 Aug 2008 13:58:32 -0700 (PDT) | Subject | Re: [RFC][PATCH] netconsole: avoid deadlock on printk from driver code | From | David Miller <> |
| |
From: Pekka J Enberg <penberg@cs.helsinki.fi> Date: Wed, 20 Aug 2008 20:54:01 +0300 (EEST)
> @@ -1721,7 +1723,8 @@ static int rtl8139_start_xmit (struct sk > return 0; > } > > - spin_lock_irqsave(&tp->lock, flags); > + local_irq_save(flags); > + netif_tx_lock(dev); > RTL_W32_F (TxStatus0 + (entry * sizeof (u32)), > tp->tx_flag | max(len, (unsigned int)ETH_ZLEN));
The generic networking takes the TX lock for you, you don't need to take it explicitly here.
You also cannot depend upon IRQ disabled locking, the generic TX lock is only softirq safe, not hard IRQ safe.
This means you have to move TX descriptor reclaim into a soft IRQ context, such as NAPI ->poll().
| |