Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/thorpej_scsipi]: src/sys/dev/scsipi Don't forget to remove xfer from the...
details: https://anonhg.NetBSD.org/src/rev/29b4786df579
branches: thorpej_scsipi
changeset: 477372:29b4786df579
user: bouyer <bouyer%NetBSD.org@localhost>
date: Mon Jan 22 17:43:02 2001 +0000
description:
Don't forget to remove xfer from the channel's queue in
scsipi_async_event_channel_reset()
thaw the periph when request_sense failed(), and when calling user done,
as we're not going though the usual path.
Implement XS_REQUEUE, for drivers needing to requeue a xfer.
diffstat:
sys/dev/scsipi/scsipi_base.c | 12 +++++++++++-
sys/dev/scsipi/scsipiconf.h | 3 ++-
2 files changed, 13 insertions(+), 2 deletions(-)
diffs (64 lines):
diff -r 56653ead7328 -r 29b4786df579 sys/dev/scsipi/scsipi_base.c
--- a/sys/dev/scsipi/scsipi_base.c Sun Jan 21 22:45:58 2001 +0000
+++ b/sys/dev/scsipi/scsipi_base.c Mon Jan 22 17:43:02 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scsipi_base.c,v 1.26.2.9 2001/01/15 09:22:12 bouyer Exp $ */
+/* $NetBSD: scsipi_base.c,v 1.26.2.10 2001/01/22 17:43:02 bouyer Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -1208,6 +1208,9 @@
if (xs->xs_control & XS_CTL_REQSENSE) {
scsipi_printaddr(periph);
printf("request sense for request sense\n");
+ /* we've been frozen because xs->error != XS_NOERROR */
+ scsipi_periph_thaw(periph, 1);
+ splx(s);
return EIO;
}
scsipi_request_sense(xs);
@@ -1219,6 +1222,8 @@
*/
if ((xs->xs_control & XS_CTL_USERCMD) != 0) {
SC_DEBUG(periph, SCSIPI_DB3, ("calling user done()\n"));
+ if (xs->error != XS_NOERROR)
+ scsipi_periph_thaw(periph, 1);
scsipi_user_done(xs);
SC_DEBUG(periph, SCSIPI_DB3, ("returned from user done()\n "));
return 0;
@@ -1287,6 +1292,10 @@
error = EBUSY;
break;
+ case XS_REQUEUE:
+ error = ERESTART;
+ break;
+
case XS_TIMEOUT:
if (xs->xs_retries != 0) {
xs->xs_retries--;
@@ -2076,6 +2085,7 @@
for (xs = TAILQ_FIRST(&chan->chan_queue); xs != NULL; xs = xs_next) {
xs_next = TAILQ_NEXT(xs, channel_q);
if (xs->xs_control & XS_CTL_REQSENSE) {
+ TAILQ_REMOVE(&chan->chan_queue, xs, channel_q);
xs->error = XS_RESET;
scsipi_done(xs);
}
diff -r 56653ead7328 -r 29b4786df579 sys/dev/scsipi/scsipiconf.h
--- a/sys/dev/scsipi/scsipiconf.h Sun Jan 21 22:45:58 2001 +0000
+++ b/sys/dev/scsipi/scsipiconf.h Mon Jan 22 17:43:02 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scsipiconf.h,v 1.32.2.9 2001/01/15 09:22:13 bouyer Exp $ */
+/* $NetBSD: scsipiconf.h,v 1.32.2.10 2001/01/22 17:43:03 bouyer Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -441,6 +441,7 @@
XS_TIMEOUT, /* The Timeout reported was caught by SW */
XS_BUSY, /* The device busy, try again later? */
XS_RESET, /* bus was reset; possible retry command */
+ XS_REQUEUE, /* requeue this command */
} scsipi_xfer_result_t;
Home |
Main Index |
Thread Index |
Old Index