On Mon, 2018-02-12 at 17:41 +0000, Ian Lepore wrote:
> Author: ian
> Date: Mon Feb 12 17:41:11 2018
> New Revision: 329173
> URL: https://svnweb.freebsd.org/changeset/base/329173
> Log:
>   Add a new sysctl, debug.clock_do_io, to allow manully triggering a one-shot
>   read or write of all registered realtime clocks.  In the read case, the
>   values read are simply discarded.  For writes, there's no alternative but
>   to actually write the current system time to the device.
> Modified:
>   head/sys/kern/subr_rtc.c

I've received several questions about this series of commits, which I
think means I probably should have put it up for review first.  I
didn't do so only because every other RTC-related change I've put on
phab has just languished without comments for a couple weeks before I
gave up waiting and committed it anyway.

As to what this series of rtc debugging changes was about in general...

I'm tired of hacking read-now/write-now sysctls into (and then back out
of before committing) every RTC driver I've ever worked on.  It's nice
to be able to debug them without actually changing the time on the
system continuously and/or rebooting.  If you can trigger the IO on
demand you can use kldload/unload while testing.  Otherwise the only
way to make a read happen after you've made a code change is to

Another motivation: I want to eliminate atrtc's ddb "show rtc" command
that only works in that one of the dozen+ rtc drivers we have, and it
brings complications to the atrtc code that I want to clean up.  

As to why I made clock_do_io a "write to read" thing...

I find myself always doing "sysctl -a | grep something" where something
is some fragment of an oid name I vaguely remember.  I'm probably not
alone in doing things like that, and I didn't want sysctl -a to start
triggering expensive hardware accesses like i2c bus transactions;
that's why I made it "write-to-read" (which requires that you go look
for the debugging output on the console or in dmesg, which is klunky,
but hey... this is debugging stuff, not some fancy new kernel abi for
reading time).

-- Ian

svn-src-all@freebsd.org mailing list
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to