From 0af57c24612ffc597e5a521c8ac16536301b9181 Mon Sep 17 00:00:00 2001 From: scottr Date: Mon, 14 Sep 1998 05:56:14 +0000 Subject: [PATCH] Correct a serious problem that affects at least front ends that can only use PIO (or equivalent) code to do asynchronous transfers: In ncr5380_scsi_cmd(), test to see if the request has been completed after the call to ncr5380_sched(), and return COMPLETE if so. This avoids going into an infinite loop in scsipi_execute_xs() while waiting for an interrupt to trigger completion of the transfer... which, of course, never happens, since it's already done. --- sys/dev/ic/ncr5380sbc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/ic/ncr5380sbc.c b/sys/dev/ic/ncr5380sbc.c index 803054edaeab..ec974b406d24 100644 --- a/sys/dev/ic/ncr5380sbc.c +++ b/sys/dev/ic/ncr5380sbc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ncr5380sbc.c,v 1.25 1998/07/04 22:18:50 jonathan Exp $ */ +/* $NetBSD: ncr5380sbc.c,v 1.26 1998/09/14 05:56:14 scottr Exp $ */ /* * Copyright (c) 1995 David Jones, Gordon W. Ross @@ -670,7 +670,8 @@ new: if ((xs->flags & ITSDONE) == 0) panic("ncr5380_scsi_cmd: poll didn't finish"); rv = COMPLETE; - } + } else if ((xs->flags & ITSDONE)) + rv = COMPLETE; out: splx(s); @@ -2537,7 +2538,7 @@ ncr5380_show_req(sr) return; } db_printf("\n"); -#ifdef PIDEBUG +#ifdef SCSIDEBUG show_scsipi_xs(xs); #else db_printf("xs=%p\n", xs);