From owner-svn-src-head@freebsd.org Mon Aug 22 14:51:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF706BC276E; Mon, 22 Aug 2016 14:51:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80D0B1765; Mon, 22 Aug 2016 14:51:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7MEp956072620; Mon, 22 Aug 2016 14:51:09 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7MEp9hX072619; Mon, 22 Aug 2016 14:51:09 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201608221451.u7MEp9hX072619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 22 Aug 2016 14:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304603 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2016 14:51:10 -0000 Author: cem Date: Mon Aug 22 14:51:09 2016 New Revision: 304603 URL: https://svnweb.freebsd.org/changeset/base/304603 Log: ioat(4): Allow callouts to be scheduled after hw reset is_completion_pending governs whether or not a callout will be scheduled when new work is queued on the IOAT device. If true, a callout is already scheduled, so we do not need a new one. If false, we schedule one and set it true. Because resetting the hardware completed all outstanding work but failed to clear is_completion_pending, no new callout could be scheduled after a reset with pending work. This resulted in a driver hang for polled-only work. Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Mon Aug 22 14:51:07 2016 (r304602) +++ head/sys/dev/ioat/ioat.c Mon Aug 22 14:51:09 2016 (r304603) @@ -768,6 +768,13 @@ ioat_process_events(struct ioat_softc *i ioat->stats.descriptors_error++; } + if (ioat->is_completion_pending) { + ioat->is_completion_pending = FALSE; + callout_reset(&ioat->shrink_timer, IOAT_SHRINK_PERIOD, + ioat_shrink_timer_callback, ioat); + callout_stop(&ioat->poll_timer); + } + /* Clear error status */ ioat_write_4(ioat, IOAT_CHANERR_OFFSET, chanerr); @@ -1898,6 +1905,7 @@ ioat_reset_hw(struct ioat_softc *ioat) ioat->tail = ioat->head = ioat->hw_head = 0; ioat->last_seen = 0; *ioat->comp_update = 0; + KASSERT(!ioat->is_completion_pending, ("bogus completion_pending")); ioat_write_chanctrl(ioat, IOAT_CHANCTRL_RUN); ioat_write_chancmp(ioat, ioat->comp_update_bus_addr);