summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2013-05-20 18:39:02 (GMT)
committerScott Wood <scottwood@freescale.com>2013-05-20 18:39:02 (GMT)
commitb08bbdbf93d9862b77d41560c1447f37c3954930 (patch)
tree1defef32b478eead9fbcfc4646900a4122a86172 /drivers/tty
parent84df6e416de47ccca8845e584ef3683ad068b790 (diff)
parentdbf932a9b316d5b29b3e220e5a30e7a165ad2992 (diff)
downloadlinux-fsl-qoriq-b08bbdbf93d9862b77d41560c1447f37c3954930.tar.xz
Merge tag 'v3.8.13'
This is the 3.8.13 stable release
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/pty.c3
-rw-r--r--drivers/tty/serial/serial_core.c4
-rw-r--r--drivers/tty/tty_io.c14
3 files changed, 19 insertions, 2 deletions
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index ac35c90..c830b60 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -675,6 +675,9 @@ static int ptmx_open(struct inode *inode, struct file *filp)
nonseekable_open(inode, filp);
+ /* We refuse fsnotify events on ptmx, since it's a shared resource */
+ filp->f_mode |= FMODE_NONOTIFY;
+
retval = tty_alloc_file(filp);
if (retval)
return retval;
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 2c7230a..4293a3e 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1940,6 +1940,8 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
mutex_unlock(&port->mutex);
return 0;
}
+ put_device(tty_dev);
+
if (console_suspend_enabled || !uart_console(uport))
uport->suspended = 1;
@@ -2005,9 +2007,11 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
disable_irq_wake(uport->irq);
uport->irq_wake = 0;
}
+ put_device(tty_dev);
mutex_unlock(&port->mutex);
return 0;
}
+ put_device(tty_dev);
uport->suspended = 0;
/*
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index da9fde8..f34f98d 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -941,6 +941,14 @@ void start_tty(struct tty_struct *tty)
EXPORT_SYMBOL(start_tty);
+/* We limit tty time update visibility to every 8 seconds or so. */
+static void tty_update_time(struct timespec *time)
+{
+ unsigned long sec = get_seconds() & ~7;
+ if ((long)(sec - time->tv_sec) > 0)
+ time->tv_sec = sec;
+}
+
/**
* tty_read - read method for tty device files
* @file: pointer to tty file
@@ -977,8 +985,10 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count,
else
i = -EIO;
tty_ldisc_deref(ld);
+
if (i > 0)
- inode->i_atime = current_fs_time(inode->i_sb);
+ tty_update_time(&inode->i_atime);
+
return i;
}
@@ -1081,7 +1091,7 @@ static inline ssize_t do_tty_write(
}
if (written) {
struct inode *inode = file->f_path.dentry->d_inode;
- inode->i_mtime = current_fs_time(inode->i_sb);
+ tty_update_time(&inode->i_mtime);
ret = written;
}
out: