summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorDennis Kou <dkou@nvidia.com>2015-03-17 21:35:03 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-08-03 10:34:57 -0400
commitea0c4300a6bfe7b3e607c45658968fcb22cb78f4 (patch)
tree52470fd1e0804fa969b64dc8d03dca767fd20d80 /drivers/tty
parentcd1acad975a765d62c28bb33acfd535365cbd81a (diff)
tegra: hv_comm: update driver for ivc reset
Update the virtual serial driver to implement support for ivc channel resets. Use of ivc under the previous (non-reset) model has been deprecated. Bug 1597821 Change-Id: Icbe2914d66628f0e604808fa8fafa5778edc866b Signed-off-by: Dennis Kou <dkou@nvidia.com> Reviewed-on: http://git-master/r/1314799 Signed-off-by: Bo Kim <bok@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1527785 GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/tegra_hv_comm.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/tty/serial/tegra_hv_comm.c b/drivers/tty/serial/tegra_hv_comm.c
index 301a53197..5a08c8bfe 100644
--- a/drivers/tty/serial/tegra_hv_comm.c
+++ b/drivers/tty/serial/tegra_hv_comm.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * tegra_hv_comm.c: TTY over Tegra HV 2 * tegra_hv_comm.c: TTY over Tegra HV
3 * 3 *
4 * Copyright (c) 2014 NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2015 NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * Very loosely based on altera_jtaguart.c 6 * Very loosely based on altera_jtaguart.c
7 * 7 *
@@ -323,11 +323,14 @@ static irqreturn_t tegra_hv_comm_interrupt(int irq, void *data)
323 323
324 spin_lock(&port->lock); 324 spin_lock(&port->lock);
325 325
326 if (pp->rx_en && tegra_hv_ivc_can_read(pp->ivck)) 326 /* until this function returns 0, the channel is unusable */
327 tegra_hv_comm_rx_chars(pp); 327 if (tegra_hv_ivc_channel_notified(pp->ivck) == 0) {
328 if (pp->rx_en && tegra_hv_ivc_can_read(pp->ivck))
329 tegra_hv_comm_rx_chars(pp);
328 330
329 tegra_hv_comm_tx_chars(pp); 331 tegra_hv_comm_tx_chars(pp);
330 xmit_timer_setup(pp, 0); 332 xmit_timer_setup(pp, 0);
333 }
331 334
332 spin_unlock(&port->lock); 335 spin_unlock(&port->lock);
333 336
@@ -543,6 +546,13 @@ static int tegra_hv_comm_probe(struct platform_device *pdev)
543 port->ops = &tegra_hv_comm_ops; 546 port->ops = &tegra_hv_comm_ops;
544 port->flags = UPF_BOOT_AUTOCONF; 547 port->flags = UPF_BOOT_AUTOCONF;
545 548
549 /*
550 * start the channel reset process asynchronously. until the reset
551 * process completes, any attempt to use the ivc channel will return
552 * an error (e.g., all transmits will fail.)
553 */
554 tegra_hv_ivc_channel_reset(pp->ivck);
555
546 ret = uart_add_one_port(&tegra_hv_comm_driver, port); 556 ret = uart_add_one_port(&tegra_hv_comm_driver, port);
547 if (ret != 0) { 557 if (ret != 0) {
548 dev_err(dev, "uart_add_one_port failed\n"); 558 dev_err(dev, "uart_add_one_port failed\n");