Subject: Re: port-i386/12860
To: Jason Wright <jason@thought.net>
From: Nigel Reed <nigel@nelgin.nu>
List: netbsd-bugs
Date: 07/17/2001 01:11:53
Excellent...well. It half works anyway. The patch didn't apply using
patch -p0 (which I'm guessing would be the proper way) so I patched
it by hand. It compiled fine.

I configured /etc/ttys for tty02 (which is the first port on the
FlexPort since tty00 and tty01 are the built in comm ports).

Once I gave init a -HUP I got a login prompt. Great. I logged in and
all was fine. I typed exit to logout and now the port is no longer
working properly. If I 

echo hello > /dev/tty02

I just get a 'u' character. That's about it. stty -a < /dev/tty02 
gives an identical response to stty -a < /dev/tty03 when a getty
is running on the port.

/dev/tty03 works fine when logging out by using exit or ^D. I'll
reboot the system tomorrow and boot into a kernel with debugging
compiled in so I can grab information which may help to solve this
(if the reboot doesn't fix it). I'll also try some more ports to
see if I get the same sort of thing. It's late here so can't do it
right now.

Anyway, over all the results look good. I appreciate you taking the
effort to look into the problem for me.

Of course, I can't slap my AWE32 into the machine to fix the
problem with 8KHz sound files because the FlexPort took up my
spare ISA slot! I just need to start buying USB stuff!

Regards
Nigel


On Tue, Jul 17, 2001 at 12:32:25AM -0400, Jason Wright wrote:
> I just ported the driver in question (addcom) to OpenBSD and saw the
> same lock ups reported here (the card was new in box, so I don't
> suspect that being the problem).  The behavior I see is that when
> the card interrupts, the bits read back from the status port
> are all ones (they are -always- all ones), so the loop in the
> interrupt handler never exits.
> 
> The solution I took was to trust the slave devices for interrupt
> status and it appears to work just fine here.  The diff below
> hasn't been tested under NetBSD (or even compiled there), but
> reflects the changes when I brought the driver over to OpenBSD.
> 
> comments?
> 
> --Jason L. Wright
> 
> --- addcom_isa.c.orig	Tue Jul 17 00:17:35 2001
> +++ addcom_isa.c	Tue Jul 17 00:17:25 2001
> @@ -230,29 +230,11 @@
>  addcomintr(void *arg)
>  {
>  	struct addcom_softc *sc = arg;
> -	bus_space_tag_t iot = sc->sc_iot;
> -	int alive = sc->sc_alive;
> -	int bits;
> +	int i, r = 0;
>  
> -	bits = bus_space_read_1(iot, sc->sc_statusioh, 0) & alive;
> -	if (bits == 0)
> -		return (0);
> +	for (i = 0; i < NSLAVES; i++)
> +		if (sc->sc_alive & (1 << i))
> +			r |= comintr(sc->sc_slaves[i]);
>  
> -	for (;;) {
> -#define	TRY(n) \
> -		if (bits & (1 << (n))) \
> -			comintr(sc->sc_slaves[n]);
> -		TRY(0);
> -		TRY(1);
> -		TRY(2);
> -		TRY(3);
> -		TRY(4);
> -		TRY(5);
> -		TRY(6);
> -		TRY(7);
> -#undef TRY
> -		bits = bus_space_read_1(iot, sc->sc_statusioh, 0) & alive;
> -		if (bits == 0)
> -			return (1);
> - 	}
> +	return (r);
>  }

--