Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184504
b: refs/heads/master
c: dee7399
h: refs/heads/master
v: v3
  • Loading branch information
Atsushi Nemoto authored and David S. Miller committed Feb 26, 2010
1 parent bfe5148 commit 907ba0f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9c5f9c2861909753140ad6a41cdc77cdf20c1dc9
refs/heads/master: dee7399c2d9a1d3b0af5d68d7e0dd922e104a2a8
13 changes: 11 additions & 2 deletions trunk/drivers/net/tc35815.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ struct tc35815_local {
* by this lock as well.
*/
spinlock_t lock;
spinlock_t rx_lock;

struct mii_bus *mii_bus;
struct phy_device *phy_dev;
Expand Down Expand Up @@ -835,6 +836,7 @@ static int __devinit tc35815_init_one(struct pci_dev *pdev,

INIT_WORK(&lp->restart_work, tc35815_restart_work);
spin_lock_init(&lp->lock);
spin_lock_init(&lp->rx_lock);
lp->pci_dev = pdev;
lp->chiptype = ent->driver_data;

Expand Down Expand Up @@ -1186,13 +1188,15 @@ static void tc35815_restart(struct net_device *dev)
printk(KERN_ERR "%s: BMCR reset failed.\n", dev->name);
}

spin_lock_bh(&lp->rx_lock);
spin_lock_irq(&lp->lock);
tc35815_chip_reset(dev);
tc35815_clear_queues(dev);
tc35815_chip_init(dev);
/* Reconfigure CAM again since tc35815_chip_init() initialize it. */
tc35815_set_multicast_list(dev);
spin_unlock_irq(&lp->lock);
spin_unlock_bh(&lp->rx_lock);

netif_wake_queue(dev);
}
Expand All @@ -1211,11 +1215,14 @@ static void tc35815_schedule_restart(struct net_device *dev)
struct tc35815_local *lp = netdev_priv(dev);
struct tc35815_regs __iomem *tr =
(struct tc35815_regs __iomem *)dev->base_addr;
unsigned long flags;

/* disable interrupts */
spin_lock_irqsave(&lp->lock, flags);
tc_writel(0, &tr->Int_En);
tc_writel(tc_readl(&tr->DMA_Ctl) | DMA_IntMask, &tr->DMA_Ctl);
schedule_work(&lp->restart_work);
spin_unlock_irqrestore(&lp->lock, flags);
}

static void tc35815_tx_timeout(struct net_device *dev)
Expand Down Expand Up @@ -1436,7 +1443,9 @@ static int tc35815_do_interrupt(struct net_device *dev, u32 status, int limit)
if (status & Int_IntMacTx) {
/* Transmit complete. */
lp->lstats.tx_ints++;
spin_lock_irq(&lp->lock);
tc35815_txdone(dev);
spin_unlock_irq(&lp->lock);
if (ret < 0)
ret = 0;
}
Expand Down Expand Up @@ -1649,7 +1658,7 @@ static int tc35815_poll(struct napi_struct *napi, int budget)
int received = 0, handled;
u32 status;

spin_lock(&lp->lock);
spin_lock(&lp->rx_lock);
status = tc_readl(&tr->Int_Src);
do {
/* BLEx, FDAEx will be cleared later */
Expand All @@ -1667,7 +1676,7 @@ static int tc35815_poll(struct napi_struct *napi, int budget)
}
status = tc_readl(&tr->Int_Src);
} while (status);
spin_unlock(&lp->lock);
spin_unlock(&lp->rx_lock);

if (received < budget) {
napi_complete(napi);
Expand Down

0 comments on commit 907ba0f

Please sign in to comment.