I though about this circular dependency for a while and came to theconclusion that stop_machine from a multithreaded workqueue is notallowed. It deadlocks with cpu_down. We either use a single-threadedworkqueue or an explicitly created kernel thread for the clocksourcedowngrade. The kthread_run solution seems to be less painful thanto create a single-threaded workqueue. Untested patch below.

--Subject: [PATCH] clocksource watchdog circular locking dependency

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

stop_machine from a multithreaded workqueue is not allowed becauseof a circular locking dependency between cpu_down and the workqueueexecution. Use a kernel thread to do the clocksource downgrade.