From: Linus Torvalds Date: Sun, 21 Feb 2021 05:28:04 +0000 (-0800) Subject: Merge tag 'tty-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e4286926abbbaab9b047c8bc25cae78ec990928f;p=linux.git Merge tag 'tty-5.12-rc1' of git://git./linux/kernel/git/gregkh/tty Pull tty/serial driver updates from Greg KH: "Here is the big set of tty/serial driver changes for 5.12-rc1. Nothing huge, just lots of good cleanups and additions: - n_tty line discipline cleanups - vt core cleanups and reworks to make the code more "modern" - stm32 driver additions - tty led support added to the tty core and led layer - minor serial driver fixups and additions All of these have been in linux-next for a while with no reported issues" * tag 'tty-5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (54 commits) serial: core: Remove BUG_ON(in_interrupt()) check vt_ioctl: Remove in_interrupt() check dt-bindings: serial: imx: Switch to my personal address vt: keyboard, use new API for keyboard_tasklet serial: stm32: improve platform_get_irq condition handling in init_port serial: ifx6x60: Remove driver for deprecated platform tty: fix up iterate_tty_read() EOVERFLOW handling tty: fix up hung_up_tty_read() conversion tty: fix up hung_up_tty_write() conversion tty: teach the n_tty ICANON case about the new "cookie continuations" too tty: teach n_tty line discipline about the new "cookie continuations" tty: clean up legacy leftovers from n_tty line discipline tty: implement read_iter tty: convert tty_ldisc_ops 'read()' function to take a kernel pointer serial: remove sirf prima/atlas driver serial: mxs-auart: Remove serial: mxs-auart: Remove serial_mxs_probe_dt() serial: fsl_lpuart: Use of_device_get_match_data() dt-bindings: serial: renesas,hscif: Add r8a779a0 support tty: serial: Drop unused efm32 serial driver ... --- e4286926abbbaab9b047c8bc25cae78ec990928f diff --cc drivers/tty/n_tty.c index 219e85756171b,e508c4672bcf9..87ec15dbe10db --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@@ -2077,10 -2072,16 +2072,13 @@@ static bool canon_copy_from_read_buf(st else ldata->push = 0; tty_audit_push(); + return false; } - return 0; + + /* No EOL found - do a continuation retry if there is more data */ + return ldata->read_tail != canon_head; } -extern ssize_t redirected_tty_write(struct file *, const char __user *, - size_t, loff_t *); - /** * job_control - check job control * @tty: tty diff --cc drivers/tty/tty_io.c index 082da38762fc7,eb7bd80cd1559..74733ec8f5653 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@@ -142,10 -142,12 +142,10 @@@ LIST_HEAD(tty_drivers); /* linked lis /* Mutex to protect creating and releasing a tty */ DEFINE_MUTEX(tty_mutex); - static ssize_t tty_read(struct file *, char __user *, size_t, loff_t *); + static ssize_t tty_read(struct kiocb *, struct iov_iter *); static ssize_t tty_write(struct kiocb *, struct iov_iter *); -ssize_t redirected_tty_write(struct kiocb *, struct iov_iter *); static __poll_t tty_poll(struct file *, poll_table *); static int tty_open(struct inode *, struct file *); -long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg); #ifdef CONFIG_COMPAT static long tty_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg); diff --cc include/linux/tty.h index 37803f3e6d49e,dd6ded6138f79..95fc2f100f12d --- a/include/linux/tty.h +++ b/include/linux/tty.h @@@ -421,7 -421,7 +421,8 @@@ extern void tty_kclose(struct tty_struc extern int tty_dev_name_to_number(const char *name, dev_t *number); extern int tty_ldisc_lock(struct tty_struct *tty, unsigned long timeout); extern void tty_ldisc_unlock(struct tty_struct *tty); +extern ssize_t redirected_tty_write(struct kiocb *, struct iov_iter *); + extern struct file *tty_release_redirect(struct tty_struct *tty); #else static inline void tty_kref_put(struct tty_struct *tty) { }