Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Oct 2015 23:46:08 +0000 (UTC)
From:      "Conrad E. Meyer" <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r289910 - head/sys/dev/ioat
Message-ID:  <201510242346.t9ONk8VA012068@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Sat Oct 24 23:46:08 2015
New Revision: 289910
URL: https://svnweb.freebsd.org/changeset/base/289910

Log:
  ioat: Extract halted error-debugging to a function
  
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/dev/ioat/ioat.c

Modified: head/sys/dev/ioat/ioat.c
==============================================================================
--- head/sys/dev/ioat/ioat.c	Sat Oct 24 23:45:56 2015	(r289909)
+++ head/sys/dev/ioat/ioat.c	Sat Oct 24 23:46:08 2015	(r289910)
@@ -930,9 +930,24 @@ resize_ring(struct ioat_softc *ioat, int
 }
 
 static void
-ioat_timer_callback(void *arg)
+ioat_halted_debug(struct ioat_softc *ioat, uint32_t chanerr)
 {
 	struct ioat_descriptor *desc;
+
+	ioat_log_message(0, "Channel halted (%x)\n", chanerr);
+	if (chanerr == 0)
+		return;
+
+	desc = ioat_get_ring_entry(ioat, ioat->tail + 0);
+	dump_descriptor(desc->u.raw);
+
+	desc = ioat_get_ring_entry(ioat, ioat->tail + 1);
+	dump_descriptor(desc->u.raw);
+}
+
+static void
+ioat_timer_callback(void *arg)
+{
 	struct ioat_softc *ioat;
 	uint64_t status;
 	uint32_t chanerr;
@@ -949,13 +964,7 @@ ioat_timer_callback(void *arg)
 		 */
 		if (is_ioat_halted(status)) {
 			chanerr = ioat_read_4(ioat, IOAT_CHANERR_OFFSET);
-			ioat_log_message(0, "Channel halted (%x)\n", chanerr);
-
-			desc = ioat_get_ring_entry(ioat, ioat->tail + 0);
-			dump_descriptor(desc->u.raw);
-
-			desc = ioat_get_ring_entry(ioat, ioat->tail + 1);
-			dump_descriptor(desc->u.raw);
+			ioat_halted_debug(ioat, chanerr);
 		}
 		ioat_process_events(ioat);
 	} else {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510242346.t9ONk8VA012068>