Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jun 2010 21:03:44 +1200
From:      Andrew Turner <andrew@fubar.geek.nz>
To:        Rafal Jaworowski <raj@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r209129 - head/sys/arm/arm
Message-ID:  <20100616210344.47209ff2@bender>
In-Reply-To: <201006131308.o5DD8NTA033564@svn.freebsd.org>
References:  <201006131308.o5DD8NTA033564@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--MP_/C.+KRF8KSl6VNQrOYwcmbnS
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Sun, 13 Jun 2010 13:08:23 +0000 (UTC)
Rafal Jaworowski <raj@FreeBSD.org> wrote:

> Author: raj
> Date: Sun Jun 13 13:08:23 2010
> New Revision: 209129
> URL: http://svn.freebsd.org/changeset/base/209129
> 
> Log:
>   Improve style.
> 
> Modified:
>   head/sys/arm/arm/nexus.c
> 
> Modified: head/sys/arm/arm/nexus.c
> ==============================================================================
> --- head/sys/arm/arm/nexus.c	Sun Jun 13 13:02:43 2010
> (r209128) +++ head/sys/arm/arm/nexus.c	Sun Jun 13 13:08:23
> 2010	(r209129) @@ -107,6 +107,7 @@ static devclass_t
> nexus_devclass; static int
>  nexus_probe(device_t dev)
>  {
> +
>  	device_quiet(dev);	/* suppress attach message for
> neatness */ 
>  	mem_rman.rm_start = 0;
> @@ -116,7 +117,7 @@ nexus_probe(device_t dev)
>  	if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0,
> ~0u)) panic("nexus_probe mem_rman");
>  
> -	return (0);
> +	return (BUS_PROBE_DEFAULT);
Changing the return value of nexus_probe from 0 to BUS_PROBE_DEFAULT
causes the following panic for me when the s3c24x0 driver calls
rman_init. The attached patch fixes it by moving the call to rman_init
from nexus_probe to nexus_attach.

Andrew

KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2010 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights
reserved. FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 9.0-CURRENT #10 r209128M: Wed Jun 16 20:47:22 NZST 2010
    andrew@bender:/usr/obj/arm/home/andrew/freebsd/svn/head/sys/LN2410SBC
arm WARNING: WITNESS option enabled, expect reduced performance.
CPU: ARM920T rev 0 (ARM9TDMI core)
  DC enabled IC enabled WB enabled LABT
  16KB/32B 64-way Instruction cache
  16KB/32B 64-way write-back-locking-A Data cache
real memory  = 67108864 (64 MB)
avail memory = 56320000 (53 MB)
s3c24x00 on motherboard
s3c24x00: Found S3C2410A CPU (Chip ID: 0x32410002)
s3c24x00: fclk 202 MHz hclk 101 MHz pclk 50 MHz
panic: Bad tailq NEXT(0xc068eab8->tqh_last) != NULL
KDB: enter: panic
[ thread pid 0 tid 100000 ]
Stopped at      kdb_enter+0x44: ldrb    r15, [r15, r15, ror r15]!
db> reset

--MP_/C.+KRF8KSl6VNQrOYwcmbnS
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=rman_panic.diff

Index: sys/arm/arm/nexus.c
===================================================================
--- sys/arm/arm/nexus.c	(revision 209229)
+++ sys/arm/arm/nexus.c	(working copy)
@@ -110,13 +110,6 @@
 
 	device_quiet(dev);	/* suppress attach message for neatness */
 
-	mem_rman.rm_start = 0;
-	mem_rman.rm_end = ~0u;
-	mem_rman.rm_type = RMAN_ARRAY;
-	mem_rman.rm_descr = "I/O memory addresses";
-	if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0u))
-		panic("nexus_probe mem_rman");
-
 	return (BUS_PROBE_DEFAULT);
 }
 
@@ -144,6 +137,13 @@
 nexus_attach(device_t dev)
 {
 
+	mem_rman.rm_start = 0;
+	mem_rman.rm_end = ~0u;
+	mem_rman.rm_type = RMAN_ARRAY;
+	mem_rman.rm_descr = "I/O memory addresses";
+	if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0u))
+		panic("nexus_probe mem_rman");
+
 	/*
 	 * First, deal with the children we know about already
 	 */

--MP_/C.+KRF8KSl6VNQrOYwcmbnS--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100616210344.47209ff2>