Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Aug 2012 17:37:01 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r239912 - head/sys/dev/amr
Message-ID:  <201208301737.q7UHb1H5085136@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



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