Module Name: src Committed By: mhitch Date: Fri Oct 30 18:55:45 UTC 2009
Modified Files: src/sys/arch/alpha/pci: tsp_bus_io.c tsp_bus_mem.c tsvar.h Log Message: The tsc(4) bus initialization was using a single statically allocated extent storage for each tsp(4), which caused a LOCKDEBUG kernel to fail because the extent storage contained a mutex which panics when the second mutex_init() is attempted. Put the extent storage into the tsp_config structure so each tsp(4) gets it own. Fixes PR port-alpha/38358. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/alpha/pci/tsp_bus_io.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/alpha/pci/tsp_bus_mem.c cvs rdiff -u -r1.6 -r1.7 src/sys/arch/alpha/pci/tsvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/alpha/pci/tsp_bus_io.c diff -u src/sys/arch/alpha/pci/tsp_bus_io.c:1.5 src/sys/arch/alpha/pci/tsp_bus_io.c:1.6 --- src/sys/arch/alpha/pci/tsp_bus_io.c:1.5 Thu Jun 29 08:58:50 2000 +++ src/sys/arch/alpha/pci/tsp_bus_io.c Fri Oct 30 18:55:45 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tsp_bus_io.c,v 1.5 2000/06/29 08:58:50 mrg Exp $ */ +/* $NetBSD: tsp_bus_io.c,v 1.6 2009/10/30 18:55:45 mhitch Exp $ */ /*- * Copyright (c) 1999 by Ross Harvey. All rights reserved. @@ -33,7 +33,7 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: tsp_bus_io.c,v 1.5 2000/06/29 08:58:50 mrg Exp $"); +__KERNEL_RCSID(1, "$NetBSD: tsp_bus_io.c,v 1.6 2009/10/30 18:55:45 mhitch Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -58,6 +58,8 @@ #define CHIP_EX_MALLOC_SAFE(v) (((TSPCON)(v))->pc_mallocsafe) #define CHIP_IO_EXTENT(v) (((TSPCON)(v))->pc_io_ex) +#define CHIP_IO_EX_STORE(v) (((TSPCON)(v))->pc_io_exstorage) +#define CHIP_IO_EX_STORE_SIZE(v) (sizeof (((TSPCON)(v))->pc_io_exstorage)) #define CHIP_IO_SYS_START(v) (((TSPCON)(v))->pc_iobase | P_PCI_IO) Index: src/sys/arch/alpha/pci/tsp_bus_mem.c diff -u src/sys/arch/alpha/pci/tsp_bus_mem.c:1.8 src/sys/arch/alpha/pci/tsp_bus_mem.c:1.9 --- src/sys/arch/alpha/pci/tsp_bus_mem.c:1.8 Sun Dec 11 12:16:17 2005 +++ src/sys/arch/alpha/pci/tsp_bus_mem.c Fri Oct 30 18:55:45 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tsp_bus_mem.c,v 1.8 2005/12/11 12:16:17 christos Exp $ */ +/* $NetBSD: tsp_bus_mem.c,v 1.9 2009/10/30 18:55:45 mhitch Exp $ */ /*- * Copyright (c) 1999 by Ross Harvey. All rights reserved. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tsp_bus_mem.c,v 1.8 2005/12/11 12:16:17 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tsp_bus_mem.c,v 1.9 2009/10/30 18:55:45 mhitch Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -55,6 +55,9 @@ #define CHIP_EX_MALLOC_SAFE(v) (((struct tsp_config *)(v))->pc_mallocsafe) #define CHIP_MEM_EXTENT(v) (((struct tsp_config *)(v))->pc_mem_ex) +#define CHIP_MEM_EX_STORE(v) (((struct tsp_config *)(v))->pc_mem_exstorage) +#define CHIP_MEM_EX_STORE_SIZE(v) \ + (sizeof (((struct tsp_config *)(v))->pc_mem_exstorage)) #define CHIP_MEM_SYS_START(v) (((struct tsp_config *)(v))->pc_iobase) Index: src/sys/arch/alpha/pci/tsvar.h diff -u src/sys/arch/alpha/pci/tsvar.h:1.6 src/sys/arch/alpha/pci/tsvar.h:1.7 --- src/sys/arch/alpha/pci/tsvar.h:1.6 Sat Mar 14 14:45:53 2009 +++ src/sys/arch/alpha/pci/tsvar.h Fri Oct 30 18:55:45 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tsvar.h,v 1.6 2009/03/14 14:45:53 dsl Exp $ */ +/* $NetBSD: tsvar.h,v 1.7 2009/10/30 18:55:45 mhitch Exp $ */ /*- * Copyright (c) 1999 by Ross Harvey. All rights reserved. @@ -35,6 +35,8 @@ #include <dev/pci/pcivar.h> #include <alpha/pci/pci_sgmap_pte64.h> +#define _FSTORE (EXTENT_FIXED_STORAGE_SIZE(8) / sizeof(long)) + #define tsvar() { Generate ctags(1) key. } struct tsc_softc { @@ -58,6 +60,8 @@ u_int32_t pc_hae_mem; u_int32_t pc_hae_io; + long pc_io_exstorage[_FSTORE]; + long pc_mem_exstorage[_FSTORE]; struct extent *pc_io_ex, *pc_mem_ex; int pc_mallocsafe; };