NetBSD Problem Report #42186

From tsutsui@ceres.dti.ne.jp  Thu Oct 15 15:31:13 2009
Return-Path: <tsutsui@ceres.dti.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id B7D4363B8B6
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 15 Oct 2009 15:31:13 +0000 (UTC)
Message-Id: <200910151531.n9FFVAVb013202@mirage.ceres.dti.ne.jp>
Date: Fri, 16 Oct 2009 00:31:10 +0900 (JST)
From: tsutsui@ceres.dti.ne.jp
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@gnats.NetBSD.org
Subject: sparc boot floppy "Data Access Exception" error
X-Send-Pr-Version: 3.95

>Number:         42186
>Category:       port-sparc
>Synopsis:       sparc boot floppy "Data Access Exception" error
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    tsutsui
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 15 15:35:00 +0000 2009
>Closed-Date:    Thu Jan 28 13:58:14 +0000 2010
>Last-Modified:  Thu Jan 28 13:58:14 +0000 2010
>Originator:     Izumi Tsutsui
>Release:        NetBSD 5.0.1
>Organization:
>Environment:
System: NetBSD 5.0.1
Architecture: sparc
Machine: sparc SPARCstation 1+ and SPARCstation 20 compatible
>Description:
Booting sparc installation floppy fetched from
pub/NetBSD/NetBSD-5.0.1/sparc/installation/floppy/disk1.gz
causes "Data Access Exception" error.
4.0.1 has the same problem.
3.0 works fine.

>How-To-Repeat:
On SS1+:
---
Type  help  for more information
ok boot fd()
Booting from: fd(0,0,0) 
>> NetBSD/sparc Secondary Boot, Revision 1.15
>> (builds@b8.netbsd.org, Thu Jul 30 00:08:01 UTC 2009)
Booting netbsd
Data Access Exception
ok 
---

On SS20:
---
Type  help  for more information
ok boot floppy
Boot device: /obio/SUNW,fdtwo  File and args:
>> NetBSD/sparc Secondary Boot, Revision 1.15
>> (builds@b8.netbsd.org, Thu Jul 30 00:08:01 UTC 2009)
Booting netbsd
Data Access Exception
ok
---

>Fix:
It looks support of booting from RAID in stand/common/promdev.c rev 1.19
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/sparc/stand/common/promdev.c#rev1.19
causes this problem and disabling disklabel read to check RAID partition
in promdev.c:devopen() fixes it.

Probably PROM routine is confused by opening the same floppy device
more than once?

The following patch checks boot device and skip RAID check on floppy boot,
and it fixes the problem.

---
Index: promdev.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/stand/common/promdev.c,v
retrieving revision 1.21
diff -u -r1.21 promdev.c
--- promdev.c	5 Apr 2008 06:39:08 -0000	1.21
+++ promdev.c	15 Oct 2009 15:21:48 -0000
@@ -215,6 +215,13 @@
 #endif

 		/*
+		 * Don't check disklabel on floppy boot.
+		 */
+		if (strncmp(prom_bootdevice, "fd", 2) == 0 ||
+		    strstr(prom_bootdevice, "SUNW,fdtwo") != NULL)
+			return 0;
+
+		/*
 		 * We need to read from the raw partition (i.e. the
 		 * beginning of the disk in order to check the NetBSD
 		 * disklabel to see if the boot partition is type RAID.

---

The GENERIC kernel still has another problem around floppy access
(it gets soft error or hard error even after floppy boot),
but I'll file another PR for it.

---
Izumi Tsutsui

>Release-Note:

>Audit-Trail:
From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@NetBSD.org
Cc: port-sparc-maintainer@netbsd.org, gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org
Subject: re: port-sparc/42186: sparc boot floppy "Data Access Exception" error
Date: Sat, 17 Oct 2009 03:53:05 +1100


    ---
    Index: promdev.c
    ===================================================================
    RCS file: /cvsroot/src/sys/arch/sparc/stand/common/promdev.c,v
    retrieving revision 1.21
    diff -u -r1.21 promdev.c
    --- promdev.c	5 Apr 2008 06:39:08 -0000	1.21
    +++ promdev.c	15 Oct 2009 15:21:48 -0000
    @@ -215,6 +215,13 @@
     #endif

     		/*
    +		 * Don't check disklabel on floppy boot.
    +		 */
    +		if (strncmp(prom_bootdevice, "fd", 2) == 0 ||
    +		    strstr(prom_bootdevice, "SUNW,fdtwo") != NULL)
    +			return 0;
    +

 can you also check for "SUNW,fdthree"?

 i think those only exist on sparc64 systems, but i know that the
 plan is to have those marged...


 .mrg.

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org, mrg@eterna.com.au
Cc: port-sparc-maintainer@NetBSD.org, gnats-admin@NetBSD.org,
        netbsd-bugs@NetBSD.org, tsutsui@ceres.dti.ne.jp
