From f79121dacb798816be6b8b3440216e6e043252d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 8 Dec 2007 14:52:14 +0000 Subject: [PATCH] * Only acknowledge the interrupt in the service thread, so that no new one will be triggered. * Also, loop as long as new interrupts are coming in. * This fixes the high CPU usage and low throughput of the 3com driver; it now works just fine; dunno why it worked for me that well last time. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23084 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/drivers/network/3com/pci/glue.c | 1 - src/add-ons/kernel/drivers/network/3com/pci/if_xl.c | 11 ++++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/add-ons/kernel/drivers/network/3com/pci/glue.c b/src/add-ons/kernel/drivers/network/3com/pci/glue.c index 4e55fe61c4..0bfd328ba5 100644 --- a/src/add-ons/kernel/drivers/network/3com/pci/glue.c +++ b/src/add-ons/kernel/drivers/network/3com/pci/glue.c @@ -41,7 +41,6 @@ __haiku_disable_interrupts(device_t dev) return 0; atomic_or((int32 *)&sc->xl_intr_status, status); - CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_INTR_ACK | (status & XL_INTRS)); return 1; } diff --git a/src/add-ons/kernel/drivers/network/3com/pci/if_xl.c b/src/add-ons/kernel/drivers/network/3com/pci/if_xl.c index 1ccfcc32ab..5727741135 100644 --- a/src/add-ons/kernel/drivers/network/3com/pci/if_xl.c +++ b/src/add-ons/kernel/drivers/network/3com/pci/if_xl.c @@ -2289,12 +2289,12 @@ xl_intr(void *arg) #ifndef __HAIKU__ while ((status = CSR_READ_2(sc, XL_STATUS)) & XL_INTRS && status != 0xFFFF) { - CSR_WRITE_2(sc, XL_COMMAND, - XL_CMD_INTR_ACK|(status & XL_INTRS)); #else status = atomic_and((int32 *)&sc->xl_intr_status, 0); - if ((status & XL_INTRS) != 0 && status != 0xFFFF) { + do { #endif + CSR_WRITE_2(sc, XL_COMMAND, + XL_CMD_INTR_ACK|(status & XL_INTRS)); if (status & XL_STAT_UP_COMPLETE) { int curpkts; @@ -2329,7 +2329,12 @@ xl_intr(void *arg) xl_stats_update_locked(sc); sc->xl_stats_no_timeout = 0; } +#ifdef __HAIKU__ + status = CSR_READ_2(sc, XL_STATUS); + } while ((status & XL_INTRS) != 0 && status != 0xFFFF); +#else } +#endif if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { if (sc->xl_type == XL_TYPE_905B)