NetBSD Problem Report #37464
From martin@duskware.de Sun Dec 2 22:47:41 2007
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by narn.NetBSD.org (Postfix) with ESMTP id 75D4263B935
for <gnats-bugs@gnats.netbsd.org>; Sun, 2 Dec 2007 22:47:41 +0000 (UTC)
Message-Id: <20071202223946.1E2B263B867@narn.NetBSD.org>
Date: Sun, 2 Dec 2007 22:39:46 +0000 (UTC)
From: alanh@fairlite.demon.co.uk
Reply-To: alanh@fairlite.demon.co.uk
To: netbsd-bugs-owner@NetBSD.org
Subject: NetBSD 3.1 doesn't boot on Atari Falcon
X-Send-Pr-Version: www-1.0
>Number: 37464
>Category: port-atari
>Synopsis: NetBSD 3.1 doesn't boot on Atari Falcon
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: tsutsui
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Dec 02 22:50:00 +0000 2007
>Closed-Date: Thu Dec 06 14:46:34 +0000 2007
>Last-Modified: Sat Feb 02 03:35:01 +0000 2008
>Originator: Alan Hourihane
>Release: 3.1
>Organization:
>Environment:
>Description:
Trying to boot the NetBSD-BOOTX or NetBSD-BOOT kernel on a Falcon results in a crash with the following backtrace...
panic: MMU fault
cpu_Debugger(2300,8,6a21e,169a88,e682c) + 6
panic(109977,8,1,6a21e,12286c) + f8
panictrap(8,4020715,1,169b18) + 9a
trap(8,4020715,1) + 438
mb_bus_space_write_1(1d2c00,0,0,2,1d2c00,1f9e80,0,a0) + 22
wdcprobe1(169d04,1,169e1c,cf69e,169d04) + 14a
wdcprobe(169d04,1f9f80,0,10fda0,169e5c) + 20
wdc_mb_probe(1f9f80,10fff0,f40df) + 150
mapply(169e5c,10fff0) + 66
config_search_loc(0,1f9f80,0,0,f40df) + a2
config_found_sm_loc(1f9f80,0,0,f40df,e1326,0,1f9f80,0,0,109330,e1326) + 26
mbattach(0,1f9f80,109e1e,10931e,10931e) + 110
config_attach_loc(0,110028,0,10931e,0) + 2d4
config_rootfound(10931e,10931e) + 2e
cpu_configure(d,169fa4,472bc,8,3) + 18
configure(8,3,dfffffc,0,0) + 3a
main(169fb0) + 2f2
>How-To-Repeat:
boot the netbsd kernel ready for installation
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: install-manager->port-atari-maintainer
Responsible-Changed-By: tsutsui@netbsd.org
Responsible-Changed-When: Mon, 03 Dec 2007 23:06:59 +0900
Responsible-Changed-Why:
Atari specific problem.
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org,
tsutsui@ceres.dti.ne.jp
Subject: Re: port-atari/37464: NetBSD 3.1 doesn't boot on Atari Falcon
Date: Mon, 3 Dec 2007 23:10:50 +0900
alanh@fairlite.demon.co.uk wrote:
> >Synopsis: NetBSD 3.1 doesn't boot on Atari Falcon
How about this one?
http://www.ceres.dti.ne.jp/~tsutsui/netbsd/netbsd-atari-BOOTX-3.1.gz
Index: wdc_mb.c
===================================================================
RCS file: /cvsroot/src/sys/arch/atari/dev/wdc_mb.c,v
retrieving revision 1.24
diff -u -r1.24 wdc_mb.c
--- wdc_mb.c 20 Aug 2004 06:39:38 -0000 1.24
+++ wdc_mb.c 3 Dec 2007 14:03:03 -0000
@@ -60,6 +60,11 @@
#include <atari/dev/ym2149reg.h>
#include <atari/atari/device.h>
+/* Falcon IDE register locations (base and offsets). */
+#define FALCON_WD_BASE 0xfff00000
+#define FALCON_WD_LEN 0x40
+#define FALCON_WD_AUX 0x38
+
/*
* XXX This code currently doesn't even try to allow 32-bit data port use.
*/
@@ -95,7 +100,7 @@
struct ata_channel ch;
struct wdc_softc wdc;
struct wdc_regs wdr;
- int result = 0;
+ int result = 0, i;
u_char sv_ierb;
if ((machineid & ATARI_TT) || strcmp("wdc", aux) || wdc_matched)
@@ -111,14 +116,22 @@
wdr.cmd_iot = wdr.ctl_iot = mb_alloc_bus_space_tag();
if (wdr.cmd_iot == NULL)
return 0;
- wdr.cmd_iot->stride = 2;
+ wdr.cmd_iot->stride = 0;
wdr.cmd_iot->wo_1 = 1;
- if (bus_space_map(wdr.cmd_iot, 0xfff00000, 0x40, 0, &wdr.cmd_baseioh))
- return 0;
- if (bus_space_subregion(wdr.cmd_iot, wdr.cmd_baseioh, 0x38, 1,
+ if (bus_space_map(wdr.cmd_iot, FALCON_WD_BASE, FALCON_WD_LEN, 0,
+ &wdr.cmd_baseioh))
+ goto out;
+ for (i = 0; i < WDC_NREG; i++) {
+ if (bus_space_subregion(wdr.cmd_iot, wdr.cmd_baseioh,
+ i * 4, 4, &wdr.cmd_iohs[i]) != 0)
+ goto outunmap;
+ }
+ wdc_init_shadow_regs(&ch);
+
+ if (bus_space_subregion(wdr.cmd_iot, wdr.cmd_baseioh, FALCON_WD_AUX, 4,
&wdr.ctl_ioh))
- return 0;
+ goto outunmap;
/*
* Make sure IDE interrupts are disabled during probing.
@@ -136,7 +149,9 @@
MFP->mf_ierb = sv_ierb;
- bus_space_unmap(wdr.cmd_iot, wdr.cmd_baseioh, 0x40);
+ outunmap:
+ bus_space_unmap(wdr.cmd_iot, wdr.cmd_baseioh, FALCON_WD_LEN);
+ out:
mb_free_bus_space_tag(wdr.cmd_iot);
if (result)
@@ -151,25 +166,37 @@
{
struct wdc_mb_softc *sc = (void *)self;
struct wdc_regs *wdr;
+ int i;
printf("\n");
sc->sc_wdcdev.regs = wdr = &sc->sc_wdc_regs;
wdr->cmd_iot = wdr->ctl_iot =
mb_alloc_bus_space_tag();
- wdr->cmd_iot->stride = 2;
+ wdr->cmd_iot->stride = 0;
wdr->cmd_iot->wo_1 = 1;
wdr->cmd_iot->abs_rms_2 = read_multi_2_swap;
wdr->cmd_iot->abs_wms_2 = write_multi_2_swap;
- if (bus_space_map(wdr->cmd_iot, 0xfff00000, 0x40, 0,
+ if (bus_space_map(wdr->cmd_iot, FALCON_WD_BASE, FALCON_WD_LEN, 0,
&wdr->cmd_baseioh)) {
printf("%s: couldn't map registers\n",
sc->sc_wdcdev.sc_atac.atac_dev.dv_xname);
return;
}
+ for (i = 0; i < WDC_NREG; i++) {
+ if (bus_space_subregion(wdr->cmd_iot, wdr->cmd_baseioh,
+ i * 4, 4, &wdr->cmd_iohs[i]) != 0) {
+ bus_space_unmap(wdr->cmd_iot, wdr->cmd_baseioh,
+ FALCON_WD_LEN);
+ return;
+ }
+ }
+
if (bus_space_subregion(wdr->cmd_iot,
- wdr->cmd_baseioh, 0x38, 1, &wdr->ctl_ioh))
+ wdr->cmd_baseioh, FALCON_WD_AUX, 4, &wdr->ctl_ioh)) {
+ bus_space_unmap(wdr->cmd_iot, wdr->cmd_baseioh, FALCON_WD_LEN);
return;
+ }
/*
* Play a nasty trick here. Normally we only manipulate the
@@ -189,6 +216,7 @@
sc->sc_channel.ch_channel = 0;
sc->sc_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
sc->sc_channel.ch_queue = &sc->sc_chqueue;
+ wdc_init_shadow_regs(&sc->sc_channel);
/*
* Setup & enable disk related interrupts.
---
Izumi Tsutsui
Responsible-Changed-From-To: port-atari-maintainer->tsutsui
Responsible-Changed-By: tsutsui@netbsd.org
Responsible-Changed-When: Mon, 03 Dec 2007 23:51:15 +0900
Responsible-Changed-Why:
I'll take a look.
State-Changed-From-To: open->feedback
State-Changed-By: tsutsui@netbsd.org
State-Changed-When: Mon, 03 Dec 2007 23:51:15 +0900
State-Changed-Why:
Patch provided.
From: Alan Hourihane <alanh@fairlite.demon.co.uk>
To: gnats-bugs@NetBSD.org
Cc: port-atari-maintainer@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: port-atari/37464: NetBSD 3.1 doesn't boot on Atari Falcon
Date: Mon, 03 Dec 2007 14:33:37 +0000
Excellent.
The new boot image fixes the problem.
Thanks.
Alan.
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: alanh@fairlite.demon.co.uk
Cc: 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/37464: NetBSD 3.1 doesn't boot on Atari Falcon
Date: Tue, 4 Dec 2007 03:00:31 +0900
alanh@fairlite.demon.co.uk wrote:
> Excellent.
>
> The new boot image fixes the problem.
Thanks, could you also try a patched 4.0_RC5 kernel
to see if the similar patch works for a recent source?
http://www.ceres.dti.ne.jp/~tsutsui/netbsd/netbsd-atari-BOOTX-4.0_RC5.gz
Index: wdc_mb.c
===================================================================
RCS file: /cvsroot/src/sys/arch/atari/dev/wdc_mb.c,v
retrieving revision 1.28
diff -u -r1.28 wdc_mb.c
--- wdc_mb.c 29 Jan 2006 21:42:41 -0000 1.28
+++ wdc_mb.c 3 Dec 2007 17:56:04 -0000
@@ -63,19 +63,7 @@
/* Falcon IDE register locations (base and offsets). */
#define FALCON_WD_BASE 0xfff00000
#define FALCON_WD_LEN 0x40
-
-static int falcon_wd_reg[WDC_NREG + WDC_NSHADOWREG] = {
- 0x00, /* wd_data */
- 0x05, /* wd_error */
- 0x09, /* wd_seccnt */
- 0x0d, /* wd_sector */
- 0x11, /* wd_cyl_lo */
- 0x15, /* wd_cyl_hi */
- 0x19, /* wd_sdh */
- 0x1d, /* wd_command */
- 0x39, /* wd_status */
- 0x01 /* wd_features */
- };
+#define FALCON_WD_AUX 0x38
/*
* XXX This code currently doesn't even try to allow 32-bit data port use.
@@ -128,19 +116,22 @@
wdr.cmd_iot = wdr.ctl_iot = mb_alloc_bus_space_tag();
if (wdr.cmd_iot == NULL)
return 0;
- wdr.cmd_iot->stride = 2;
+ wdr.cmd_iot->stride = 0;
wdr.cmd_iot->wo_1 = 1;
if (bus_space_map(wdr.cmd_iot, FALCON_WD_BASE, FALCON_WD_LEN, 0,
&wdr.cmd_baseioh))
- return 0;
- for (i = 0; i < (WDC_NREG + WDC_NSHADOWREG); i++)
+ goto out;
+ for (i = 0; i < WDC_NREG; i++) {
if (bus_space_subregion(wdr.cmd_iot, wdr.cmd_baseioh,
- falcon_wd_reg[i], i == 0 ? 2 : 1, &wdr.cmd_iohs[i]) != 0) {
- bus_space_unmap(wdr.cmd_iot, wdr.cmd_baseioh,
- FALCON_WD_LEN);
- return 0;
- }
+ i * 4, 4, &wdr.cmd_iohs[i]) != 0)
+ goto outunmap;
+ }
+ wdc_init_shadow_regs(&ch);
+
+ if (bus_space_subregion(wdr.cmd_iot, wdr.cmd_baseioh, FALCON_WD_AUX, 4,
+ &wdr.ctl_ioh))
+ goto outunmap;
/*
* Make sure IDE interrupts are disabled during probing.
@@ -158,7 +149,9 @@
MFP->mf_ierb = sv_ierb;
+ outunmap:
bus_space_unmap(wdr.cmd_iot, wdr.cmd_baseioh, FALCON_WD_LEN);
+ out:
mb_free_bus_space_tag(wdr.cmd_iot);
if (result)
@@ -180,7 +173,7 @@
sc->sc_wdcdev.regs = wdr = &sc->sc_wdc_regs;
wdr->cmd_iot = wdr->ctl_iot =
mb_alloc_bus_space_tag();
- wdr->cmd_iot->stride = 2;
+ wdr->cmd_iot->stride = 0;
wdr->cmd_iot->wo_1 = 1;
wdr->cmd_iot->abs_rms_2 = read_multi_2_swap;
wdr->cmd_iot->abs_wms_2 = write_multi_2_swap;
@@ -190,15 +183,22 @@
sc->sc_wdcdev.sc_atac.atac_dev.dv_xname);
return;
}
- for (i = 0; i < (WDC_NREG + WDC_NSHADOWREG); i++)
+ for (i = 0; i < WDC_NREG; i++) {
if (bus_space_subregion(wdr->cmd_iot, wdr->cmd_baseioh,
- falcon_wd_reg[i], i == 0 ? 2 : 1, &wdr->cmd_iohs[i]) != 0) {
+ i * 4, 4, &wdr->cmd_iohs[i]) != 0) {
printf("%s: couldn't subregion cmd reg %i\n",
sc->sc_wdcdev.sc_atac.atac_dev.dv_xname, i);
bus_space_unmap(wdr->cmd_iot, wdr->cmd_baseioh,
FALCON_WD_LEN);
return;
}
+ }
+
+ if (bus_space_subregion(wdr->cmd_iot,
+ wdr->cmd_baseioh, FALCON_WD_AUX, 4, &wdr->ctl_ioh)) {
+ bus_space_unmap(wdr->cmd_iot, wdr->cmd_baseioh, FALCON_WD_LEN);
+ return;
+ }
/*
* Play a nasty trick here. Normally we only manipulate the
@@ -219,6 +219,7 @@
sc->sc_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
sc->sc_channel.ch_queue = &sc->sc_chqueue;
sc->sc_channel.ch_ndrive = 2;
+ wdc_init_shadow_regs(&sc->sc_channel);
/*
* Setup & enable disk related interrupts.
---
Izumi Tsutsui
From: Alan Hourihane <alanh@fairlite.demon.co.uk>
To: gnats-bugs@NetBSD.org
Cc: tsutsui@NetBSD.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: port-atari/37464: NetBSD 3.1 doesn't boot on Atari Falcon
Date: Mon, 03 Dec 2007 19:06:06 +0000
I've never tried this kernel before, so I don't have anything to compare
to. But it hangs after displaying...
kbd0 at mainbus0
and stops. So I'm not sure if it's even started the wdc probe or not.
Alan.
From: Alan Hourihane <alanh@fairlite.demon.co.uk>
To: gnats-bugs@NetBSD.org
Cc: tsutsui@NetBSD.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: port-atari/37464: NetBSD 3.1 doesn't boot on Atari Falcon
Date: Mon, 03 Dec 2007 19:09:18 +0000
Oh, wait a minute.
I left it there for at least 60 seconds or so, and it eventually carried
on until it hit...
scsibus0: waiting 2 seconds for devices to settle...
and it's pausing again.
Alan.
From: Alan Hourihane <alanh@fairlite.demon.co.uk>
To: gnats-bugs@NetBSD.org
Cc: tsutsui@NetBSD.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: port-atari/37464: NetBSD 3.1 doesn't boot on Atari Falcon
Date: Mon, 03 Dec 2007 19:28:15 +0000
So, I just tried the default NetBSD 4.0_RC5 kernel and it also hangs at
kbd0 at mainbus0
but doesn't get any further with that kernel.
From: Alan Hourihane <alanh@fairlite.demon.co.uk>
To: gnats-bugs@NetBSD.org
Cc: tsutsui@NetBSD.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: port-atari/37464: NetBSD 3.1 doesn't boot on Atari Falcon
Date: Mon, 03 Dec 2007 19:30:44 +0000
Grrr, yes, it did continue but it took about 5 minutes and is now stuck
at the scsibus0: waiting 2 seconds for devices to settle.
So, it didn't crash either as it did in the 3.1 kernel.
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: alanh@fairlite.demon.co.uk
Cc: gnats-bugs@NetBSD.org, tsutsui@NetBSD.org,
gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org,
tsutsui@ceres.dti.ne.jp
Subject: Re: port-atari/37464: NetBSD 3.1 doesn't boot on Atari Falcon
Date: Tue, 4 Dec 2007 21:12:30 +0900
alanh@fairlite.demon.co.uk wrote:
> Grrr, yes, it did continue but it took about 5 minutes and is now stuck
> at the scsibus0: waiting 2 seconds for devices to settle.
>
> So, it didn't crash either as it did in the 3.1 kernel.
Hmm, is "wdc0 at mainbus0" probed properly on both stock
and patched 4.0_RC5 kernels? Could you post dmesg?
The hangup might be caused by spurious interrupt storm,
but it should be handled in another PR..
---
Izumi Tsutsui
From: Alan Hourihane <alanh@fairlite.demon.co.uk>
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Cc: gnats-bugs@NetBSD.org, tsutsui@NetBSD.org,
gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org
Subject: Re: port-atari/37464: NetBSD 3.1 doesn't boot on Atari Falcon
Date: Tue, 04 Dec 2007 13:58:03 +0000
On Tue, 2007-12-04 at 21:12 +0900, Izumi Tsutsui wrote:
> alanh@fairlite.demon.co.uk wrote:
>
> > Grrr, yes, it did continue but it took about 5 minutes and is now stuck
> > at the scsibus0: waiting 2 seconds for devices to settle.
> >
> > So, it didn't crash either as it did in the 3.1 kernel.
>
> Hmm, is "wdc0 at mainbus0" probed properly on both stock
> and patched 4.0_RC5 kernels? Could you post dmesg?
Ah, it's detected fine with the patched kernel, but not at all with the
stock kernel.
> The hangup might be caused by spurious interrupt storm,
> but it should be handled in another PR..
O.k.
Alan.
From: Izumi Tsutsui <tsutsui@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/37464 CVS commit: src/sys/arch/atari/dev
Date: Tue, 4 Dec 2007 15:28:58 +0000 (UTC)
Module Name: src
Committed By: tsutsui
Date: Tue Dec 4 15:28:58 UTC 2007
Modified Files:
src/sys/arch/atari/dev: wdc_mb.c
Log Message:
Apply missed following MI wdc changes to atari's mainbus wdc backend:
- make bus space handles an array for each command register
http://mail-index.netbsd.org/source-changes/2003/11/27/0036.html
(note we no longer have to specify stride for wdc after this change)
- add the notion of "shadow register"
http://mail-index.netbsd.org/source-changes/2004/05/25/0048.html
Problem reported by Alan Hourihane in PR port-amiga/37464.
To generate a diff of this commit:
cvs rdiff -r1.28 -r1.29 src/sys/arch/atari/dev/wdc_mb.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->closed
State-Changed-By: tsutsui@netbsd.org
State-Changed-When: Thu, 06 Dec 2007 23:46:34 +0900
State-Changed-Why:
Fix committed and pullup requests have been sent.
From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/37464 CVS commit: [netbsd-3] src/sys/arch/atari/dev
Date: Wed, 12 Dec 2007 19:37:51 +0000 (UTC)
Module Name: src
Committed By: bouyer
Date: Wed Dec 12 19:37:51 UTC 2007
Modified Files:
src/sys/arch/atari/dev [netbsd-3]: wdc_mb.c
Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1885):
sys/arch/atari/dev/wdc_mb.c: revisions 1.29, 1.30 via patch
Apply missed following MI wdc changes to atari's mainbus wdc backend:
- make bus space handles an array for each command register
http://mail-index.netbsd.org/source-changes/2003/11/27/0036.html
(note we no longer have to specify stride for wdc after this change)
- add the notion of "shadow register"
http://mail-index.netbsd.org/source-changes/2004/05/25/0048.html
Problem reported by Alan Hourihane in PR port-amiga/37464.
To generate a diff of this commit:
cvs rdiff -r1.24 -r1.24.10.1 src/sys/arch/atari/dev/wdc_mb.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Jeff Rizzo <riz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/37464 CVS commit: [netbsd-4] src/sys/arch/atari/dev
Date: Sat, 2 Feb 2008 03:34:05 +0000 (UTC)
Module Name: src
Committed By: riz
Date: Sat Feb 2 03:34:04 UTC 2008
Modified Files:
src/sys/arch/atari/dev [netbsd-4]: wdc_mb.c
Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1013):
sys/arch/atari/dev/wdc_mb.c: revision 1.30
sys/arch/atari/dev/wdc_mb.c: revision 1.29
Apply missed following MI wdc changes to atari's mainbus wdc backend:
- make bus space handles an array for each command register
http://mail-index.netbsd.org/source-changes/2003/11/27/0036.html
(note we no longer have to specify stride for wdc after this change)
- add the notion of "shadow register"
http://mail-index.netbsd.org/source-changes/2004/05/25/0048.html
Problem reported by Alan Hourihane in PR port-amiga/37464.
- add a missing brace in the previous
- print error message on failure to map aux register
To generate a diff of this commit:
cvs rdiff -r1.28 -r1.28.22.1 src/sys/arch/atari/dev/wdc_mb.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>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.