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.
This commit is contained in:
bouyer 2012-08-21 14:19:02 +00:00
parent d010654c5e
commit d7a08d3db1
1 changed files with 18 additions and 2 deletions

View File

@ -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 self, void *aux)
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;