diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-02 12:17:24 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-02 12:17:24 -0700 |
| commit | 3f1fe48a36b0b6722dc3fd421d93512bac138e9a (patch) | |
| tree | b767d7f6e26bc64334d3f14f8422d187239dc45d /drivers/video/cmdline.c | |
| download | linux-stable-3f1fe48a36b0b6722dc3fd421d93512bac138e9a.tar.gz linux-stable-3f1fe48a36b0b6722dc3fd421d93512bac138e9a.zip | |
Merge tag 'io_uring-7.3-20261002' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linuxgrafted
Pull io_uring fixes from Jens Axboe:
- Fix a task_work add use-after-free with SQPOLL.
The sqpoll thread could pop and complete the last request while
io_req_normal_work_add() was still looking at them after the mpscq
push.
Use the same approach as DEFER_TASKRUN to protect from that, holding
an RCU read lock across the add, and have exit wait for an RCU grace
period for SQPOLL rings as well.
- CQE32 ring fixes: correct the free entry check for 32b CQEs, zero the
big_cqe for aux CQEs, and only post the dummy skip CQE on CQE_MIXED
rings
- Mark the source filter table as COW when cloning bpf filters, so
registering another filter on the source doesn't modify the shared
table in place
- Initialize the task context before running the BPF loop
- Requeue zcrx multishot receives stopped by a local resource
- End a TX_TIMESTAMP multishot cmd when the CQ is full (lollipopkit)
* tag 'io_uring-7.3-20261002' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux:
io_uring: fix task_work add use-after-free with SQPOLL
io_uring/cmd_net: end TX_TIMESTAMP multishot when the CQ is full
io_uring/zcrx: requeue multishot receives stopped by a local resource
io_uring: initialize task context before running the BPF loop
io_uring: zero big_cqe for aux CQEs on CQE32 rings
io_uring: fix free entry check for 32b CQEs on CQE32 rings
io_uring: only post the dummy skip CQE on CQE_MIXED rings
io_uring/bpf_filter: mark source as COW when cloning filters
Diffstat (limited to 'drivers/video/cmdline.c')
| -rw-r--r-- | drivers/video/cmdline.c | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/drivers/video/cmdline.c b/drivers/video/cmdline.c new file mode 100644 index 000000000..49ee3fb49 --- /dev/null +++ b/drivers/video/cmdline.c @@ -0,0 +1,135 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Based on the fbdev code in drivers/video/fbdev/core/fb_cmdline: + * + * Copyright (C) 2014 Intel Corp + * Copyright (C) 1994 Martin Schaller + * + * 2001 - Documented with DocBook + * - Brad Douglas <brad@neruo.com> + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive + * for more details. + * + * Authors: + * Daniel Vetter <daniel.vetter@ffwll.ch> + */ + +#include <linux/fb.h> /* for FB_MAX */ +#include <linux/init.h> + +#include <video/cmdline.h> + +/* + * FB_MAX is the maximum number of framebuffer devices and also + * the maximum number of video= parameters. Although not directly + * related to each other, it makes sense to keep it that way. + */ +static const char *video_options[FB_MAX] __read_mostly; +static const char *video_option __read_mostly; +static int video_of_only __read_mostly; + +static const char *__video_get_option_string(const char *name) +{ + const char *options = NULL; + size_t name_len = 0; + + if (name) + name_len = strlen(name); + + if (name_len) { + unsigned int i; + const char *opt; + + for (i = 0; i < ARRAY_SIZE(video_options); ++i) { + if (!video_options[i]) + continue; + if (video_options[i][0] == '\0') + continue; + opt = video_options[i]; + if (!strncmp(opt, name, name_len) && opt[name_len] == ':') + options = opt + name_len + 1; + } + } + + /* No match, return global options */ + if (!options) + options = video_option; + + return options; +} + +/** + * video_get_options - get kernel boot parameters + * @name: name of the output as it would appear in the boot parameter + * line (video=<name>:<options>) + * + * Looks up the video= options for the given name. Names are connector + * names with DRM, or driver names with fbdev. If no video option for + * the name has been specified, the function returns the global video= + * setting. A @name of NULL always returns the global video setting. + * + * Returns: + * The string of video options for the given name, or NULL if no video + * option has been specified. + */ +const char *video_get_options(const char *name) +{ + return __video_get_option_string(name); +} +EXPORT_SYMBOL(video_get_options); + +#if IS_ENABLED(CONFIG_FB_CORE) +bool __video_get_options(const char *name, const char **options, bool is_of) +{ + bool enabled = true; + const char *opt = NULL; + + if (video_of_only && !is_of) + enabled = false; + + opt = __video_get_option_string(name); + + if (options) + *options = opt; + + return enabled; +} +EXPORT_SYMBOL(__video_get_options); +#endif + +/* + * Process command line options for video adapters. This function is + * a __setup and __init function. It only stores the options. Drivers + * have to call video_get_options() as necessary. + */ +static int __init video_setup(char *options) +{ + if (!options || !*options) + goto out; + + if (!strncmp(options, "ofonly", 6)) { + video_of_only = true; + goto out; + } + + if (strchr(options, ':')) { + /* named */ + size_t i; + + for (i = 0; i < ARRAY_SIZE(video_options); i++) { + if (!video_options[i]) { + video_options[i] = options; + break; + } + } + } else { + /* global */ + video_option = options; + } + +out: + return 1; +} +__setup("video=", video_setup); |
