diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-10-03 21:11:15 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-10-03 21:11:15 +0000 |
commit | 0ae4055cd9ca13c195daa77e834d53c0b1e50169 (patch) | |
tree | 7bf2640547039785da1194a3ef34cdbc674411b6 /sys/dev/ic | |
parent | 72bb7f725d0ea0320d6f6099595187b1b39b608e (diff) |
Reduce the number of openings the logical devices have to play with so
that ioctl's and raw commands will not cause i/o failures. Assume a
max of two processors/enclosures per raw bus for the moment.
Fixes regular crashes on my 1 logical device, all-softdep system
during make build with a bioctl loop running.
ok dlg@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/ami.c | 11 | ||||
-rw-r--r-- | sys/dev/ic/amireg.h | 7 |
2 files changed, 14 insertions, 4 deletions
diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c index 94761a09dd6..468f2070a1d 100644 --- a/sys/dev/ic/ami.c +++ b/sys/dev/ic/ami.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ami.c,v 1.91 2005/10/02 06:30:50 dlg Exp $ */ +/* $OpenBSD: ami.c,v 1.92 2005/10/03 21:11:14 krw Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -530,6 +530,13 @@ ami_attach(sc) sc->sc_maxunits = AMI_BIG_MAX_LDRIVES; if (sc->sc_maxcmds > AMI_MAXCMDS) sc->sc_maxcmds = AMI_MAXCMDS; + /* + * Reserve ccb's for ioctl's and raw commands to + * processors/enclosures by lowering the number of + * openings available for logical units. + */ + sc->sc_maxcmds -= AMI_MAXIOCTLCMDS + AMI_MAXPROCS * + AMI_MAXRAWCMDS * sc->sc_channels; if (sc->sc_nunits) sc->sc_link.openings = @@ -610,7 +617,7 @@ ami_attach(sc) rsc->sc_softc = sc; rsc->sc_channel = rsc - sc->sc_rawsoftcs; rsc->sc_link.device = &ami_raw_dev; - rsc->sc_link.openings = sc->sc_maxcmds; + rsc->sc_link.openings = AMI_MAXRAWCMDS; rsc->sc_link.adapter_softc = rsc; rsc->sc_link.adapter = &ami_raw_switch; rsc->sc_proctarget = -1; diff --git a/sys/dev/ic/amireg.h b/sys/dev/ic/amireg.h index 0e7fb88944d..4ba96cf6f80 100644 --- a/sys/dev/ic/amireg.h +++ b/sys/dev/ic/amireg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: amireg.h,v 1.24 2005/09/21 08:39:15 dlg Exp $ */ +/* $OpenBSD: amireg.h,v 1.25 2005/10/03 21:11:14 krw Exp $ */ /* * Copyright (c) 2000 Michael Shalayeff @@ -38,12 +38,15 @@ #define AMI_BIG_MAX_SPANDEPTH 8 #define AMI_BIG_MAX_DEVDEPTH 32 -#define AMI_MAXCMDS 126 /* theoretical limit is 250 */ +#define AMI_MAXCMDS 126 /* theoretical limit is 250 */ #define AMI_SECTOR_SIZE 512 #define AMI_MAXOFFSETS 26 #define AMI_SGEPERCMD 32 /* to prevent page boundary crossing */ #define AMI_MAX_BUSYWAIT 10 /* wait up to 10 usecs */ #define AMI_MAX_POLLWAIT 1000000 /* wait up to 1000 000 usecs */ +#define AMI_MAXIOCTLCMDS 1 /* number of parallel ioctl calls */ +#define AMI_MAXPROCS 2 /* number of processors on a channel */ +#define AMI_MAXRAWCMDS 2 /* number of parallel processor cmds */ #define AMI_MAXFER (AMI_MAXOFFSETS * PAGE_SIZE) |