There are three locks involved in two sequence:But but but. suspend_console() releases console_sem again.
a) pm suspend:
console_lock (@suspend_console())
cpu_add_remove_lock (@disable_nonboot_cpus())
cpu_hotplug.lock (@_cpu_down())
So the
sequence is actually
down(&console_sem) (@suspend_console())
up(&console_sem) (@suspend_console())
cpu_add_remove_lock (@disable_nonboot_cpus())
cpu_hotplug.lock (@_cpu_down())
So console_sem *doesn't* nest outside cpu_add_remove_lock and
cpu_hotplug.lock.
b) Plug-out CPUx:console_lock() does down(&console_sem) *before* testing
cpu_add_remove_lock (@(cpu_down())
cpu_hotplug.lock (@_cpu_down())
console_lock (@console_cpu_notify()) => Lockdeps prints warning log.
There should be not real deadlock, as flag of console_suspended can
protect this.
console_suspended, so I don't understand this sentence - a more
detailed description would help.