NetBSD Problem Report #42192
From tsutsui@ceres.dti.ne.jp Sat Oct 17 15:50:19 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 7840C63BC1C
for <gnats-bugs@gnats.NetBSD.org>; Sat, 17 Oct 2009 15:50:19 +0000 (UTC)
Message-Id: <200910171550.n9HFoGwj010232@mirage.ceres.dti.ne.jp>
Date: Sun, 18 Oct 2009 00:50:16 +0900 (JST)
From: tsutsui@ceres.dti.ne.jp
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@gnats.NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: cannot access floppy on SPARCstation 1+
X-Send-Pr-Version: 3.95
>Number: 42192
>Category: port-sparc
>Synopsis: cannot access floppy on SPARCstation 1+
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: tsutsui
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Oct 17 15:55:00 +0000 2009
>Closed-Date: Sat Jan 23 23:40:20 +0000 2010
>Last-Modified: Sat Jan 23 23:40:20 +0000 2010
>Originator: Izumi Tsutsui
>Release: NetBSD 5.0.1
>Organization:
>Environment:
System: NetBSD 5.0.1
Architecture: sparc
Machine: SPARCstation 1+
>Description:
On 5.0.1 miniroot, any floppy access (at least against /dev/rfd0a)
causes timeouts and hard errors (due to lost interrupts?)
on SPARCstation 1+.
On 4.0.1 miniroot it works fine.
>How-To-Repeat:
Boot 5.0.1 miniroot.fs and try to read/write floppy:
---
Type help for more information
ok boot sd(,,1)
Booting from: sd(0,0,1)
>> NetBSD/sparc Secondary Boot, Revision 1.15
>> (builds@b8.netbsd.org, Thu Jul 30 00:08:01 UTC 2009)
Booting netbsd
3494392+98988+323288 [231376+218885]=0x43a5d8
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
NetBSD 5.0.1 (GENERIC) #0: Thu Jul 30 00:21:28 UTC 2009
builds@b8.netbsd.org:/home/builds/ab/netbsd-5-0-1-RELEASE/sparc/200907292356Z-obj/home/builds/ab/netbsd-5-0-1-RELEASE/src/sys/arch/sparc/compile/GENERIC
total memory = 65484 KB
avail memory = 59684 KB
bootpath: /sbus0/esp0/sd@0,0:b
mainbus0 (root): Sun 4/65: hostid 53009494
cpu0 at mainbus0: MB86900/1A or L64801 @ 25 MHz, WTL3170/2 FPU
cpu0: 64K byte write-through, 16 bytes/line, sw flush: cache enabled
:
fdc0 at mainbus0 ioaddr 0xf7200000 ipl 11 softpri 4: chip 82072
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
:
root file system type: ffs
WARNING: clock gained 79 days
WARNING: CHECK AND RESET THE DATE!
erase ^H, werase ^W, kill ^U, intr ^C
If you are using a SUN type 4 keyboard, please enter "sun-type4".
Terminal type? [sun]
Erase is backspace.
This installer now uses the new `sysinst' installer tool by default. To
use the old install or upgrade shell scripts instead, enter the options
(OI) for Old Install or (OU) for Old Upgrade.
The script-based installers may be removed in a future release.
(I)nstall/Upgrade, (H)alt or (S)hell? s
# dd if=/dev/rfd0a of=/dev/null
fd0: timeout: state 10
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0a: hard error reading fsbn 0
fd0: controller status: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 10
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0a: hard error reading fsbn 0
fd0: controller status: state 13 (st0 c0<invld,abnrml> cyl 0)
dd: /dev/rfd0a: Input/output error
0+0 records in
0+0 records out
0 bytes transferred in 5.770 secs (0 bytes/sec)
# dd if=/dev/zero of=/dev/rfd0a
fd0: timeout: state 10
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0a: hard error reading fsbn 0
fd0: controller status: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 10
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0: timeout: state 13 (st0 c0<invld,abnrml> cyl 0)
fd0a: hard error writing fsbn 0
fd0: controller status: state 13 (st0 c0<invld,abnrml> cyl 0)
dd: /dev/rfd0a: Input/output error
1+0 records in
0+0 records out
0 bytes transferred in 5.748 secs (0 bytes/sec)
#
---
4.0.1 works on the same machine as following:
---
ok boot sd(,,1)
Booting from: sd(0,0,1)
>> NetBSD/sparc Secondary Boot, Revision 1.15
>> (builds@wb28, Wed Oct 8 00:13:03 PDT 2008)
Booting netbsd
3297272+106168+202196 [204480+192063]=0x3e1500
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
NetBSD 4.0.1 (GENERIC) #0: Wed Oct 8 01:06:02 PDT 2008
builds@wb28:/home/builds/ab/netbsd-4-0-1-RELEASE/sparc/200810080053Z-obj/home/builds/ab/netbsd-4-0-1-RELEASE/src/sys/arch/sparc/compile/GENERIC
total memory = 65484 KB
avail memory = 60024 KB
timecounter: Timecounters tick every 10.000 msec
bootpath: /sbus0/esp0/sd@0,0:b
mainbus0 (root): Sun 4/65: hostid 53009494
:
fdc0 at mainbus0 ioaddr 0xf7200000 ipl 11 softpri 4: chip 82072
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
:
The script-based installers may be removed in a future release.
(I)nstall/Upgrade, (H)alt or (S)hell? s
# dd if=/dev/rfd0a of=/dev/null
^C36+0 records in
36+0 records out
18432 bytes transferred in 7.596 secs (2426 bytes/sec)
# dd if=/dev/zero of=/dev/rfd0a
^C27+0 records in
26+0 records out
13312 bytes transferred in 5.484 secs (2427 bytes/sec)
#
---
>Fix:
Not investigated yet.
One possibility is around MI softint(9) changes after 4.0?
---
Izumi Tsutsui
>Release-Note:
>Audit-Trail:
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: port-sparc-maintainer@NetBSD.org, gnats-admin@NetBSD.org,
netbsd-bugs@NetBSD.org, tsutsui@ceres.dti.ne.jp
Subject: Re: port-sparc/42192: cannot access floppy on SPARCstation 1+
Date: Sun, 18 Oct 2009 15:39:32 +0900
>Synopsis: cannot access floppy on SPARCstation 1+
>Fix:
> One possibility is around MI softint(9) changes after 4.0?
It looks sys/arch/sparc/sparc/bsd_fdintr.s still has
old MD softintr stuff so it should be updated to
newer MI softint(9) API.
sys/arch/sparc/sparc/amd7930intr.s has the same problem.
I've tried the following dumb patch but it causes a weird panic,
so maybe I hope someone[tm] who knows sparc asm take a look at this..
---
Index: dev/fd.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/dev/fd.c,v
retrieving revision 1.146
diff -u -r1.146 fd.c
--- dev/fd.c 25 May 2009 19:22:53 -0000 1.146
+++ dev/fd.c 18 Oct 2009 06:29:10 -0000
@@ -210,6 +210,7 @@
};
extern struct fdcio *fdciop; /* I/O descriptor used in fdintr.s */
+extern void *fdc_sicookie; /* si cookie used in fdintr.s */
/* controller driver configuration */
int fdcmatch_mainbus(struct device *, struct cfdata *, void *);
@@ -651,6 +652,7 @@
fdc->sc_dev.dv_xname);
return (-1);
}
+ fdc_sicookie = fdc->sc_sicookie;
printf(" softpri %d: chip 8207%c\n", IPL_SOFTFDC, code);
evcnt_attach_dynamic(&fdc->sc_intrcnt, EVCNT_TYPE_INTR, NULL,
Index: sparc/bsd_fdintr.s
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/sparc/bsd_fdintr.s,v
retrieving revision 1.27
diff -u -r1.27 bsd_fdintr.s
--- sparc/bsd_fdintr.s 17 Oct 2007 19:57:14 -0000 1.27
+++ sparc/bsd_fdintr.s 18 Oct 2009 06:29:10 -0000
@@ -43,6 +43,7 @@
#include <sparc/dev/fdreg.h>
#include <sparc/dev/fdvar.h>
+#if 0
#define FD_SET_SWINTR_4C \
sethi %hi(INTRREG_VA), %l5; \
ldub [%l5 + %lo(INTRREG_VA)], %l6; \
@@ -72,6 +73,12 @@
FD_SET_SWINTR_4M; \
9:
#endif
+#else
+#define FD_SET_SWINTR \
+ sethi %hi(_C_LABEL(fdc_sicookie)), %l5; \
+ call _C_LABEL(softint_schedule); \
+ ld [%l5 + %lo(_C_LABEL(fdc_sicookie))], %o0;
+#endif
! flip TC bit in auxreg
! assumes %l6 remains unchanged between ASSERT and DEASSERT
@@ -158,6 +165,9 @@
.global _C_LABEL(fdciop)
_C_LABEL(fdciop):
.word 0
+ .global _C_LABEL(fdc_sicookie)
+_C_LABEL(fdc_sicookie):
+ .word 0
.seg "text"
.align 4
---
NetBSD 5.99.20 (GENERIC) #97: Sun Oct 18 15:29:36 JST 2009
tsutsui@mirage:/usr/src/sys/arch/sparc/compile/GENERIC
total memory = 65484 KB
avail memory = 59544 KB
:
# dd if=/dev/rfd0a | tar ztvf -
drwxr-xr-x 2 root wheel 0 Dec 16 2007 .
drwxr-xr-x 2 root wheel 0 Dec 16 2007 ./bin
-r-xr-xr-x 1 root wheel 2045616 Dec 16 2007 ./bin/cat
trap type 0x7: pc=0xf01472c0 npc=0xf01472c4 psr=0x4000c4<S,PS>
kernel: alignment fault trap
Stopped in pid 0.2 (system) at netbsd:kpreempt_enable+0x8: ld [
%g1 + 0x1bc], %g2
db> tr
kpreempt_enable(0xf36aad20, 0xf36aad20, 0x0, 0xba5e187d, 0x3e06748c, 0xb781dc6d)
at netbsd:sched_curcpu_runnable_p+0x3c
sched_curcpu_runnable_p(0x0, 0x0, 0xc, 0x0, 0xffff, 0x400fe0) at netbsd:idle_loo
p+0x120
idle_loop(0xf36aad20, 0xf36aad20, 0xf03dd800, 0xf02ad400, 0x0, 0x897) at netbsd:
lwp_setfunc_trampoline
db> examine/i f01472bc
netbsd:kpreempt_enable+0x4: sethi %hi(0xf0002000), %g1
db> examine/i f01472c0
netbsd:kpreempt_enable+0x8: ld [%g1 + 0x1bc], %g2
db> examine/i f01472c4
netbsd:kpreempt_enable+0xc: ld [%g2 + 0x1f8], %g1
db> show reg
psr 0x4000c4
pc 0xf01472c0 kpreempt_enable+0x8
npc 0xf01472c4 kpreempt_enable+0xc
y 0
wim 0x10c6
g0 0
g1 0x4000c3
g2 0xf36aad20
g3 0xf0002000
g4 0xf36aad20
g5 0xffffffff
g6 0xf3a47000
g7 0
o0 0x1
o1 0xf02875b4 statintr_4
o2 0xf0002000
o3 0
o4 0
o5 0xb00
o6 0xf3a48e18
o7 0xf0008b4c sparc_interrupt44c+0x130
l0 0xc5
l1 0xf013e560 sched_curcpu_runnable_p+0x44
l2 0xf013e564 sched_curcpu_runnable_p+0x48
l3 0xf4071600
l4 0
l5 0x1
l6 0xfe00e000
l7 0xf0398630 ppp_bsd_compress+0x44
i0 0xf36aad20
i1 0xf36aad20
i2 0
i3 0xba5e187d
i4 0x3e06748c
i5 0xb781dc6d
i6 0xf3a48e80
i7 0xf013e558 sched_curcpu_runnable_p+0x3c
netbsd:kpreempt_enable+0x8: ld [%g1 + 0x1bc], %g2
db>
---
Izumi Tsutsui
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: port-sparc-maintainer@NetBSD.org, gnats-admin@NetBSD.org,
netbsd-bugs@NetBSD.org, tsutsui@ceres.dti.ne.jp
Subject: Re: port-sparc/42192: cannot access floppy on SPARCstation 1+
Date: Mon, 14 Dec 2009 23:53:51 +0900
> >Synopsis: cannot access floppy on SPARCstation 1+
> >Fix:
> > One possibility is around MI softint(9) changes after 4.0?
>
> It looks sys/arch/sparc/sparc/bsd_fdintr.s still has
> old MD softintr stuff so it should be updated to
> newer MI softint(9) API.
Okay, the following patch (disabling "fast trap" hander?)
could be a workaround at least on my SS1+.
audioamd also works.
Is it okay to commit this for workaround?
Index: dev/audioamd.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/dev/audioamd.c,v
retrieving revision 1.24
diff -u -r1.24 audioamd.c
--- dev/audioamd.c 17 Sep 2009 12:38:11 -0000 1.24
+++ dev/audioamd.c 14 Dec 2009 14:51:07 -0000
@@ -308,7 +308,13 @@
sc->sc_au.au_bt = sc->sc_bt;
sc->sc_au.au_bh = sc->sc_bh;
(void)bus_intr_establish2(sc->sc_bt, pri, IPL_HIGH,
- am7930hwintr, sc, amd7930_trap);
+ am7930hwintr, sc,
+#ifdef notyet /* XXX amd7930intr.s needs to be fixed for MI softint(9) */
+ amd7930_trap
+#else
+ NULL
+#endif
+ );
sc->sc_sicookie = softint_establish(SOFTINT_SERIAL, am7930swintr, sc);
if (sc->sc_sicookie == NULL) {
Index: dev/fd.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/dev/fd.c,v
retrieving revision 1.146
diff -u -r1.146 fd.c
--- dev/fd.c 25 May 2009 19:22:53 -0000 1.146
+++ dev/fd.c 14 Dec 2009 14:51:07 -0000
@@ -639,7 +639,13 @@
fdciop = &fdc->sc_io;
if (bus_intr_establish2(fdc->sc_bustag, pri, 0,
- fdc_c_hwintr, fdc, fdchwintr) == NULL) {
+ fdc_c_hwintr, fdc,
+#ifdef notyet /* XXX bsd_fdintr.s needs to be fixed for MI softint(9) */
+ fdchwintr
+#else
+ NULL
+#endif
+ ) == NULL) {
printf("\n%s: cannot register interrupt handler\n",
fdc->sc_dev.dv_xname);
return (-1);
---
Izumi Tsutsui
From: Izumi Tsutsui <tsutsui@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/42192 CVS commit: src/sys/arch/sparc/dev
Date: Sat, 19 Dec 2009 10:34:18 +0000
Module Name: src
Committed By: tsutsui
Date: Sat Dec 19 10:34:18 UTC 2009
Modified Files:
src/sys/arch/sparc/dev: audioamd.c fd.c
Log Message:
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).
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sparc/dev/audioamd.c
cvs rdiff -u -r1.146 -r1.147 src/sys/arch/sparc/dev/fd.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:32:49 +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:32:49 +0900
State-Changed-Why:
Both netbsd-5 and netbsd-5-0 need this fix.
From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/42192 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.
State-Changed-From-To: pending-pullups->closed
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Sun, 24 Jan 2010 08:40:20 +0900
State-Changed-Why:
Pulled up to netbsd-5.
>Unformatted:
(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.