From eb42e75cd8cf705b697196549501e552d03398c3 Mon Sep 17 00:00:00 2001 From: bouyer Date: Fri, 7 Nov 2003 08:58:33 +0000 Subject: If we already have a channel reset pending, don't try to queue a new one. Otherwise we would bump queue_freeze several times, but the kernel thread would decrease it only one time. Fix PR kern/23377 by Mattias Karlsson, and should also fix similar problem reported by Mihai CHELARU and Bruce J.A. Nourish on current-users. --- sys/dev/ic/wdc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sys/dev/ic') diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c index e0b7627bc24..54be4f2ce28 100644 --- a/sys/dev/ic/wdc.c +++ b/sys/dev/ic/wdc.c @@ -1,4 +1,4 @@ -/* $NetBSD: wdc.c,v 1.152 2003/11/02 11:07:46 wiz Exp $ */ +/* $NetBSD: wdc.c,v 1.153 2003/11/07 08:58:33 bouyer Exp $ */ /* * Copyright (c) 1998, 2001, 2003 Manuel Bouyer. All rights reserved. @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.152 2003/11/02 11:07:46 wiz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.153 2003/11/07 08:58:33 bouyer Exp $"); #ifndef WDCDEBUG #define WDCDEBUG @@ -1082,6 +1082,10 @@ wdc_reset_channel(drvp, flags) chp->wdc->sc_dev.dv_xname, chp->channel, drvp->drive), DEBUG_FUNCS); if ((flags & AT_POLL) == 0) { + if (chp->ch_flags & WDCF_TH_RESET) { + /* no need to schedule a reset more than one time */ + return; + } chp->ch_flags |= WDCF_TH_RESET; chp->ch_queue->queue_freeze++; wakeup(&chp->thread); -- cgit