Index: head/sys/riscv/riscv/plic.c =================================================================== --- head/sys/riscv/riscv/plic.c +++ head/sys/riscv/riscv/plic.c @@ -169,11 +169,11 @@ sc = arg; cpu = PCPU_GET(cpuid); + /* Claim any pending interrupt. */ pending = RD4(sc, PLIC_CLAIM(sc, cpu)); if (pending) { tf = curthread->td_intr_frame; plic_irq_dispatch(sc, pending, tf); - WR4(sc, PLIC_CLAIM(sc, cpu), pending); } return (FILTER_HANDLED); @@ -384,7 +384,17 @@ static void plic_post_ithread(device_t dev, struct intr_irqsrc *isrc) { + struct plic_softc *sc; + struct plic_irqsrc *src; + uint32_t cpu; + sc = device_get_softc(dev); + src = (struct plic_irqsrc *)isrc; + + cpu = CPU_FFS(&isrc->isrc_cpu) - 1; + + /* Complete the interrupt. */ + WR4(sc, PLIC_CLAIM(sc, cpu), src->irq); plic_enable_intr(dev, isrc); } @@ -451,6 +461,7 @@ DEVMETHOD(pic_map_intr, plic_map_intr), DEVMETHOD(pic_pre_ithread, plic_pre_ithread), DEVMETHOD(pic_post_ithread, plic_post_ithread), + DEVMETHOD(pic_post_filter, plic_post_ithread), DEVMETHOD(pic_setup_intr, plic_setup_intr), DEVMETHOD(pic_bind_intr, plic_bind_intr),