Please discard the previous patch. I'm going to take these one at a time. Here's a patch for the fec code, it also makes some global variables that aren't used anywhere or declared in a header static. Signed-off-by: Brandon Niemczyk diff -pruNX anti-cli/Documentation/dontdiff linux-pristine/drivers/net/fec.c anti-cli/drivers/net/fec.c --- linux-pristine/drivers/net/fec.c 2005-06-17 15:48:29.000000000 -0400 +++ anti-cli/drivers/net/fec.c 2005-07-11 21:29:38.000000000 -0400 @@ -237,10 +237,11 @@ typedef struct mii_list { } mii_list_t; #define NMII 20 -mii_list_t mii_cmds[NMII]; -mii_list_t *mii_free; -mii_list_t *mii_head; -mii_list_t *mii_tail; +static mii_list_t mii_cmds[NMII]; +static mii_list_t *mii_free; +static mii_list_t *mii_head; +static mii_list_t *mii_tail; +static DECLARE_SPINLOCK(mii_lock); static int mii_queue(struct net_device *dev, int request, void (*func)(uint, struct net_device *)); @@ -679,10 +680,13 @@ fec_enet_mii(struct net_device *dev) volatile fec_t *ep; mii_list_t *mip; uint mii_reg; + unsigned long flags; fep = netdev_priv(dev); ep = fep->hwp; mii_reg = ep->fec_mii_data; + + spin_lock_irqsave(&mii_lock, flags); if ((mip = mii_head) == NULL) { printk("MII and no head!\n"); @@ -698,6 +702,8 @@ fec_enet_mii(struct net_device *dev) if ((mip = mii_head) != NULL) ep->fec_mii_data = mip->mii_regval; + + spin_unlock_irqrestore(&mii_lock, flags); } static int @@ -715,8 +721,7 @@ mii_queue(struct net_device *dev, int re retval = 0; - save_flags(flags); - cli(); + spin_lock_irqsave(&mii_lock, flags); if ((mip = mii_free) != NULL) { mii_free = mip->mii_next; @@ -736,7 +741,7 @@ mii_queue(struct net_device *dev, int re retval = 1; } - restore_flags(flags); + spin_unlock_irqrestore(&mii_lock, flags); return(retval); }