Subject: Re: kern/31083: netbsd-2 system crash - wdc?
To: None <bouyer@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-bugs
Date: 08/29/2005 19:37:01
The following reply was made to PR kern/31083; it has been noted by GNATS.

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org,
	netbsd-bugs@NetBSD.org
Subject: Re: kern/31083: netbsd-2 system crash - wdc?
Date: Mon, 29 Aug 2005 21:36:07 +0200

 --+HP7ph2BbKc20aGI
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Sun, Aug 28, 2005 at 11:43:00AM +0000, j+nbsd@2005.salmi.ch wrote:
 > >Number:         31083
 > >Category:       kern
 > >Synopsis:       netbsd-2 system crash - wdc?
 > >Confidential:   no
 > >Severity:       critical
 > >Priority:       high
 > >Responsible:    kern-bug-people
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Sun Aug 28 11:43:00 +0000 2005
 > >Originator:     Jukka Salmi
 > >Release:        NetBSD 2.0_STABLE
 > >Environment:
 > System: NetBSD grouper.salmi.ch 2.0_STABLE NetBSD 2.0_STABLE (GROUPER) #3: Wed Aug 24 07:22:34 UTC 2005  root@moray.salmi.ch:/build/nbsd/i386/sys/arch/i386/compile/GROUPER i386
 > Architecture: i386
 > Machine: i386
 > >Description:
 > 
 > Two days ago an up-to-date netbsd-2 system crashed:
 > 
 > db> dmesg
 > [...]
 > viaide0:0:1: lost interrupt
 >         type: ata tc_bcount: 0 tc_skip: 0
 > db> bt
 > ltsleep(c03a4db8,10,c02d6d2f,1,0) at netbsd:ltsleep+0x6b
 > wdcwait(c0c45900,48,40,3e8,9) at netbsd:wdcwait+0xa5
 > __wdccommand_start(c0c45900,c0d97000,0,c0d98904,c0d98904) at netbsd:__wdccommand_start+0x73
 > wdcstart(c0c45900,c0d97034,c03a4e50,c0d37b00,4000) at netbsd:wdcstart+0xb1
 > wdc_ata_bio_intr(c0c45900,c0d97034,1,1,c03a4e7c) at netbsd:wdc_ata_bio_intr+0x18a
 > wdcintr(c0c45900,0,7aad0010,30,580e0010) at netbsd:wdcintr+0xda
 > Xintr_legacy14() at netbsd:Xintr_legacy14+0xa8
 [...]
 >  796              1      822          0 2       0    1           smartd  wdccmd
 
 Hi,
 I just commited a fix to current, and attached is a patch against netbsd-2.
 Can you try this on your system ?
 Thanks
 
 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --
 
 --+HP7ph2BbKc20aGI
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename=diff2
 
 Index: wdc.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/ic/wdc.c,v
 retrieving revision 1.172.2.7.2.10
 diff -u -r1.172.2.7.2.10 wdc.c
 --- wdc.c	23 Aug 2005 13:35:55 -0000	1.172.2.7.2.10
 +++ wdc.c	29 Aug 2005 19:34:19 -0000
 @@ -1692,6 +1692,7 @@
  {   
  	struct wdc_softc *wdc = chp->ch_wdc;
  	int drive = xfer->c_drive;
 +	int wait_flags = (xfer->c_flags & C_POLL) ? AT_POLL : 0;
  	struct wdc_command *wdc_c = xfer->c_cmd;
  
  	WDCDEBUG_PRINT(("__wdccommand_start %s:%d:%d\n",
 @@ -1703,7 +1704,7 @@
  	bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh], 0,
  	    WDSD_IBM | (drive << 4));
  	switch(wdcwait(chp, wdc_c->r_st_bmask | WDCS_DRQ,
 -	    wdc_c->r_st_bmask, wdc_c->timeout, wdc_c->flags)) {
 +	    wdc_c->r_st_bmask, wdc_c->timeout, wait_flags)) {
  	case WDCWAIT_OK:
  		break;
  	case WDCWAIT_TOUT:
 
 --+HP7ph2BbKc20aGI--