diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-06-10 10:01:34 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-06-10 10:01:34 +0200 |
commit | 0ce7a6b8527fbbc84add286a0efc73803a77bcab (patch) | |
tree | 5767d1d4b878367814c962d0f2ab93121a7c54a0 | |
parent | eace8bb509d05bd888a3718fd6b8ecbc40ddd373 (diff) | |
download | patches-0ce7a6b8527fbbc84add286a0efc73803a77bcab.tar.gz |
fix up patches that have been merged
-rw-r--r-- | 0001-bpf-explicitly-memset-the-bpf_attr-structure.patch | 45 | ||||
-rw-r--r-- | 0001-readfile-implement-readfile-syscall.patch | 135 | ||||
-rw-r--r-- | 0001-tty-serial-samsung_tty-build-it-for-any-platform.patch | 34 | ||||
-rw-r--r-- | 0002-bpf-explicitly-memset-some-bpf-info-structures-decla.patch | 81 | ||||
-rw-r--r-- | 0002-readfile-add-test_readfile.c.patch | 80 | ||||
-rw-r--r-- | 0002-tty-serial-samsung_tty-remove-SERIAL_SAMSUNG_DEBUG.patch | 43 | ||||
-rw-r--r-- | dynamic_debug-allow-to-work-if-debugfs-is-disabled.patch | 98 | ||||
-rw-r--r-- | series | 7 | ||||
-rw-r--r-- | usb_DEVICE_ATTR.patch | 193 |
9 files changed, 4 insertions, 712 deletions
diff --git a/0001-bpf-explicitly-memset-the-bpf_attr-structure.patch b/0001-bpf-explicitly-memset-the-bpf_attr-structure.patch deleted file mode 100644 index ab16c12026bb4..0000000000000 --- a/0001-bpf-explicitly-memset-the-bpf_attr-structure.patch +++ /dev/null @@ -1,45 +0,0 @@ -From ca46ef180f66f15ec6e4de7e872183aa6b90e887 Mon Sep 17 00:00:00 2001 -From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -Date: Fri, 20 Mar 2020 10:09:37 +0100 -Subject: [PATCH 1/2] bpf: explicitly memset the bpf_attr structure -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -For the bpf syscall, we are relying on the compiler to properly zero out -the bpf_attr union that we copy userspace data into. Unfortunately that -doesn't always work properly, padding and other oddities might not be -correctly zeroed, and in some tests odd things have been found when the -stack is pre-initialized to other values. - -Fix this by explicitly memsetting the structure to 0 before using it. - -Reported-by: Maciej Żenczykowski <maze@google.com> -Reported-by: John Stultz <john.stultz@linaro.org> -Reported-by: Alexander Potapenko <glider@google.com> -Reported-by: Alistair Delva <adelva@google.com> -Cc: stable <stable@vger.kernel.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - kernel/bpf/syscall.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/kernel/bpf/syscall.c -+++ b/kernel/bpf/syscall.c -@@ -3354,7 +3354,7 @@ err_put: - - SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, size) - { -- union bpf_attr attr = {}; -+ union bpf_attr attr; - int err; - - if (sysctl_unprivileged_bpf_disabled && !capable(CAP_SYS_ADMIN)) -@@ -3366,6 +3366,7 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf - size = min_t(u32, size, sizeof(attr)); - - /* copy attributes from user space, may be less than sizeof(bpf_attr) */ -+ memset(&attr, 0, sizeof(attr)); - if (copy_from_user(&attr, uattr, size) != 0) - return -EFAULT; - diff --git a/0001-readfile-implement-readfile-syscall.patch b/0001-readfile-implement-readfile-syscall.patch deleted file mode 100644 index 1fe832ed0ab1b..0000000000000 --- a/0001-readfile-implement-readfile-syscall.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 5bb274ae162250fad4f4f441a4c75c47ebede90d Mon Sep 17 00:00:00 2001 -From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -Date: Tue, 3 Mar 2020 15:05:49 +0100 -Subject: [PATCH 1/2] readfile: implement readfile syscall - -It's a tiny syscall, meant to allow a user to do a single "open this -file, read into this buffer, and close the file" all in a single shot. - -Should be good for reading "tiny" files like sysfs, procfs, and other -"small" files. - -There is no restarting the syscall, am trying to keep it simple. At -least for now. - -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - arch/x86/entry/syscalls/syscall_32.tbl | 1 + - arch/x86/entry/syscalls/syscall_64.tbl | 1 + - fs/open.c | 50 ++++++++++++++++++++++++++ - include/linux/syscalls.h | 2 ++ - include/uapi/asm-generic/unistd.h | 4 ++- - 5 files changed, 57 insertions(+), 1 deletion(-) - -diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl -index 54581ac671b4..a10438d5e5ec 100644 ---- a/arch/x86/entry/syscalls/syscall_32.tbl -+++ b/arch/x86/entry/syscalls/syscall_32.tbl -@@ -442,3 +442,4 @@ - 435 i386 clone3 sys_clone3 - 437 i386 openat2 sys_openat2 - 438 i386 pidfd_getfd sys_pidfd_getfd -+439 i386 readfile sys_readfile -diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl -index 37b844f839bc..ffcc8bed83fb 100644 ---- a/arch/x86/entry/syscalls/syscall_64.tbl -+++ b/arch/x86/entry/syscalls/syscall_64.tbl -@@ -359,6 +359,7 @@ - 435 common clone3 sys_clone3 - 437 common openat2 sys_openat2 - 438 common pidfd_getfd sys_pidfd_getfd -+439 common readfile sys_readfile - - # - # x32-specific system call numbers start at 512 to avoid cache impact -diff --git a/fs/open.c b/fs/open.c -index 719b320ede52..94d1633c94bb 100644 ---- a/fs/open.c -+++ b/fs/open.c -@@ -1339,3 +1339,53 @@ int stream_open(struct inode *inode, struct file *filp) - } - - EXPORT_SYMBOL(stream_open); -+ -+static struct file *readfile_open(int dfd, const char __user *filename, -+ struct open_flags *op) -+{ -+ struct filename *tmp; -+ struct file *f; -+ -+ tmp = getname(filename); -+ if (IS_ERR(tmp)) -+ return (struct file *)tmp; -+ -+ f = do_filp_open(dfd, tmp, op); -+ if (!IS_ERR(f)) -+ fsnotify_open(f); -+ -+ putname(tmp); -+ return f; -+} -+ -+SYSCALL_DEFINE5(readfile, int, dfd, const char __user *, filename, -+ char __user *, buffer, size_t, bufsize, int, flags) -+{ -+ struct open_flags op; -+ struct open_how how; -+ struct file *file; -+ loff_t pos = 0; -+ int retval; -+ -+ /* Mask off all O_ flags as we only want to read from the file */ -+ flags &= ~(VALID_OPEN_FLAGS); -+ flags |= O_RDONLY | O_LARGEFILE; -+ -+ how = build_open_how(flags, 0000); -+ retval = build_open_flags(&how, &op); -+ if (retval) -+ return retval; -+ -+ file = readfile_open(dfd, filename, &op); -+ if (IS_ERR(file)) -+ return PTR_ERR(file); -+ -+// retval = ksys_read(fd, buffer, bufsize); -+// __close_fd(current->files, fd); -+ -+ retval = kernel_read(file, buffer, bufsize, &pos); -+ -+ filp_close(file, NULL); -+ -+ return retval; -+} -diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h -index 1815065d52f3..3a636a913437 100644 ---- a/include/linux/syscalls.h -+++ b/include/linux/syscalls.h -@@ -1003,6 +1003,8 @@ asmlinkage long sys_pidfd_send_signal(int pidfd, int sig, - siginfo_t __user *info, - unsigned int flags); - asmlinkage long sys_pidfd_getfd(int pidfd, int fd, unsigned int flags); -+asmlinkage long sys_readfile(int dfd, const char __user *filename, -+ char __user *buffer, size_t bufsize, int flags); - - /* - * Architecture-specific system calls -diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h -index 3a3201e4618e..31f84500915d 100644 ---- a/include/uapi/asm-generic/unistd.h -+++ b/include/uapi/asm-generic/unistd.h -@@ -855,9 +855,11 @@ __SYSCALL(__NR_clone3, sys_clone3) - __SYSCALL(__NR_openat2, sys_openat2) - #define __NR_pidfd_getfd 438 - __SYSCALL(__NR_pidfd_getfd, sys_pidfd_getfd) -+#define __NR_readfile 439 -+__SYSCALL(__NR_readfile, sys_readfile) - - #undef __NR_syscalls --#define __NR_syscalls 439 -+#define __NR_syscalls 440 - - /* - * 32 bit systems traditionally used different --- -2.26.2 - diff --git a/0001-tty-serial-samsung_tty-build-it-for-any-platform.patch b/0001-tty-serial-samsung_tty-build-it-for-any-platform.patch deleted file mode 100644 index 422a414a0bbf3..0000000000000 --- a/0001-tty-serial-samsung_tty-build-it-for-any-platform.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 36a463525d74c196a011c69921aad9bb5e7d2a34 Mon Sep 17 00:00:00 2001 -From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -Date: Thu, 20 Feb 2020 11:20:19 +0100 -Subject: [PATCH 1/2] tty: serial: samsung_tty: build it for any platform - -There is no need to tie this driver to only a specific SoC, or compile -test, so remove that dependancy from the Kconfig rules. - -Cc: Kukjin Kim <kgene@kernel.org> -Cc: Donghoon Yu <hoony.yu@samsung.com> -Cc: Hyunki Koo <kkoos00@naver.com> -Cc: HYUN-KI KOO <hyunki00.koo@samsung.com> -Cc: Shinbeom Choi <sbeom.choi@samsung.com> -Cc: Krzysztof Kozlowski <krzk@kernel.org> -Cc: Jiri Slaby <jslaby@suse.com> -Cc: linux-arm-kernel@lists.infradead.org -Cc: linux-samsung-soc@vger.kernel.org -Cc: linux-serial@vger.kernel.org -Cc: linux-kernel@vger.kernel.org -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - drivers/tty/serial/Kconfig | 1 - - 1 file changed, 1 deletion(-) - ---- a/drivers/tty/serial/Kconfig -+++ b/drivers/tty/serial/Kconfig -@@ -237,7 +237,6 @@ config SERIAL_CLPS711X_CONSOLE - - config SERIAL_SAMSUNG - tristate "Samsung SoC serial support" -- depends on PLAT_SAMSUNG || ARCH_EXYNOS || COMPILE_TEST - select SERIAL_CORE - help - Support for the on-chip UARTs on the Samsung S3C24XX series CPUs, diff --git a/0002-bpf-explicitly-memset-some-bpf-info-structures-decla.patch b/0002-bpf-explicitly-memset-some-bpf-info-structures-decla.patch deleted file mode 100644 index dc3e0e99ba0d8..0000000000000 --- a/0002-bpf-explicitly-memset-some-bpf-info-structures-decla.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 32f493a17f62a2b144790b7b46054b9b4ee43f68 Mon Sep 17 00:00:00 2001 -From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -Date: Fri, 20 Mar 2020 17:18:56 +0100 -Subject: [PATCH 2/2] bpf: explicitly memset some bpf info structures declared - on the stack - -Trying to initialize a structure with "= {};" will not always clean out -all padding locations in a structure. So be explicit and call memset to -initialize everything for a number of bpf information structures that -are then copied from userspace, sometimes from smaller memory locations -than the size of the structure. - -Reported-by: Daniel Borkmann <daniel@iogearbox.net -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - kernel/bpf/btf.c | 3 ++- - kernel/bpf/syscall.c | 6 ++++-- - 2 files changed, 6 insertions(+), 3 deletions(-) - -diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c -index 787140095e58..2fc945fcf952 100644 ---- a/kernel/bpf/btf.c -+++ b/kernel/bpf/btf.c -@@ -4564,7 +4564,7 @@ int btf_get_info_by_fd(const struct btf *btf, - union bpf_attr __user *uattr) - { - struct bpf_btf_info __user *uinfo; -- struct bpf_btf_info info = {}; -+ struct bpf_btf_info info; - u32 info_copy, btf_copy; - void __user *ubtf; - u32 uinfo_len; -@@ -4573,6 +4573,7 @@ int btf_get_info_by_fd(const struct btf *btf, - uinfo_len = attr->info.info_len; - - info_copy = min_t(u32, uinfo_len, sizeof(info)); -+ memset(&info, 0, sizeof(info)); - if (copy_from_user(&info, uinfo, info_copy)) - return -EFAULT; - -diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c -index a4b1de8ea409..84213cc5d016 100644 ---- a/kernel/bpf/syscall.c -+++ b/kernel/bpf/syscall.c -@@ -2787,7 +2787,7 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog, - union bpf_attr __user *uattr) - { - struct bpf_prog_info __user *uinfo = u64_to_user_ptr(attr->info.info); -- struct bpf_prog_info info = {}; -+ struct bpf_prog_info info; - u32 info_len = attr->info.info_len; - struct bpf_prog_stats stats; - char __user *uinsns; -@@ -2799,6 +2799,7 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog, - return err; - info_len = min_t(u32, sizeof(info), info_len); - -+ memset(&info, 0, sizeof(info)); - if (copy_from_user(&info, uinfo, info_len)) - return -EFAULT; - -@@ -3062,7 +3063,7 @@ static int bpf_map_get_info_by_fd(struct bpf_map *map, - union bpf_attr __user *uattr) - { - struct bpf_map_info __user *uinfo = u64_to_user_ptr(attr->info.info); -- struct bpf_map_info info = {}; -+ struct bpf_map_info info; - u32 info_len = attr->info.info_len; - int err; - -@@ -3071,6 +3072,7 @@ static int bpf_map_get_info_by_fd(struct bpf_map *map, - return err; - info_len = min_t(u32, sizeof(info), info_len); - -+ memset(&info, 0, sizeof(info)); - info.type = map->map_type; - info.id = map->id; - info.key_size = map->key_size; --- -2.25.2 - diff --git a/0002-readfile-add-test_readfile.c.patch b/0002-readfile-add-test_readfile.c.patch deleted file mode 100644 index cb1deca510b20..0000000000000 --- a/0002-readfile-add-test_readfile.c.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 4c20f7981f2ceff4d47fd6d36a12e66785e2107f 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 2/2] readfile: add test_readfile.c - ---- - test_readfile.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 61 insertions(+) - create mode 100644 test_readfile.c - -diff --git a/test_readfile.c b/test_readfile.c -new file mode 100644 -index 000000000000..e9fdf999ba91 ---- /dev/null -+++ b/test_readfile.c -@@ -0,0 +1,61 @@ -+// SPDX-License-Identifier: GPL-2.0 -+#include <stdlib.h> -+#include <stdio.h> -+#include <linux/types.h> -+#include <sys/syscall.h> -+#include <fcntl.h> -+ -+#include <assert.h> -+#include <dirent.h> -+#include <limits.h> -+#include <stdio.h> -+#include <string.h> -+#include <sys/types.h> -+#include <sys/stat.h> -+#include <fcntl.h> -+#include <unistd.h> -+ -+ -+#define NR_readfile 439 -+ -+#define TEST_FILE1 "/sys/devices/system/cpu/vulnerabilities/meltdown" -+#define TEST_FILE2 "/sys/devices/system/cpu/vulnerabilities/spectre_v1" -+#define TEST_FILE3 "/proc/self/maps" -+#define TEST_FILE4 "/sys/kernel/debug/usb/devices" -+ -+static int sys_readfile(int fd, const char *filename, char *buffer, -+ size_t bufsize, int flags) -+{ -+ return syscall(NR_readfile, fd, filename, buffer, bufsize, flags); -+} -+ -+void readfile(const char *filename) -+{ -+ int root_fd; -+ char buffer[16000]; -+ int retval; -+ -+ memset(buffer, 0x00, sizeof(buffer)); -+ -+ root_fd = open("/", O_DIRECTORY); -+ if (root_fd == -1) { -+ printf("error with root_fd\n"); -+ return; -+ } -+ -+ retval = sys_readfile(root_fd, filename, &buffer[0], sizeof(buffer), 0); -+ printf("filename=%s\n retval=%d\n buffer='%s'\n", -+ filename, retval, &buffer[0]); -+ -+ close(root_fd); -+} -+ -+int main(void) -+{ -+ readfile(TEST_FILE1); -+ readfile(TEST_FILE2); -+ readfile(TEST_FILE3); -+ readfile(TEST_FILE4); -+ return 0; -+} -+ --- -2.26.2 - diff --git a/0002-tty-serial-samsung_tty-remove-SERIAL_SAMSUNG_DEBUG.patch b/0002-tty-serial-samsung_tty-remove-SERIAL_SAMSUNG_DEBUG.patch deleted file mode 100644 index e6806503041e0..0000000000000 --- a/0002-tty-serial-samsung_tty-remove-SERIAL_SAMSUNG_DEBUG.patch +++ /dev/null @@ -1,43 +0,0 @@ -From b25668c1066459d320800f4d34eb3820798d9e1c Mon Sep 17 00:00:00 2001 -From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -Date: Thu, 20 Feb 2020 11:23:30 +0100 -Subject: [PATCH 2/2] tty: serial: samsung_tty: remove SERIAL_SAMSUNG_DEBUG - -Since a05025d0ce72 ("tty: serial: samsung_tty: use standard debugging -macros") this configuration option is not used at all, so remove it from -the Kconfig file. - -Cc: Kukjin Kim <kgene@kernel.org> -Cc: Donghoon Yu <hoony.yu@samsung.com> -Cc: Hyunki Koo <kkoos00@naver.com> -Cc: HYUN-KI KOO <hyunki00.koo@samsung.com> -Cc: Shinbeom Choi <sbeom.choi@samsung.com> -Cc: Krzysztof Kozlowski <krzk@kernel.org> -Cc: Jiri Slaby <jslaby@suse.com> -Cc: linux-arm-kernel@lists.infradead.org -Cc: linux-samsung-soc@vger.kernel.org -Cc: linux-serial@vger.kernel.org -Cc: linux-kernel@vger.kernel.org -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - drivers/tty/serial/Kconfig | 9 --------- - 1 file changed, 9 deletions(-) - ---- a/drivers/tty/serial/Kconfig -+++ b/drivers/tty/serial/Kconfig -@@ -259,15 +259,6 @@ config SERIAL_SAMSUNG_UARTS - help - Select the number of available UART ports for the Samsung S3C - serial driver -- --config SERIAL_SAMSUNG_DEBUG -- bool "Samsung SoC serial debug" -- depends on SERIAL_SAMSUNG && DEBUG_LL -- help -- Add support for debugging the serial driver. Since this is -- generally being used as a console, we use our own output -- routines that go via the low-level debug printascii() -- function. - - config SERIAL_SAMSUNG_CONSOLE - bool "Support for console on Samsung SoC serial port" diff --git a/dynamic_debug-allow-to-work-if-debugfs-is-disabled.patch b/dynamic_debug-allow-to-work-if-debugfs-is-disabled.patch deleted file mode 100644 index 2df24d3099c99..0000000000000 --- a/dynamic_debug-allow-to-work-if-debugfs-is-disabled.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 7d61af935fdc0e18519a6f907d4b3b0aa05b5972 Mon Sep 17 00:00:00 2001 -From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -Date: Wed, 22 Jan 2020 08:39:32 +0100 -Subject: [PATCH] dynamic_debug: allow to work if debugfs is disabled - -With the realization that having debugfs enabled on "production" systems -is generally not a good idea, debugfs is being disabled from more and -more platforms over time. However, the functionality of dynamic -debugging still is needed at times, and since it relies on debugfs for -its user api, having debugfs disabled also forces dynamic debug to be -disabled. - -To get around this, also create the "control" file for dynamic_debug in -procfs. This allows people turn on debugging as needed at runtime for -individual driverfs and subsystems. - -Reported-by: many different companies -Cc: Jason Baron <jbaron@akamai.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ---- - Documentation/admin-guide/dynamic-debug-howto.rst | 3 +++ - lib/Kconfig.debug | 7 ++++--- - lib/dynamic_debug.c | 20 +++++++++++++++----- - 3 files changed, 22 insertions(+), 8 deletions(-) - ---- a/Documentation/admin-guide/dynamic-debug-howto.rst -+++ b/Documentation/admin-guide/dynamic-debug-howto.rst -@@ -54,6 +54,9 @@ If you make a mistake with the syntax, t - <debugfs>/dynamic_debug/control - -bash: echo: write error: Invalid argument - -+Note, for systems without 'debugfs' enabled, the control file can also -+be found in ``/proc/dynamic_debug/control``. -+ - Viewing Dynamic Debug Behaviour - =============================== - ---- a/lib/Kconfig.debug -+++ b/lib/Kconfig.debug -@@ -98,7 +98,7 @@ config DYNAMIC_DEBUG - bool "Enable dynamic printk() support" - default n - depends on PRINTK -- depends on DEBUG_FS -+ depends on (DEBUG_FS || PROC_FS) - help - - Compiles debug level messages into the kernel, which would not -@@ -116,8 +116,9 @@ config DYNAMIC_DEBUG - Usage: - - Dynamic debugging is controlled via the 'dynamic_debug/control' file, -- which is contained in the 'debugfs' filesystem. Thus, the debugfs -- filesystem must first be mounted before making use of this feature. -+ which is contained in the 'debugfs' filesystem or procfs. -+ Thus, the debugfs or procfs filesystem must first be mounted before -+ making use of this feature. - We refer the control file as: <debugfs>/dynamic_debug/control. This - file contains a list of the debug statements that can be enabled. The - format for each line of the file is: ---- a/lib/dynamic_debug.c -+++ b/lib/dynamic_debug.c -@@ -991,15 +991,25 @@ static void ddebug_remove_all_tables(voi - - static __initdata int ddebug_init_success; - --static int __init dynamic_debug_init_debugfs(void) -+static int __init dynamic_debug_init_control(void) - { -- struct dentry *dir; -+ struct proc_dir_entry *procfs_dir; -+ struct dentry *debugfs_dir; - - if (!ddebug_init_success) - return -ENODEV; - -- dir = debugfs_create_dir("dynamic_debug", NULL); -- debugfs_create_file("control", 0644, dir, NULL, &ddebug_proc_fops); -+ /* Create the control file in debugfs if it is enabled */ -+ if (debugfs_initialized()) { -+ debugfs_dir = debugfs_create_dir("dynamic_debug", NULL); -+ debugfs_create_file("control", 0644, debugfs_dir, NULL, -+ &ddebug_proc_fops); -+ } -+ -+ /* Also create the control file in procfs */ -+ procfs_dir = proc_mkdir("dynamic_debug", NULL); -+ if (procfs_dir) -+ proc_create("control", 0644, procfs_dir, &ddebug_proc_fops); - - return 0; - } -@@ -1077,4 +1087,4 @@ out_err: - early_initcall(dynamic_debug_init); - - /* Debugfs setup must be done later */ --fs_initcall(dynamic_debug_init_debugfs); -+fs_initcall(dynamic_debug_init_control); @@ -1,11 +1,4 @@ # -0001-readfile-implement-readfile-syscall.patch -0002-readfile-add-test_readfile.c.patch -0001-bpf-explicitly-memset-the-bpf_attr-structure.patch -0002-bpf-explicitly-memset-some-bpf-info-structures-decla.patch -0001-tty-serial-samsung_tty-build-it-for-any-platform.patch -0002-tty-serial-samsung_tty-remove-SERIAL_SAMSUNG_DEBUG.patch -dynamic_debug-allow-to-work-if-debugfs-is-disabled.patch spdxcheck-print-out-files-without-any-spdx-lines.patch 0001-tty-n_r3964-locking-fixups.patch diff --git a/usb_DEVICE_ATTR.patch b/usb_DEVICE_ATTR.patch index 87fb4c20bba97..0c707ffde70c9 100644 --- a/usb_DEVICE_ATTR.patch +++ b/usb_DEVICE_ATTR.patch @@ -12,198 +12,13 @@ future. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- - drivers/staging/wusbcore/cbaf.c | 82 +++++++++++---------------- - drivers/usb/gadget/function/f_mass_storage.c | 5 - - drivers/usb/phy/phy-fsl-usb.c | 6 - - 3 files changed, 41 insertions(+), 52 deletions(-) + drivers/usb/gadget/function/f_mass_storage.c | 5 ++--- + drivers/usb/phy/phy-fsl-usb.c | 6 +++--- + 2 files changed, 5 insertions(+), 6 deletions(-) ---- a/drivers/staging/wusbcore/cbaf.c -+++ b/drivers/staging/wusbcore/cbaf.c -@@ -296,9 +296,8 @@ static int cbaf_cdid_get(struct cbaf *cb - return 0; - } - --static ssize_t cbaf_wusb_chid_show(struct device *dev, -- struct device_attribute *attr, -- char *buf) -+static ssize_t wusb_chid_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct usb_interface *iface = to_usb_interface(dev); - struct cbaf *cbaf = usb_get_intfdata(iface); -@@ -306,9 +305,9 @@ static ssize_t cbaf_wusb_chid_show(struc - return sprintf(buf, "%16ph\n", cbaf->chid.data); - } - --static ssize_t cbaf_wusb_chid_store(struct device *dev, -- struct device_attribute *attr, -- const char *buf, size_t size) -+static ssize_t wusb_chid_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t size) - { - ssize_t result; - struct usb_interface *iface = to_usb_interface(dev); -@@ -339,11 +338,10 @@ static ssize_t cbaf_wusb_chid_store(stru - return result; - return size; - } --static DEVICE_ATTR(wusb_chid, 0600, cbaf_wusb_chid_show, cbaf_wusb_chid_store); -+static DEVICE_ATTR_RW(wusb_chid); - --static ssize_t cbaf_wusb_host_name_show(struct device *dev, -- struct device_attribute *attr, -- char *buf) -+static ssize_t wusb_host_name_show(struct device *dev, -+ struct device_attribute *attr, char *buf) - { - struct usb_interface *iface = to_usb_interface(dev); - struct cbaf *cbaf = usb_get_intfdata(iface); -@@ -351,9 +349,9 @@ static ssize_t cbaf_wusb_host_name_show( - return scnprintf(buf, PAGE_SIZE, "%s\n", cbaf->host_name); - } - --static ssize_t cbaf_wusb_host_name_store(struct device *dev, -- struct device_attribute *attr, -- const char *buf, size_t size) -+static ssize_t wusb_host_name_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t size) - { - ssize_t result; - struct usb_interface *iface = to_usb_interface(dev); -@@ -365,12 +363,11 @@ static ssize_t cbaf_wusb_host_name_store - - return size; - } --static DEVICE_ATTR(wusb_host_name, 0600, cbaf_wusb_host_name_show, -- cbaf_wusb_host_name_store); -+static DEVICE_ATTR_RW(wusb_host_name); - --static ssize_t cbaf_wusb_host_band_groups_show(struct device *dev, -- struct device_attribute *attr, -- char *buf) -+static ssize_t wusb_host_band_groups_show(struct device *dev, -+ struct device_attribute *attr, -+ char *buf) - { - struct usb_interface *iface = to_usb_interface(dev); - struct cbaf *cbaf = usb_get_intfdata(iface); -@@ -378,9 +375,9 @@ static ssize_t cbaf_wusb_host_band_group - return scnprintf(buf, PAGE_SIZE, "0x%04x\n", cbaf->host_band_groups); - } - --static ssize_t cbaf_wusb_host_band_groups_store(struct device *dev, -- struct device_attribute *attr, -- const char *buf, size_t size) -+static ssize_t wusb_host_band_groups_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t size) - { - ssize_t result; - struct usb_interface *iface = to_usb_interface(dev); -@@ -395,10 +392,7 @@ static ssize_t cbaf_wusb_host_band_group - - return size; - } -- --static DEVICE_ATTR(wusb_host_band_groups, 0600, -- cbaf_wusb_host_band_groups_show, -- cbaf_wusb_host_band_groups_store); -+static DEVICE_ATTR_RW(wusb_host_band_groups); - - static const struct wusb_cbaf_device_info cbaf_device_info_defaults = { - .Length_hdr = WUSB_AR_Length, -@@ -408,8 +402,8 @@ static const struct wusb_cbaf_device_inf - .DeviceFriendlyName_hdr = WUSB_AR_DeviceFriendlyName, - }; - --static ssize_t cbaf_wusb_cdid_show(struct device *dev, -- struct device_attribute *attr, char *buf) -+static ssize_t wusb_cdid_show(struct device *dev, struct device_attribute *attr, -+ char *buf) - { - struct usb_interface *iface = to_usb_interface(dev); - struct cbaf *cbaf = usb_get_intfdata(iface); -@@ -417,9 +411,9 @@ static ssize_t cbaf_wusb_cdid_show(struc - return sprintf(buf, "%16ph\n", cbaf->cdid.data); - } - --static ssize_t cbaf_wusb_cdid_store(struct device *dev, -- struct device_attribute *attr, -- const char *buf, size_t size) -+static ssize_t wusb_cdid_store(struct device *dev, -+ struct device_attribute *attr, const char *buf, -+ size_t size) - { - ssize_t result; - struct usb_interface *iface = to_usb_interface(dev); -@@ -446,32 +440,28 @@ static ssize_t cbaf_wusb_cdid_store(stru - - return size; - } --static DEVICE_ATTR(wusb_cdid, 0600, cbaf_wusb_cdid_show, cbaf_wusb_cdid_store); -+static DEVICE_ATTR_RW(wusb_cdid); - --static ssize_t cbaf_wusb_device_band_groups_show(struct device *dev, -- struct device_attribute *attr, -- char *buf) -+static ssize_t wusb_device_band_groups_show(struct device *dev, -+ struct device_attribute *attr, -+ char *buf) - { - struct usb_interface *iface = to_usb_interface(dev); - struct cbaf *cbaf = usb_get_intfdata(iface); - - return scnprintf(buf, PAGE_SIZE, "0x%04x\n", cbaf->device_band_groups); - } -+static DEVICE_ATTR_RO(wusb_device_band_groups); - --static DEVICE_ATTR(wusb_device_band_groups, 0600, -- cbaf_wusb_device_band_groups_show, -- NULL); -- --static ssize_t cbaf_wusb_device_name_show(struct device *dev, -- struct device_attribute *attr, -- char *buf) -+static ssize_t wusb_device_name_show(struct device *dev, -+ struct device_attribute *attr, char *buf) - { - struct usb_interface *iface = to_usb_interface(dev); - struct cbaf *cbaf = usb_get_intfdata(iface); - - return scnprintf(buf, PAGE_SIZE, "%s\n", cbaf->device_name); - } --static DEVICE_ATTR(wusb_device_name, 0600, cbaf_wusb_device_name_show, NULL); -+static DEVICE_ATTR_RO(wusb_device_name); - - static const struct wusb_cbaf_cc_data cbaf_cc_data_defaults = { - .AssociationTypeId_hdr = WUSB_AR_AssociationTypeId, -@@ -522,9 +512,9 @@ static int cbaf_cc_upload(struct cbaf *c - return result; - } - --static ssize_t cbaf_wusb_ck_store(struct device *dev, -- struct device_attribute *attr, -- const char *buf, size_t size) -+static ssize_t wusb_ck_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t size) - { - ssize_t result; - struct usb_interface *iface = to_usb_interface(dev); -@@ -552,7 +542,7 @@ static ssize_t cbaf_wusb_ck_store(struct - - return size; - } --static DEVICE_ATTR(wusb_ck, 0600, NULL, cbaf_wusb_ck_store); -+static DEVICE_ATTR_WO(wusb_ck); - - static struct attribute *cbaf_dev_attrs[] = { - &dev_attr_wusb_host_name.attr, --- a/drivers/usb/gadget/function/f_mass_storage.c +++ b/drivers/usb/gadget/function/f_mass_storage.c -@@ -2553,9 +2553,8 @@ static ssize_t file_store(struct device +@@ -2554,9 +2554,8 @@ static ssize_t file_store(struct device } static DEVICE_ATTR_RW(nofua); |