summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2002-12-23 00:42:33 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2002-12-23 00:42:33 +0000
commitf5aa62997deecf4ec29874c3321e0b1df74bc912 (patch)
tree53e410f27a02d884e01f7661d4fa01dd2cc7a576 /sys
parent547181efe216860231db2838f9f37584665e969f (diff)
Fix complete botch in handling of 'openings'.
Assign a fixed value (SIOP_NTAGS) to the openings field in the adapter's template sc_link, rather than incrementing the value as cbd's are allocated. The template value is the one copied into each device's sc_link structure as it is created. Incrementing the value meant that each new device got a larger value for openings. The total number of openings claimed by devices on a bus soon exceeded the number of cbd's available. e.g. after 5 devices there would be 132 allocated cbd's, but the total number of openings claimed by devices would be 300. A heavy i/o load on an adapter with multiple devices could have caused the upper scsi layer to try to queue more i/o's than the driver had cbd's to store them in. Such i/o's would fail with EIO if they were started with SCSI_NOSLEEP (e.g. sdstart()) or were not queued within the specified retry limit. I/o's for devices 'later' on the bus would be more likely to trigger this behaviour, due to their inflated openings values. This is good candidate for -stable.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/siop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ic/siop.c b/sys/dev/ic/siop.c
index 00fc0c83108..f93f16df9c8 100644
--- a/sys/dev/ic/siop.c
+++ b/sys/dev/ic/siop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: siop.c,v 1.23 2002/11/16 04:37:29 krw Exp $ */
+/* $OpenBSD: siop.c,v 1.24 2002/12/23 00:42:32 krw Exp $ */
/* $NetBSD: siop.c,v 1.65 2002/11/08 22:04:41 bouyer Exp $ */
/*
@@ -175,6 +175,7 @@ siop_attach(sc)
sc->sc_currschedslot = 0;
sc->sc_c.sc_link.adapter = &siop_adapter;
sc->sc_c.sc_link.device = &siop_dev;
+ sc->sc_c.sc_link.openings = SIOP_NTAG;
/* Start with one page worth of commands */
siop_morecbd(sc);
@@ -1860,7 +1861,6 @@ siop_morecbd(sc)
}
s = splbio();
TAILQ_INSERT_TAIL(&sc->cmds, newcbd, next);
- sc->sc_c.sc_link.openings += SIOP_NCMDPB;
splx(s);
return;
bad0: