Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

powerpc/powernv: move opal console flushing to udbg

OPAL console writes do not have to synchronously flush firmware /
hardware buffers unless they are going through the udbg path.

Remove the unconditional flushing from opal_put_chars. Flush if
there was no space in the buffer as an optimisation (callers loop
waiting for success in that case). udbg flushing is moved to
udbg_opal_putc.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Nicholas Piggin and committed by
Michael Ellerman
ac4ac788 b74d2807

+12 -5
+7 -5
arch/powerpc/platforms/powernv/opal.c
··· 400 400 out: 401 401 spin_unlock_irqrestore(&opal_write_lock, flags); 402 402 403 - /* This is a bit nasty but we need that for the console to 404 - * flush when there aren't any interrupts. We will clean 405 - * things a bit later to limit that to synchronous path 406 - * such as the kernel console and xmon/udbg 403 + /* In the -EAGAIN case, callers loop, so we have to flush the console 404 + * here in case they have interrupts off (and we don't want to wait 405 + * for async flushing if we can make immediate progress here). If 406 + * necessary the API could be made entirely non-flushing if the 407 + * callers had a ->flush API to use. 407 408 */ 408 - opal_flush_console(vtermno); 409 + if (written == -EAGAIN) 410 + opal_flush_console(vtermno); 409 411 410 412 return written; 411 413 }
+5
drivers/tty/hvc/hvc_opal.c
··· 275 275 count = hvc_opal_hvsi_put_chars(termno, &c, 1); 276 276 break; 277 277 } 278 + 279 + /* This is needed for the cosole to flush 280 + * when there aren't any interrupts. 281 + */ 282 + opal_flush_console(termno); 278 283 } while(count == 0 || count == -EAGAIN); 279 284 } 280 285