Re: [chrony-dev] [PATCH] rtc (linux): Help the user diagnose a problem with RTC UIE ioctl requests

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Sun, Dec 06, 2020 at 01:00:00PM -0000, Michael Witten wrote:
> --- a/doc/faq.adoc
> +++ b/doc/faq.adoc
> @@ -587,12 +587,17 @@ is started after it has run.
>  === I just keep getting the `513 RTC driver not running` message
>  
>  For the real-time clock support to work, you need the following three
> -things
> +things:
>  
>  * an RTC in your computer
>  * a Linux kernel with enabled RTC support
>  * an `rtcfile` directive in your _chrony.conf_ file
>  
> +Your real-time clock hardware might not support the required ioctl requests;
> +it might be necessary to build the Linux kernel with support for software
> +emulation instead (try enabling the following build-time option:
> +`CONFIG_RTC_INTF_DEV_UIE_EMUL`).

I like this.

> --- a/rtc_linux.c
> +++ b/rtc_linux.c
> @@ -518,6 +518,14 @@ RTC_Linux_Initialise(void)
>    /* Make sure the RTC supports interrupts */
>    if (!switch_interrupts(1) || !switch_interrupts(0)) {
>      close(fd);
> +    LOG(LOGS_WARN, "The RTC driver could not be initialised.");
> +#if DEBUG > 0
> +    LOG(LOGS_INFO,
> +        "Your real-time clock hardware might not support the required "
> +        "ioctl requests; it might be necessary to build the Linux kernel "
> +        "with support for software emulation instead: When configuring the "
> +        "kernel, enable this option: CONFIG_RTC_INTF_DEV_UIE_EMUL");
> +#endif
>      return 0;
>    }

The switch_interrupts() function should log an error message when the
driver doesn't support interrupts. Instead of adding more log messages
to explain the error, I'd prefer a new question in the FAQ
specifically for the error message.

There are many other error messages that can be generated. I think the
documentation is a better place than the system log to describe the
issues and provide potential solutions.

-- 
Miroslav Lichvar


-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/