Module Name:    src
Committed By:   bouyer
Date:           Tue Aug 21 14:19:03 UTC 2012

Modified Files:
        src/sys/dev/scsipi: scsiconf.c

Log Message:
If the controller supports more than 256 commands per target,
clamp it to 256 (maximum number of tags in SCSI). Newer controllers
(such as mpii(4), and mfi(4) when fixed to announce tagged queuing support)
support more than 256 outstanding commands and don't use the scsi tag,
but at this time scsipi will always allocate a tag, and panic if a periph
tries to send more than 256 commands.


To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.269 src/sys/dev/scsipi/scsiconf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/scsipi/scsiconf.c
diff -u src/sys/dev/scsipi/scsiconf.c:1.268 src/sys/dev/scsipi/scsiconf.c:1.269
--- src/sys/dev/scsipi/scsiconf.c:1.268	Sun May 13 01:03:13 2012
+++ src/sys/dev/scsipi/scsiconf.c	Tue Aug 21 14:19:02 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsiconf.c,v 1.268 2012/05/13 01:03:13 jakllsch Exp $	*/
+/*	$NetBSD: scsiconf.c,v 1.269 2012/08/21 14:19:02 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.268 2012/05/13 01:03:13 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.269 2012/08/21 14:19:02 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -213,6 +213,22 @@ scsibusattach(device_t parent, device_t 
 	    chan->chan_nluns,
 	    chan->chan_nluns == 1 ? "" : "s");
 
+	/*
+	 * XXX 
+	 * newer adapters support more than 256 outstanding commands
+	 * per periph and don't use the tag (they eventually allocate one
+	 * internally). Right now scsipi always allocate a tag and
+	 * is limited to 256 tags, per scsi specs.
+	 * this should be revisited
+	 */
+	if (chan->chan_flags & SCSIPI_CHAN_OPENINGS) {
+		if (chan->chan_max_periph > 256)
+			chan->chan_max_periph = 256;
+	} else {
+		if (chan->chan_adapter->adapt_max_periph > 256)
+			chan->chan_adapter->adapt_max_periph = 256;
+	}
+
 	if (scsipi_adapter_addref(chan->chan_adapter))
 		return;
 

Reply via email to