Subject: Re: port-sun2/32420: NetBSD/sun2 3.0 INSTALL kernel hangs during boot
To: None <port-sun2-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: netbsd-bugs
Date: 04/23/2006 02:10:03
The following reply was made to PR port-sun2/32420; it has been noted by GNATS.

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@netbsd.org
Cc: port-sun2-maintainer@netbsd.org, gnats-admin@netbsd.org,
	tsutsui@ceres.dti.ne.jp
Subject: Re: port-sun2/32420: NetBSD/sun2 3.0 INSTALL kernel hangs during boot
	 
Date: Sun, 23 Apr 2006 11:06:54 +0900

 In article <20060406150503.67D7F63B896@narn.netbsd.org>
 oster@cs.usask.ca wrote:
 
 >  > -	zst->zst_rbuf = malloc(zstty_rbuf_size << 1, M_DEVBUF, M_WAITOK);
 >  > +	zst->zst_rbuf = malloc(zstty_rbuf_size << 1, M_DEVBUF, M_NOWAIT);
 >  
 >  Is the system just running out of kernel memory then?
 
 Hmm, adding a nop before splzs() in zstty_attach() also fixes
 the hang:
 ---
 Index: dev/ic/z8530tty.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/ic/z8530tty.c,v
 retrieving revision 1.97
 diff -u -r1.97 z8530tty.c
 --- dev/ic/z8530tty.c	27 Feb 2005 00:27:03 -0000	1.97
 +++ dev/ic/z8530tty.c	23 Apr 2006 02:02:57 -0000
 @@ -449,6 +449,7 @@
  		resetbit = (channel == 0) ? ZSWR9_A_RESET : ZSWR9_B_RESET;
  	}
  
 +asm("nop");
  	s = splzs();
  	simple_lock(&cs->cs_lock);
  	if (resetbit)
 ---
 so it smells some timing problem on tme around interrupt emulation.
 
 I'll close this PR unless someone reports the same problem
 on real hardware, since -current, netbsd-3, and netbsd-3-0
 don't have this problem anyway.
 ---
 Izumi Tsutsui