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/06/2006 12:40:01
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,
	oster@cs.usask.ca, tsutsui@ceres.dti.ne.jp
Subject: Re: port-sun2/32420: NetBSD/sun2 3.0 INSTALL kernel hangs during boot
Date: Thu, 6 Apr 2006 21:35:42 +0900

 > BTW, today I've tried 3.0_STABLE, and sun2 INSTALL kernel
 > no longer hangs. I'll try track which change fixes the problem.
 > (it looks like malloc(9) issue, but not sure)
 
 Hmm, the following change seems to fixes the problem:
 
 ---
 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	6 Apr 2006 12:19:20 -0000
 @@ -399,7 +399,12 @@
  	tty_attach(tp);
  
  	zst->zst_tty = tp;
 -	zst->zst_rbuf = malloc(zstty_rbuf_size << 1, M_DEVBUF, M_WAITOK);
 +	zst->zst_rbuf = malloc(zstty_rbuf_size << 1, M_DEVBUF, M_NOWAIT);
 +	if (zst->zst_rbuf == NULL) {
 +		aprint_error("%s: unable to allocate ring buffer\n",
 +		    zst->zst_dev.dv_xname);
 +		return;
 +	}
  	zst->zst_ebuf = zst->zst_rbuf + (zstty_rbuf_size << 1);
  	/* Disable the high water mark. */
  	zst->zst_r_hiwat = 0;
 ---
 
 though it's not in netbsd-3. (just memory usage has been changed?)
 
 BTW netbsd-RAMDISK in 3.0-relrease on tme with sun3/150 emutation
 works fine to me.
 ---
 Izumi Tsutsui