diff -u --recursive linux-2.5.40org/drivers/net/lp486e.c linux-2.5.40/drivers/net/lp486e.c --- linux-2.5.40org/drivers/net/lp486e.c Thu Oct 3 12:08:00 2002 +++ linux-2.5.40/drivers/net/lp486e.c Wed Oct 9 10:53:26 2002 @@ -85,6 +85,8 @@ static int i596_debug = 0; +static spinlock_t irq_lock = SPIN_LOCK_UNLOCKED; + static const char * const medianame[] = { "10baseT", "AUI", "10baseT-FD", "AUI-FD", @@ -403,6 +405,7 @@ return 0; } +/* Have single call site */ static inline int init_rx_bufs(struct net_device *dev, int num) { volatile struct i596_private *lp; @@ -462,6 +465,7 @@ return (i); } +/* Have single call site */ static inline void remove_rx_bufs(struct net_device *dev) { struct i596_private *lp; @@ -812,8 +816,8 @@ cmd->command |= (CMD_EOL | CMD_INTR); cmd->pa_next = I596_NULL; - save_flags(flags); - cli(); + spin_lock_irqsave(&irq_lock, flags); + if (lp->cmd_head) { lp->cmd_tail->pa_next = va_to_pa(cmd); } else { @@ -826,9 +830,9 @@ } lp->cmd_tail = cmd; lp->cmd_backlog++; - lp->cmd_head = pa_to_va(lp->scb.pa_cmd); - restore_flags(flags); + + spin_unlock_irqrestore(&irq_lock, flags); if (lp->cmd_backlog > 16) { int tickssofar = jiffies - lp->last_cmd; @@ -1179,6 +1183,8 @@ } lp = (struct i596_private *) dev->priv; + + /* FIXME: spinlock here! */ /* * The 82596 examines the command, performs the required action,