]> git.karo-electronics.de Git - karo-tx-linux.git/commit
clocksource: Provide unbind interface in sysfs
authorThomas Gleixner <tglx@linutronix.de>
Thu, 25 Apr 2013 20:31:46 +0000 (20:31 +0000)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 16 May 2013 09:09:15 +0000 (11:09 +0200)
commit7eaeb34305dee26634f7c98ae62646da5cebe91d
tree90651274a29cbb0e17d7655ca63a15aa5e7edc30
parent29b5407819f59731c9423238fae03b756822708c
clocksource: Provide unbind interface in sysfs

With the module refcount held for the current clocksource there is no
way to unload the module.

Provide a sysfs interface which allows to unbind the clocksource. One
could argue that the clocksource override could be (ab)used to do so,
but the clocksource override cannot be used from the kernel itself,
while an unbind function can be used to programmatically check whether
a clocksource can be shutdown or not.

The unbind functionality uses the new skip current feature of
clocksource_select and verifies that a fallback clocksource has been
installed. If the clocksource which should be unbound is the current
clocksource and no fallback can be found, unbind returns -EBUSY.

This does not support the unbinding of a clocksource which is used as
the watchdog clocksource. No point in fostering crappy hardware.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
Link: http://lkml.kernel.org/r/20130425143435.964218245@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/time/clocksource.c