Author: kib
Date: Wed Jun 10 22:30:32 2020
New Revision: 362033
URL: https://svnweb.freebsd.org/changeset/base/362033

Log:
  Remove double-calls to tc_get_timecount() to warm timecounters.
  
  It seems that second call does not add any useful state change for all
  implemented timecounters.
  
  Discussed with:       bde
  Sponsored by: The FreeBSD Foundation
  MFC after:    3 weeks

Modified:
  head/sys/dev/acpica/acpi.c
  head/sys/dev/acpica/acpi_timer.c
  head/sys/dev/xen/control/control.c
  head/sys/kern/kern_tc.c

Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c  Wed Jun 10 22:13:24 2020        (r362032)
+++ head/sys/dev/acpica/acpi.c  Wed Jun 10 22:30:32 2020        (r362033)
@@ -3220,7 +3220,6 @@ acpi_resync_clock(struct acpi_softc *sc)
      * Warm up timecounter again and reset system clock.
      */
     (void)timecounter->tc_get_timecount(timecounter);
-    (void)timecounter->tc_get_timecount(timecounter);
     inittodr(time_second + sc->acpi_sleep_delay);
 }
 

Modified: head/sys/dev/acpica/acpi_timer.c
==============================================================================
--- head/sys/dev/acpica/acpi_timer.c    Wed Jun 10 22:13:24 2020        
(r362032)
+++ head/sys/dev/acpica/acpi_timer.c    Wed Jun 10 22:30:32 2020        
(r362033)
@@ -274,7 +274,6 @@ acpi_timer_resume_handler(struct timecounter *newtc)
                            "restoring timecounter, %s -> %s\n",
                            tc->tc_name, newtc->tc_name);
                (void)newtc->tc_get_timecount(newtc);
-               (void)newtc->tc_get_timecount(newtc);
                timecounter = newtc;
        }
 }

Modified: head/sys/dev/xen/control/control.c
==============================================================================
--- head/sys/dev/xen/control/control.c  Wed Jun 10 22:13:24 2020        
(r362032)
+++ head/sys/dev/xen/control/control.c  Wed Jun 10 22:30:32 2020        
(r362033)
@@ -303,7 +303,6 @@ xctrl_suspend()
         * Warm up timecounter again and reset system clock.
         */
        timecounter->tc_get_timecount(timecounter);
-       timecounter->tc_get_timecount(timecounter);
        inittodr(time_second);
 
 #ifdef EARLY_AP_STARTUP

Modified: head/sys/kern/kern_tc.c
==============================================================================
--- head/sys/kern/kern_tc.c     Wed Jun 10 22:13:24 2020        (r362032)
+++ head/sys/kern/kern_tc.c     Wed Jun 10 22:30:32 2020        (r362033)
@@ -1206,7 +1206,6 @@ tc_init(struct timecounter *tc)
            tc->tc_frequency < timecounter->tc_frequency)
                return;
        (void)tc->tc_get_timecount(tc);
-       (void)tc->tc_get_timecount(tc);
        timecounter = tc;
 }
 
@@ -1469,7 +1468,6 @@ sysctl_kern_timecounter_hardware(SYSCTL_HANDLER_ARGS)
 
                /* Warm up new timecounter. */
                (void)newtc->tc_get_timecount(newtc);
-               (void)newtc->tc_get_timecount(newtc);
 
                timecounter = newtc;
 
@@ -1962,7 +1960,6 @@ inittimecounter(void *dummy)
 #endif
 
        /* warm up new timecounter (again) and get rolling. */
-       (void)timecounter->tc_get_timecount(timecounter);
        (void)timecounter->tc_get_timecount(timecounter);
        mtx_lock_spin(&tc_setclock_mtx);
        tc_windup(NULL);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to