Skip to content

Commit

Permalink
Disable duplicated interrupt disable code in marvell yukon.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mmlr committed Nov 7, 2012
1 parent 63dffc0 commit c72218a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Expand Up @@ -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);
Expand Up @@ -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 ||
Expand All @@ -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];
Expand Down Expand Up @@ -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))
Expand Down
Expand Up @@ -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)
Expand Down

0 comments on commit c72218a

Please sign in to comment.