summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorKarthikeyan Ramasubramanian <kramasub@codeaurora.org>2018-05-03 22:14:33 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-14 13:44:54 +0200
commitf02625689e543165d840aa0eb9cf2945636de25d (patch)
tree1c5d116f63acc9ba0ea07a122edab70c7937db63 /drivers/tty
parentserial: samsung: fix maxburst parameter for DMA transactions (diff)
downloadlinux-f02625689e543165d840aa0eb9cf2945636de25d.tar.xz
linux-f02625689e543165d840aa0eb9cf2945636de25d.zip
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>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/qcom_geni_serial.c12
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,
u32 bytes_to_send = count;
for (i = 0; i < count; i++) {
+ /*
+ * uart_console_write() adds a carriage return for each newline.
+ * Account for additional bytes to be written.
+ */
if (s[i] == '\n')
bytes_to_send++;
}
@@ -1101,6 +1105,14 @@ static int __maybe_unused qcom_geni_serial_sys_resume_noirq(struct device *dev)
if (console_suspend_enabled && uport->suspended) {
uart_resume_port(uport->private_data, uport);
+ /*
+ * uart_suspend_port() invokes port shutdown which in turn
+ * frees the irq. uart_resume_port invokes port startup which
+ * performs request_irq. The request_irq auto-enables the IRQ.
+ * In addition, resume_noirq implicitly enables the IRQ and
+ * leads to an unbalanced IRQ enable warning. Disable the IRQ
+ * before returning so that the warning is suppressed.
+ */
disable_irq(uport->irq);
}
return 0;