From owner-svn-src-all@FreeBSD.ORG Thu Aug 30 17:37:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B5471065694; Thu, 30 Aug 2012 17:37:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 348978FC29; Thu, 30 Aug 2012 17:37:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7UHb2hU085140; Thu, 30 Aug 2012 17:37:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7UHb1H5085136; Thu, 30 Aug 2012 17:37:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201208301737.q7UHb1H5085136@svn.freebsd.org> From: John Baldwin Date: Thu, 30 Aug 2012 17:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239912 - head/sys/dev/amr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 30 Aug 2012 17:37:02 -0000 Author: jhb Date: Thu Aug 30 17:37:01 2012 New Revision: 239912 URL: http://svn.freebsd.org/changeset/base/239912 Log: Use callout(9) rather than timeout(9). Note that the periodic timer in amr(4) is never started, so this should be even more of a NOP than normal. Modified: head/sys/dev/amr/amr.c head/sys/dev/amr/amr_pci.c head/sys/dev/amr/amrvar.h Modified: head/sys/dev/amr/amr.c ============================================================================== --- head/sys/dev/amr/amr.c Thu Aug 30 17:35:12 2012 (r239911) +++ head/sys/dev/amr/amr.c Thu Aug 30 17:37:01 2012 (r239912) @@ -351,7 +351,7 @@ amr_startup(void *arg) /* * Start the timeout routine. */ -/* sc->amr_timeout = timeout(amr_periodic, sc, hz);*/ +/* callout_reset(&sc->amr_timeout, hz, amr_periodic, sc);*/ return; } @@ -392,7 +392,7 @@ amr_free(struct amr_softc *sc) device_delete_child(sc->amr_dev, sc->amr_pass); /* cancel status timeout */ - untimeout(amr_periodic, sc, sc->amr_timeout); + callout_drain(&sc->amr_timeout); /* throw away any command buffers */ while ((acc = TAILQ_FIRST(&sc->amr_cmd_clusters)) != NULL) { @@ -979,7 +979,7 @@ amr_periodic(void *data) amr_done(sc); /* reschedule */ - sc->amr_timeout = timeout(amr_periodic, sc, hz); + callout_reset(&sc->amr_timeout, hz, amr_periodic, sc); } /******************************************************************************** Modified: head/sys/dev/amr/amr_pci.c ============================================================================== --- head/sys/dev/amr/amr_pci.c Thu Aug 30 17:35:12 2012 (r239911) +++ head/sys/dev/amr/amr_pci.c Thu Aug 30 17:37:01 2012 (r239912) @@ -331,6 +331,7 @@ amr_pci_attach(device_t dev) */ mtx_init(&sc->amr_list_lock, "AMR List Lock", NULL, MTX_DEF); mtx_init(&sc->amr_hw_lock, "AMR HW Lock", NULL, MTX_DEF); + callout_init(&sc->amr_timeout, CALLOUT_MPSAFE); if ((error = amr_setup_mbox(sc)) != 0) goto out; Modified: head/sys/dev/amr/amrvar.h ============================================================================== --- head/sys/dev/amr/amrvar.h Thu Aug 30 17:35:12 2012 (r239911) +++ head/sys/dev/amr/amrvar.h Thu Aug 30 17:37:01 2012 (r239912) @@ -256,7 +256,7 @@ struct amr_softc device_t amr_pass; int (*amr_cam_command)(struct amr_softc *sc, struct amr_command **acp); struct intr_config_hook amr_ich; /* wait-for-interrupts probe hook */ - struct callout_handle amr_timeout; /* periodic status check */ + struct callout amr_timeout; /* periodic status check */ int amr_allow_vol_config; int amr_linux_no_adapters; int amr_ld_del_supported;