aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-05-08 00:14:26 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-05-08 00:14:26 -0400
commit1de1455f33709a8afd8d41d26d09739a1148105b (patch)
tree5818d3cd5c087f8df8e423db7ba9ee88fb370371 /arch/powerpc/platforms
parent30650239adc9e4e9439256d6988e521518dccbb3 (diff)
powerpc/powernv: Properly drop characters if console is closed
If the firmware returns an error such as "closed" (or hardware error), we should drop characters. Currently we only do that when a firmware compatible with OPAL v2 APIs is detected, in the code that calls opal_console_write_buffer_space(), which didn't exist with OPAL v1 (or didn't work). However, when enabling early debug consoles, the flag indicating that v2 is supported isn't set yet, causing us, in case of errors or closed console, to spin forever. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/powernv/opal.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index ade4463226c6..12d9846aa87e 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -144,6 +144,13 @@ int opal_put_chars(uint32_t vtermno, const char *data, int total_len)
144 rc == OPAL_BUSY_EVENT || rc == OPAL_SUCCESS)) { 144 rc == OPAL_BUSY_EVENT || rc == OPAL_SUCCESS)) {
145 len = total_len; 145 len = total_len;
146 rc = opal_console_write(vtermno, &len, data); 146 rc = opal_console_write(vtermno, &len, data);
147
148 /* Closed or other error drop */
149 if (rc != OPAL_SUCCESS && rc != OPAL_BUSY &&
150 rc != OPAL_BUSY_EVENT) {
151 written = total_len;
152 break;
153 }
147 if (rc == OPAL_SUCCESS) { 154 if (rc == OPAL_SUCCESS) {
148 total_len -= len; 155 total_len -= len;
149 data += len; 156 data += len;