Index: uspace/drv/time/cmos-rtc/cmos-rtc.c
===================================================================
--- uspace/drv/time/cmos-rtc/cmos-rtc.c	(revision 6f445a67491000572da4fa7897f93fdff426b03f)
+++ uspace/drv/time/cmos-rtc/cmos-rtc.c	(revision 60af6fc234335c908ed82994b95ed141c90f15a6)
@@ -71,4 +71,6 @@
 	/** true if device is removed */
 	bool removed;
+	/** time at which the system booted */
+	time_t boottime;
 } rtc_t;
 
@@ -94,5 +96,4 @@
 
 static ddf_dev_ops_t rtc_dev_ops;
-static time_t boottime = 0;
 
 /** The RTC device driver's standard operations */
@@ -298,10 +299,15 @@
 	rtc_t *rtc = fun_rtc(fun);
 
-	if (boottime != 0) {
+	fibril_mutex_lock(&rtc->mutex);
+
+	if (rtc->boottime != 0) {
 		/* There is no need to read the current time from the
 		 * device because it has already been cached.
 		 */
 
-		time_t cur_time = boottime + uptime_get();
+		time_t cur_time = rtc->boottime + uptime_get();
+
+		fibril_mutex_unlock(&rtc->mutex);
+
 		return localtime2tm(cur_time, t);
 	}
@@ -372,10 +378,10 @@
 	}
 
-	fibril_mutex_unlock(&rtc->mutex);
-
 	/* Try to normalize the content of the tm structure */
 	time_t r = mktime(t);
 
-	boottime = r - uptime_get();
+	rtc->boottime = r - uptime_get();
+
+	fibril_mutex_unlock(&rtc->mutex);
 
 	return r < 0 ? EINVAL : EOK;
@@ -410,8 +416,8 @@
 	}
 
+	fibril_mutex_lock(&rtc->mutex);
+
 	/* boottime must be recomputed */
-	boottime = 0;
-
-	fibril_mutex_lock(&rtc->mutex);
+	rtc->boottime = 0;
 
 	/* Detect the RTC epoch */
