Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jun 2017 17:26:54 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320074 - head/sys/arm/arm
Message-ID:  <201706181726.v5IHQsAD056026@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Sun Jun 18 17:26:54 2017
New Revision: 320074
URL: https://svnweb.freebsd.org/changeset/base/320074

Log:
  Only register as the platform DELAY() implementation if the setup of the
  global timer was successful, since the implementation tries to read it.
  
  Notably, if the platform has a variable-frequency global timer (because
  of dynamic frequency scaling), it doesn't set up the global timer for use
  as a system timecounter, and in that case it also can't use it for DELAY.
  Such platforms use different timer hardware for both timecounter and DELAY.

Modified:
  head/sys/arm/arm/mpcore_timer.c

Modified: head/sys/arm/arm/mpcore_timer.c
==============================================================================
--- head/sys/arm/arm/mpcore_timer.c	Sun Jun 18 17:20:48 2017	(r320073)
+++ head/sys/arm/arm/mpcore_timer.c	Sun Jun 18 17:26:54 2017	(r320074)
@@ -439,7 +439,12 @@ arm_tmr_attach(device_t dev)
 	}
 
 #ifdef MULTIDELAY
-	arm_set_delay(arm_tmr_delay, sc);
+	/*
+	 * We can register as the DELAY() implementation only if we successfully
+	 * set up the global timer.
+	 */
+	if (tc_err == 0)
+		arm_set_delay(arm_tmr_delay, sc);
 #endif
 
 	return (0);



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