Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic I was allowing adapt_max_periph to use all availa...



details:   https://anonhg.NetBSD.org/src/rev/013c89556370
branches:  trunk
changeset: 765035:013c89556370
user:      mhitch <mhitch%NetBSD.org@localhost>
date:      Mon May 16 17:21:37 2011 +0000

description:
I was allowing adapt_max_periph to use all available command slots, which
easily exceeds the maximum of 256 tags used by the scsipi layer because
the tag information from the scsipi layer was ignored and all the tagging
is handled implicitly internal to ciss(4).  But with the DIAGNOSTIC option,
the scsipi layer does a check for > 256 tags and will panic.  So, lets just
limit the adapt_max_periph to 256 so the scsipi layer won't try to user more.

diffstat:

 sys/dev/ic/ciss.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 67c927ee91aa -r 013c89556370 sys/dev/ic/ciss.c
--- a/sys/dev/ic/ciss.c Mon May 16 15:09:31 2011 +0000
+++ b/sys/dev/ic/ciss.c Mon May 16 17:21:37 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ciss.c,v 1.24 2010/11/13 13:52:00 uebayasi Exp $       */
+/*     $NetBSD: ciss.c,v 1.25 2011/05/16 17:21:37 mhitch Exp $ */
 /*     $OpenBSD: ciss.c,v 1.14 2006/03/13 16:02:23 mickey Exp $        */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.24 2010/11/13 13:52:00 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.25 2011/05/16 17:21:37 mhitch Exp $");
 
 #include "bio.h"
 
@@ -373,7 +373,7 @@
 
        sc->sc_adapter.adapt_dev = (device_t) sc;
        sc->sc_adapter.adapt_openings = sc->sc_channel.chan_openings;
-       sc->sc_adapter.adapt_max_periph = sc->sc_channel.chan_openings;
+       sc->sc_adapter.adapt_max_periph = min(sc->sc_adapter.adapt_openings, 256);
        sc->sc_adapter.adapt_request = ciss_scsi_cmd;
        sc->sc_adapter.adapt_minphys = cissminphys;
        sc->sc_adapter.adapt_ioctl = ciss_scsi_ioctl;



Home | Main Index | Thread Index | Old Index