NetBSD Problem Report #43472

From www@NetBSD.org  Mon Jun 14 20:59:30 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id CB57C63BA08
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 14 Jun 2010 20:59:30 +0000 (UTC)
Message-Id: <20100614205930.974C563B8DF@www.NetBSD.org>
Date: Mon, 14 Jun 2010 20:59:30 +0000 (UTC)
From: sainio@t-online.de
Reply-To: sainio@t-online.de
To: gnats-bugs@NetBSD.org
Subject: Missing callout_init in .../hpcmips/tx/txcom.c - kernel hangs up when booting
X-Send-Pr-Version: www-1.0

>Number:         43472
>Category:       port-hpcmips
>Synopsis:       Missing callout_init in .../hpcmips/tx/txcom.c - kernel hangs up when booting
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    tsutsui
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 14 21:00:00 +0000 2010
>Closed-Date:    Fri Nov 26 22:08:16 +0000 2010
>Last-Modified:  Fri Nov 26 22:08:16 +0000 2010
>Originator:     Risto Sainio
>Release:        NetBSD 5.0.2_PATCH
>Organization:
>Environment:
NetBSD rsa02.rsa.org 5.0.2_PATCH NetBSD 5.0.2_PATCH (TX3922_rsa) #22: Sat Jun 12 01:50:35 CEST 2010  root@vrsa89:/usr/objdir_current/sys/arch/hpcmips/compile/TX3922_rsa hpcmips
>Description:
While booting on TX3922 based system kernel hangs up. Switching on DIAGNOSTIC showed following:

panic: kernel diagnostic assertion "c->c_magic == CALLOUT_MAGIC" failed: file "/usr/src/sys/kern/kern_timeout.c", line 382
Stopped in pid 0.1 (system) at  netbsd:cpu_Debugger+0x4:        jr      ra
                bdslot: nop
db> bt
cpu_Debugger+4 (83fef000,1,5,0) ra 801713bc sz 0
panic+1fc (83fef000,8022db74,80243c08,80243be4) ra 8021df4c sz 48
__kernassert+3c (83fef000,8022db74,80243c08,80243be4) ra 8015d5f8 sz 32
callout_reset+5c (83fef000,8022db74,80243c08,80243be4) ra 80200f14 sz 40
txcom_txintr+74 (83fef000,8022db74,80243c08,80243be4) ra 801fd180 sz 24
cpu_intr+164 (83fef000,8022db74,80243c08,80243be4) ra 801e021c sz 40
mips1_KernIntr+84 (7f01,0,8032b928,80242f88) ra 801501d8 sz 128
sleepq_abort+3c (7f01,0,8032b928,80242f88) ra 80155308 sz 32
ltsleep+8c (7f01,0,8032b928,80242f88) ra 8020ade8 sz 56
wdc_pcmcia_attach+328 (7f01,0,8032b928,80242f88) ra 80162ffc sz 64
config_attach_loc+1ac (7f01,0,8032b928,80242f88) ra 80207c0c sz 48
pcmcia_rescan+c0 (7f01,0,8032b928,80242f88) ra 80207d4c sz 72
pcmcia_card_attach+114 (7f01,0,8032b928,80242f88) ra 80204488 sz 32
plumpcmcia_attach_socket+8c (7f01,0,8032b928,80242f88) ra 80204610 sz 48
plumpcmcia_attach+178 (7f01,0,8032b928,80242f88) ra 80162ffc sz 56
config_attach_loc+1ac (7f01,0,8032b928,80242f88) ra 8016306c sz 48
config_attach+18 (7f01,0,8032b928,80201ed0) ra 80201fc4 sz 32
plum_search+74 (7f01,0,8032b928,8029d978) ra 801619b0 sz 56
mapply+38 (7f01,0,8032b928,8029d978) ra 80161bc4 sz 32
config_search_loc+13c (7f01,0,8032b928,8029d978) ra 80161c14 sz 64
config_search_ia+14 (7f01,0,8032b928,80201ed0) ra 80162ffc sz 32
config_attach_loc+1ac (7f01,0,8032b928,80201ed0) ra 8016306c sz 48

>How-To-Repeat:
booting the system
>Fix:
added following in hpcmips/tx/txcom.c
function txcom_attach:

        printf("\n");

        /* initialize callouts */
        callout_init(&sc->sc_rxsoft_ch, 0);
        callout_init(&sc->sc_txsoft_ch, 0);


        /*
         * Enable interrupt
         */
#define TXCOMINTR(i, s) MAKEINTR(2, TX39_INTRSTATUS2_UART##i##INT(s))

>Release-Note:

>Audit-Trail:
From: Izumi Tsutsui <tsutsui@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43472 CVS commit: src/sys/arch/hpcmips/tx
Date: Fri, 16 Jul 2010 15:28:38 +0000

 Module Name:	src
 Committed By:	tsutsui
 Date:		Fri Jul 16 15:28:38 UTC 2010

 Modified Files:
 	src/sys/arch/hpcmips/tx: txcom.c

 Log Message:
 Add missing callout_init(9) calls. PR port-hpcmips/43472


 To generate a diff of this commit:
 cvs rdiff -u -r1.41 -r1.42 src/sys/arch/hpcmips/tx/txcom.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: sainio@t-online.de
Cc: gnats-bugs@NetBSD.org, port-hpcmips-maintainer@NetBSD.org,
        gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org,
        tsutsui@ceres.dti.ne.jp
Subject: Re: PR/43472 CVS commit: src/sys/arch/hpcmips/tx
Date: Sat, 17 Jul 2010 00:46:19 +0900

 Thanks, I've committed your fixes, but could you also try
 the attached patch (for netbsd-5-0 branch)?

 It's better to use newer MI softint(9) than callout(9)
 for such deferred interrupt handlers.

 ---
 Index: txcom.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/hpcmips/tx/txcom.c,v
 retrieving revision 1.40
 diff -u -r1.40 txcom.c
 --- txcom.c	12 Jun 2008 16:50:53 -0000	1.40
 +++ txcom.c	16 Jul 2010 15:42:54 -0000
 @@ -99,8 +99,8 @@
  	struct tty		*sc_tty;
  	struct txcom_chip	*sc_chip;

 -	struct callout		sc_txsoft_ch;
 -	struct callout		sc_rxsoft_ch;
 +	void		*sc_txsoft_cookie;
 +	void		*sc_rxsoft_cookie;

   	u_int8_t	*sc_tba;	/* transmit buffer address */
   	int		sc_tbc;		/* transmit byte count */
 @@ -272,6 +272,11 @@
  	tx_intr_establish(tc, TXCOMINTR(BREAK, slot), IST_EDGE, IPL_TTY,
  	    txcom_break_intr, sc);

 +	sc->sc_txsoft_cookie =
 +	    softint_establish(SOFTINT_SERIAL, txcom_txsoft, sc);
 +	sc->sc_rxsoft_cookie =
 +	    softint_establish(SOFTINT_SERIAL, txcom_rxsoft, sc);
 +
  	/*
  	 * UARTA has external signal line. (its wiring is platform dependent)
  	 */
 @@ -699,7 +704,7 @@
  	sc->sc_rbuf[sc->sc_rbput] = c;
  	sc->sc_rbput = (sc->sc_rbput + 1) % TXCOM_RING_MASK;

 -	callout_reset(&sc->sc_rxsoft_ch, 1, txcom_rxsoft, sc);
 +	softint_schedule(sc->sc_rxsoft_cookie);

  	return 0;
  }
 @@ -748,7 +753,7 @@
  		sc->sc_tbc--;
  		sc->sc_tba++;
  	} else {
 -		callout_reset(&sc->sc_rxsoft_ch, 1, txcom_txsoft, sc);
 +		softint_schedule(sc->sc_txsoft_cookie);
  	}

  	return 0;

 ---
 Izumi Tsutsui

Responsible-Changed-From-To: port-hpcmips-maintainer->tsutsui
Responsible-Changed-By: tsutsui@NetBSD.org
Responsible-Changed-When: Sat, 17 Jul 2010 01:26:45 +0900
Responsible-Changed-Why:
I'll check this one.


State-Changed-From-To: open->feedback
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Sat, 17 Jul 2010 01:26:45 +0900
State-Changed-Why:
Fix committed, but also awaiting feedback for possible alternative fix.


From: Izumi Tsutsui <tsutsui@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43472 CVS commit: src/sys/arch/hpcmips/tx
Date: Tue, 20 Jul 2010 15:03:53 +0000

 Module Name:	src
 Committed By:	tsutsui
 Date:		Tue Jul 20 15:03:53 UTC 2010

 Modified Files:
 	src/sys/arch/hpcmips/tx: txcom.c

 Log Message:
 Replace callout(9) with softint(9) which is more appropriate there.
 Inspired by PR port-hpcmips/43472 and tested by Risto Sainio.


 To generate a diff of this commit:
 cvs rdiff -u -r1.43 -r1.44 src/sys/arch/hpcmips/tx/txcom.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: feedback->pending-pullups
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Wed, 21 Jul 2010 22:44:21 +0900
State-Changed-Why:
I'll send a pullup request later.


From: "Jeff Rizzo" <riz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43472 CVS commit: [netbsd-5] src/sys/arch/hpcmips/tx
Date: Fri, 26 Nov 2010 17:16:04 +0000

 Module Name:	src
 Committed By:	riz
 Date:		Fri Nov 26 17:16:03 UTC 2010

 Modified Files:
 	src/sys/arch/hpcmips/tx [netbsd-5]: txcom.c

 Log Message:
 Pull up following revision(s) (requested by tsutsui in ticket #1485):
 	sys/arch/hpcmips/tx/txcom.c: revision 1.42
 	sys/arch/hpcmips/tx/txcom.c: revision 1.43
 Add missing callout_init(9) calls. PR port-hpcmips/43472
 Fix a wrong arg for callout_reset(9) in txcom_txintr(). PR port-hpcmips/43474


 To generate a diff of this commit:
 cvs rdiff -u -r1.40 -r1.40.6.1 src/sys/arch/hpcmips/tx/txcom.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Fri, 26 Nov 2010 22:08:16 +0000
State-Changed-Why:
Pullups completed.


>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-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.