diff options
author | Karthikeyan Ramasubramanian <kramasub@codeaurora.org> | 2018-05-03 16:14:33 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-14 07:44:54 -0400 |
commit | f02625689e543165d840aa0eb9cf2945636de25d (patch) | |
tree | 1c5d116f63acc9ba0ea07a122edab70c7937db63 | |
parent | aa2f80e752c75e593b3820f42c416ed9458fa73e (diff) |
tty: serial: qcom_geni_serial: Add comments for clarification
* Document reason for newline character counting in console_write
* Document reason for disabling IRQ in the system resume operation
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/qcom_geni_serial.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index c3eb87c028a6..dcd22ca33485 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c | |||
@@ -286,6 +286,10 @@ __qcom_geni_serial_console_write(struct uart_port *uport, const char *s, | |||
286 | u32 bytes_to_send = count; | 286 | u32 bytes_to_send = count; |
287 | 287 | ||
288 | for (i = 0; i < count; i++) { | 288 | for (i = 0; i < count; i++) { |
289 | /* | ||
290 | * uart_console_write() adds a carriage return for each newline. | ||
291 | * Account for additional bytes to be written. | ||
292 | */ | ||
289 | if (s[i] == '\n') | 293 | if (s[i] == '\n') |
290 | bytes_to_send++; | 294 | bytes_to_send++; |
291 | } | 295 | } |
@@ -1101,6 +1105,14 @@ static int __maybe_unused qcom_geni_serial_sys_resume_noirq(struct device *dev) | |||
1101 | 1105 | ||
1102 | if (console_suspend_enabled && uport->suspended) { | 1106 | if (console_suspend_enabled && uport->suspended) { |
1103 | uart_resume_port(uport->private_data, uport); | 1107 | uart_resume_port(uport->private_data, uport); |
1108 | /* | ||
1109 | * uart_suspend_port() invokes port shutdown which in turn | ||
1110 | * frees the irq. uart_resume_port invokes port startup which | ||
1111 | * performs request_irq. The request_irq auto-enables the IRQ. | ||
1112 | * In addition, resume_noirq implicitly enables the IRQ and | ||
1113 | * leads to an unbalanced IRQ enable warning. Disable the IRQ | ||
1114 | * before returning so that the warning is suppressed. | ||
1115 | */ | ||
1104 | disable_irq(uport->irq); | 1116 | disable_irq(uport->irq); |
1105 | } | 1117 | } |
1106 | return 0; | 1118 | return 0; |