Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

via-rhine: balance interrupt acknowledge and events retrieval.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>

+14 -8
+14 -8
drivers/net/ethernet/via/via-rhine.c
··· 508 508 1024 - i, __func__, __LINE__); \ 509 509 } while (0) 510 510 511 - static inline u32 get_intr_status(struct net_device *dev) 511 + static u32 rhine_get_events(struct rhine_private *rp) 512 512 { 513 - struct rhine_private *rp = netdev_priv(dev); 514 513 void __iomem *ioaddr = rp->base; 515 514 u32 intr_status; 516 515 ··· 518 519 if (rp->quirks & rqStatusWBRace) 519 520 intr_status |= ioread8(ioaddr + IntrStatus2) << 16; 520 521 return intr_status; 522 + } 523 + 524 + static void rhine_ack_events(struct rhine_private *rp, u32 mask) 525 + { 526 + void __iomem *ioaddr = rp->base; 527 + 528 + if (rp->quirks & rqStatusWBRace) 529 + iowrite8(mask >> 16, ioaddr + IntrStatus2); 530 + iowrite16(mask, ioaddr + IntrStatus); 531 + IOSYNC; 521 532 } 522 533 523 534 /* ··· 1589 1580 int boguscnt = max_interrupt_work; 1590 1581 int handled = 0; 1591 1582 1592 - while ((intr_status = get_intr_status(dev))) { 1583 + while ((intr_status = rhine_get_events(rp))) { 1593 1584 handled = 1; 1594 1585 1595 1586 /* Acknowledge all of the current interrupt sources ASAP. */ 1596 - if (intr_status & IntrTxDescRace) 1597 - iowrite8(0x08, ioaddr + IntrStatus2); 1598 - iowrite16(intr_status & 0xffff, ioaddr + IntrStatus); 1599 - IOSYNC; 1587 + rhine_ack_events(rp, intr_status); 1600 1588 1601 1589 if (debug > 4) 1602 1590 netdev_dbg(dev, "Interrupt, status %08x\n", ··· 1878 1872 * If new errors occurred, we need to sort them out before doing Tx. 1879 1873 * In that case the ISR will be back here RSN anyway. 1880 1874 */ 1881 - intr_status = get_intr_status(dev); 1875 + intr_status = rhine_get_events(rp); 1882 1876 1883 1877 if ((intr_status & IntrTxErrSummary) == 0) { 1884 1878