Subject: Re: port-sparc/42186: sparc boot floppy "Data Access Exception" error
Date: Sat, 17 Oct 2009 21:10:21 +0900

 >      		/*
 >     +		 * Don't check disklabel on floppy boot.
 >     +		 */
 >     +		if (strncmp(prom_bootdevice, "fd", 2) == 0 ||
 >     +		    strstr(prom_bootdevice, "SUNW,fdtwo") != NULL)
 >     +			return 0;
 >     +
 >  
 >  can you also check for "SUNW,fdthree"?
 >  
 >  i think those only exist on sparc64 systems, but i know that the
 >  plan is to have those marged...

 It's no problem to add sparc64 stuff for me, but I wonder if
 the prom_bootdevice passed from firmware is really SUNW,fdthree.
 sys/arch/sparc64/dev/fdc.c uses "fdthree" (without SUNW,)
 and several dmesg also shows fdthree too:

 >> fdthree at ebus0 addr 3023f0-3023f7, 706000-70600f, 720000-720003 ipl 39 not configured

 ---
 Izumi Tsutsui

From: matthew green <mrg@eterna.com.au>
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Cc: port-sparc-maintainer@NetBSD.org, gnats-admin@NetBSD.org,
    netbsd-bugs@NetBSD.org, gnats-bugs@NetBSD.org
Subject: re: port-sparc/42186: sparc boot floppy "Data Access Exception" error
Date: Sun, 18 Oct 2009 11:48:48 +1100


    It's no problem to add sparc64 stuff for me, but I wonder if
    the prom_bootdevice passed from firmware is really SUNW,fdthree.
    sys/arch/sparc64/dev/fdc.c uses "fdthree" (without SUNW,)
    and several dmesg also shows fdthree too:

    >> fdthree at ebus0 addr 3023f0-3023f7, 706000-70600f, 720000-720003 ipl 39 not configured


 right you are.  it's been a few years :)


 .mrg.

From: Izumi Tsutsui <tsutsui@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/42186 CVS commit: src/sys/arch/sparc/stand/common
Date: Sun, 18 Oct 2009 06:24:22 +0000

 Module Name:	src
 Committed By:	tsutsui
 Date:		Sun Oct 18 06:24:22 UTC 2009

 Modified Files:
 	src/sys/arch/sparc/stand/common: promdev.c

 Log Message:
 Don't try to read disklabel to check FS_RAID on floppy boot since
 reopening floppy could cause Data Access Exception later.
 Fixes PR port-sparc/42186, ok'ed by mrg@.


 To generate a diff of this commit:
 cvs rdiff -u -r1.22 -r1.23 src/sys/arch/sparc/stand/common/promdev.c

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

Responsible-Changed-From-To: port-sparc-maintainer->tsutsui
Responsible-Changed-By: tsutsui@NetBSD.org
Responsible-Changed-When: Fri, 25 Dec 2009 00:31:32 +0900
Responsible-Changed-Why:


State-Changed-From-To: open->pending-pullups
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Fri, 25 Dec 2009 00:31:32 +0900
State-Changed-Why:
All netbsd-4 and netbsd-5 branches should have this fix.


