Subject: kern/11805: isa_ntwoc hangs on reboot
To: None <gnats-bugs@gnats.netbsd.org, mkl@nw.com>
From: None <mkl@nw.com>
List: netbsd-bugs
Date: 12/23/2000 17:22:14
>Number:         11805
>Category:       kern
>Synopsis:       isa_ntwoc hangs on reboot
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 23 17:22:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Charlie Root
>Release:        NetBSD-1.5
>Organization:
>Environment:
System: NetBSD router.nw.com 1.5 NetBSD 1.5 (ROUTER) #4: Thu Dec 21 19:13:26 PST 2000 root@router.nw.com:/usr/src/sys/arch/i386/compile/ROUTER i386


>Description:
	Adding an SDL Riscom/N2 ISA card and configuring the GENERIC kernel to use this
        card causes the system to hang after the "reboot" command is given.
>How-To-Repeat:
	Very repeatable as mentioned above and with non-GENERIC kernels.
>Fix:

	change the shutdown routine to look like the one below (based on pci version of driver):

	in /sys/dev/isa/if_ntwoc_isa.c, add a line to turn off the card:

/*
 * shut down interrupts and DMA, so we don't trash the kernel on warm
 * boot.  Also, lower DTR on each port and disable card interrupts.
 */
static void
ntwoc_isa_shutdown(void *aux)
{
	struct ntwoc_isa_softc *sc = aux;
	u_int16_t mcr;

	/*
	 * shut down the SCA ports
	 */
	sca_shutdown(&sc->sc_sca);

	/*
	 * lower DTR on both ports
	 */
	mcr = bus_space_read_1(sc->sc_sca.sc_iot, sc->sc_sca.sc_ioh, NTWOC_MCR);
	mcr |= (NTWOC_MCR_DTR0 | NTWOC_MCR_DTR1);
	bus_space_write_1(sc->sc_sca.sc_iot, sc->sc_sca.sc_ioh, NTWOC_MCR, mcr);

	/* turn off the card */
	bus_space_write_1(sc->sc_sca.sc_iot, sc->sc_sca.sc_ioh, NTWOC_PCR, 0);
}

>Release-Note:
>Audit-Trail:
>Unformatted: