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.
This commit is contained in:
mhitch 2009-10-30 18:55:45 +00:00
parent 73810e776b
commit a755312d41
3 changed files with 14 additions and 5 deletions

View File

@ -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 @@ typedef struct tsp_config *TSPCON;
#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)

View File

@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: tsp_bus_mem.c,v 1.8 2005/12/11 12:16:17 christos Exp
#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)

View File

@ -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 @@ struct tsp_config {
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;
};