aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-03 13:11:36 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-03 13:11:36 +0200
commitcce81eac7fd0852d96ce0ce62cbe8f2b76d227f5 (patch)
treeb3ec5c9b08f41581185754ac199f0dcb9d6dda95
parent4a11ea0818f9d84b7b29693f27adaa5d020ffe25 (diff)
downloadpatches-cce81eac7fd0852d96ce0ce62cbe8f2b76d227f5.tar.gz
update readfile and other patches to 5.12-rc5
-rw-r--r--0001-readfile-implement-readfile-syscall.patch4
-rw-r--r--0001-tty-n_r3964-locking-fixups.patch4
-rw-r--r--0002-arch-wire-up-the-readfile-syscall.patch120
-rw-r--r--0002-tty-n_r3964-fix-poll-return-value.patch2
-rw-r--r--0003-selftests-add-readfile-2-selftests.patch81
-rw-r--r--0004-readfile.2-new-page-describing-readfile-2.patch2
-rw-r--r--0005-tty-n_r3964-split-rx-and-tx-header-structures.patch6
-rw-r--r--0009-tty-n_r3964-for-messages-use-a-real-kernel-list.patch8
-rw-r--r--0012-tty-n_r3964-remove-read_lock-from-some-ioctls.patch4
-rw-r--r--0014-tty-n_r3964-properly-reference-count-pids.patch12
-rw-r--r--0015-tty-n_r3964-add-reference-counting-to-the-client-str.patch8
11 files changed, 127 insertions, 124 deletions
diff --git a/0001-readfile-implement-readfile-syscall.patch b/0001-readfile-implement-readfile-syscall.patch
index 3c231178ee635e..b34eca5524367e 100644
--- a/0001-readfile-implement-readfile-syscall.patch
+++ b/0001-readfile-implement-readfile-syscall.patch
@@ -1,4 +1,4 @@
-From 81ede03c890891a967dad69370fcf821c4c283fc Mon Sep 17 00:00:00 2001
+From 9f2f78c4e3056805f8b5c6d58ec7a2c5cfda5482 Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Sun, 24 May 2020 12:37:15 +0200
Subject: [PATCH 1/4] readfile: implement readfile syscall
@@ -20,7 +20,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/fs/open.c
+++ b/fs/open.c
-@@ -1385,3 +1385,53 @@ int stream_open(struct inode *inode, str
+@@ -1400,3 +1400,53 @@ int stream_open(struct inode *inode, str
}
EXPORT_SYMBOL(stream_open);
diff --git a/0001-tty-n_r3964-locking-fixups.patch b/0001-tty-n_r3964-locking-fixups.patch
index 77d8f13af100ba..678565cff8abf7 100644
--- a/0001-tty-n_r3964-locking-fixups.patch
+++ b/0001-tty-n_r3964-locking-fixups.patch
@@ -129,7 +129,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
TRACE_M("add_msg - kmalloc %p", pMsg);
if (pMsg == NULL) {
return;
-@@ -1068,9 +1081,7 @@ static ssize_t r3964_read(struct tty_str
+@@ -1069,9 +1082,7 @@ static ssize_t r3964_read(struct tty_str
TRACE_L("read()");
@@ -140,7 +140,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (file->f_flags & O_NONBLOCK) {
if (!mutex_trylock(&pInfo->read_lock))
return -EAGAIN;
-@@ -1192,28 +1203,45 @@ static int r3964_ioctl(struct tty_struct
+@@ -1190,28 +1201,45 @@ static int r3964_ioctl(struct tty_struct
unsigned int cmd, unsigned long arg)
{
struct r3964_info *pInfo = tty->disc_data;
diff --git a/0002-arch-wire-up-the-readfile-syscall.patch b/0002-arch-wire-up-the-readfile-syscall.patch
index 687aad72dbc606..5b6b45f0ed9070 100644
--- a/0002-arch-wire-up-the-readfile-syscall.patch
+++ b/0002-arch-wire-up-the-readfile-syscall.patch
@@ -1,4 +1,4 @@
-From 7cb89db31b533823719673c881acb19d6b879f98 Mon Sep 17 00:00:00 2001
+From 8e475ba37dc1e5922dc4648bb42b1a36f692e440 Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Sun, 24 May 2020 12:36:21 +0200
Subject: [PATCH 2/4] arch: wire up the readfile syscall
@@ -30,133 +30,133 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/arch/alpha/kernel/syscalls/syscall.tbl
+++ b/arch/alpha/kernel/syscalls/syscall.tbl
-@@ -481,3 +481,4 @@
- 549 common faccessat2 sys_faccessat2
+@@ -482,3 +482,4 @@
550 common process_madvise sys_process_madvise
551 common epoll_pwait2 sys_epoll_pwait2
-+552 common readfile sys_readfile
+ 552 common mount_setattr sys_mount_setattr
++553 common readfile sys_readfile
--- a/arch/arm/tools/syscall.tbl
+++ b/arch/arm/tools/syscall.tbl
-@@ -455,3 +455,4 @@
- 439 common faccessat2 sys_faccessat2
+@@ -456,3 +456,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2
-+442 common readfile sys_readfile
+ 442 common mount_setattr sys_mount_setattr
++443 common readfile sys_readfile
--- a/arch/arm64/include/asm/unistd32.h
+++ b/arch/arm64/include/asm/unistd32.h
-@@ -891,6 +891,8 @@ __SYSCALL(__NR_faccessat2, sys_faccessat
- __SYSCALL(__NR_process_madvise, sys_process_madvise)
- #define __NR_epoll_pwait2 441
+@@ -893,6 +893,8 @@ __SYSCALL(__NR_process_madvise, sys_proc
__SYSCALL(__NR_epoll_pwait2, compat_sys_epoll_pwait2)
-+#define __NR_readfile 442
+ #define __NR_mount_setattr 442
+ __SYSCALL(__NR_mount_setattr, sys_mount_setattr)
++#define __NR_readfile 443
+__SYSCALL(__NR_readfile, sys_readfile)
/*
* Please add new compat syscalls above this comment and update
--- a/arch/ia64/kernel/syscalls/syscall.tbl
+++ b/arch/ia64/kernel/syscalls/syscall.tbl
-@@ -362,3 +362,4 @@
- 439 common faccessat2 sys_faccessat2
+@@ -363,3 +363,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2
-+442 common readfile sys_readfile
+ 442 common mount_setattr sys_mount_setattr
++443 common readfile sys_readfile
--- a/arch/m68k/kernel/syscalls/syscall.tbl
+++ b/arch/m68k/kernel/syscalls/syscall.tbl
-@@ -441,3 +441,4 @@
- 439 common faccessat2 sys_faccessat2
+@@ -442,3 +442,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2
-+442 common readfile sys_readfile
+ 442 common mount_setattr sys_mount_setattr
++443 common readfile sys_readfile
--- a/arch/microblaze/kernel/syscalls/syscall.tbl
+++ b/arch/microblaze/kernel/syscalls/syscall.tbl
-@@ -447,3 +447,4 @@
- 439 common faccessat2 sys_faccessat2
+@@ -448,3 +448,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2
-+442 common readfile sys_readfile
+ 442 common mount_setattr sys_mount_setattr
++443 common readfile sys_readfile
--- a/arch/mips/kernel/syscalls/syscall_n32.tbl
+++ b/arch/mips/kernel/syscalls/syscall_n32.tbl
-@@ -380,3 +380,4 @@
- 439 n32 faccessat2 sys_faccessat2
+@@ -381,3 +381,4 @@
440 n32 process_madvise sys_process_madvise
441 n32 epoll_pwait2 compat_sys_epoll_pwait2
-+442 n32 readfile sys_readfile
+ 442 n32 mount_setattr sys_mount_setattr
++443 n32 readfile sys_readfile
--- a/arch/mips/kernel/syscalls/syscall_n64.tbl
+++ b/arch/mips/kernel/syscalls/syscall_n64.tbl
-@@ -356,3 +356,4 @@
- 439 n64 faccessat2 sys_faccessat2
+@@ -357,3 +357,4 @@
440 n64 process_madvise sys_process_madvise
441 n64 epoll_pwait2 sys_epoll_pwait2
-+442 n64 readfile sys_readfile
+ 442 n64 mount_setattr sys_mount_setattr
++443 n64 readfile sys_readfile
--- a/arch/mips/kernel/syscalls/syscall_o32.tbl
+++ b/arch/mips/kernel/syscalls/syscall_o32.tbl
-@@ -429,3 +429,4 @@
- 439 o32 faccessat2 sys_faccessat2
+@@ -430,3 +430,4 @@
440 o32 process_madvise sys_process_madvise
441 o32 epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
-+442 o32 readfile sys_readfile
+ 442 o32 mount_setattr sys_mount_setattr
++443 o32 readfile sys_readfile
--- a/arch/parisc/kernel/syscalls/syscall.tbl
+++ b/arch/parisc/kernel/syscalls/syscall.tbl
-@@ -439,3 +439,4 @@
- 439 common faccessat2 sys_faccessat2
+@@ -440,3 +440,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
-+442 common readfile sys_readfile
+ 442 common mount_setattr sys_mount_setattr
++443 common readfile sys_readfile
--- a/arch/powerpc/kernel/syscalls/syscall.tbl
+++ b/arch/powerpc/kernel/syscalls/syscall.tbl
-@@ -531,3 +531,4 @@
- 439 common faccessat2 sys_faccessat2
+@@ -522,3 +522,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
-+442 common readfile sys_readfile
+ 442 common mount_setattr sys_mount_setattr
++443 common readfile sys_readfile
--- a/arch/s390/kernel/syscalls/syscall.tbl
+++ b/arch/s390/kernel/syscalls/syscall.tbl
-@@ -444,3 +444,4 @@
- 439 common faccessat2 sys_faccessat2 sys_faccessat2
+@@ -445,3 +445,4 @@
440 common process_madvise sys_process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
-+442 common readfile sys_readfile sys_readfile
+ 442 common mount_setattr sys_mount_setattr sys_mount_setattr
++443 common readfile sys_readfile sys_readfile
--- a/arch/sh/kernel/syscalls/syscall.tbl
+++ b/arch/sh/kernel/syscalls/syscall.tbl
-@@ -444,3 +444,4 @@
- 439 common faccessat2 sys_faccessat2
+@@ -445,3 +445,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2
-+442 common readfile sys_readfile
+ 442 common mount_setattr sys_mount_setattr
++443 common readfile sys_readfile
--- a/arch/sparc/kernel/syscalls/syscall.tbl
+++ b/arch/sparc/kernel/syscalls/syscall.tbl
-@@ -487,3 +487,4 @@
- 439 common faccessat2 sys_faccessat2
+@@ -488,3 +488,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
-+442 common readfile sys_readfile
+ 442 common mount_setattr sys_mount_setattr
++443 common readfile sys_readfile
--- a/arch/x86/entry/syscalls/syscall_32.tbl
+++ b/arch/x86/entry/syscalls/syscall_32.tbl
-@@ -446,3 +446,4 @@
- 439 i386 faccessat2 sys_faccessat2
+@@ -447,3 +447,4 @@
440 i386 process_madvise sys_process_madvise
441 i386 epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
-+442 i386 readfile sys_readfile
+ 442 i386 mount_setattr sys_mount_setattr
++443 i386 readfile sys_readfile
--- a/arch/x86/entry/syscalls/syscall_64.tbl
+++ b/arch/x86/entry/syscalls/syscall_64.tbl
-@@ -363,6 +363,7 @@
- 439 common faccessat2 sys_faccessat2
+@@ -364,6 +364,7 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2
-+442 common readfile sys_readfile
+ 442 common mount_setattr sys_mount_setattr
++443 common readfile sys_readfile
#
# Due to a historical design error, certain syscalls are numbered differently
--- a/arch/xtensa/kernel/syscalls/syscall.tbl
+++ b/arch/xtensa/kernel/syscalls/syscall.tbl
-@@ -412,3 +412,4 @@
- 439 common faccessat2 sys_faccessat2
+@@ -413,3 +413,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2
-+442 common readfile sys_readfile
+ 442 common mount_setattr sys_mount_setattr
++443 common readfile sys_readfile
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
-@@ -1037,6 +1037,8 @@ asmlinkage long sys_pidfd_send_signal(in
+@@ -1041,6 +1041,8 @@ asmlinkage long sys_pidfd_send_signal(in
siginfo_t __user *info,
unsigned int flags);
asmlinkage long sys_pidfd_getfd(int pidfd, int fd, unsigned int flags);
@@ -167,16 +167,16 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Architecture-specific system calls
--- a/include/uapi/asm-generic/unistd.h
+++ b/include/uapi/asm-generic/unistd.h
-@@ -861,9 +861,11 @@ __SYSCALL(__NR_faccessat2, sys_faccessat
- __SYSCALL(__NR_process_madvise, sys_process_madvise)
- #define __NR_epoll_pwait2 441
+@@ -863,9 +863,11 @@ __SYSCALL(__NR_process_madvise, sys_proc
__SC_COMP(__NR_epoll_pwait2, sys_epoll_pwait2, compat_sys_epoll_pwait2)
-+#define __NR_readfile 442
+ #define __NR_mount_setattr 442
+ __SYSCALL(__NR_mount_setattr, sys_mount_setattr)
++#define __NR_readfile 443
+__SYSCALL(__NR_readfile, sys_readfile)
#undef __NR_syscalls
--#define __NR_syscalls 442
-+#define __NR_syscalls 443
+-#define __NR_syscalls 443
++#define __NR_syscalls 444
/*
* 32 bit systems traditionally used different
diff --git a/0002-tty-n_r3964-fix-poll-return-value.patch b/0002-tty-n_r3964-fix-poll-return-value.patch
index 8e861506afeabd..f4f0b79115cb15 100644
--- a/0002-tty-n_r3964-fix-poll-return-value.patch
+++ b/0002-tty-n_r3964-fix-poll-return-value.patch
@@ -14,7 +14,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/tty/n_r3964.c
+++ b/drivers/tty/n_r3964.c
-@@ -1285,7 +1285,7 @@ static __poll_t r3964_poll(struct tty_st
+@@ -1283,7 +1283,7 @@ static __poll_t r3964_poll(struct tty_st
if (pMsg)
result |= EPOLLIN | EPOLLRDNORM;
} else {
diff --git a/0003-selftests-add-readfile-2-selftests.patch b/0003-selftests-add-readfile-2-selftests.patch
index 0c6d99157d82c6..60d6ee3a16e010 100644
--- a/0003-selftests-add-readfile-2-selftests.patch
+++ b/0003-selftests-add-readfile-2-selftests.patch
@@ -1,4 +1,4 @@
-From 0a72e28bbec2bca34b98823313a03145c4ed507c Mon Sep 17 00:00:00 2001
+From 46848d3e7dac653b47d1657188fd3d3d8b5ff8f9 Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Sun, 8 Mar 2020 09:54:45 +0100
Subject: [PATCH 3/4] selftests: add readfile(2) selftests
@@ -13,17 +13,19 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/Makefile | 1
tools/testing/selftests/readfile/.gitignore | 3
tools/testing/selftests/readfile/Makefile | 7
- tools/testing/selftests/readfile/readfile.c | 285 ++++++++++++++++++++
- tools/testing/selftests/readfile/readfile_speed.c | 301 ++++++++++++++++++++++
- 5 files changed, 597 insertions(+)
+ tools/testing/selftests/readfile/readfile.c | 272 ++++++++++++++++++++
+ tools/testing/selftests/readfile/readfile.h | 23 +
+ tools/testing/selftests/readfile/readfile_speed.c | 289 ++++++++++++++++++++++
+ 6 files changed, 595 insertions(+)
create mode 100644 tools/testing/selftests/readfile/.gitignore
create mode 100644 tools/testing/selftests/readfile/Makefile
create mode 100644 tools/testing/selftests/readfile/readfile.c
+ create mode 100644 tools/testing/selftests/readfile/readfile.h
create mode 100644 tools/testing/selftests/readfile/readfile_speed.c
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
-@@ -48,6 +48,7 @@ TARGETS += ptrace
+@@ -50,6 +50,7 @@ TARGETS += ptrace
TARGETS += openat2
TARGETS += rseq
TARGETS += rtc
@@ -49,43 +51,30 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+include ../lib.mk
--- /dev/null
+++ b/tools/testing/selftests/readfile/readfile.c
-@@ -0,0 +1,285 @@
+@@ -0,0 +1,272 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
-+ * Copyright (c) 2020 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-+ * Copyright (c) 2020 The Linux Foundation
++ * Copyright (c) 2020-2021 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
++ * Copyright (c) 2020-2021 The Linux Foundation
+ *
+ * Test the readfile() syscall in various ways.
+ */
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
-+#include <sys/syscall.h>
+#include <sys/types.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <string.h>
-+#include <syscall.h>
+
+#include "../kselftest.h"
-+
-+//#ifndef __NR_readfile
-+//#define __NR_readfile -1
-+//#endif
-+
-+#define __NR_readfile 442
++#include "readfile.h"
+
+#define TEST_FILE1 "/sys/devices/system/cpu/vulnerabilities/meltdown"
+#define TEST_FILE2 "/sys/devices/system/cpu/vulnerabilities/spectre_v1"
+#define TEST_FILE4 "/sys/kernel/debug/usb/devices"
+
-+static int sys_readfile(int fd, const char *filename, unsigned char *buffer,
-+ size_t bufsize, int flags)
-+{
-+ return syscall(__NR_readfile, fd, filename, buffer, bufsize, flags);
-+}
-+
+/*
+ * Test that readfile() is even in the running kernel or not.
+ */
@@ -336,12 +325,38 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+}
+
--- /dev/null
++++ b/tools/testing/selftests/readfile/readfile.h
+@@ -0,0 +1,23 @@
++// SPDX-License-Identifier: GPL-2.0
++/*
++ * Copyright (c) 2021 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
++ * Copyright (c) 2021 The Linux Foundation
++ *
++ * Define the readfile system call number and
++ * provide a "syscall" function for it.
++ */
++#define _GNU_SOURCE
++#include <sys/syscall.h>
++#include <syscall.h>
++
++//#ifndef __NR_readfile
++//#define __NR_readfile -1
++//#endif
++
++#define __NR_readfile 443
++
++static inline int sys_readfile(int fd, const char *filename,
++ unsigned char *buffer, size_t bufsize, int flags)
++{
++ return syscall(__NR_readfile, fd, filename, buffer, bufsize, flags);
++}
+--- /dev/null
+++ b/tools/testing/selftests/readfile/readfile_speed.c
-@@ -0,0 +1,301 @@
+@@ -0,0 +1,289 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
-+ * Copyright (c) 2020 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-+ * Copyright (c) 2020 The Linux Foundation
++ * Copyright (c) 2020-2021 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
++ * Copyright (c) 2020-2021 The Linux Foundation
+ *
+ * Tiny test program to try to benchmark the speed of the readfile syscall vs.
+ * the open/read/close sequence it can replace.
@@ -356,12 +371,12 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
-+#include <sys/syscall.h>
+#include <sys/types.h>
-+#include <syscall.h>
+#include <time.h>
+#include <unistd.h>
+
++#include "readfile.h"
++
+/* Default test file if no one wants to pick something else */
+#define DEFAULT_TEST_FILE "/sys/devices/system/cpu/vulnerabilities/meltdown"
+
@@ -379,18 +394,6 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+ TEST_BOTH,
+};
+
-+/* Find the readfile syscall number */
-+//#ifndef __NR_readfile
-+//#define __NR_readfile -1
-+//#endif
-+#define __NR_readfile 440
-+
-+static int sys_readfile(int fd, const char *filename, unsigned char *buffer,
-+ size_t bufsize, int flags)
-+{
-+ return syscall(__NR_readfile, fd, filename, buffer, bufsize, flags);
-+}
-+
+/* Test that readfile() is even in the running kernel or not. */
+static void test_readfile_supported(void)
+{
diff --git a/0004-readfile.2-new-page-describing-readfile-2.patch b/0004-readfile.2-new-page-describing-readfile-2.patch
index aabf15fb3262d1..3e7cc64295d6fd 100644
--- a/0004-readfile.2-new-page-describing-readfile-2.patch
+++ b/0004-readfile.2-new-page-describing-readfile-2.patch
@@ -1,4 +1,4 @@
-From 4fe70751742eb5c27d82d5a9c641f9003111c2cd Mon Sep 17 00:00:00 2001
+From 49df3607c64bd48afbc4ce729ee310364c134def Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Fri, 12 Jun 2020 12:11:39 +0200
Subject: [PATCH 4/4] readfile.2: new page describing readfile(2)
diff --git a/0005-tty-n_r3964-split-rx-and-tx-header-structures.patch b/0005-tty-n_r3964-split-rx-and-tx-header-structures.patch
index 90e6521e7e01ad..6f41d34f2f0003 100644
--- a/0005-tty-n_r3964-split-rx-and-tx-header-structures.patch
+++ b/0005-tty-n_r3964-split-rx-and-tx-header-structures.patch
@@ -226,7 +226,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
unsigned long flags;
TRACE_L("close");
-@@ -1213,7 +1215,7 @@ static ssize_t r3964_write(struct tty_st
+@@ -1211,7 +1213,7 @@ static ssize_t r3964_write(struct tty_st
const unsigned char *data, size_t count)
{
struct r3964_info *pInfo = tty->disc_data;
@@ -235,7 +235,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct r3964_client_info *pClient;
unsigned char *new_data;
-@@ -1238,8 +1240,7 @@ static ssize_t r3964_write(struct tty_st
+@@ -1236,8 +1238,7 @@ static ssize_t r3964_write(struct tty_st
/*
* Allocate a buffer for the data and copy it from the buffer with header prepended
*/
@@ -245,7 +245,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
TRACE_M("r3964_write - kmalloc %p", new_data);
if (new_data == NULL) {
if (pInfo->flags & R3964_DEBUG) {
-@@ -1248,10 +1249,9 @@ static ssize_t r3964_write(struct tty_st
+@@ -1246,10 +1247,9 @@ static ssize_t r3964_write(struct tty_st
return -ENOSPC;
}
diff --git a/0009-tty-n_r3964-for-messages-use-a-real-kernel-list.patch b/0009-tty-n_r3964-for-messages-use-a-real-kernel-list.patch
index fcec159b7188ea..02042fadda9567 100644
--- a/0009-tty-n_r3964-for-messages-use-a-real-kernel-list.patch
+++ b/0009-tty-n_r3964-for-messages-use-a-real-kernel-list.patch
@@ -222,7 +222,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (pMsg) {
kfree(pMsg);
TRACE_M("r3964_close - msg kfree %p", pMsg);
-@@ -1090,7 +1084,7 @@ static ssize_t r3964_read(struct tty_str
+@@ -1091,7 +1085,7 @@ static ssize_t r3964_read(struct tty_str
pClient = findClient(pInfo, task_pid(current));
if (pClient) {
@@ -231,7 +231,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (pMsg == NULL) {
/* no messages available. */
if (tty_io_nonblock(tty, file)) {
-@@ -1099,7 +1093,7 @@ static ssize_t r3964_read(struct tty_str
+@@ -1100,7 +1094,7 @@ static ssize_t r3964_read(struct tty_str
}
/* block until there is a message: */
wait_event_interruptible(tty->read_wait,
@@ -240,7 +240,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
}
/* If we still haven't got a message, we must have been signalled */
-@@ -1266,7 +1260,6 @@ static __poll_t r3964_poll(struct tty_st
+@@ -1264,7 +1258,6 @@ static __poll_t r3964_poll(struct tty_st
{
struct r3964_info *pInfo = tty->disc_data;
struct r3964_client_info *pClient;
@@ -248,7 +248,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
unsigned long flags;
__poll_t result = EPOLLOUT;
-@@ -1275,11 +1268,10 @@ static __poll_t r3964_poll(struct tty_st
+@@ -1273,11 +1266,10 @@ static __poll_t r3964_poll(struct tty_st
pClient = findClient(pInfo, task_pid(current));
if (pClient) {
poll_wait(file, &tty->read_wait, wait);
diff --git a/0012-tty-n_r3964-remove-read_lock-from-some-ioctls.patch b/0012-tty-n_r3964-remove-read_lock-from-some-ioctls.patch
index c27f4026fbe3b9..71c6b33bba2de3 100644
--- a/0012-tty-n_r3964-remove-read_lock-from-some-ioctls.patch
+++ b/0012-tty-n_r3964-remove-read_lock-from-some-ioctls.patch
@@ -27,7 +27,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct list_head clients;
unsigned int state;
-@@ -1218,33 +1219,41 @@ static int r3964_ioctl(struct tty_struct
+@@ -1216,33 +1217,41 @@ static int r3964_ioctl(struct tty_struct
unsigned int cmd, unsigned long arg)
{
struct r3964_info *pInfo = tty->disc_data;
@@ -77,7 +77,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
break;
case R3964_READ_TELEGRAM:
retval = read_telegram(pInfo, task_pid(current),
-@@ -1255,7 +1264,6 @@ static int r3964_ioctl(struct tty_struct
+@@ -1253,7 +1262,6 @@ static int r3964_ioctl(struct tty_struct
break;
}
diff --git a/0014-tty-n_r3964-properly-reference-count-pids.patch b/0014-tty-n_r3964-properly-reference-count-pids.patch
index 00131e5ac5d75f..9587d275eb18e2 100644
--- a/0014-tty-n_r3964-properly-reference-count-pids.patch
+++ b/0014-tty-n_r3964-properly-reference-count-pids.patch
@@ -38,7 +38,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
static int enable_signals(struct r3964_info *pInfo, struct pid *pid, int arg)
{
struct r3964_client_info *pClient;
-@@ -1120,7 +1132,7 @@ static ssize_t r3964_read(struct tty_str
+@@ -1121,7 +1133,7 @@ static ssize_t r3964_read(struct tty_str
return -ERESTARTSYS;
}
@@ -47,7 +47,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (pClient) {
pMsg = remove_msg(pClient);
if (pMsg == NULL) {
-@@ -1207,7 +1219,7 @@ static ssize_t r3964_write(struct tty_st
+@@ -1205,7 +1217,7 @@ static ssize_t r3964_write(struct tty_st
pHeader->length = count;
pHeader->owner = NULL;
@@ -56,7 +56,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (pClient) {
pHeader->owner = pClient;
}
-@@ -1231,6 +1243,7 @@ static int r3964_ioctl(struct tty_struct
+@@ -1229,6 +1241,7 @@ static int r3964_ioctl(struct tty_struct
unsigned int cmd, unsigned long arg)
{
struct r3964_info *pInfo = tty->disc_data;
@@ -64,7 +64,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
unsigned long flags;
int retval = 0;
-@@ -1248,7 +1261,9 @@ static int r3964_ioctl(struct tty_struct
+@@ -1246,7 +1259,9 @@ static int r3964_ioctl(struct tty_struct
return -ERESTARTSYS;
}
@@ -75,7 +75,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mutex_unlock(&pInfo->read_lock);
break;
-@@ -1268,8 +1283,9 @@ static int r3964_ioctl(struct tty_struct
+@@ -1266,8 +1281,9 @@ static int r3964_ioctl(struct tty_struct
spin_unlock_irqrestore(&pInfo->lock, flags);
break;
case R3964_READ_TELEGRAM:
@@ -87,7 +87,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
break;
default:
retval = -ENOIOCTLCMD;
-@@ -1310,7 +1326,7 @@ static __poll_t r3964_poll(struct tty_st
+@@ -1308,7 +1324,7 @@ static __poll_t r3964_poll(struct tty_st
TRACE_L("POLL");
diff --git a/0015-tty-n_r3964-add-reference-counting-to-the-client-str.patch b/0015-tty-n_r3964-add-reference-counting-to-the-client-str.patch
index ec31e9dbb8b167..862be5f5310f93 100644
--- a/0015-tty-n_r3964-add-reference-counting-to-the-client-str.patch
+++ b/0015-tty-n_r3964-add-reference-counting-to-the-client-str.patch
@@ -201,7 +201,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
}
/* Remove jobs from tx_queue: */
spin_lock_irqsave(&pInfo->lock, flags);
-@@ -1173,6 +1218,7 @@ static ssize_t r3964_read(struct tty_str
+@@ -1171,6 +1216,7 @@ static ssize_t r3964_read(struct tty_str
ret = -EPERM;
unlock:
mutex_unlock(&pInfo->read_lock);
@@ -209,7 +209,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
return ret;
}
-@@ -1181,7 +1227,6 @@ static ssize_t r3964_write(struct tty_st
+@@ -1179,7 +1225,6 @@ static ssize_t r3964_write(struct tty_st
{
struct r3964_info *pInfo = tty->disc_data;
struct tx_block_header *pHeader;
@@ -217,7 +217,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
unsigned char *new_data;
TRACE_L("write request, %d characters", count);
-@@ -1217,12 +1262,12 @@ static ssize_t r3964_write(struct tty_st
+@@ -1215,12 +1260,12 @@ static ssize_t r3964_write(struct tty_st
pHeader = (struct tx_block_header *)new_data;
pHeader->data = new_data + sizeof(*pHeader);
pHeader->length = count;
@@ -235,7 +235,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
memcpy(pHeader->data, data, count); /* We already verified this */
-@@ -1333,6 +1378,7 @@ static __poll_t r3964_poll(struct tty_st
+@@ -1331,6 +1376,7 @@ static __poll_t r3964_poll(struct tty_st
if (!list_empty(&pClient->msgs))
result |= EPOLLIN | EPOLLRDNORM;
spin_unlock_irqrestore(&pClient->lock, flags);