aboutsummaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2018-05-08 16:58:53 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-05-24 04:03:20 -0500
commit277615348ba64dbdff426206d1b6a619811163b1 (patch)
tree8e562ad953d6a75533c2c5d4a1bd6c2ff7228631 /external
parente9ee7c7d357160a704c8248a1787124f94df8c54 (diff)
downloadskiboot-277615348ba64dbdff426206d1b6a619811163b1.zip
skiboot-277615348ba64dbdff426206d1b6a619811163b1.tar.gz
skiboot-277615348ba64dbdff426206d1b6a619811163b1.tar.bz2
core/console: fix deadlock when printing with console lock held
Some debugging options will print while the console lock is held, which is why the console lock is taken as a recursive lock. However console_write calls __flush_console, which will drop and re-take the lock non-recursively in some cases. Just set con_need_flush and return from __flush_console if we are holding the console lock already. This stack usage message (taken with this patch applied) could lead to a deadlock without this: CPU 0000 lowest stack mark 11768 bytes left pc=300cb808 token=0 CPU 0000 Backtrace: S: 0000000031c03370 R: 00000000300cb808 .list_check_node+0x1c S: 0000000031c03410 R: 00000000300cb910 .list_check+0x38 S: 0000000031c034b0 R: 00000000300190ac .try_lock_caller+0xb8 S: 0000000031c03540 R: 00000000300192e0 .lock_caller+0x80 S: 0000000031c03600 R: 0000000030012c70 .__flush_console+0x134 S: 0000000031c036d0 R: 00000000300130cc .console_write+0x68 S: 0000000031c03780 R: 00000000300347bc .vprlog+0xc8 S: 0000000031c03970 R: 0000000030034844 ._prlog+0x50 S: 0000000031c03a00 R: 00000000300364a4 .log_simple_error+0x74 S: 0000000031c03b90 R: 000000003004ab48 .occ_pstates_init+0x184 S: 0000000031c03d50 R: 000000003001480c .load_and_boot_kernel+0x38c S: 0000000031c03e30 R: 000000003001571c .main_cpu_entry+0x62c S: 0000000031c03f00 R: 0000000030002700 boot_entry+0x1c0 Reported-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'external')
0 files changed, 0 insertions, 0 deletions