aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2018-09-02 20:17:51 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2018-09-02 20:17:51 +0000
commit420382368aedd73a0c87b8686049041e3479db3b (patch)
treea010fd611bdfd9ef47eb74701ae9f25530bdf960 /sys
parent9eb958988a31a375385b4ff1088ab9da6e55c2de (diff)
downloadsrc-420382368aedd73a0c87b8686049041e3479db3b.tar.gz
src-420382368aedd73a0c87b8686049041e3479db3b.zip
Improve error messages from clock_if.m method failures.
Print error message in verbose mode when CLOCK_SETTIME() clock_if.m method failed. For EFIRT RTC clock, add error code for the failure of CLOCK_GETTIME() report. Reviewed by: kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (rgrimes) Differential revision: https://reviews.freebsd.org/D16972
Notes
Notes: svn path=/head/; revision=338435
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/efidev/efirtc.c3
-rw-r--r--sys/kern/subr_rtc.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/efidev/efirtc.c b/sys/dev/efidev/efirtc.c
index b9e06bcc362e..e5a2ec262bf5 100644
--- a/sys/dev/efidev/efirtc.c
+++ b/sys/dev/efidev/efirtc.c
@@ -74,7 +74,8 @@ efirtc_probe(device_t dev)
*/
if ((error = efi_get_time(&tm)) != 0) {
if (bootverbose)
- device_printf(dev, "cannot read EFI realtime clock\n");
+ device_printf(dev, "cannot read EFI realtime clock, "
+ "error %d\n", error);
return (error);
}
device_set_desc(dev, "EFI Realtime Clock");
diff --git a/sys/kern/subr_rtc.c b/sys/kern/subr_rtc.c
index 82c276f210a2..1c3a9804694c 100644
--- a/sys/kern/subr_rtc.c
+++ b/sys/kern/subr_rtc.c
@@ -138,6 +138,7 @@ settime_task_func(void *arg, int pending)
{
struct timespec ts;
struct rtc_instance *rtc;
+ int error;
rtc = arg;
if (!(rtc->flags & CLOCKF_SETTIME_NO_TS)) {
@@ -150,7 +151,9 @@ settime_task_func(void *arg, int pending)
ts.tv_sec = 0;
ts.tv_nsec = 0;
}
- CLOCK_SETTIME(rtc->clockdev, &ts);
+ error = CLOCK_SETTIME(rtc->clockdev, &ts);
+ if (error != 0 && bootverbose)
+ device_printf(rtc->clockdev, "CLOCK_SETTIME error %d\n", error);
}
static void