Re: [RFC][PATCH] netconsole: avoid deadlock on printk from drivercode

From: David Miller
Date: Wed Aug 20 2008 - 16:58:46 EST


From: Pekka J Enberg <penberg@xxxxxxxxxxxxxx>
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().
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/