Automatic merge of /spare/repo/netdev-2.6 branch amd8111

authored by and committed by Jeff Garzik f6f3a488 a58eae64

+14 -10
+14 -10
drivers/net/amd8111e.c
··· 738 738 short vtag; 739 739 #endif 740 740 int rx_pkt_limit = dev->quota; 741 + unsigned long flags; 741 742 742 743 do{ 743 744 /* process receive packets until we use the quota*/ ··· 842 841 /* Receive descriptor is empty now */ 843 842 dev->quota -= num_rx_pkt; 844 843 *budget -= num_rx_pkt; 844 + 845 + spin_lock_irqsave(&lp->lock, flags); 845 846 netif_rx_complete(dev); 846 - /* enable receive interrupt */ 847 847 writel(VAL0|RINTEN0, mmio + INTEN0); 848 848 writel(VAL2 | RDMD0, mmio + CMD0); 849 + spin_unlock_irqrestore(&lp->lock, flags); 849 850 return 0; 851 + 850 852 rx_not_empty: 851 853 /* Do not call a netif_rx_complete */ 852 854 dev->quota -= num_rx_pkt; 853 855 *budget -= num_rx_pkt; 854 856 return 1; 855 - 856 - 857 857 } 858 858 859 859 #else ··· 1263 1261 struct net_device * dev = (struct net_device *) dev_id; 1264 1262 struct amd8111e_priv *lp = netdev_priv(dev); 1265 1263 void __iomem *mmio = lp->mmio; 1266 - unsigned int intr0; 1264 + unsigned int intr0, intren0; 1267 1265 unsigned int handled = 1; 1268 1266 1269 - if(dev == NULL) 1267 + if(unlikely(dev == NULL)) 1270 1268 return IRQ_NONE; 1271 1269 1272 - if (regs) spin_lock (&lp->lock); 1270 + spin_lock(&lp->lock); 1271 + 1273 1272 /* disabling interrupt */ 1274 1273 writel(INTREN, mmio + CMD0); 1275 1274 1276 1275 /* Read interrupt status */ 1277 1276 intr0 = readl(mmio + INT0); 1277 + intren0 = readl(mmio + INTEN0); 1278 1278 1279 1279 /* Process all the INT event until INTR bit is clear. */ 1280 1280 ··· 1297 1293 /* Schedule a polling routine */ 1298 1294 __netif_rx_schedule(dev); 1299 1295 } 1300 - else { 1296 + else if (intren0 & RINTEN0) { 1301 1297 printk("************Driver bug! \ 1302 1298 interrupt while in poll\n"); 1303 - /* Fix by disabling interrupts */ 1304 - writel(RINT0, mmio + INT0); 1299 + /* Fix by disable receive interrupts */ 1300 + writel(RINTEN0, mmio + INTEN0); 1305 1301 } 1306 1302 } 1307 1303 #else ··· 1325 1321 err_no_interrupt: 1326 1322 writel( VAL0 | INTREN,mmio + CMD0); 1327 1323 1328 - if (regs) spin_unlock(&lp->lock); 1324 + spin_unlock(&lp->lock); 1329 1325 1330 1326 return IRQ_RETVAL(handled); 1331 1327 }