From owner-svn-src-all@freebsd.org Thu Oct 29 04:16:53 2015 Return-Path: Delivered-To: svn-src-all@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 4F30BA20A17; Thu, 29 Oct 2015 04:16:53 +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 1C3E910EF; Thu, 29 Oct 2015 04:16:53 +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 t9T4Gqha044381; Thu, 29 Oct 2015 04:16:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9T4GqDM044380; Thu, 29 Oct 2015 04:16:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510290416.t9T4GqDM044380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 29 Oct 2015 04:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290132 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Oct 2015 04:16:53 -0000 Author: cem Date: Thu Oct 29 04:16:52 2015 New Revision: 290132 URL: https://svnweb.freebsd.org/changeset/base/290132 Log: ioat_test: Handled forced hardware resets gracefully Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat_test.c Modified: head/sys/dev/ioat/ioat_test.c ============================================================================== --- head/sys/dev/ioat/ioat_test.c Thu Oct 29 04:16:39 2015 (r290131) +++ head/sys/dev/ioat/ioat_test.c Thu Oct 29 04:16:52 2015 (r290132) @@ -284,12 +284,23 @@ ioat_test_submit_1_tx(struct ioat_test * desc = ioat_blockfill(dma, dest, fillpattern, tx->length, cb, tx, flags); } - if (desc == NULL) - panic("Failed to allocate a ring slot " - "-- this shouldn't happen!"); + break; } ioat_release(dma); + + /* + * We couldn't issue an IO -- either the device is being detached or + * the HW reset. Essentially spin until the device comes back up or + * our timer expires. + */ + if (desc == NULL && tx->depth > 0) { + atomic_add_32(&test->status[IOAT_TEST_NO_DMA_ENGINE], tx->depth); + IT_LOCK(); + TAILQ_REMOVE(&test->pend_q, tx, entry); + TAILQ_INSERT_HEAD(&test->free_q, tx, entry); + IT_UNLOCK(); + } } static void