From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/42186 CVS commit: [netbsd-5] src
Date: Sat, 23 Jan 2010 17:47:37 +0000

 Module Name:	src
 Committed By:	bouyer
 Date:		Sat Jan 23 17:47:37 UTC 2010

 Modified Files:
 	src/distrib/sparc/miniroot [netbsd-5]: Makefile.inc
 	src/distrib/sparc/ramdisk [netbsd-5]: dot.profile
 	src/sys/arch/sparc/dev [netbsd-5]: audioamd.c fd.c
 	src/sys/arch/sparc/sparc [netbsd-5]: auxreg.h
 	src/sys/arch/sparc/stand/common [netbsd-5]: promdev.c

 Log Message:
 Pull up following revision(s) (requested by tsutsui in ticket #1251):
 	sys/arch/sparc/sparc/auxreg.h: revision 1.13
 	distrib/sparc/ramdisk/dot.profile: revision 1.20
 	sys/arch/sparc/dev/audioamd.c: revision 1.25
 	sys/arch/sparc/dev/fd.c: revision 1.147
 	sys/arch/sparc/stand/common/promdev.c: revision 1.23
 	distrib/sparc/miniroot/Makefile.inc: revision 1.16
 Build miniroot binaries for sparc with -Os to shrink instfs.tgz
 for the second boot floppy which use miniroot objects.
 This is workaround for PR install/42146, and ok'ed by mrg@.
 Don't try to read disklabel to check FS_RAID on floppy boot since
 reopening floppy could cause Data Access Exception later.
 Fixes PR port-sparc/42186, ok'ed by mrg@.
 Disable "fast trap" handlers which invoke software interrupts
 in sparc/amd7930intr.s and sparc/bsd_fdintr.s until they are
 rewritten to adapt new MI softint(9) API.
 No particular comments on PR port-sparc/42192, but
 this fixes timeout problem on floppy access on my SPARCstation 1+.
 XXX: floppy support on sun4m seems to have another problem (data overrun).
 Use /dev/fd0a rather than /dev/rfd0a to read instfs.tgz image from floppy.
 It looks newer (appearred after 1.6) gzip tries to read less than DEV_BSIZE
 (to check header?) so we can't use raw device directly.
 (note sparc bootfs ramdisk doesn't have dd(1))
 Workaround for PR port-sparc/42193, and would also fix PR install/28734.
 Explicitly clear AUXIO4M_FTC bit in FTC_FLIP macro used on
 pseudo-dma for floppy, as well as AUXIO4C_FTC bit for sun4c.
 A comment in the macro says AUXIO4M_FTC bit is auto-clear,
 but my two SS20s (including compatible) with 150MHz hyperSPARCs
 get data_overrun without it, and no bad side effect on SS5
 (works with and without this change).
 Closes PR port-sparc/42516, which is the last one of a bunch of
 floppy issue on NetBSD/sparc since NetBSD 2.0 days. See
 http://mail-index.NetBSD.org/port-sparc/2009/12/20/msg000484.html
 for details.


 To generate a diff of this commit:
 cvs rdiff -u -r1.12 -r1.12.34.1 src/distrib/sparc/miniroot/Makefile.inc
 cvs rdiff -u -r1.19 -r1.19.4.1 src/distrib/sparc/ramdisk/dot.profile
 cvs rdiff -u -r1.23 -r1.23.28.1 src/sys/arch/sparc/dev/audioamd.c
 cvs rdiff -u -r1.141 -r1.141.6.1 src/sys/arch/sparc/dev/fd.c
 cvs rdiff -u -r1.12 -r1.12.88.1 src/sys/arch/sparc/sparc/auxreg.h
 cvs rdiff -u -r1.21 -r1.21.14.1 src/sys/arch/sparc/stand/common/promdev.c

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

From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/42186 CVS commit: [netbsd-4] src
Date: Wed, 27 Jan 2010 20:59:46 +0000

 Module Name:	src
 Committed By:	bouyer
 Date:		Wed Jan 27 20:59:46 UTC 2010

 Modified Files:
 	src/distrib/sparc/ramdisk [netbsd-4]: dot.profile
 	src/sys/arch/sparc/sparc [netbsd-4]: auxreg.h
 	src/sys/arch/sparc/stand/common [netbsd-4]: promdev.c

 Log Message:
 Pull up following revision(s) (requested by tsutsui in ticket #1379):
 	sys/arch/sparc/sparc/auxreg.h: revision 1.13
 	distrib/sparc/ramdisk/dot.profile: revision 1.20
 	sys/arch/sparc/stand/common/promdev.c: revision 1.23
 Don't try to read disklabel to check FS_RAID on floppy boot since
 reopening floppy could cause Data Access Exception later.
 Fixes PR port-sparc/42186, ok'ed by mrg@.
 Use /dev/fd0a rather than /dev/rfd0a to read instfs.tgz image from floppy.
 It looks newer (appearred after 1.6) gzip tries to read less than DEV_BSIZE
 (to check header?) so we can't use raw device directly.
 (note sparc bootfs ramdisk doesn't have dd(1))
 Workaround for PR port-sparc/42193, and would also fix PR install/28734.
 Explicitly clear AUXIO4M_FTC bit in FTC_FLIP macro used on
 pseudo-dma for floppy, as well as AUXIO4C_FTC bit for sun4c.
 A comment in the macro says AUXIO4M_FTC bit is auto-clear,
 but my two SS20s (including compatible) with 150MHz hyperSPARCs
 get data_overrun without it, and no bad side effect on SS5
 (works with and without this change).
 Closes PR port-sparc/42516, which is the last one of a bunch of
 floppy issue on NetBSD/sparc since NetBSD 2.0 days. See
 http://mail-index.NetBSD.org/port-sparc/2009/12/20/msg000484.html
 for details.


 To generate a diff of this commit:
 cvs rdiff -u -r1.18 -r1.18.16.1 src/distrib/sparc/ramdisk/dot.profile
 cvs rdiff -u -r1.12 -r1.12.24.1 src/sys/arch/sparc/sparc/auxreg.h
 cvs rdiff -u -r1.20.8.1 -r1.20.8.2 src/sys/arch/sparc/stand/common/promdev.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: tsutsui@NetBSD.org
State-Changed-When: Thu, 28 Jan 2010 22:58:14 +0900
State-Changed-Why:
Pulled up to netbsd-4 and 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-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.