NetBSD Problem Report #39965

From www@NetBSD.org  Thu Nov 20 06:06:22 2008
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id ED73A63B8BD
	for <gnats-bugs@gnats.netbsd.org>; Thu, 20 Nov 2008 06:06:21 +0000 (UTC)
Message-Id: <20081120060621.A9CD063B874@narn.NetBSD.org>
Date: Thu, 20 Nov 2008 06:06:21 +0000 (UTC)
From: dross@pobox.com
Reply-To: dross@pobox.com
To: gnats-bugs@NetBSD.org
Subject: "lock error" panic on install with Atari TT030
X-Send-Pr-Version: www-1.0

>Number:         39965
>Category:       port-atari
>Synopsis:       "lock error" panic on install with Atari TT030
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    tsutsui
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 20 06:10:00 +0000 2008
>Closed-Date:    Fri Jan 09 13:50:39 +0000 2009
>Last-Modified:  Fri Jan 09 13:50:39 +0000 2009
>Originator:     David Ross
>Release:        4.0
>Organization:
>Environment:
n/a
>Description:
NetBSD 4.0 HEAD installation fails on Atari TT030 due to this "lock error" panic.  This is using the 200811180002Z HEAD release.

I hit this issue reliably on my TT030 and it's not possible to make it through a complete install.  My machine has 26mb of RAM and can run NetBSD 1.6.1 very reliably.

Screen shots:
http://i38.tinypic.com/2j5aqf.jpg
http://i38.tinypic.com/ml791x.jpg
http://i37.tinypic.com/9746de.jpg

