printk: fix lockdep instrumentation of console_sem
printk: fix lockdep instrumentation of console_sem

Printk calls mutex_acquire() / mutex_release() by hand to instrument
lockdep about console_sem.  However in some corner cases the
instrumentation is missing.  Fix the problem by creating helper functions
for locking / unlocking console_sem which take care of lockdep
instrumentation as well.

Signed-off-by: Jan Kara <596727c8a0ea4db3ba2ceceedccbacd3d7b371b8@suse.cz>
Reported-by: Fabio Estevam <288a049a20dc4091188b72022d411ad1375e6737@gmail.com>
Reported-by: Andy Shevchenko <74f0c009df510614346aa771cd21959b78cdb413@linux.intel.com>
Tested-by: Fabio Estevam <679188261afeb60eb822cd934fd7b46a48ddd743@freescale.com>
Tested-By: Valdis Kletnieks <814188cd03107d5799513ce54504ae6de4a1462b@vt.edu>
Cc: Steven Rostedt <43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org>
Cc: Peter Zijlstra <3fddac958924aef220f202ca567388ddab3f14a8@infradead.org>
Cc: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@kernel.org>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs