Module Name: src Committed By: riz Date: Mon Sep 3 18:36:33 UTC 2012
Modified Files: src/sys/dev/scsipi [netbsd-6]: scsiconf.c Log Message: Pull up following revision(s) (requested by bouyer in ticket #523): sys/dev/scsipi/scsiconf.c: revision 1.269 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.262.10.3 -r1.262.10.4 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.262.10.3 src/sys/dev/scsipi/scsiconf.c:1.262.10.4 --- src/sys/dev/scsipi/scsiconf.c:1.262.10.3 Tue May 22 18:46:09 2012 +++ src/sys/dev/scsipi/scsiconf.c Mon Sep 3 18:36:33 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: scsiconf.c,v 1.262.10.3 2012/05/22 18:46:09 riz Exp $ */ +/* $NetBSD: scsiconf.c,v 1.262.10.4 2012/09/03 18:36:33 riz 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.262.10.3 2012/05/22 18:46:09 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.262.10.4 2012/09/03 18:36:33 riz Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -209,6 +209,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;