>How-To-Repeat:
1.  Boot the netbsd atari kernel on an Atari TT030.  I'm using the "ATARITT" kernel.
2.  Load the sysinst image on md2a.
3.  Set up networking via the menu system (or otherwise ensure that the NetBSD sets are available.)
4.  From the main menu, choose to do a NetBSD install.
5.  Proceed through the steps that prepare the drive for installation.
6.  Choose where to install the sets from (I'm using FTP with a Riebl ethernet card).
7.  Observe that the first set or so downloads and extracts.
8.  At some point as the sets are downloaded and extracted you will see the system panic with the lock error described above.

>Fix:

>Release-Note:

>Audit-Trail:
From: "David Ross" <dross@pobox.com>
To: "David Brownlee" <abs@absd.org>,
	<gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: port-atari/39965: "lock error" panic on install with Atari TT030
Date: Mon, 24 Nov 2008 21:32:04 -0800

 a) There's a kernel diagnostic assertion while loading the filesystem image 
 from md2a.  Here's a screenshot: http://i38.tinypic.com/kei834.jpg
 panic: kernel diagnostic assertion "bp->b_refcnt > 0" failed: file 
 "/home/netbsd/current/sys/kern/vfs_bio.c", line 1503

 b) & c) ...tbd...  Busy week!  I don't have a spare SCSI CDROM, but I think 
 per the FAQ I can use a spare AHDI partition to try this out. I don't 
 _think_ it's the NIC because at least once the install failed in the gzip 
 decompression (after FTP), but I don't remember if this was the lock error 
 panic or something else.  In any event, I'd like to answer these questions 
 more definitively so I'll try this soon.

 ----- Original Message ----- 
 From: "David Brownlee" <abs@absd.org>
 To: <gnats-bugs@NetBSD.org>
 Cc: <dross@pobox.com>
 Sent: Sunday, November 23, 2008 3:27 AM
 Subject: Re: port-atari/39965: "lock error" panic on install with Atari 
 TT030


 >> NetBSD 4.0 HEAD installation fails on Atari TT030 due to this "lock
 > error" panic.  This is using the 200811180002Z HEAD release.
 > [...]
 >> 1.  Boot the netbsd atari kernel on an Atari TT030.  I'm using the
 > "ATARITT" kernel.
 >> 2.  Load the sysinst image on md2a.
 >> 3.  Set up networking via the menu system (or otherwise ensure that the
 > NetBSD sets are available.)
 >> 4.  From the main menu, choose to do a NetBSD install.
 >> 5.  Proceed through the steps that prepare the drive for installation.
 >> 6.  Choose where to install the sets from (I'm using FTP with a Riebl
 > ethernet card).
 >> 7.  Observe that the first set or so downloads and extracts.
 >> 8.  At some point as the sets are downloaded and extracted you will see
 > the system panic with the lock error described above.
 >
 > Could you run a few more tests to try to help track down the issue?
 >
 > a) try a kernel without SCSI DMA - see patch at end, and DEBUG + 
 > DIAGNOSTIC
 > enabled
 > http://mono.org/abs/netbsd-nodma-debug.gz
 >
 > b) eliminate the network interface
 > download or copy the sets to a local disk (ffs or msdos filesystem), or
 > even burn to CD, then do not configure the network during install.
 >
 > c) as b, but using the BOOTX kernel.
 >
 > its a pity the TT030 doesn't support IDE like the Falcon, as that would
 > allow us to eliminate the SCSI in a test.
 >
 > Index: sys/arch/atari/dev/ncr5380.c
 > ===================================================================
 > RCS file: /cvsroot/src/sys/arch/atari/dev/ncr5380.c,v
 > retrieving revision 1.57
 > diff -u -r1.57 ncr5380.c
 > --- sys/arch/atari/dev/ncr5380.c 15 Nov 2008 21:35:31 -0000 1.57
 > +++ sys/arch/atari/dev/ncr5380.c 23 Nov 2008 11:01:37 -0000
 > @@ -1821,6 +1821,7 @@
 >   */
 >  if (machineid & ATARI_FALCON)
 >   return (0);
 > + return (0);
 >
 >  /*
 >   * Initialize locals and requests' DMA-chain.
 >
 > 

From: David Holland <dholland-bugs@netbsd.org>
To: dross@pobox.com, gnats-bugs@netbsd.org
Cc: port-atari-maintainer@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: port-atari/39965: "lock error" panic on install with Atari
	TT030
Date: Thu, 27 Nov 2008 23:31:05 +0000

 On Thu, Nov 20, 2008 at 06:10:00AM +0000, dross@pobox.com wrote:
  > Screen shots:
  > http://i38.tinypic.com/2j5aqf.jpg
  > http://i38.tinypic.com/ml791x.jpg
  > http://i37.tinypic.com/9746de.jpg

 Transcription for posterity, just in case.

 It doesn't look machine-specific to me, unless the root cause is e.g.
 a problem with the locking primitives.

   --------

    :
    :
 local: base.tgz remote: base.tgz
 227 Entering Passive Mode (204,152,190,13,217,124)
 panic: lock error
 Stopped in pid 54.1 (ftp) at    netbsd:cpu_Debugger+0x6:   unlk  a6
 db> tr
 cpu_Debugger(2c26c0,0,1a566c,287d72c,287d738) + 6
 panic(2596eb,170a000,2c26c0,0,287d750) + 172
 lockdebug_abort(2c26c0,2718f0,24556f,245527) + 6c
 mutex_abort(2c26c0,24556f) + 28
 mutex_spin_enter(?)
 mutex_enter(2c26c0,287d79c,202568,414cf4,0) + ba
 brelse(414cf4,0,310ccc4) + a
 biodone2(414cf4) + ae
 biodone(414cf4,30b44d4,fccba0,30b4408,4000,0) + 92
 sddone(405ec0,0) + 78
 scsipi_complete(405ec0) + 162
 scsipi_done(405ec0) + 18c
 run_main(2861860) + b72
 ncr_ctrl_intr(2861860,287d8b4,251a,2000,fffffffb) + ba
 scsi_ctrl(2000) + 48
 nfp2_5380(?)
 brelsel(41508c,0,2c26c0,287d8e4,203018) + 10
 brelse(41508c,0,310dbc4) + 18
 bdwrite(41508c,5c1bcc) + 92
 ffs_alloccg(310f3f4,2c,0,3f34b0,4000) + 25c
 ffs_hashalloc(310f3f4,2c,0,3f34b0,4000,0,45b12) + 30
 ffs_alloc(310f3f4,0,f,0,3f34b0,4000,0,1709ec0,287db28,310f3f4,0,f,3,0,31bcc) + 142
 ffs_balloc_ufs1(310cb44,0,3c00,3a20,1709ec0,0,0) + fc8
 ffs_balloc(310cb44,0,3c000,3a20,1709ec0,0,0) + a2
 ufs_gop_alloc(310cb44,0,3c00,0,3a20,0,1709ec0,310cb44,310cb44) + 88
 ufs_balloc_range(310cb44,0,3c000,0,3a20,1709ec0,0) + 1f6
 ffs_write(287de40,260920,310cb44,287deb8,10) + 912
 VOP_WRITE(310cb44,287db8,10,1709ec0,310cb44,20002) + 32
 vn_write(3101d50,3101d50,287deb8,1709ec0,1) + 96
 dofilewrite(5,3101d50,4228000,7a20,3101d50,1,287df78) + 64
 sys_write(170a000,287df38,287df78,0,9f) + 4c
 syscall_plain(4,170a000,287dfb4,4228000,7a20) + c2
 syscall(4) + 78
 trap0() + e
 db> 

 -- 
 David A. Holland
 dholland@netbsd.org

From: "David Ross" <dross@pobox.com>
To: "David Holland" <dholland-bugs@netbsd.org>,
	<gnats-bugs@netbsd.org>
Cc: <port-atari-maintainer@netbsd.org>,
	<gnats-admin@netbsd.org>,
	<netbsd-bugs@netbsd.org>
Subject: Re: port-atari/39965: "lock error" panic on install with Atari TT030
Date: Sun, 30 Nov 2008 21:12:13 -0800

 Wow, we're up to three Davids now, this might get confusing.  =)

 Ok, so here are the answers to David Brownlee's questions b) and c) earlier 
 in the bug report.

 b)  Same as before but install via CD-ROM.  I used the 11/20 ATARITT HEAD 
 built kernel.  No networking set up.
 Result: not exactly the same panic but consistent with the "lock error" 
 panic in terms of when it occurred.

 Screenshot:
 http://i38.tinypic.com/2s7if0k.jpg

 c)  Same as b) but with BOOTX kernel.  No networking set up.
 Result: mostly the same as b)...  Different panic but consistent with the 
 "lock error" panic in terms of when it occurred.

 Screenshots:
 http://i33.tinypic.com/2enx6zb.jpg
 http://i37.tinypic.com/okwraw.jpg
 http://i37.tinypic.com/281vpyg.jpg

 Sorry about the fuzzyness of the second shot.  Most of it is duplicative 
 with the third shot which is much sharper.

 David (Holland), if there's a better place to upload the screenshots so you 
 don't feel compelled to transcribe them, please let me know!  =)

 David Ross
 dross@pobox.com


 ----- Original Message ----- 
 From: "David Holland" <dholland-bugs@netbsd.org>
 To: <dross@pobox.com>; <gnats-bugs@netbsd.org>
 Cc: <port-atari-maintainer@netbsd.org>; <gnats-admin@netbsd.org>; 
 <netbsd-bugs@netbsd.org>
 Sent: Thursday, November 27, 2008 3:31 PM
 Subject: Re: port-atari/39965: "lock error" panic on install with Atari 
 TT030


 > On Thu, Nov 20, 2008 at 06:10:00AM +0000, dross@pobox.com wrote:
 > > Screen shots:
 > > http://i38.tinypic.com/2j5aqf.jpg
 > > http://i38.tinypic.com/ml791x.jpg
 > > http://i37.tinypic.com/9746de.jpg
 >
 > Transcription for posterity, just in case.
 >
 > It doesn't look machine-specific to me, unless the root cause is e.g.
 > a problem with the locking primitives.
 >
 >  --------
 >
 >   :
 >   :
 > local: base.tgz remote: base.tgz
 > 227 Entering Passive Mode (204,152,190,13,217,124)
 > panic: lock error
 > Stopped in pid 54.1 (ftp) at    netbsd:cpu_Debugger+0x6:   unlk  a6
 > db> tr
 > cpu_Debugger(2c26c0,0,1a566c,287d72c,287d738) + 6
 > panic(2596eb,170a000,2c26c0,0,287d750) + 172
 > lockdebug_abort(2c26c0,2718f0,24556f,245527) + 6c
 > mutex_abort(2c26c0,24556f) + 28
 > mutex_spin_enter(?)
 > mutex_enter(2c26c0,287d79c,202568,414cf4,0) + ba
 > brelse(414cf4,0,310ccc4) + a
 > biodone2(414cf4) + ae
 > biodone(414cf4,30b44d4,fccba0,30b4408,4000,0) + 92
 > sddone(405ec0,0) + 78
 > scsipi_complete(405ec0) + 162
 > scsipi_done(405ec0) + 18c
 > run_main(2861860) + b72
 > ncr_ctrl_intr(2861860,287d8b4,251a,2000,fffffffb) + ba
 > scsi_ctrl(2000) + 48
 > nfp2_5380(?)
 > brelsel(41508c,0,2c26c0,287d8e4,203018) + 10
 > brelse(41508c,0,310dbc4) + 18
 > bdwrite(41508c,5c1bcc) + 92
 > ffs_alloccg(310f3f4,2c,0,3f34b0,4000) + 25c
 > ffs_hashalloc(310f3f4,2c,0,3f34b0,4000,0,45b12) + 30
 > ffs_alloc(310f3f4,0,f,0,3f34b0,4000,0,1709ec0,287db28,310f3f4,0,f,3,0,31bcc) 
 > + 142
 > ffs_balloc_ufs1(310cb44,0,3c00,3a20,1709ec0,0,0) + fc8
 > ffs_balloc(310cb44,0,3c000,3a20,1709ec0,0,0) + a2
 > ufs_gop_alloc(310cb44,0,3c00,0,3a20,0,1709ec0,310cb44,310cb44) + 88
 > ufs_balloc_range(310cb44,0,3c000,0,3a20,1709ec0,0) + 1f6
 > ffs_write(287de40,260920,310cb44,287deb8,10) + 912
 > VOP_WRITE(310cb44,287db8,10,1709ec0,310cb44,20002) + 32
 > vn_write(3101d50,3101d50,287deb8,1709ec0,1) + 96
 > dofilewrite(5,3101d50,4228000,7a20,3101d50,1,287df78) + 64
 > sys_write(170a000,287df38,287df78,0,9f) + 4c
 > syscall_plain(4,170a000,287dfb4,4228000,7a20) + c2
 > syscall(4) + 78
 > trap0() + e
 > db>
 >
 > -- 
 > David A. Holland
 > dholland@netbsd.org
 > 

From: David Holland <dholland-bugs@netbsd.org>
To: David Ross <dross@pobox.com>
Cc: David Holland <dholland-bugs@netbsd.org>, gnats-bugs@netbsd.org,
	port-atari-maintainer@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: port-atari/39965: "lock error" panic on install with Atari
	TT030
Date: Mon, 1 Dec 2008 05:44:57 +0000

 On Sun, Nov 30, 2008 at 09:12:13PM -0800, David Ross wrote:
 > David (Holland), if there's a better place to upload the screenshots so you 
 > don't feel compelled to transcribe them, please let me know!  =)

 There isn't - gnats can't handle images in any useful way. In the long
 term something should be done about that, because screenshots are very
 useful for dealing with panics.

 (Transcribing them was partly a way to attract attention to the PR, so
 don't worry about it.)

 -- 
 David A. Holland
 dholland@netbsd.org

From: David Holland <dholland-bugs@netbsd.org>
To: David Ross <dross@pobox.com>
Cc: David Holland <dholland-bugs@netbsd.org>, gnats-bugs@netbsd.org,
	port-atari-maintainer@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: port-atari/39965: "lock error" panic on install with Atari
	TT030
Date: Mon, 1 Dec 2008 06:11:00 +0000

 On Sun, Nov 30, 2008 at 09:12:13PM -0800, David Ross wrote:
 > c)  Same as b) but with BOOTX kernel.  No networking set up.
 > Result: mostly the same as b)...  Different panic but consistent with the 
 > "lock error" panic in terms of when it occurred.
 >
 > Screenshots:
 > http://i33.tinypic.com/2enx6zb.jpg
 > http://i37.tinypic.com/okwraw.jpg
 > http://i37.tinypic.com/281vpyg.jpg

 This is reaching biodone() from (what I assume is) an interrupt
 handler while sleeping in biowait() on the same buffer, and choking
 because it already holds the buffer lock for that buffer.

 This should not be possible, so it looks to me as if either the
 interrupt levels or the lock/cv implementation must be broken.

 -- 
 David A. Holland
 dholland@netbsd.org

From: David Holland <dholland-bugs@netbsd.org>
To: David Ross <dross@pobox.com>
Cc: David Holland <dholland-bugs@netbsd.org>, gnats-bugs@netbsd.org,
	port-atari-maintainer@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: port-atari/39965: "lock error" panic on install with Atari
	TT030
Date: Wed, 3 Dec 2008 08:17:28 +0000

 On Sun, Nov 30, 2008 at 09:12:13PM -0800, David Ross wrote:
 > c)  Same as b) but with BOOTX kernel.  No networking set up.
 > Result: mostly the same as b)...  Different panic but consistent with the 
 > "lock error" panic in terms of when it occurred.
 >
 > Screenshots:
 > http://i33.tinypic.com/2enx6zb.jpg
 > http://i37.tinypic.com/okwraw.jpg
 > http://i37.tinypic.com/281vpyg.jpg

 Ok, I think I've found the problem.

 biodone() relies on cpu_intr_p() to determine whether to shunt to a
 softint or plow straight ahead.

 The atari cpu_intr_p() tests the "idepth" variable managed by
 intr_dispatch() in atari/atari/intr.c. However, several of the
 interrupts, including the 5380 one, are hardwired and don't go
 anywhere near intr_dispatch().

 One then ends up in biodone2() in an interrupt handler, which is not
 supposed to happen, and everything goes downhill from there.

 -- 
 David A. Holland
 dholland@netbsd.org

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: dholland-bugs@NetBSD.org
Cc: dross@pobox.com, gnats-bugs@NetBSD.org, port-atari-maintainer@NetBSD.org,
        gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org,
        tsutsui@ceres.dti.ne.jp
Subject: Re: port-atari/39965: "lock error" panic on install with AtariTT030
Date: Wed, 3 Dec 2008 18:34:14 +0900

 > The atari cpu_intr_p() tests the "idepth" variable managed by
 > intr_dispatch() in atari/atari/intr.c. However, several of the
 > interrupts, including the 5380 one, are hardwired and don't go
 > anywhere near intr_dispatch().

 Yes, it's the same problem I saw on sun3x on January.

 atari has too many interrupt handlers, so it may be worth
 to pull merged handlers (for both vectored and autovectored)
 like other m68k ports.

 XXX arch/atari/atari/intr.h should be merged into <machine/intr.h> too.

 ---
 Index: atari/intr.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/atari/atari/intr.c,v
 retrieving revision 1.15
 diff -u -r1.15 intr.c
 --- atari/intr.c	28 Jun 2008 05:26:33 -0000	1.15
 +++ atari/intr.c	3 Dec 2008 09:31:08 -0000
 @@ -55,7 +55,7 @@
  typedef LIST_HEAD(, intrhand) ih_list_t;
  ih_list_t autovec_list[AVEC_MAX - AVEC_MIN + 1];
  ih_list_t uservec_list[UVEC_MAX - UVEC_MIN + 1];
 -static int idepth;
 +int idepth;
  volatile int ssir;

  void
 @@ -287,7 +287,6 @@
  	ih_list_t	*vec_list;
  	struct intrhand	*ih;

 -	idepth++;
  	uvmexp.intrs++;
  	vector = (frame.cf_vo & 0xfff) >> 2;
  	if (vector < (AVEC_LOC+AVEC_MAX) && vector >= AVEC_LOC)
 @@ -300,7 +299,6 @@
  		printf("intr_dispatch: vector %d unexpected\n", vector);
  		if (++unexpected > 10)
  		  panic("intr_dispatch: too many unexpected interrupts");
 -		idepth--;
  		return;
  	}
  	ih->ih_intrcnt[0]++;
 @@ -316,7 +314,6 @@
  	    panic("intr_dispatch: too many stray interrupts");
  	else
  	    printf("intr_dispatch: stray level %d interrupt\n", vector);
 -	idepth--;
  }

  bool
 Index: atari/locore.s
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/atari/atari/locore.s,v
 retrieving revision 1.101
 diff -u -r1.101 locore.s
 --- atari/locore.s	3 Dec 2007 15:33:21 -0000	1.101
 +++ atari/locore.s	3 Dec 2008 09:31:09 -0000
 @@ -379,9 +379,11 @@
   */

  ENTRY_NOPROFILE(intr_glue)
 +	addql	#1,_C_LABEL(idepth)
  	moveml	%d0-%d1/%a0-%a1,%sp@-	|  Save scratch registers
  	jbsr	_C_LABEL(intr_dispatch)	|  handle interrupt
  	moveml	%sp@+,%d0-%d1/%a0-%a1
 +	subql	#1,_C_LABEL(idepth)
  	jra	_ASM_LABEL(rei)

  ENTRY_NOPROFILE(lev2intr)
 @@ -393,9 +395,11 @@
  	jne	1f			|  Yes, go service a VBL-request
  	rte				|  Nothing to do.
  1:
 +	addql	#1,_C_LABEL(idepth)
  	moveml	%d0-%d1/%a0-%a1,%sp@-
  	jbsr	_C_LABEL(falcon_display_switch)
  	moveml	%sp@+,%d0-%d1/%a0-%a1
 +	subql	#1,_C_LABEL(idepth)
  #endif /* FALCON_VIDEO */
  	rte

 @@ -409,6 +413,7 @@
  #define	PLX_PCICR	0x4204
  #define	PLX_CNTRL	0x42ec
  #define	PLX_DMCFGA	0x42ac
 +	addql	#1,_C_LABEL(idepth)
  	moveml	%d0-%d2/%a0-%a1,%sp@-
  	movw	%sp@(20),%sp@-		|  push previous SR value
  	clrw	%sp@-			|	padded to longword
 @@ -431,6 +436,7 @@
  	jbsr	_C_LABEL(milan_isa_intr)
  	addql	#8,%sp
  	moveml	%sp@+,%d0-%d2/%a0-%a1
 +	subql	#1,_C_LABEL(idepth)
  	jra	_ASM_LABEL(rei)

  /*
 @@ -492,6 +498,7 @@

  ENTRY_NOPROFILE(lev3intr)
  ENTRY_NOPROFILE(badtrap)
 +	addql	#1,_C_LABEL(idepth)
  	moveml	#0xC0C0,%sp@-		|  save scratch regs
  	movw	%sp@(22),%sp@-		|  push exception vector info
  	clrw	%sp@-
 @@ -499,9 +506,11 @@
  	jbsr	_C_LABEL(straytrap)	|  report
  	addql	#8,%sp			|  pop args
  	moveml	%sp@+,#0x0303		|  restore regs
 +	subql	#1,_C_LABEL(idepth)
  	jra	_ASM_LABEL(rei)		|  all done

  ENTRY_NOPROFILE(badmfpint)
 +	addql	#1,_C_LABEL(idepth)
  	moveml	#0xC0C0,%sp@-		|  save scratch regs
  	movw	%sp@(22),%sp@-		|  push exception vector info
  	clrw	%sp@-
 @@ -509,6 +518,7 @@
  	jbsr	_C_LABEL(straymfpint)	|  report
  	addql	#8,%sp			|  pop args
  	moveml	%sp@+,#0x0303		|  restore regs
 +	subql	#1,_C_LABEL(idepth)
  	jra	_ASM_LABEL(rei)		|  all done

  ENTRY_NOPROFILE(trap0)
 @@ -672,6 +682,7 @@

  	/* MFP timer A handler --- System clock --- */
  ASENTRY_NOPROFILE(mfp_tima)
 +	addql	#1,_C_LABEL(idepth)
  	moveml	%d0-%d1/%a0-%a1,%sp@-	|  save scratch registers
  	movl	%sp,%sp@-		|  push pointer to clockframe
  	jbsr	_C_LABEL(hardclock)	|  call generic clock int routine
 @@ -680,22 +691,26 @@
  					|  add another system clock interrupt
  	moveml	%sp@+,%d0-%d1/%a0-%a1	|  restore scratch regs	
  	addql	#1,_C_LABEL(uvmexp)+UVMEXP_INTRS
 +	subql	#1,_C_LABEL(idepth)
  	jra	_ASM_LABEL(rei)		|  all done

  #ifdef STATCLOCK
  	/* MFP timer C handler --- Stat/Prof clock --- */
  ASENTRY_NOPROFILE(mfp_timc)
 +	addql	#1,_C_LABEL(idepth)
  	moveml	%d0-%d1/%a0-%a1,%sp@-	|  save scratch registers
  	jbsr	_C_LABEL(statintr)	|  call statistics clock handler
  	addql	#1,_C_LABEL(intrcnt)+36	|  add another stat clock interrupt
  	moveml	%sp@+,%d0-%d1/%a0-%a1	|  restore scratch regs	
  	addql	#1,_C_LABEL(uvmexp)+UVMEXP_INTRS
 +	subql	#1,_C_LABEL(idepth)
  	jra	_ASM_LABEL(rei)		|  all done
  #endif /* STATCLOCK */

  #if NKBD > 0
  	/* MFP ACIA handler --- keyboard/midi --- */
  ASENTRY_NOPROFILE(mfp_kbd)
 +	addql	#1,_C_LABEL(idepth)
  	addql	#1,_C_LABEL(intrcnt)+8	|  add another kbd/mouse interrupt

  	moveml	%d0-%d1/%a0-%a1,%sp@-	|  Save scratch registers
 @@ -705,12 +720,14 @@
  	addql	#4,%sp			|  pop SR
  	moveml	%sp@+,%d0-%d1/%a0-%a1
  	addql	#1,_C_LABEL(uvmexp)+UVMEXP_INTRS
 +	subql	#1,_C_LABEL(idepth)
  	jra	_ASM_LABEL(rei)
  #endif /* NKBD */

  #if NNCRSCSI > 0
  	/* MFP2 SCSI DMA handler --- NCR5380 --- */
  ASENTRY_NOPROFILE(mfp2_5380dm)
 +	addql	#1,_C_LABEL(idepth)
  	addql	#1,_C_LABEL(intrcnt)+24	|  add another 5380-DMA interrupt

  	moveml	%d0-%d1/%a0-%a1,%sp@-	|  Save scratch registers
 @@ -720,10 +737,12 @@
  	addql	#4,%sp			|  pop SR
  	moveml	%sp@+,%d0-%d1/%a0-%a1
  	addql	#1,_C_LABEL(uvmexp)+UVMEXP_INTRS
 +	subql	#1,_C_LABEL(idepth)
  	jra	_ASM_LABEL(rei)

  	/* MFP2 SCSI handler --- NCR5380 --- */
  ASENTRY_NOPROFILE(mfp2_5380)
 +	addql	#1,_C_LABEL(idepth)
  	addql	#1,_C_LABEL(intrcnt)+20	|  add another 5380-SCSI interrupt

  	moveml	%d0-%d1/%a0-%a1,%sp@-	|  Save scratch registers
 @@ -733,12 +752,14 @@
  	addql	#4,%sp			|  pop SR
  	moveml	%sp@+,%d0-%d1/%a0-%a1
  	addql	#1,_C_LABEL(uvmexp)+UVMEXP_INTRS
 +	subql	#1,_C_LABEL(idepth)
  	jra	_ASM_LABEL(rei)
  #endif /* NNCRSCSI > 0 */

  #if NZS > 0
  	/* SCC Interrupt --- modem2/serial2 --- */
  ASENTRY_NOPROFILE(sccint)
 +	addql	#1,_C_LABEL(idepth)
  	addql	#1,_C_LABEL(intrcnt)+32	|  add another SCC interrupt

  	moveml	%d0-%d1/%a0-%a1,%sp@-	|  Save scratch registers
 @@ -748,12 +769,14 @@
  	addql	#4,%sp			|  pop SR
  	moveml	%sp@+,%d0-%d1/%a0-%a1
  	addql	#1,_C_LABEL(uvmexp)+UVMEXP_INTRS
 +	addql	#1,_C_LABEL(idepth)
  	jra	_ASM_LABEL(rei)
  #endif /* NZS > 0 */

  #ifdef _ATARIHW_
  	/* Level 1 (Software) interrupt handler */
  ENTRY_NOPROFILE(lev1intr)
 +	addql	#1,_C_LABEL(idepth)
  	moveml	%d0-%d1/%a0-%a1,%sp@-
  	movl	_C_LABEL(stio_addr),%a0 |  get KVA of ST-IO area
  	moveb	#0, %a0@(SCU_SOFTINT)	|  Turn off software interrupt
 @@ -761,6 +784,7 @@
  	jbsr	_C_LABEL(nullop)	|  XXX handle software interrupts
  	moveml	%sp@+,%d0-%d1/%a0-%a1
  	addql	#1,_C_LABEL(uvmexp)+UVMEXP_INTRS
 +	subql	#1,_C_LABEL(idepth)
  	jra	_ASM_LABEL(rei)

  	/*
 @@ -774,6 +798,7 @@
  	 * Note that the nmi has to be turned off while handling it because
  	 * the hardware modification has no de-bouncing logic....
  	 */
 +	addql	#1,_C_LABEL(idepth)
  	movl	%a0, %sp@-		|  save a0
  	movl	_C_LABEL(stio_addr),%a0	|  get KVA of ST-IO area
  	movb	%a0@(SCU_SYSMASK),%sp@-	|  save current sysmask
 @@ -781,6 +806,7 @@
  	trap	#15			|  drop into the debugger
  	movb	%sp@+, %a0@(SCU_SYSMASK)|  restore sysmask
  	movl	%sp@+, %a0		|  restore a0
 +	subql	#1,_C_LABEL(idepth)
  #endif
  	addql	#1,_C_LABEL(intrcnt)+28	|  add another nmi interrupt
  	rte				|  all done
 Index: include/intr.h
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/atari/include/intr.h,v
 retrieving revision 1.18
 diff -u -r1.18 intr.h
 --- include/intr.h	28 Jun 2008 05:26:33 -0000	1.18
 +++ include/intr.h	3 Dec 2008 09:31:09 -0000
 @@ -65,6 +65,7 @@
  int spl0 __P((void));

  extern const uint16_t ipl2psl_table[NIPL];
 +extern int idepth;

  typedef int ipl_t;
  typedef struct {

 ---
 Izumi Tsutsui

State-Changed-From-To: open->feedback
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Sat, 20 Dec 2008 13:39:31 +0900
State-Changed-Why:
Could you try a kernel provided by Tuomo Makinen on port-atari?
http://mail-index.netbsd.org/port-atari/2008/12/20/msg000143.html
This also includes idepth accounting fixes.


Responsible-Changed-From-To: port-atari-maintainer->tsutsui
Responsible-Changed-By: tsutsui@NetBSD.org
Responsible-Changed-When: Wed, 31 Dec 2008 15:18:27 +0900
Responsible-Changed-Why:
I committed fix.


State-Changed-From-To: feedback->pending-pullups
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Wed, 31 Dec 2008 15:18:27 +0900
State-Changed-Why:
idepth accounting fix has been committed:
http://mail-index.netbsd.org/source-changes/2008/12/27/msg214462.html
and installation has been confirmed by submitter with it:
http://mail-index.netbsd.org/port-atari/2008/12/30/msg000178.html

A pullup request to netbsd-5 will be sent later.


State-Changed-From-To: pending-pullups->closed
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Fri, 09 Jan 2009 22:50:39 +0900
State-Changed-Why:
Pulled up to netbsd-5.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.