Disable duplicated interrupt disable code in marvell yukon.

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 as that is
cleaner and just in case reading the register somehow clears it. May
help with #8454.
This commit is contained in:
Michael Lotz
2012-11-07 14:28:49 +01:00
parent 63dffc0194
commit c72218a094
3 changed files with 17 additions and 1 deletions
@@ -51,10 +51,17 @@ HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
return 0;
}
sc->haiku_interrupt_status = status;
return 1;
}
NO_HAIKU_REENABLE_INTERRUPTS();
void
HAIKU_REENABLE_INTERRUPTS(device_t dev)
{
struct msk_softc *sc = device_get_softc(dev);
CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2);
}
HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES | FBSD_FAST_TASKQUEUE | FBSD_SWI_TASKQUEUE);
@@ -3610,6 +3610,7 @@ msk_intr(void *xsc)
sc = xsc;
MSK_LOCK(sc);
#ifndef __HAIKU__
/* Reading B0_Y2_SP_ISRC2 masks further interrupts. */
status = CSR_READ_4(sc, B0_Y2_SP_ISRC2);
if (status == 0 || status == 0xffffffff ||
@@ -3619,6 +3620,9 @@ msk_intr(void *xsc)
MSK_UNLOCK(sc);
return;
}
#else
status = sc->haiku_interrupt_status;
#endif
sc_if0 = sc->msk_if[MSK_PORT_A];
sc_if1 = sc->msk_if[MSK_PORT_B];
@@ -3655,8 +3659,10 @@ msk_intr(void *xsc)
if ((status & Y2_IS_STAT_BMU) != 0 && domore == 0)
CSR_WRITE_4(sc, STAT_CTRL, SC_STAT_CLR_IRQ);
#ifndef __HAIKU__
/* Reenable interrupts. */
CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2);
#endif
if (ifp0 != NULL && (ifp0->if_drv_flags & IFF_DRV_RUNNING) != 0 &&
!IFQ_DRV_IS_EMPTY(&ifp0->if_snd))
@@ -2520,6 +2520,9 @@ struct msk_softc {
int msk_process_limit;
int msk_stat_cons;
struct mtx msk_mtx;
#ifdef __HAIKU__
uint32_t haiku_interrupt_status;
#endif
};
#define MSK_LOCK(_sc) mtx_lock(&(_sc)->msk_mtx)