From owner-p4-projects@FreeBSD.ORG Sat Feb 6 01:02:31 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 12E561065696; Sat, 6 Feb 2010 01:02:31 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB7EC106568D for ; Sat, 6 Feb 2010 01:02:30 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 842FD8FC16 for ; Sat, 6 Feb 2010 01:02:30 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o1612UtP028744 for ; Sat, 6 Feb 2010 01:02:30 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o1612Uh8028742 for perforce@freebsd.org; Sat, 6 Feb 2010 01:02:30 GMT (envelope-from mav@freebsd.org) Date: Sat, 6 Feb 2010 01:02:30 GMT Message-Id: <201002060102.o1612Uh8028742@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mav@freebsd.org using -f From: Alexander Motin To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 174385 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2010 01:02:31 -0000 http://p4web.freebsd.org/chv.cgi?CH=174385 Change 174385 by mav@mav_mavtest on 2010/02/06 01:01:49 After last running command completed, give commands in timeout second time. Affected files ... .. //depot/projects/scottl-camlock/src/sys/dev/siis/siis.c#42 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/dev/siis/siis.c#42 (text+ko) ==== @@ -1074,6 +1074,28 @@ } } +/* Must be called with channel locked. */ +static void +siis_rearm_timeout(device_t dev) +{ + struct siis_channel *ch = device_get_softc(dev); + int i; + + mtx_assert(&ch->mtx, MA_OWNED); + for (i = 0; i < SIIS_MAX_SLOTS; i++) { + struct siis_slot *slot = &ch->slot[i]; + + /* Do we have a running request on slot? */ + if (slot->state < SIIS_SLOT_RUNNING) + continue; + if ((ch->toslots & (1 << i)) == 0) + continue; + callout_reset(&slot->timeout, + (int)slot->ccb->ccb_h.timeout * hz / 1000, + (timeout_t*)siis_timeout, slot); + } +} + /* Locked by callout mechanism. */ static void siis_timeout(struct siis_slot *slot) @@ -1235,8 +1257,9 @@ siis_issue_read_log(dev); } /* If all the reset of commands are in timeout - abort them. */ - } else if ((ch->rslots & ~ch->toslots) == 0) - siis_process_timeout(dev); + } else if ((ch->rslots & ~ch->toslots) == 0 && + et != SIIS_ERR_TIMEOUT) + siis_rearm_timeout(dev); } static void