Ticket #8454: 0001-Disable-duplicated-interrupt-disable-code.patch

File 0001-Disable-duplicated-interrupt-disable-code.patch, 3.0 KB (added by mmlr, 12 years ago)
  • src/add-ons/kernel/drivers/network/marvell_yukon/dev/msk/glue.c

    From 2edefe9d871785adf057f220b45b70705db97c3b Mon Sep 17 00:00:00 2001
    From: Michael Lotz <mmlr@mlotz.ch>
    Date: Fri, 2 Nov 2012 15:37:11 +0100
    Subject: [PATCH 1/2] Disable duplicated interrupt disable code.
    
    Since we now implement HAIKU_CHECK_DISABLE_INTERRUPTS there is no need
    to do it again in the interrupt handler. Further, store and carry over
    the interrupt status from the hook to the interrupt handler in case
    reading the register somehow clears it.
    ---
     .../drivers/network/marvell_yukon/dev/msk/glue.c   |    9 ++++++++-
     .../drivers/network/marvell_yukon/dev/msk/if_msk.c |    6 ++++++
     .../network/marvell_yukon/dev/msk/if_mskreg.h      |    3 +++
     3 files changed, 17 insertions(+), 1 deletion(-)
    
    diff --git a/src/add-ons/kernel/drivers/network/marvell_yukon/dev/msk/glue.c b/src/add-ons/kernel/drivers/network/marvell_yukon/dev/msk/glue.c
    index 997689e..6b76ab6 100644
    a b HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)  
    5151        return 0;
    5252    }
    5353
     54    sc->haiku_interrupt_status = status;
    5455    return 1;
    5556}
    5657
    5758
    58 NO_HAIKU_REENABLE_INTERRUPTS();
     59void
     60HAIKU_REENABLE_INTERRUPTS(device_t dev)
     61{
     62    struct msk_softc *sc = device_get_softc(dev);
     63    CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2);
     64}
     65
    5966
    6067HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES | FBSD_FAST_TASKQUEUE | FBSD_SWI_TASKQUEUE);
  • src/add-ons/kernel/drivers/network/marvell_yukon/dev/msk/if_msk.c

    diff --git a/src/add-ons/kernel/drivers/network/marvell_yukon/dev/msk/if_msk.c b/src/add-ons/kernel/drivers/network/marvell_yukon/dev/msk/if_msk.c
    index be4ac5d..377a158 100644
    a b msk_intr(void *xsc)  
    36103610    sc = xsc;
    36113611    MSK_LOCK(sc);
    36123612
     3613#ifndef __HAIKU__
    36133614    /* Reading B0_Y2_SP_ISRC2 masks further interrupts. */
    36143615    status = CSR_READ_4(sc, B0_Y2_SP_ISRC2);
    36153616    if (status == 0 || status == 0xffffffff ||
    msk_intr(void *xsc)  
    36193620        MSK_UNLOCK(sc);
    36203621        return;
    36213622    }
     3623#else
     3624    status = sc->haiku_interrupt_status;
     3625#endif
    36223626
    36233627    sc_if0 = sc->msk_if[MSK_PORT_A];
    36243628    sc_if1 = sc->msk_if[MSK_PORT_B];
    msk_intr(void *xsc)  
    36553659    if ((status & Y2_IS_STAT_BMU) != 0 && domore == 0)
    36563660        CSR_WRITE_4(sc, STAT_CTRL, SC_STAT_CLR_IRQ);
    36573661
     3662#ifndef __HAIKU__
    36583663    /* Reenable interrupts. */
    36593664    CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2);
     3665#endif
    36603666
    36613667    if (ifp0 != NULL && (ifp0->if_drv_flags & IFF_DRV_RUNNING) != 0 &&
    36623668        !IFQ_DRV_IS_EMPTY(&ifp0->if_snd))
  • src/add-ons/kernel/drivers/network/marvell_yukon/dev/msk/if_mskreg.h

    diff --git a/src/add-ons/kernel/drivers/network/marvell_yukon/dev/msk/if_mskreg.h b/src/add-ons/kernel/drivers/network/marvell_yukon/dev/msk/if_mskreg.h
    index 583f5e8..75ef99b 100644
    a b struct msk_softc {  
    25202520    int         msk_process_limit;
    25212521    int         msk_stat_cons;
    25222522    struct mtx      msk_mtx;
     2523#ifdef __HAIKU__
     2524    uint32_t    haiku_interrupt_status;
     2525#endif
    25232526};
    25242527
    25252528#define MSK_LOCK(_sc)       mtx_lock(&(_sc)->msk_mtx)