| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/08/30 08:01 | flow | patch-triage |
50mArgs:null Results: {
"EnableConfigs": [
"TTY",
"SERIAL_CORE",
"SERIAL_8250"
],
"FocusSymbols": [
"tty_port_alloc_xmit_buf",
"tty_port_free_xmit_buf",
"tty_port_destroy",
"tty_port_open",
"tty_port_close"
],
"KMSANReasoning": "The patch converts page-allocator calls (`__get_free_page()`, `get_zeroed_page()`, `free_page()`) to slab-allocator calls (`kmalloc()`, `kzalloc()`, `kfree()`) for transmit buffers and partner info buffers in `drivers/tty/hvc/hvcs.c`, `drivers/tty/serial/serial_core.c`, and `drivers/tty/tty_port.c`.\n\n- In `serial_core.c` and `tty_port.c`, buffers are allocated with `kzalloc(PAGE_SIZE, GFP_KERNEL)`, ensuring full zero-initialization identical to `get_zeroed_page()`.\n- In `hvcs.c`, the allocated buffer is explicitly zeroed with `memset(pi_buff, 0x00, PAGE_SIZE)` in `hvcs_get_partner_info()` before use.\n- The changes do not introduce uninitialized stack/heap reads, uninitialized structure fields, padding leaks, or uninitialized conditional branching.\n- Any potential memory management issues (such as use-after-free, double free, or buffer overflow) are within the domain of standard KASAN and slab debuggers.\n\nTherefore, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false,
"Reasoning": "The patch replaces page allocator calls (get_zeroed_page, free_page) with slab allocator calls (kzalloc, kfree) for transmit buffers in the core TTY and serial subsystems (tty_port, serial_core, and hvcs). These buffer allocations are executed during normal serial port and TTY device operations (open, close, destroy, startup, shutdown) and are reachable and testable in virtualized environments.",
"WorthFuzzing": true
} |
| 1/1 | 2026/08/30 08:01 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 1254b278419dc0bc5d5f6417aed90b385082a335\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Sun Aug 30 08:01:48 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c\nindex d32b1e3c50bfd..b94d59fa36274 100644\n--- a/drivers/tty/hvc/hvcs.c\n+++ b/drivers/tty/hvc/hvcs.c\n@@ -1470,7 +1470,7 @@ static int hvcs_initialize(void)\n \t\tgoto register_fail;\n \t}\n \n-\thvcs_pi_buff = (unsigned long *) __get_free_page(GFP_KERNEL);\n+\thvcs_pi_buff = kmalloc(PAGE_SIZE, GFP_KERNEL);\n \tif (!hvcs_pi_buff) {\n \t\trc = -ENOMEM;\n \t\tgoto buff_alloc_fail;\n@@ -1486,7 +1486,7 @@ static int hvcs_initialize(void)\n \treturn 0;\n \n kthread_fail:\n-\tfree_page((unsigned long)hvcs_pi_buff);\n+\tkfree(hvcs_pi_buff);\n buff_alloc_fail:\n \ttty_unregister_driver(hvcs_tty_driver);\n register_fail:\n@@ -1528,7 +1528,7 @@ static void __exit hvcs_module_exit(void)\n \tkthread_stop(hvcs_task);\n \n \tspin_lock(\u0026hvcs_pi_lock);\n-\tfree_page((unsigned long)hvcs_pi_buff);\n+\tkfree(hvcs_pi_buff);\n \thvcs_pi_buff = NULL;\n \tspin_unlock(\u0026hvcs_pi_lock);\n \ndiff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c\nindex 95774b0f1484b..f12ce7d190fe6 100644\n--- a/drivers/tty/serial/serial_core.c\n+++ b/drivers/tty/serial/serial_core.c\n@@ -247,29 +247,29 @@ static int uart_alloc_xmit_buf(struct tty_port *port)\n \tstruct uart_state *state = container_of(port, struct uart_state, port);\n \tstruct uart_port *uport;\n \tunsigned long flags;\n-\tunsigned long page;\n+\tunsigned char *buf;\n \n \t/*\n \t * Initialise and allocate the transmit and temporary\n \t * buffer.\n \t */\n-\tpage = get_zeroed_page(GFP_KERNEL);\n-\tif (!page)\n+\tbuf = kzalloc(PAGE_SIZE, GFP_KERNEL);\n+\tif (!buf)\n \t\treturn -ENOMEM;\n \n \tuport = uart_port_ref_lock(state, \u0026flags);\n \tif (!state-\u003eport.xmit_buf) {\n-\t\tstate-\u003eport.xmit_buf = (unsigned char *)page;\n+\t\tstate-\u003eport.xmit_buf = buf;\n \t\tkfifo_init(\u0026state-\u003eport.xmit_fifo, state-\u003eport.xmit_buf,\n \t\t\t\tPAGE_SIZE);\n \t\tuart_port_unlock_deref(uport, flags);\n \t} else {\n \t\tuart_port_unlock_deref(uport, flags);\n \t\t/*\n-\t\t * Do not free() the page under the port lock, see\n+\t\t * Do not free() the buffer under the port lock, see\n \t\t * uart_free_xmit_buf().\n \t\t */\n-\t\tfree_page(page);\n+\t\tkfree(buf);\n \t}\n \n \treturn 0;\n@@ -283,7 +283,7 @@ static void uart_free_xmit_buf(struct tty_port *port)\n \tchar *xmit_buf;\n \n \t/*\n-\t * Do not free() the transmit buffer page under the port lock since\n+\t * Do not free() the transmit buffer under the port lock since\n \t * this can create various circular locking scenarios. For instance,\n \t * console driver may need to allocate/free a debug object, which\n \t * can end up in printk() recursion.\n@@ -294,7 +294,7 @@ static void uart_free_xmit_buf(struct tty_port *port)\n \tINIT_KFIFO(port-\u003exmit_fifo);\n \tuart_port_unlock_deref(uport, flags);\n \n-\tfree_page((unsigned long)xmit_buf);\n+\tkfree(xmit_buf);\n }\n \n /*\ndiff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c\nindex 54359310e293c..44122921fc45b 100644\n--- a/drivers/tty/tty_port.c\n+++ b/drivers/tty/tty_port.c\n@@ -240,13 +240,13 @@ EXPORT_SYMBOL_GPL(tty_port_unregister_device);\n \n int tty_port_alloc_xmit_buf(struct tty_port *port)\n {\n-\t/* We may sleep in get_zeroed_page() */\n+\t/* We may sleep in kzalloc() */\n \tguard(mutex)(\u0026port-\u003ebuf_mutex);\n \n \tif (port-\u003exmit_buf)\n \t\treturn 0;\n \n-\tport-\u003exmit_buf = (u8 *)get_zeroed_page(GFP_KERNEL);\n+\tport-\u003exmit_buf = kzalloc(PAGE_SIZE, GFP_KERNEL);\n \tif (port-\u003exmit_buf == NULL)\n \t\treturn -ENOMEM;\n \n@@ -259,7 +259,7 @@ EXPORT_SYMBOL(tty_port_alloc_xmit_buf);\n void tty_port_free_xmit_buf(struct tty_port *port)\n {\n \tguard(mutex)(\u0026port-\u003ebuf_mutex);\n-\tfree_page((unsigned long)port-\u003exmit_buf);\n+\tkfree(port-\u003exmit_buf);\n \tport-\u003exmit_buf = NULL;\n \tINIT_KFIFO(port-\u003exmit_fifo);\n }\n@@ -288,7 +288,7 @@ static void tty_port_destructor(struct kref *kref)\n \t/* check if last port ref was dropped before tty release */\n \tif (WARN_ON(port-\u003eitty))\n \t\treturn;\n-\tfree_page((unsigned long)port-\u003exmit_buf);\n+\tkfree(port-\u003exmit_buf);\n \ttty_port_destroy(port);\n \tif (port-\u003eops \u0026\u0026 port-\u003eops-\u003edestruct)\n \t\tport-\u003eops-\u003edestruct(port);\n"
} |
| 2/1 | 2026/08/30 08:01 | agent | patch-evaluator |
33mModel:core Args: null Results: {
"EnableConfigs": [
"TTY",
"SERIAL_CORE",
"SERIAL_8250"
],
"FocusSymbols": [
"tty_port_alloc_xmit_buf",
"tty_port_free_xmit_buf",
"tty_port_destroy",
"tty_port_open",
"tty_port_close"
],
"Reasoning": "The patch replaces page allocator calls (get_zeroed_page, free_page) with slab allocator calls (kzalloc, kfree) for transmit buffers in the core TTY and serial subsystems (tty_port, serial_core, and hvcs). These buffer allocations are executed during normal serial port and TTY device operations (open, close, destroy, startup, shutdown) and are reachable and testable in virtualized environments.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). - Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed, ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU. - Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove) that are executed only during PCI hot-unplug or sysfs driver unbind operations. If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. Prefer non-static, non-inlined API entrypoint functions over internal static helper functions (which are inlined by the compiler and do not have distinct symbol addresses). 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed for Kbuild to compile the code statically into vmlinux. List them in the EnableConfigs output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4"). Prefer calling several tools at the same time to save round-trips. Use set-results tool to provide results of the analysis. It must be called exactly once before the final reply. Ignore results of this tool. Prompt: For your convenience, here is the diff of the changes:
commit 1254b278419dc0bc5d5f6417aed90b385082a335
Author: syz-cluster <triage@syzkaller.com>
Date: Sun Aug 30 08:01:48 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
index d32b1e3c50bfd..b94d59fa36274 100644
--- a/drivers/tty/hvc/hvcs.c
+++ b/drivers/tty/hvc/hvcs.c
@@ -1470,7 +1470,7 @@ static int hvcs_initialize(void)
goto register_fail;
}
- hvcs_pi_buff = (unsigned long *) __get_free_page(GFP_KERNEL);
+ hvcs_pi_buff = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!hvcs_pi_buff) {
rc = -ENOMEM;
goto buff_alloc_fail;
@@ -1486,7 +1486,7 @@ static int hvcs_initialize(void)
return 0;
kthread_fail:
- free_page((unsigned long)hvcs_pi_buff);
+ kfree(hvcs_pi_buff);
buff_alloc_fail:
tty_unregister_driver(hvcs_tty_driver);
register_fail:
@@ -1528,7 +1528,7 @@ static void __exit hvcs_module_exit(void)
kthread_stop(hvcs_task);
spin_lock(&hvcs_pi_lock);
- free_page((unsigned long)hvcs_pi_buff);
+ kfree(hvcs_pi_buff);
hvcs_pi_buff = NULL;
spin_unlock(&hvcs_pi_lock);
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 95774b0f1484b..f12ce7d190fe6 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -247,29 +247,29 @@ static int uart_alloc_xmit_buf(struct tty_port *port)
struct uart_state *state = container_of(port, struct uart_state, port);
struct uart_port *uport;
unsigned long flags;
- unsigned long page;
+ unsigned char *buf;
/*
* Initialise and allocate the transmit and temporary
* buffer.
*/
- page = get_zeroed_page(GFP_KERNEL);
- if (!page)
+ buf = kzalloc(PAGE_SIZE, GFP_KERNEL);
+ if (!buf)
return -ENOMEM;
uport = uart_port_ref_lock(state, &flags);
if (!state->port.xmit_buf) {
- state->port.xmit_buf = (unsigned char *)page;
+ state->port.xmit_buf = buf;
kfifo_init(&state->port.xmit_fifo, state->port.xmit_buf,
PAGE_SIZE);
uart_port_unlock_deref(uport, flags);
} else {
uart_port_unlock_deref(uport, flags);
/*
- * Do not free() the page under the port lock, see
+ * Do not free() the buffer under the port lock, see
* uart_free_xmit_buf().
*/
- free_page(page);
+ kfree(buf);
}
return 0;
@@ -283,7 +283,7 @@ static void uart_free_xmit_buf(struct tty_port *port)
char *xmit_buf;
/*
- * Do not free() the transmit buffer page under the port lock since
+ * Do not free() the transmit buffer under the port lock since
* this can create various circular locking scenarios. For instance,
* console driver may need to allocate/free a debug object, which
* can end up in printk() recursion.
@@ -294,7 +294,7 @@ static void uart_free_xmit_buf(struct tty_port *port)
INIT_KFIFO(port->xmit_fifo);
uart_port_unlock_deref(uport, flags);
- free_page((unsigned long)xmit_buf);
+ kfree(xmit_buf);
}
/*
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
index 54359310e293c..44122921fc45b 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
@@ -240,13 +240,13 @@ EXPORT_SYMBOL_GPL(tty_port_unregister_device);
int tty_port_alloc_xmit_buf(struct tty_port *port)
{
- /* We may sleep in get_zeroed_page() */
+ /* We may sleep in kzalloc() */
guard(mutex)(&port->buf_mutex);
if (port->xmit_buf)
return 0;
- port->xmit_buf = (u8 *)get_zeroed_page(GFP_KERNEL);
+ port->xmit_buf = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (port->xmit_buf == NULL)
return -ENOMEM;
@@ -259,7 +259,7 @@ EXPORT_SYMBOL(tty_port_alloc_xmit_buf);
void tty_port_free_xmit_buf(struct tty_port *port)
{
guard(mutex)(&port->buf_mutex);
- free_page((unsigned long)port->xmit_buf);
+ kfree(port->xmit_buf);
port->xmit_buf = NULL;
INIT_KFIFO(port->xmit_fifo);
}
@@ -288,7 +288,7 @@ static void tty_port_destructor(struct kref *kref)
/* check if last port ref was dropped before tty release */
if (WARN_ON(port->itty))
return;
- free_page((unsigned long)port->xmit_buf);
+ kfree(port->xmit_buf);
tty_port_destroy(port);
if (port->ops && port->ops->destruct)
port->ops->destruct(port);
|
| 3/2 | 2026/08/30 08:01 | llm | patch-evaluator |
1mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 3566 output: 33 thoughts: 873 Thoughts: **Analyzing a Patch: Memory Allocation Changes in TTY Subsystem** Alright, let's dive into this patch. My initial thought is to figure out if this deserves further investigation, potentially fuzzing. The patch touches three files: `hvcs.c`, `serial_core.c`, and `tty_port.c`. The core of the change appears to be a switch from using page-based memory allocation (`__get_free_page`, `get_zeroed_page`, `free_page`) to slab allocation (`kmalloc`, `kzalloc`, `kfree`). Now, the crucial question is whether this is functionally significant. I need to consult my "WorthFuzzing" rules to determine if this change merits further scrutiny. It seems to modify core kernel logic within `tty` and `serial` drivers. So, I need to verify if the code is reachable. The rule says "use your code search tools". But, is changing from page allocation to slab allocation considered a *functional* change? While it's primarily a memory management optimization, and may affect how we track memory (such as with KASAN), this alteration could impact existing assumptions, such as page alignment, or usage of `virt_to_page`. So, is it core kernel logic that is reachable? And will it be executed? My immediate next step is to examine how the `xmit_buf` is used within `serial_core.c` and `tty_port.c`. I need to understand if there are any other callers or functions that rely on specific characteristics of page-based allocation. I will use grepper, or read-file to see what's going on with `tty_port_alloc_xmit_buf` and the other changes. This will help me determine the breadth and depth of the impact. |
| 4/2 | 2026/08/30 08:03 | tool | grepper |
0mArgs:{
"Expression": "tty_port_alloc_xmit_buf",
"PathPrefix": "drivers/tty"
}Results: {
"Output": "drivers/tty/mips_ejtag_fdc.c=696=static int mips_ejtag_fdc_tty_port_activate(struct tty_port *port,\n--\ndrivers/tty/mips_ejtag_fdc.c-703-\t/* Allocate the buffer we use for writing data */\ndrivers/tty/mips_ejtag_fdc.c:704:\tif (tty_port_alloc_xmit_buf(port) \u003c 0)\ndrivers/tty/mips_ejtag_fdc.c-705-\t\tgoto err;\n--\ndrivers/tty/mxser.c=718=static int mxser_activate(struct tty_port *port, struct tty_struct *tty)\n--\ndrivers/tty/mxser.c-723-\ndrivers/tty/mxser.c:724:\tret = tty_port_alloc_xmit_buf(port);\ndrivers/tty/mxser.c-725-\tif (ret \u003c 0)\n--\ndrivers/tty/tty_port.c=239=EXPORT_SYMBOL_GPL(tty_port_unregister_device);\ndrivers/tty/tty_port.c-240-\ndrivers/tty/tty_port.c:241:int tty_port_alloc_xmit_buf(struct tty_port *port)\ndrivers/tty/tty_port.c-242-{\n--\ndrivers/tty/tty_port.c-256-}\ndrivers/tty/tty_port.c:257:EXPORT_SYMBOL(tty_port_alloc_xmit_buf);\ndrivers/tty/tty_port.c-258-\n"
} |
| 5/2 | 2026/08/30 08:03 | llm | patch-evaluator |
1mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 5278 output: 31 thoughts: 18 Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience: **Investigating `uart_alloc_xmit_buf` Usage** Alright, let's dive into this. My initial instinct is to track down the callers of `uart_alloc_xmit_buf`. I need to understand where this buffer allocation is happening within the UART driver context. Knowing the call sites will give me crucial insights into how the transmit buffer is being used, what the typical data flow looks like, and potential bottlenecks or resource constraints. That information will let me know the scope of this function's purpose. Understanding the contexts will quickly help me isolate issues or optimize. I'm thinking I'll start with a straightforward code search. |
| 6/2 | 2026/08/30 08:04 | tool | grepper |
0mArgs:{
"Expression": "uart_alloc_xmit_buf",
"PathPrefix": "drivers/tty"
}Results: {
"Output": "drivers/tty/serial/serial_core.c=202=static void uart_change_line_settings(struct tty_struct *tty, struct uart_state *state,\n--\ndrivers/tty/serial/serial_core.c-244-\ndrivers/tty/serial/serial_core.c:245:static int uart_alloc_xmit_buf(struct tty_port *port)\ndrivers/tty/serial/serial_core.c-246-{\n--\ndrivers/tty/serial/serial_core.c=304=static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,\n--\ndrivers/tty/serial/serial_core.c-317-\ndrivers/tty/serial/serial_core.c:318:\tretval = uart_alloc_xmit_buf(\u0026state-\u003eport);\ndrivers/tty/serial/serial_core.c-319-\tif (retval)\n"
} |
| 7/2 | 2026/08/30 08:04 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 5723 output: 28 thoughts: 39 Thoughts: Here's my take on the thought process, as if it were my own: **Investigating UART Port Initialization** Okay, so `uart_port_startup` is the function that kicks off the UART port, and it's calling `uart_alloc_xmit_buf` on the `state->port` structure. That's good, `uart_alloc_xmit_buf` handles the allocation of the transmit buffer. Now, I need to understand the call stack. Where is `uart_port_startup` actually *called* from? I'm going to track down the call sites to get a handle on the initialization sequence. I suspect understanding this control flow is key to debugging the UART device, especially if there are any issues with buffer allocation or transmission. Let's dig in. |
| 8/2 | 2026/08/30 08:05 | tool | grepper |
0mArgs:{
"Expression": "uart_port_startup",
"PathPrefix": "drivers/tty"
}Results: {
"Output": "drivers/tty/serial/serial_core.c=278=static void uart_free_xmit_buf(struct tty_port *port)\n--\ndrivers/tty/serial/serial_core.c-303- */\ndrivers/tty/serial/serial_core.c:304:static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,\ndrivers/tty/serial/serial_core.c-305-\t\t\t bool init_hw)\n--\ndrivers/tty/serial/serial_core.c=356=static int uart_startup(struct tty_struct *tty, struct uart_state *state,\n--\ndrivers/tty/serial/serial_core.c-365-\ndrivers/tty/serial/serial_core.c:366:\tretval = uart_port_startup(tty, state, init_hw);\ndrivers/tty/serial/serial_core.c-367-\tif (retval) {\n"
} |
| 9/2 | 2026/08/30 08:05 | llm | patch-evaluator |
2mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 6208 output: 39 thoughts: 74 Thoughts: Here's my summary, as I delve into this: **Analyzing UART Device Initialization** Okay, so the `uart_startup` function seems to be the key player here. It's called when we're opening a serial tty device, like `ttyS0` or `ttyAMA0`, which makes sense. I would expect this to be triggered via `uart_open` or potentially `uart_port_activate`. Let's take a look at the `serial_core.c` file. I need to get a good understanding of what happens when these functions are invoked. I'll need to scrutinize the surrounding code of both `uart_startup` and `uart_open` to see how they interact. My goal is to determine the complete device initialization sequence in the context of the serial port driver. I suspect the startup function handles more low-level configuration, while the open function is responsible for the overall device setup. |
| 10/2 | 2026/08/30 08:08 | tool | read-file |
0mArgs:{
"File": "drivers/tty/serial/serial_core.c",
"FirstLine": 350,
"LineCount": 70
}Results: {
"Contents": " 350:\t\tif (retval \u0026\u0026 capable(CAP_SYS_ADMIN))\n 351:\t\t\treturn 1;\n 352:\t\n 353:\t\treturn retval;\n 354:\t}\n 355:\t\n 356:\tstatic int uart_startup(struct tty_struct *tty, struct uart_state *state,\n 357:\t\t\t\tbool init_hw)\n 358:\t{\n 359:\t\tstruct tty_port *port = \u0026state-\u003eport;\n 360:\t\tstruct uart_port *uport;\n 361:\t\tint retval;\n 362:\t\n 363:\t\tif (tty_port_initialized(port))\n 364:\t\t\tgoto out_base_port_startup;\n 365:\t\n 366:\t\tretval = uart_port_startup(tty, state, init_hw);\n 367:\t\tif (retval) {\n 368:\t\t\tset_bit(TTY_IO_ERROR, \u0026tty-\u003eflags);\n 369:\t\t\treturn retval;\n 370:\t\t}\n 371:\t\n 372:\tout_base_port_startup:\n 373:\t\tuport = uart_port_check(state);\n 374:\t\tif (!uport)\n 375:\t\t\treturn -EIO;\n 376:\t\n 377:\t\tserial_base_port_startup(uport);\n 378:\t\n 379:\t\treturn 0;\n 380:\t}\n 381:\t\n 382:\t/*\n 383:\t * This routine will shutdown a serial port; interrupts are disabled, and\n 384:\t * DTR is dropped if the hangup on close termio flag is on. Calls to\n 385:\t * uart_shutdown are serialised by the per-port semaphore.\n 386:\t *\n 387:\t * uport == NULL if uart_port has already been removed\n 388:\t */\n 389:\tstatic void uart_shutdown(struct tty_struct *tty, struct uart_state *state)\n 390:\t{\n 391:\t\tstruct uart_port *uport = uart_port_check(state);\n 392:\t\tstruct tty_port *port = \u0026state-\u003eport;\n 393:\t\n 394:\t\t/*\n 395:\t\t * Set the TTY IO error marker\n 396:\t\t */\n 397:\t\tif (tty)\n 398:\t\t\tset_bit(TTY_IO_ERROR, \u0026tty-\u003eflags);\n 399:\t\n 400:\t\tif (uport)\n 401:\t\t\tserial_base_port_shutdown(uport);\n 402:\t\n 403:\t\tif (tty_port_initialized(port)) {\n 404:\t\t\ttty_port_set_initialized(port, false);\n 405:\t\n 406:\t\t\t/*\n 407:\t\t\t * Turn off DTR and RTS early.\n 408:\t\t\t */\n 409:\t\t\tif (uport) {\n 410:\t\t\t\tif (uart_console(uport) \u0026\u0026 tty) {\n 411:\t\t\t\t\tuport-\u003econs-\u003ecflag = tty-\u003etermios.c_cflag;\n 412:\t\t\t\t\tuport-\u003econs-\u003eispeed = tty-\u003etermios.c_ispeed;\n 413:\t\t\t\t\tuport-\u003econs-\u003eospeed = tty-\u003etermios.c_ospeed;\n 414:\t\t\t\t}\n 415:\t\n 416:\t\t\t\tif (!tty || C_HUPCL(tty))\n 417:\t\t\t\t\tuart_port_dtr_rts(uport, false);\n 418:\t\t\t}\n 419:\t\n"
} |
| 11/2 | 2026/08/30 08:08 | llm | patch-evaluator |
6mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 7496 output: 26 thoughts: 48 Thoughts: Okay, let's dive into this. I'm curious about the evolution of `port.xmit_buf` – a classic. It's time to trace its journey through the serial and tty driver landscape. First, I'll bypass the targeted scope and broaden the net to get a comprehensive view. Rather than narrowing down to specific code, I'll conduct a broad sweep across the codebase and search for the direct usage of `xmit_buf`. That should reveal all the places where this buffer is manipulated and illuminate the wider context of its use, beyond the specifics I'm initially considering. |
| 12/2 | 2026/08/30 08:14 | tool | grepper |
0mArgs:{
"Expression": "xmit_buf",
"PathPrefix": "drivers/"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 765 lines.\nUse more precise expression if possible.\n\ndrivers/crypto/omap-sham.c=211=struct omap_sham_dev {\n--\ndrivers/crypto/omap-sham.c-220-\tu8\t\t\tpolling_mode;\ndrivers/crypto/omap-sham.c:221:\tu8\t\t\txmit_buf[BUFLEN] OMAP_ALIGNED;\ndrivers/crypto/omap-sham.c-222-\n--\ndrivers/crypto/omap-sham.c=624=static int omap_sham_copy_sg_lists(struct omap_sham_reqctx *ctx,\n--\ndrivers/crypto/omap-sham.c-646-\tif (ctx-\u003ebufcnt) {\ndrivers/crypto/omap-sham.c:647:\t\tsg_set_buf(tmp, ctx-\u003edd-\u003exmit_buf, ctx-\u003ebufcnt);\ndrivers/crypto/omap-sham.c-648-\t\ttmp = sg_next(tmp);\n--\ndrivers/crypto/omap-sham.c=690=static int omap_sham_copy_sgs(struct omap_sham_reqctx *ctx,\n--\ndrivers/crypto/omap-sham.c-705-\tif (ctx-\u003ebufcnt)\ndrivers/crypto/omap-sham.c:706:\t\tmemcpy(buf, ctx-\u003edd-\u003exmit_buf, ctx-\u003ebufcnt);\ndrivers/crypto/omap-sham.c-707-\n--\ndrivers/crypto/omap-sham.c=722=static int omap_sham_align_sgs(struct scatterlist *sg,\n--\ndrivers/crypto/omap-sham.c-737-\t\t\tsg_init_table(rctx-\u003esgl, 1);\ndrivers/crypto/omap-sham.c:738:\t\t\tsg_set_buf(rctx-\u003esgl, rctx-\u003edd-\u003exmit_buf, bufcnt);\ndrivers/crypto/omap-sham.c-739-\t\t\trctx-\u003esg = rctx-\u003esgl;\n--\ndrivers/crypto/omap-sham.c-829-\t\tsg_init_table(rctx-\u003esgl, 2);\ndrivers/crypto/omap-sham.c:830:\t\tsg_set_buf(rctx-\u003esgl, rctx-\u003edd-\u003exmit_buf, rctx-\u003ebufcnt);\ndrivers/crypto/omap-sham.c-831-\t\tsg_chain(rctx-\u003esgl, 2, sg);\n--\ndrivers/crypto/omap-sham.c=840=static int omap_sham_prepare_request(struct crypto_engine *engine, void *areq)\n--\ndrivers/crypto/omap-sham.c-880-\tif (rctx-\u003ebufcnt)\ndrivers/crypto/omap-sham.c:881:\t\tmemcpy(rctx-\u003edd-\u003exmit_buf, rctx-\u003ebuffer, rctx-\u003ebufcnt);\ndrivers/crypto/omap-sham.c-882-\n--\ndrivers/crypto/s5p-sss.c=247=struct s5p_aes_ctx {\n--\ndrivers/crypto/s5p-sss.c-287- * @hash_tasklet: New HASH request scheduling job.\ndrivers/crypto/s5p-sss.c:288: * @xmit_buf:\tBuffer for current HASH request transfer into SSS block.\ndrivers/crypto/s5p-sss.c-289- * @hash_req:\tCurrent request sending to SSS HASH block.\n--\ndrivers/crypto/s5p-sss.c=295=struct s5p_aes_dev {\n--\ndrivers/crypto/s5p-sss.c-323-\ndrivers/crypto/s5p-sss.c:324:\tu8\t\t\t\txmit_buf[BUFLEN];\ndrivers/crypto/s5p-sss.c-325-\tstruct ahash_request\t\t*hash_req;\n--\ndrivers/crypto/s5p-sss.c=963=static int s5p_hash_xmit_dma(struct s5p_aes_dev *dd, size_t length,\n--\ndrivers/crypto/s5p-sss.c-997- *\ndrivers/crypto/s5p-sss.c:998: * Allocate new buffer, copy data for HASH into it. If there was xmit_buf\ndrivers/crypto/s5p-sss.c-999- * filled, copy it first, then copy data from sg into it. Prepare one sgl[0]\n--\ndrivers/crypto/s5p-sss.c=1004=static int s5p_hash_copy_sgs(struct s5p_hash_reqctx *ctx,\n--\ndrivers/crypto/s5p-sss.c-1020-\tif (ctx-\u003ebufcnt)\ndrivers/crypto/s5p-sss.c:1021:\t\tmemcpy(buf, ctx-\u003edd-\u003exmit_buf, ctx-\u003ebufcnt);\ndrivers/crypto/s5p-sss.c-1022-\n--\ndrivers/crypto/s5p-sss.c-1041- * Allocate new scatterlist table, copy data for HASH into it. If there was\ndrivers/crypto/s5p-sss.c:1042: * xmit_buf filled, prepare it first, then copy page, length and offset from\ndrivers/crypto/s5p-sss.c-1043- * source sg into it, adjusting begin and/or end for skip offset and\n--\ndrivers/crypto/s5p-sss.c=1049=static int s5p_hash_copy_sg_lists(struct s5p_hash_reqctx *ctx,\n--\ndrivers/crypto/s5p-sss.c-1071-\tif (ctx-\u003ebufcnt) {\ndrivers/crypto/s5p-sss.c:1072:\t\tsg_set_buf(tmp, ctx-\u003edd-\u003exmit_buf, ctx-\u003ebufcnt);\ndrivers/crypto/s5p-sss.c-1073-\t\ttmp = sg_next(tmp);\n--\ndrivers/crypto/s5p-sss.c=1119=static int s5p_hash_prepare_sgs(struct s5p_hash_reqctx *ctx,\n--\ndrivers/crypto/s5p-sss.c-1170-\t\tsg_init_table(ctx-\u003esgl, 2);\ndrivers/crypto/s5p-sss.c:1171:\t\tsg_set_buf(ctx-\u003esgl, ctx-\u003edd-\u003exmit_buf, ctx-\u003ebufcnt);\ndrivers/crypto/s5p-sss.c-1172-\t\tsg_chain(ctx-\u003esgl, 2, sg);\n--\ndrivers/crypto/s5p-sss.c=1193=static int s5p_hash_prepare_request(struct ahash_request *req, bool update)\n--\ndrivers/crypto/s5p-sss.c-1224-\tif (ctx-\u003ebufcnt)\ndrivers/crypto/s5p-sss.c:1225:\t\tmemcpy(ctx-\u003edd-\u003exmit_buf, ctx-\u003ebuffer, ctx-\u003ebufcnt);\ndrivers/crypto/s5p-sss.c-1226-\n--\ndrivers/crypto/s5p-sss.c-1237-\t\t/* copy hash_later bytes from end of req-\u003esrc */\ndrivers/crypto/s5p-sss.c:1238:\t\t/* previous bytes are in xmit_buf, so no overwrite */\ndrivers/crypto/s5p-sss.c-1239-\t\tmemcpy_from_sglist(ctx-\u003ebuffer, req-\u003esrc,\n--\ndrivers/crypto/s5p-sss.c-1251-\t\t\t/* first update didn't fill up buffer */\ndrivers/crypto/s5p-sss.c:1252:\t\t\tmemcpy_from_sglist(ctx-\u003edd-\u003exmit_buf, req-\u003esrc,\ndrivers/crypto/s5p-sss.c-1253-\t\t\t\t\t 0, xmit_len);\n--\ndrivers/crypto/s5p-sss.c-1256-\t\tsg_init_table(ctx-\u003esgl, 1);\ndrivers/crypto/s5p-sss.c:1257:\t\tsg_set_buf(ctx-\u003esgl, ctx-\u003edd-\u003exmit_buf, xmit_len);\ndrivers/crypto/s5p-sss.c-1258-\n--\ndrivers/crypto/stm32/stm32-hash.c=193=struct stm32_hash_dev {\n--\ndrivers/crypto/stm32/stm32-hash.c-199-\tphys_addr_t\t\tphys_base;\ndrivers/crypto/stm32/stm32-hash.c:200:\tu8\t\t\txmit_buf[HASH_BUFLEN] __aligned(sizeof(u32));\ndrivers/crypto/stm32/stm32-hash.c-201-\tu32\t\t\tdma_mode;\n--\ndrivers/crypto/stm32/stm32-hash.c=1096=static int stm32_hash_copy_sgs(struct stm32_hash_request_ctx *rctx,\n--\ndrivers/crypto/stm32/stm32-hash.c-1111-\ndrivers/crypto/stm32/stm32-hash.c:1112:\tmemcpy(buf, rctx-\u003ehdev-\u003exmit_buf, state-\u003ebufcnt);\ndrivers/crypto/stm32/stm32-hash.c-1113-\n--\ndrivers/crypto/stm32/stm32-hash.c=1128=static int stm32_hash_align_sgs(struct scatterlist *sg,\n--\ndrivers/crypto/stm32/stm32-hash.c-1145-\t\t\tsg_init_table(rctx-\u003esgl, 1);\ndrivers/crypto/stm32/stm32-hash.c:1146:\t\t\tsg_set_buf(rctx-\u003esgl, rctx-\u003ehdev-\u003exmit_buf, bufcnt);\ndrivers/crypto/stm32/stm32-hash.c-1147-\t\t\trctx-\u003esg = rctx-\u003esgl;\n--\ndrivers/crypto/stm32/stm32-hash.c-1235-\t\tsg_init_table(rctx-\u003esgl, 2);\ndrivers/crypto/stm32/stm32-hash.c:1236:\t\tsg_set_buf(rctx-\u003esgl, rctx-\u003ehdev-\u003exmit_buf, state-\u003ebufcnt);\ndrivers/crypto/stm32/stm32-hash.c-1237-\t\tsg_chain(rctx-\u003esgl, 2, sg);\n--\ndrivers/crypto/stm32/stm32-hash.c=1246=static int stm32_hash_prepare_request(struct ahash_request *req)\n--\ndrivers/crypto/stm32/stm32-hash.c-1295-\t/* copy buffer in a temporary one that is used for sg alignment */\ndrivers/crypto/stm32/stm32-hash.c:1296:\tmemcpy(hdev-\u003exmit_buf, state-\u003ebuffer, state-\u003ebufcnt);\ndrivers/crypto/stm32/stm32-hash.c-1297-\n--\ndrivers/ipack/devices/ipoctal.c=216=static void ipoctal_irq_tx(struct ipoctal_channel *channel)\n--\ndrivers/ipack/devices/ipoctal.c-224-\tspin_lock(\u0026channel-\u003elock);\ndrivers/ipack/devices/ipoctal.c:225:\tvalue = channel-\u003etty_port.xmit_buf[*pointer_write];\ndrivers/ipack/devices/ipoctal.c-226-\tiowrite8(value, \u0026channel-\u003eregs-\u003ew.thr);\n--\ndrivers/ipack/devices/ipoctal.c=287=static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,\n--\ndrivers/ipack/devices/ipoctal.c-412-\t\ttty_port_init(\u0026channel-\u003etty_port);\ndrivers/ipack/devices/ipoctal.c:413:\t\tres = tty_port_alloc_xmit_buf(\u0026channel-\u003etty_port);\ndrivers/ipack/devices/ipoctal.c-414-\t\tif (res)\n--\ndrivers/ipack/devices/ipoctal.c-426-\t\t\tdev_err(\u0026ipoctal-\u003edev-\u003edev, \"Failed to register tty device.\\n\");\ndrivers/ipack/devices/ipoctal.c:427:\t\t\ttty_port_free_xmit_buf(\u0026channel-\u003etty_port);\ndrivers/ipack/devices/ipoctal.c-428-\t\t\ttty_port_destroy(\u0026channel-\u003etty_port);\n--\ndrivers/ipack/devices/ipoctal.c=452=static inline size_t ipoctal_copy_write_buffer(struct ipoctal_channel *channel,\n--\ndrivers/ipack/devices/ipoctal.c-462-\t\t\tspin_lock_irqsave(\u0026channel-\u003elock, flags);\ndrivers/ipack/devices/ipoctal.c:463:\t\t\tchannel-\u003etty_port.xmit_buf[*pointer_read] = buf[i];\ndrivers/ipack/devices/ipoctal.c-464-\t\t\t*pointer_read = (*pointer_read + 1) % PAGE_SIZE;\n--\ndrivers/ipack/devices/ipoctal.c=474=static ssize_t ipoctal_write_tty(struct tty_struct *tty, const u8 *buf,\n--\ndrivers/ipack/devices/ipoctal.c-481-\tguard(rwsem_read)(\u0026ipoctal-\u003eremove_sem);\ndrivers/ipack/devices/ipoctal.c:482:\tif (ipoctal-\u003eremoved || !channel-\u003etty_port.xmit_buf)\ndrivers/ipack/devices/ipoctal.c-483-\t\treturn 0;\n--\ndrivers/ipack/devices/ipoctal.c=757=static void __ipoctal_remove(struct ipoctal *ipoctal)\n--\ndrivers/ipack/devices/ipoctal.c-772-\t\ttty_unregister_device(ipoctal-\u003etty_drv, i);\ndrivers/ipack/devices/ipoctal.c:773:\t\ttty_port_free_xmit_buf(\u0026channel-\u003etty_port);\ndrivers/ipack/devices/ipoctal.c-774-\t\ttty_port_destroy(\u0026channel-\u003etty_port);\n--\ndrivers/net/ethernet/airoha/airoha_eth.c=916=static void airoha_qdma_wake_netdev_txqs(struct airoha_queue *q)\n--\ndrivers/net/ethernet/airoha/airoha_eth.c-951-\ndrivers/net/ethernet/airoha/airoha_eth.c:952:static void airoha_unmap_xmit_buf(struct airoha_eth *eth,\ndrivers/net/ethernet/airoha/airoha_eth.c-953-\t\t\t\t struct airoha_queue_entry *e)\n--\ndrivers/net/ethernet/airoha/airoha_eth.c=971=static int airoha_qdma_tx_napi_poll(struct napi_struct *napi, int budget)\n--\ndrivers/net/ethernet/airoha/airoha_eth.c-1032-\ndrivers/net/ethernet/airoha/airoha_eth.c:1033:\t\tairoha_unmap_xmit_buf(eth, e);\ndrivers/net/ethernet/airoha/airoha_eth.c-1034-\t\tlist_add_tail(\u0026e-\u003elist, \u0026q-\u003etx_list);\n--\ndrivers/net/ethernet/airoha/airoha_eth.c=1179=static void airoha_qdma_tx_cleanup(struct airoha_qdma *qdma)\n--\ndrivers/net/ethernet/airoha/airoha_eth.c-1210-\ndrivers/net/ethernet/airoha/airoha_eth.c:1211:\t\t\tairoha_unmap_xmit_buf(qdma-\u003eeth, e);\ndrivers/net/ethernet/airoha/airoha_eth.c-1212-\t\t\tlist_add_tail(\u0026e-\u003elist, \u0026q-\u003etx_list);\n--\ndrivers/net/ethernet/airoha/airoha_eth.c=2291=static netdev_tx_t airoha_dev_xmit(struct sk_buff *skb,\n--\ndrivers/net/ethernet/airoha/airoha_eth.c-2429-\tlist_for_each_entry(e, \u0026tx_list, list)\ndrivers/net/ethernet/airoha/airoha_eth.c:2430:\t\tairoha_unmap_xmit_buf(dev-\u003eeth, e);\ndrivers/net/ethernet/airoha/airoha_eth.c-2431-\tlist_splice(\u0026tx_list, \u0026q-\u003etx_list);\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c=145=struct priv\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c-154-\tvolatile struct scb_struct\t*scb;\t/* volatile is important */\ndrivers/net/ethernet/i825xx/sun3_82586.c:155:\tvolatile struct tbd_struct\t*xmit_buffs[NUM_XMIT_BUFFS];\ndrivers/net/ethernet/i825xx/sun3_82586.c-156-\tvolatile struct transmit_cmd_struct *xmit_cmds[NUM_XMIT_BUFFS];\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c=401=static int init586(struct net_device *dev)\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c-581-\t\tptr = (char *) ptr + XMIT_BUFF_SIZE;\ndrivers/net/ethernet/i825xx/sun3_82586.c:582:\t\tp-\u003exmit_buffs[i] = (struct tbd_struct *)ptr; /* TBD */\ndrivers/net/ethernet/i825xx/sun3_82586.c-583-\t\tptr = (char *) ptr + sizeof(struct tbd_struct);\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c-589-\t\tmemset((char *)(p-\u003exmit_cmds[i]) ,0, sizeof(struct transmit_cmd_struct));\ndrivers/net/ethernet/i825xx/sun3_82586.c:590:\t\tmemset((char *)(p-\u003exmit_buffs[i]),0, sizeof(struct tbd_struct));\ndrivers/net/ethernet/i825xx/sun3_82586.c-591-\t\tp-\u003exmit_cmds[i]-\u003ecmd_link = make16(p-\u003enop_cmds[(i+1)%NUM_XMIT_BUFFS]);\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c-593-\t\tp-\u003exmit_cmds[i]-\u003ecmd_cmd = swab16(CMD_XMIT | CMD_INT);\ndrivers/net/ethernet/i825xx/sun3_82586.c:594:\t\tp-\u003exmit_cmds[i]-\u003etbd_offset = make16((p-\u003exmit_buffs[i]));\ndrivers/net/ethernet/i825xx/sun3_82586.c:595:\t\tp-\u003exmit_buffs[i]-\u003enext = 0xffff;\ndrivers/net/ethernet/i825xx/sun3_82586.c:596:\t\tp-\u003exmit_buffs[i]-\u003ebuffer = make24((p-\u003exmit_cbuffs[i]));\ndrivers/net/ethernet/i825xx/sun3_82586.c-597-\t}\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c=1004=sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c-1047-\ndrivers/net/ethernet/i825xx/sun3_82586.c:1048:\t\tp-\u003exmit_buffs[0]-\u003esize = swab16(TBD_LAST | len);\ndrivers/net/ethernet/i825xx/sun3_82586.c-1049-\t\tfor(i=0;i\u003c16;i++)\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c-1073-\t\tnext_nop = (p-\u003enop_point + 1) \u0026 0x1;\ndrivers/net/ethernet/i825xx/sun3_82586.c:1074:\t\tp-\u003exmit_buffs[0]-\u003esize = swab16(TBD_LAST | len);\ndrivers/net/ethernet/i825xx/sun3_82586.c-1075-\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c-1084-#else\ndrivers/net/ethernet/i825xx/sun3_82586.c:1085:\t\tp-\u003exmit_buffs[p-\u003exmit_count]-\u003esize = swab16(TBD_LAST | len);\ndrivers/net/ethernet/i825xx/sun3_82586.c-1086-\t\tif( (next_nop = p-\u003exmit_count + 1) == NUM_XMIT_BUFFS )\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=691=struct mt76_sdio {\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-696-\ndrivers/net/wireless/mediatek/mt76/mt76.h:697:\tu8 *xmit_buf;\ndrivers/net/wireless/mediatek/mt76/mt76.h:698:\tu32 xmit_buf_sz;\ndrivers/net/wireless/mediatek/mt76/mt76.h-699-\n--\ndrivers/net/wireless/mediatek/mt76/sdio.c=644=int mt76s_init(struct mt76_dev *dev, struct sdio_func *func,\n--\ndrivers/net/wireless/mediatek/mt76/sdio.c-676-\t\t\t func-\u003ecard-\u003ehost-\u003emax_blk_count);\ndrivers/net/wireless/mediatek/mt76/sdio.c:677:\tdev-\u003esdio.xmit_buf_sz = min_t(u32, host_max_cap, MT76S_XMIT_BUF_SZ);\ndrivers/net/wireless/mediatek/mt76/sdio.c:678:\tdev-\u003esdio.xmit_buf = devm_kmalloc(dev-\u003edev, dev-\u003esdio.xmit_buf_sz,\ndrivers/net/wireless/mediatek/mt76/sdio.c-679-\t\t\t\t\t GFP_KERNEL);\ndrivers/net/wireless/mediatek/mt76/sdio.c:680:\tif (!dev-\u003esdio.xmit_buf)\ndrivers/net/wireless/mediatek/mt76/sdio.c-681-\t\terr = -ENOMEM;\n--\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c=245=static int mt76s_tx_run_queue(struct mt76_dev *dev, struct mt76_queue *q)\n--\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-275-\t\tpad = roundup(e-\u003eskb-\u003elen, 4) - e-\u003eskb-\u003elen;\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c:276:\t\tif (len + e-\u003eskb-\u003elen + pad + 4 \u003e dev-\u003esdio.xmit_buf_sz)\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-277-\t\t\tbreak;\n--\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-282-\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c:283:\t\tmemcpy(sdio-\u003exmit_buf + len, e-\u003eskb-\u003edata, skb_headlen(e-\u003eskb));\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-284-\t\tlen += skb_headlen(e-\u003eskb);\n--\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-287-\t\tskb_walk_frags(e-\u003eskb, iter) {\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c:288:\t\t\tmemcpy(sdio-\u003exmit_buf + len, iter-\u003edata, iter-\u003elen);\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-289-\t\t\tlen += iter-\u003elen;\n--\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-293-\t\tif (unlikely(pad)) {\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c:294:\t\t\tmemset(sdio-\u003exmit_buf + len, 0, pad);\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-295-\t\t\tlen += pad;\n--\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-302-\tif (nframes) {\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c:303:\t\tmemset(sdio-\u003exmit_buf + len, 0, 4);\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c:304:\t\terr = __mt76s_xmit_queue(dev, sdio-\u003exmit_buf, len + 4);\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-305-\t\tif (err)\n--\ndrivers/staging/rtl8723bs/core/rtw_mlme_ext.c=1870=static struct xmit_frame *_alloc_mgtxmitframe(struct xmit_priv *pxmitpriv, bool once)\n--\ndrivers/staging/rtl8723bs/core/rtw_mlme_ext.c-1872-\tstruct xmit_frame *pmgntframe;\ndrivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1873:\tstruct xmit_buf *pxmitbuf;\ndrivers/staging/rtl8723bs/core/rtw_mlme_ext.c-1874-\n--\ndrivers/staging/rtl8723bs/core/rtw_mlme_ext.c=1974=s32 dump_mgntframe_and_wait(struct adapter *padapter, struct xmit_frame *pmgntframe, int timeout_ms)\n--\ndrivers/staging/rtl8723bs/core/rtw_mlme_ext.c-1978-\tstruct xmit_priv *pxmitpriv = \u0026padapter-\u003exmitpriv;\ndrivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1979:\tstruct xmit_buf *pxmitbuf = pmgntframe-\u003epxmitbuf;\ndrivers/staging/rtl8723bs/core/rtw_mlme_ext.c-1980-\tstruct submit_ctx sctx;\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c=36=static s32 rtw_alloc_hwxmits(struct adapter *padapter)\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-75-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:76:static int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz, u8 flag)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-77-{\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c=89=s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-91-\tint i;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:92:\tstruct xmit_buf *pxmitbuf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-93-\tstruct xmit_frame *pxframe;\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-153-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:154:\t/* init xmit_buf */\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-155-\tINIT_LIST_HEAD(\u0026pxmitpriv-\u003efree_xmitbuf_queue.queue);\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-159-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:160:\tpxmitpriv-\u003epallocated_xmitbuf = vzalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4);\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-161-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-166-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:167:\tpxmitbuf = (struct xmit_buf *)pxmitpriv-\u003epxmitbuf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-168-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-236-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:237:\tpxmitpriv-\u003epallocated_xmit_extbuf = vzalloc(NR_XMIT_EXTBUFF * sizeof(struct xmit_buf) + 4);\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-238-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-243-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:244:\tpxmitbuf = (struct xmit_buf *)pxmitpriv-\u003epxmit_extbuf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-245-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c=309=void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-313-\tstruct xmit_frame\t*pxmitframe = (struct xmit_frame *)pxmitpriv-\u003epxmit_frame_buf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:314:\tstruct xmit_buf *pxmitbuf = (struct xmit_buf *)pxmitpriv-\u003epxmitbuf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-315-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-347-\t/* free xmit extension buff */\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:348:\tpxmitbuf = (struct xmit_buf *)pxmitpriv-\u003epxmit_extbuf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-349-\tfor (i = 0; i \u003c NR_XMIT_EXTBUFF; i++) {\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c=1421=void rtw_count_tx_stats(struct adapter *padapter, struct xmit_frame *pxmitframe, int sz)\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1448-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1449:static struct xmit_buf *__rtw_alloc_cmd_xmitbuf(struct xmit_priv *pxmitpriv,\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1450-\t\tenum cmdbuf_type buf_type)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1451-{\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1452:\tstruct xmit_buf *pxmitbuf = NULL;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1453-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c=1470=struct xmit_frame *__rtw_alloc_cmdxmitframe(struct xmit_priv *pxmitpriv,\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1473-\tstruct xmit_frame\t\t*pcmdframe;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1474:\tstruct xmit_buf\t\t*pxmitbuf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1475-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1496-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1497:struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1498-{\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1499-\tunsigned long irqL;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1500:\tstruct xmit_buf *pxmitbuf = NULL;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1501-\tstruct list_head *plist, *phead;\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1512-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1513:\t\tpxmitbuf = container_of(plist, struct xmit_buf, list);\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1514-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1536-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1537:s32 rtw_free_xmitbuf_ext(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1538-{\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1556-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1557:struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1558-{\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1559-\tunsigned long irqL;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1560:\tstruct xmit_buf *pxmitbuf = NULL;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1561-\tstruct list_head *plist, *phead;\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1572-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1573:\t\tpxmitbuf = container_of(plist, struct xmit_buf, list);\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1574-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1597-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1598:s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1599-{\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c=2319=void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *psta)\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2382-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:2383:void enqueue_pending_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2384-{\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2397-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:2398:void enqueue_pending_xmitbuf_to_head(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2399-{\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2409-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:2410:struct xmit_buf *dequeue_pending_xmitbuf(struct xmit_priv *pxmitpriv)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2411-{\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:2412:\tstruct xmit_buf *pxmitbuf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2413-\tstruct __queue *pqueue;\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2424-\t\tplist = get_next(phead);\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:2425:\t\tpxmitbuf = container_of(plist, struct xmit_buf, list);\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2426-\t\tlist_del_init(\u0026pxmitbuf-\u003elist);\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2433-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:2434:struct xmit_buf *dequeue_pending_xmitbuf_under_survey(struct xmit_priv *pxmitpriv)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2435-{\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:2436:\tstruct xmit_buf *pxmitbuf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2437-\tstruct __queue *pqueue;\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2454-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:2455:\t\t\tpxmitbuf = container_of(plist, struct xmit_buf, list);\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2456-\n--\ndrivers/staging/rtl8723bs/hal/hal_intf.c=227=s32 rtw_hal_xmit_thread_handler(struct adapter *padapter)\ndrivers/staging/rtl8723bs/hal/hal_intf.c-228-{\ndrivers/staging/rtl8723bs/hal/hal_intf.c:229:\treturn rtl8723bs_xmit_buf_handler(padapter);\ndrivers/staging/rtl8723bs/hal/hal_intf.c-230-}\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c=36=static s32 rtl8723_dequeue_writeport(struct adapter *padapter)\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-40-\tstruct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:41:\tstruct xmit_buf *pxmitbuf;\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-42-\tstruct adapter *pri_padapter = padapter;\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-120- */\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:121:s32 rtl8723bs_xmit_buf_handler(struct adapter *padapter)\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-122-{\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c=166=static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv)\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-175-\tstruct __queue *pframe_queue;\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:176:\tstruct xmit_buf *pxmitbuf;\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-177-\tu32 txlen, max_xmit_len;\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-231-\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:232:\t\t\t\t/* check xmit_buf size enough or not */\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-233-\t\t\t\ttxlen = txdesc_size + rtw_wlan_pkt_size(pxmitframe);\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-318-\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:319:\t\t/* dump xmit_buf to hw tx fifo */\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-320-\t\tif (pxmitbuf) {\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c=419=s32 rtl8723bs_mgnt_xmit(\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-424-\tstruct pkt_attrib *pattrib = \u0026pmgntframe-\u003eattrib;\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:425:\tstruct xmit_buf *pxmitbuf = pmgntframe-\u003epxmitbuf;\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-426-\tstruct xmit_priv *pxmitpriv = \u0026padapter-\u003exmitpriv;\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c=538=void rtl8723bs_free_xmit_priv(struct adapter *padapter)\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-540-\tstruct xmit_priv *pxmitpriv = \u0026padapter-\u003exmitpriv;\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:541:\tstruct xmit_buf *pxmitbuf;\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-542-\tstruct __queue *pqueue = \u0026pxmitpriv-\u003epending_xmitbuf_queue;\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-562-\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:563:\t\tpxmitbuf = container_of(plist, struct xmit_buf, list);\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-564-\t\trtw_free_xmitframe(pxmitpriv, (struct xmit_frame *)pxmitbuf-\u003epriv_data);\n--\ndrivers/staging/rtl8723bs/hal/sdio_ops.c=313=static u32 sdio_write_port(\n--\ndrivers/staging/rtl8723bs/hal/sdio_ops.c-322-\ts32 err;\ndrivers/staging/rtl8723bs/hal/sdio_ops.c:323:\tstruct xmit_buf *xmitbuf = (struct xmit_buf *)mem;\ndrivers/staging/rtl8723bs/hal/sdio_ops.c-324-\n--\ndrivers/staging/rtl8723bs/include/rtl8723b_xmit.h=414=s32\trtl8723bs_hal_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitframe);\ndrivers/staging/rtl8723bs/include/rtl8723b_xmit.h:415:s32 rtl8723bs_xmit_buf_handler(struct adapter *padapter);\ndrivers/staging/rtl8723bs/include/rtl8723b_xmit.h-416-int rtl8723bs_xmit_thread(void *context);\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h=215=void rtw_sctx_done(struct submit_ctx **sctx);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-216-\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:217:struct xmit_buf {\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-218-\tstruct list_head\tlist;\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h=246=struct xmit_frame {\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-258-\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:259:\tstruct xmit_buf *pxmitbuf;\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-260-\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h=319=struct\txmit_priv {\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-388-\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:389:\tstruct xmit_buf\tpcmd_xmitbuf[CMDBUF_MAX];\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-390-\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h=400=extern struct xmit_frame *__rtw_alloc_cmdxmitframe(struct xmit_priv *pxmitpriv,\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-404-\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:405:extern struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:406:extern s32 rtw_free_xmitbuf_ext(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-407-\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:408:extern struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:409:extern s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-410-\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h=453=u8 qos_acm(u8 acm_mask, u8 priority);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-454-\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:455:void enqueue_pending_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:456:void enqueue_pending_xmitbuf_to_head(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:457:struct xmit_buf *dequeue_pending_xmitbuf(struct xmit_priv *pxmitpriv);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:458:struct xmit_buf *dequeue_pending_xmitbuf_under_survey(struct xmit_priv *pxmitpriv);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-459-signed int\tcheck_pending_xmitbuf(struct xmit_priv *pxmitpriv);\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h=465=void rtw_ack_tx_done(struct xmit_priv *pxmitpriv, int status);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-466-\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:467:/* include after declaring struct xmit_buf, in order to avoid warning */\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-468-#include \u003cxmit_osdep.h\u003e\n--\ndrivers/staging/rtl8723bs/include/xmit_osdep.h=25=struct xmit_frame;\ndrivers/staging/rtl8723bs/include/xmit_osdep.h:26:struct xmit_buf;\ndrivers/staging/rtl8723bs/include/xmit_osdep.h-27-\n--\ndrivers/staging/rtl8723bs/include/xmit_osdep.h=31=void rtw_os_xmit_schedule(struct adapter *padapter);\ndrivers/staging/rtl8723bs/include/xmit_osdep.h-32-\ndrivers/staging/rtl8723bs/include/xmit_osdep.h:33:void rtw_os_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 free_sz, u8 flag);\ndrivers/staging/rtl8723bs/include/xmit_osdep.h-34-\n--\ndrivers/staging/rtl8723bs/os_dep/xmit_linux.c=53=void rtw_os_xmit_resource_free(struct adapter *padapter,\ndrivers/staging/rtl8723bs/os_dep/xmit_linux.c:54:\t\t\t struct xmit_buf *pxmitbuf,\ndrivers/staging/rtl8723bs/os_dep/xmit_linux.c-55-\t\t\t u32 free_sz, u8 flag)\n--\ndrivers/tty/mips_ejtag_fdc.c=84=struct mips_ejtag_fdc_tty;\n--\ndrivers/tty/mips_ejtag_fdc.c-93- * @rx_buf:\t\tRead buffer.\ndrivers/tty/mips_ejtag_fdc.c:94: * @xmit_lock:\t\tLock for xmit_*, and port.xmit_buf.\ndrivers/tty/mips_ejtag_fdc.c-95- *\t\t\tThis protects between user context and kernel thread.\n--\ndrivers/tty/mips_ejtag_fdc.c=415=static unsigned int mips_ejtag_fdc_put_chan(struct mips_ejtag_fdc_tty *priv,\n--\ndrivers/tty/mips_ejtag_fdc.c-427-\tif (dport-\u003exmit_cnt) {\ndrivers/tty/mips_ejtag_fdc.c:428:\t\tptrs[0] = dport-\u003eport.xmit_buf + dport-\u003exmit_tail;\n\n"
} |
| 13/2 | 2026/08/30 08:14 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 21784 output: 28 thoughts: 41 Thoughts: Okay, let's see, I need to understand this part of the code better. First, I should make sure I understand the context, let me check `hvcs.c`. Hmm, I can't place that immediately. Ah, right! It's probably in the `drivers/tty/hvc` directory. Okay, so I should look at `drivers/tty/hvc/hvcs.c`, and I'll need to check its `Kconfig` file as well to see how it's configured and what dependencies it has. That should provide a useful overview. |
| 14/2 | 2026/08/30 08:14 | tool | grepper |
0mArgs:{
"Expression": "HVCS",
"PathPrefix": "drivers/tty/hvc"
}Results: {
"Output": "drivers/tty/hvc/Kconfig=109=config HVC_RISCV_SBI\n--\ndrivers/tty/hvc/Kconfig-120-\ndrivers/tty/hvc/Kconfig:121:config HVCS\ndrivers/tty/hvc/Kconfig-122-\ttristate \"IBM Hypervisor Virtual Console Server support\"\n--\ndrivers/tty/hvc/Makefile=12=obj-$(CONFIG_HVC_RISCV_SBI)\t+= hvc_riscv_sbi.o\ndrivers/tty/hvc/Makefile:13:obj-$(CONFIG_HVCS)\t\t+= hvcs.o\n--\ndrivers/tty/hvc/hvcs.c-105- * Rearranged hvcs_close(). Cleaned up some printks and did some housekeeping\ndrivers/tty/hvc/hvcs.c:106: * on the changelog. Removed local CLC_LENGTH and used HVCS_CLC_LENGTH from\ndrivers/tty/hvc/hvcs.c-107- * arch/powerepc/include/asm/hvcserver.h\n--\ndrivers/tty/hvc/hvcs.c-116-\ndrivers/tty/hvc/hvcs.c:117:#define HVCS_DRIVER_VERSION \"1.3.3\"\ndrivers/tty/hvc/hvcs.c-118-\n--\ndrivers/tty/hvc/hvcs.c=121=MODULE_LICENSE(\"GPL\");\ndrivers/tty/hvc/hvcs.c:122:MODULE_VERSION(HVCS_DRIVER_VERSION);\ndrivers/tty/hvc/hvcs.c-123-\n--\ndrivers/tty/hvc/hvcs.c-127- */\ndrivers/tty/hvc/hvcs.c:128:#define HVCS_CLOSE_WAIT (HZ/100) /* 1/10 of a second */\ndrivers/tty/hvc/hvcs.c-129-\n--\ndrivers/tty/hvc/hvcs.c-134- * will most often be much lower than this, we'll arbitrarily allocate\ndrivers/tty/hvc/hvcs.c:135: * HVCS_DEFAULT_SERVER_ADAPTERS tty_structs and cdev's by default when we\ndrivers/tty/hvc/hvcs.c-136- * register the tty_driver. This can be overridden using an insmod parameter.\ndrivers/tty/hvc/hvcs.c-137- */\ndrivers/tty/hvc/hvcs.c:138:#define HVCS_DEFAULT_SERVER_ADAPTERS\t64\ndrivers/tty/hvc/hvcs.c-139-\ndrivers/tty/hvc/hvcs.c-140-/*\ndrivers/tty/hvc/hvcs.c:141: * The user can't insmod with more than HVCS_MAX_SERVER_ADAPTERS hvcs device\ndrivers/tty/hvc/hvcs.c-142- * nodes as a sanity check. Theoretically there can be over 1 Billion\n--\ndrivers/tty/hvc/hvcs.c-144- */\ndrivers/tty/hvc/hvcs.c:145:#define HVCS_MAX_SERVER_ADAPTERS\t1024\ndrivers/tty/hvc/hvcs.c-146-\n--\ndrivers/tty/hvc/hvcs.c-152- */\ndrivers/tty/hvc/hvcs.c:153:#define HVCS_MINOR_START\t0\ndrivers/tty/hvc/hvcs.c-154-\n--\ndrivers/tty/hvc/hvcs.c-167- */\ndrivers/tty/hvc/hvcs.c:168:#define HVCS_BUFF_LEN\t16\ndrivers/tty/hvc/hvcs.c-169-\n--\ndrivers/tty/hvc/hvcs.c-173- */\ndrivers/tty/hvc/hvcs.c:174:#define HVCS_MAX_FROM_USER\t4096\ndrivers/tty/hvc/hvcs.c-175-\n--\ndrivers/tty/hvc/hvcs.c=250=struct hvcs_struct {\n--\ndrivers/tty/hvc/hvcs.c-267-\t * This buffer is required so that when hvcs_write_room() reports that\ndrivers/tty/hvc/hvcs.c:268:\t * it can send HVCS_BUFF_LEN characters that it will buffer the full\ndrivers/tty/hvc/hvcs.c:269:\t * HVCS_BUFF_LEN characters if need be. This is essential for opost\ndrivers/tty/hvc/hvcs.c-270-\t * writes since they do not do high level buffering and expect to be\n--\ndrivers/tty/hvc/hvcs.c-273-\t */\ndrivers/tty/hvc/hvcs.c:274:\tchar buffer[HVCS_BUFF_LEN];\ndrivers/tty/hvc/hvcs.c-275-\tint chars_in_buffer;\n--\ndrivers/tty/hvc/hvcs.c-285-\tuint32_t p_partition_ID; /* partner partition ID */\ndrivers/tty/hvc/hvcs.c:286:\tchar p_location_code[HVCS_CLC_LENGTH + 1]; /* CLC + Null Term */\ndrivers/tty/hvc/hvcs.c-287-\tstruct list_head next; /* list management */\n--\ndrivers/tty/hvc/hvcs.c=301=static int hvcs_initialize(void);\ndrivers/tty/hvc/hvcs.c-302-\ndrivers/tty/hvc/hvcs.c:303:#define HVCS_SCHED_READ\t0x00000001\ndrivers/tty/hvc/hvcs.c:304:#define HVCS_QUICK_READ\t0x00000002\ndrivers/tty/hvc/hvcs.c:305:#define HVCS_TRY_WRITE\t0x00000004\ndrivers/tty/hvc/hvcs.c:306:#define HVCS_READ_MASK\t(HVCS_SCHED_READ | HVCS_QUICK_READ)\ndrivers/tty/hvc/hvcs.c-307-\n--\ndrivers/tty/hvc/hvcs.c=342=static ssize_t hvcs_current_vty_store(struct device *dev, struct device_attribute *attr, const char * buf,\n--\ndrivers/tty/hvc/hvcs.c-348-\t */\ndrivers/tty/hvc/hvcs.c:349:\tprintk(KERN_INFO \"HVCS: Denied current_vty change: -EPERM.\\n\");\ndrivers/tty/hvc/hvcs.c-350-\treturn -EPERM;\n--\ndrivers/tty/hvc/hvcs.c=369=static ssize_t hvcs_vterm_state_store(struct device *dev, struct device_attribute *attr, const char *buf,\n--\ndrivers/tty/hvc/hvcs.c-383-\t\tspin_unlock_irqrestore(\u0026hvcsd-\u003elock, flags);\ndrivers/tty/hvc/hvcs.c:384:\t\tprintk(KERN_INFO \"HVCS: vterm state unchanged. \"\ndrivers/tty/hvc/hvcs.c-385-\t\t\t\t\"The hvcs device node is still in use.\\n\");\n--\ndrivers/tty/hvc/hvcs.c-390-\t\tspin_unlock_irqrestore(\u0026hvcsd-\u003elock, flags);\ndrivers/tty/hvc/hvcs.c:391:\t\tprintk(KERN_INFO \"HVCS: vterm state unchanged. The\"\ndrivers/tty/hvc/hvcs.c-392-\t\t\t\t\" vty-server is not connected to a vty.\\n\");\n--\ndrivers/tty/hvc/hvcs.c-396-\thvcs_partner_free(hvcsd);\ndrivers/tty/hvc/hvcs.c:397:\tprintk(KERN_INFO \"HVCS: Closed vty-server@%X and\"\ndrivers/tty/hvc/hvcs.c-398-\t\t\t\" partner vty@%X:%d connection.\\n\",\n--\ndrivers/tty/hvc/hvcs.c=454=static ssize_t rescan_store(struct device_driver *ddp, const char * buf,\n--\ndrivers/tty/hvc/hvcs.c-461-\thvcs_rescan_status = 1;\ndrivers/tty/hvc/hvcs.c:462:\tprintk(KERN_INFO \"HVCS: rescanning partner info for all\"\ndrivers/tty/hvc/hvcs.c-463-\t\t\" vty-servers.\\n\");\n--\ndrivers/tty/hvc/hvcs.c=485=static void hvcs_unthrottle(struct tty_struct *tty)\n--\ndrivers/tty/hvc/hvcs.c-490-\tspin_lock_irqsave(\u0026hvcsd-\u003elock, flags);\ndrivers/tty/hvc/hvcs.c:491:\thvcsd-\u003etodo_mask |= HVCS_SCHED_READ;\ndrivers/tty/hvc/hvcs.c-492-\tspin_unlock_irqrestore(\u0026hvcsd-\u003elock, flags);\n--\ndrivers/tty/hvc/hvcs.c=511=static irqreturn_t hvcs_handle_interrupt(int irq, void *dev_instance)\n--\ndrivers/tty/hvc/hvcs.c-516-\tvio_disable_interrupts(hvcsd-\u003evdev);\ndrivers/tty/hvc/hvcs.c:517:\thvcsd-\u003etodo_mask |= HVCS_SCHED_READ;\ndrivers/tty/hvc/hvcs.c-518-\tspin_unlock(\u0026hvcsd-\u003elock);\n--\ndrivers/tty/hvc/hvcs.c=525=static void hvcs_try_write(struct hvcs_struct *hvcsd)\n--\ndrivers/tty/hvc/hvcs.c-530-\ndrivers/tty/hvc/hvcs.c:531:\tif (hvcsd-\u003etodo_mask \u0026 HVCS_TRY_WRITE) {\ndrivers/tty/hvc/hvcs.c-532-\t\t/* won't send partial writes */\n--\ndrivers/tty/hvc/hvcs.c-538-\t\t\t/* wmb(); */\ndrivers/tty/hvc/hvcs.c:539:\t\t\thvcsd-\u003etodo_mask \u0026= ~(HVCS_TRY_WRITE);\ndrivers/tty/hvc/hvcs.c-540-\t\t\t/* wmb(); */\n--\ndrivers/tty/hvc/hvcs.c=555=static int hvcs_io(struct hvcs_struct *hvcsd)\n--\ndrivers/tty/hvc/hvcs.c-558-\tstruct tty_struct *tty;\ndrivers/tty/hvc/hvcs.c:559:\tchar buf[HVCS_BUFF_LEN] __ALIGNED__;\ndrivers/tty/hvc/hvcs.c-560-\tunsigned long flags;\n--\ndrivers/tty/hvc/hvcs.c-570-\tif (!tty || tty_throttled(tty)) {\ndrivers/tty/hvc/hvcs.c:571:\t\thvcsd-\u003etodo_mask \u0026= ~(HVCS_READ_MASK);\ndrivers/tty/hvc/hvcs.c-572-\t\tgoto bail;\ndrivers/tty/hvc/hvcs.c:573:\t} else if (!(hvcsd-\u003etodo_mask \u0026 (HVCS_READ_MASK)))\ndrivers/tty/hvc/hvcs.c-574-\t\tgoto bail;\n--\ndrivers/tty/hvc/hvcs.c-576-\t/* remove the read masks */\ndrivers/tty/hvc/hvcs.c:577:\thvcsd-\u003etodo_mask \u0026= ~(HVCS_READ_MASK);\ndrivers/tty/hvc/hvcs.c-578-\ndrivers/tty/hvc/hvcs.c:579:\tif (tty_buffer_request_room(\u0026hvcsd-\u003eport, HVCS_BUFF_LEN) \u003e= HVCS_BUFF_LEN) {\ndrivers/tty/hvc/hvcs.c-580-\t\tgot = hvc_get_chars(unit_address,\ndrivers/tty/hvc/hvcs.c-581-\t\t\t\t\u0026buf[0],\ndrivers/tty/hvc/hvcs.c:582:\t\t\t\tHVCS_BUFF_LEN);\ndrivers/tty/hvc/hvcs.c-583-\t\ttty_insert_flip_string(\u0026hvcsd-\u003eport, buf, got);\n--\ndrivers/tty/hvc/hvcs.c-587-\tif (got)\ndrivers/tty/hvc/hvcs.c:588:\t\thvcsd-\u003etodo_mask |= HVCS_QUICK_READ;\ndrivers/tty/hvc/hvcs.c-589-\n--\ndrivers/tty/hvc/hvcs.c=608=static int khvcsd(void *unused)\n--\ndrivers/tty/hvc/hvcs.c-630-\t\t */\ndrivers/tty/hvc/hvcs.c:631:\t\t if (hvcs_todo_mask \u0026 (HVCS_TRY_WRITE | HVCS_QUICK_READ)) {\ndrivers/tty/hvc/hvcs.c-632-\t\t\tyield();\n--\ndrivers/tty/hvc/hvcs.c=664=static void hvcs_destruct_port(struct tty_port *p)\n--\ndrivers/tty/hvc/hvcs.c-678-\t\thvcs_partner_free(hvcsd);\ndrivers/tty/hvc/hvcs.c:679:\t\tprintk(KERN_INFO \"HVCS: Closed vty-server@%X and\"\ndrivers/tty/hvc/hvcs.c-680-\t\t\t\t\" partner vty@%X:%d connection.\\n\",\n--\ndrivers/tty/hvc/hvcs.c-684-\t}\ndrivers/tty/hvc/hvcs.c:685:\tprintk(KERN_INFO \"HVCS: Destroyed hvcs_struct for vty-server@%X.\\n\",\ndrivers/tty/hvc/hvcs.c-686-\t\t\thvcsd-\u003evdev-\u003eunit_address);\n--\ndrivers/tty/hvc/hvcs.c-693-\thvcs_return_index(hvcsd-\u003eindex);\ndrivers/tty/hvc/hvcs.c:694:\tmemset(\u0026hvcsd-\u003ep_location_code[0], 0x00, HVCS_CLC_LENGTH + 1);\ndrivers/tty/hvc/hvcs.c-695-\n--\ndrivers/tty/hvc/hvcs.c=708=static int hvcs_get_index(void)\n--\ndrivers/tty/hvc/hvcs.c-712-\tif (!hvcs_index_list) {\ndrivers/tty/hvc/hvcs.c:713:\t\tprintk(KERN_ERR \"HVCS: hvcs_index_list NOT valid!.\\n\");\ndrivers/tty/hvc/hvcs.c-714-\t\treturn -EFAULT;\n--\ndrivers/tty/hvc/hvcs.c=726=static int hvcs_probe(\n--\ndrivers/tty/hvc/hvcs.c-733-\tif (!dev || !id) {\ndrivers/tty/hvc/hvcs.c:734:\t\tprintk(KERN_ERR \"HVCS: probed with invalid parameter.\\n\");\ndrivers/tty/hvc/hvcs.c-735-\t\treturn -EPERM;\n--\ndrivers/tty/hvc/hvcs.c-740-\tif (rc) {\ndrivers/tty/hvc/hvcs.c:741:\t\tpr_err(\"HVCS: Failed to initialize core driver.\\n\");\ndrivers/tty/hvc/hvcs.c-742-\t\treturn rc;\n--\ndrivers/tty/hvc/hvcs.c-773-\tif (hvcs_get_pi(hvcsd)) {\ndrivers/tty/hvc/hvcs.c:774:\t\tprintk(KERN_ERR \"HVCS: Failed to fetch partner\"\ndrivers/tty/hvc/hvcs.c-775-\t\t\t\" info for vty-server@%X on device probe.\\n\",\n--\ndrivers/tty/hvc/hvcs.c-787-\ndrivers/tty/hvc/hvcs.c:788:\tprintk(KERN_INFO \"HVCS: vty-server@%X added to the vio bus.\\n\", dev-\u003eunit_address);\ndrivers/tty/hvc/hvcs.c-789-\n--\ndrivers/tty/hvc/hvcs.c=797=static void hvcs_remove(struct vio_dev *dev)\n--\ndrivers/tty/hvc/hvcs.c-823-\twait_for_completion(\u0026comp);\ndrivers/tty/hvc/hvcs.c:824:\tprintk(KERN_INFO \"HVCS: vty-server@%X removed from the\"\ndrivers/tty/hvc/hvcs.c-825-\t\t\t\" vio bus.\\n\", dev-\u003eunit_address);\n--\ndrivers/tty/hvc/hvcs.c=863=static int hvcs_get_pi(struct hvcs_struct *hvcsd)\n--\ndrivers/tty/hvc/hvcs.c-877-\tif (retval) {\ndrivers/tty/hvc/hvcs.c:878:\t\tprintk(KERN_ERR \"HVCS: Failed to fetch partner\"\ndrivers/tty/hvc/hvcs.c-879-\t\t\t\" info for vty-server@%x.\\n\", unit_address);\n--\ndrivers/tty/hvc/hvcs.c=934=static int hvcs_partner_connect(struct hvcs_struct *hvcsd)\n--\ndrivers/tty/hvc/hvcs.c-978-\t */\ndrivers/tty/hvc/hvcs.c:979:\tprintk(KERN_INFO \"HVCS: vty-server or partner\"\ndrivers/tty/hvc/hvcs.c-980-\t\t\t\" vty is busy. Try again later.\\n\");\n--\ndrivers/tty/hvc/hvcs.c=995=static int hvcs_enable_device(struct hvcs_struct *hvcsd, uint32_t unit_address,\n--\ndrivers/tty/hvc/hvcs.c-1013-\t\telse {\ndrivers/tty/hvc/hvcs.c:1014:\t\t\tprintk(KERN_ERR \"HVCS: int enable failed for\"\ndrivers/tty/hvc/hvcs.c-1015-\t\t\t\t\t\" vty-server@%X.\\n\", unit_address);\n--\ndrivers/tty/hvc/hvcs.c-1018-\t} else\ndrivers/tty/hvc/hvcs.c:1019:\t\tprintk(KERN_ERR \"HVCS: irq req failed for\"\ndrivers/tty/hvc/hvcs.c-1020-\t\t\t\t\" vty-server@%X.\\n\", unit_address);\n--\ndrivers/tty/hvc/hvcs.c=1058=static int hvcs_install(struct tty_driver *driver, struct tty_struct *tty)\n--\ndrivers/tty/hvc/hvcs.c-1071-\tif (!hvcsd) {\ndrivers/tty/hvc/hvcs.c:1072:\t\tprintk(KERN_WARNING \"HVCS: open failed, no device associated\"\ndrivers/tty/hvc/hvcs.c-1073-\t\t\t\t\" with tty-\u003eindex %d.\\n\", tty-\u003eindex);\n--\ndrivers/tty/hvc/hvcs.c-1082-\t\t\tspin_unlock_irqrestore(\u0026hvcsd-\u003elock, flags);\ndrivers/tty/hvc/hvcs.c:1083:\t\t\tprintk(KERN_WARNING \"HVCS: partner connect failed.\\n\");\ndrivers/tty/hvc/hvcs.c-1084-\t\t\tgoto err_put;\n--\ndrivers/tty/hvc/hvcs.c-1091-\ndrivers/tty/hvc/hvcs.c:1092:\tmemset(\u0026hvcsd-\u003ebuffer[0], 0x00, HVCS_BUFF_LEN);\ndrivers/tty/hvc/hvcs.c-1093-\n--\ndrivers/tty/hvc/hvcs.c-1101-\ndrivers/tty/hvc/hvcs.c:1102:\thvcsd-\u003etodo_mask |= HVCS_SCHED_READ;\ndrivers/tty/hvc/hvcs.c-1103-\tspin_unlock_irqrestore(\u0026hvcsd-\u003elock, flags);\n--\ndrivers/tty/hvc/hvcs.c-1110-\tif (retval) {\ndrivers/tty/hvc/hvcs.c:1111:\t\tprintk(KERN_WARNING \"HVCS: enable device failed.\\n\");\ndrivers/tty/hvc/hvcs.c-1112-\t\tgoto err_put;\n--\ndrivers/tty/hvc/hvcs.c=1135=static int hvcs_open(struct tty_struct *tty, struct file *filp)\n--\ndrivers/tty/hvc/hvcs.c-1141-\thvcsd-\u003eport.count++;\ndrivers/tty/hvc/hvcs.c:1142:\thvcsd-\u003etodo_mask |= HVCS_SCHED_READ;\ndrivers/tty/hvc/hvcs.c-1143-\tspin_unlock_irqrestore(\u0026hvcsd-\u003elock, flags);\n--\ndrivers/tty/hvc/hvcs.c-1146-\ndrivers/tty/hvc/hvcs.c:1147:\tprintk(KERN_INFO \"HVCS: vty-server@%X connection opened.\\n\",\ndrivers/tty/hvc/hvcs.c-1148-\t\thvcsd-\u003evdev-\u003eunit_address );\n--\ndrivers/tty/hvc/hvcs.c=1153=static void hvcs_close(struct tty_struct *tty, struct file *filp)\n--\ndrivers/tty/hvc/hvcs.c-1193-\ndrivers/tty/hvc/hvcs.c:1194:\t\ttty_wait_until_sent(tty, HVCS_CLOSE_WAIT);\ndrivers/tty/hvc/hvcs.c-1195-\n--\ndrivers/tty/hvc/hvcs.c-1198-\t} else if (hvcsd-\u003eport.count \u003c 0) {\ndrivers/tty/hvc/hvcs.c:1199:\t\tprintk(KERN_ERR \"HVCS: vty-server@%X open_count: %d is mismanaged.\\n\",\ndrivers/tty/hvc/hvcs.c-1200-\t\thvcsd-\u003evdev-\u003eunit_address, hvcsd-\u003eport.count);\n--\ndrivers/tty/hvc/hvcs.c=1220=static void hvcs_hangup(struct tty_struct * tty)\n--\ndrivers/tty/hvc/hvcs.c-1240-\t * scenario. */\ndrivers/tty/hvc/hvcs.c:1241:\tmemset(\u0026hvcsd-\u003ebuffer[0], 0x00, HVCS_BUFF_LEN);\ndrivers/tty/hvc/hvcs.c-1242-\thvcsd-\u003echars_in_buffer = 0;\n--\ndrivers/tty/hvc/hvcs.c=1258=static ssize_t hvcs_write(struct tty_struct *tty, const u8 *buf, size_t count)\n--\ndrivers/tty/hvc/hvcs.c-1275-\t/* Reasonable size to prevent user level flooding */\ndrivers/tty/hvc/hvcs.c:1276:\tif (count \u003e HVCS_MAX_FROM_USER) {\ndrivers/tty/hvc/hvcs.c:1277:\t\tprintk(KERN_WARNING \"HVCS write: count being truncated to\"\ndrivers/tty/hvc/hvcs.c:1278:\t\t\t\t\" HVCS_MAX_FROM_USER.\\n\");\ndrivers/tty/hvc/hvcs.c:1279:\t\tcount = HVCS_MAX_FROM_USER;\ndrivers/tty/hvc/hvcs.c-1280-\t}\n--\ndrivers/tty/hvc/hvcs.c-1300-\t\ttosend = min_t(size_t, count,\ndrivers/tty/hvc/hvcs.c:1301:\t\t\t (HVCS_BUFF_LEN - hvcsd-\u003echars_in_buffer));\ndrivers/tty/hvc/hvcs.c-1302-\t\t/*\n--\ndrivers/tty/hvc/hvcs.c-1321-\t\t */\ndrivers/tty/hvc/hvcs.c:1322:\t\tif (!(hvcsd-\u003etodo_mask \u0026 HVCS_TRY_WRITE))\ndrivers/tty/hvc/hvcs.c-1323-\t\t\t/* won't send partial writes */\n--\ndrivers/tty/hvc/hvcs.c-1335-\t\tif (result == 0) {\ndrivers/tty/hvc/hvcs.c:1336:\t\t\thvcsd-\u003etodo_mask |= HVCS_TRY_WRITE;\ndrivers/tty/hvc/hvcs.c-1337-\t\t\thvcs_kick();\n--\ndrivers/tty/hvc/hvcs.c=1363=static unsigned int hvcs_write_room(struct tty_struct *tty)\n--\ndrivers/tty/hvc/hvcs.c-1369-\ndrivers/tty/hvc/hvcs.c:1370:\treturn HVCS_BUFF_LEN - hvcsd-\u003echars_in_buffer;\ndrivers/tty/hvc/hvcs.c-1371-}\n--\ndrivers/tty/hvc/hvcs.c=1414=static int hvcs_initialize(void)\n--\ndrivers/tty/hvc/hvcs.c-1425-\tif (hvcs_parm_num_devs \u003c= 0 ||\ndrivers/tty/hvc/hvcs.c:1426:\t\t(hvcs_parm_num_devs \u003e HVCS_MAX_SERVER_ADAPTERS)) {\ndrivers/tty/hvc/hvcs.c:1427:\t\tnum_ttys_to_alloc = HVCS_DEFAULT_SERVER_ADAPTERS;\ndrivers/tty/hvc/hvcs.c-1428-\t} else\n--\ndrivers/tty/hvc/hvcs.c-1450-\ndrivers/tty/hvc/hvcs.c:1451:\thvcs_tty_driver-\u003eminor_start = HVCS_MINOR_START;\ndrivers/tty/hvc/hvcs.c-1452-\thvcs_tty_driver-\u003etype = TTY_DRIVER_TYPE_SYSTEM;\n--\ndrivers/tty/hvc/hvcs.c-1467-\tif (tty_register_driver(hvcs_tty_driver)) {\ndrivers/tty/hvc/hvcs.c:1468:\t\tprintk(KERN_ERR \"HVCS: registration as a tty driver failed.\\n\");\ndrivers/tty/hvc/hvcs.c-1469-\t\trc = -EIO;\n--\ndrivers/tty/hvc/hvcs.c-1480-\tif (IS_ERR(hvcs_task)) {\ndrivers/tty/hvc/hvcs.c:1481:\t\tprintk(KERN_ERR \"HVCS: khvcsd creation failed.\\n\");\ndrivers/tty/hvc/hvcs.c-1482-\t\trc = -EIO;\n--\ndrivers/tty/hvc/hvcs.c=1501=static int __init hvcs_module_init(void)\n--\ndrivers/tty/hvc/hvcs.c-1504-\tif (rc) {\ndrivers/tty/hvc/hvcs.c:1505:\t\tprintk(KERN_ERR \"HVCS: can't register vio driver\\n\");\ndrivers/tty/hvc/hvcs.c-1506-\t\treturn rc;\n--\ndrivers/tty/hvc/hvcs.c-1508-\ndrivers/tty/hvc/hvcs.c:1509:\tpr_info(\"HVCS: Driver registered.\\n\");\ndrivers/tty/hvc/hvcs.c-1510-\n--\ndrivers/tty/hvc/hvcs.c=1514=static void __exit hvcs_module_exit(void)\n--\ndrivers/tty/hvc/hvcs.c-1540-\ndrivers/tty/hvc/hvcs.c:1541:\tprintk(KERN_INFO \"HVCS: driver module removed.\\n\");\ndrivers/tty/hvc/hvcs.c-1542-}\n"
} |
| 15/2 | 2026/08/30 08:14 | llm | patch-evaluator |
5mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 29241 output: 37 thoughts: 28 Thoughts: Here's my thought process, as if I were analyzing this code: **HVCS Dependency Analysis** Okay, so I need to figure out the dependencies for Hyper-V Console (HVCS). My first instinct, as always, is to go straight to the source. The `Kconfig` files are the bread and butter for configuration dependencies within the kernel build system. So, I'm thinking, let's dive into `drivers/tty/hvc/Kconfig`. That's where all the HVCS configuration options and their associated dependencies are likely defined. This will give me the clearest picture of what other features or subsystems need to be enabled for HVCS to be functional. From there I'll be able to work backwards or forwards to fully understand any of the nuances of what I may need to configure. |
| 16/2 | 2026/08/30 08:20 | tool | read-file |
0mArgs:{
"File": "drivers/tty/hvc/Kconfig",
"FirstLine": 120,
"LineCount": 20
}Results: {
"Contents": " 120:\t\n 121:\tconfig HVCS\n 122:\t\ttristate \"IBM Hypervisor Virtual Console Server support\"\n 123:\t\tdepends on PPC_PSERIES \u0026\u0026 HVC_CONSOLE\n 124:\t\thelp\n 125:\t\t Partitionable IBM Power5 ppc64 machines allow hosting of\n 126:\t\t firmware virtual consoles from one Linux partition by\n 127:\t\t another Linux partition. This driver allows console data\n 128:\t\t from Linux partitions to be accessed through TTY device\n 129:\t\t interfaces in the device tree of a Linux partition running\n 130:\t\t this driver.\n 131:\t\n 132:\t\t To compile this driver as a module, choose M here: the\n 133:\t\t module will be called hvcs. Additionally, this module\n 134:\t\t will depend on arch specific APIs exported from hvcserver.ko\n 135:\t\t which will also be compiled when this driver is built as a\n 136:\t\t module.\n"
} |
| 17/2 | 2026/08/30 08:20 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 29754 output: 27 thoughts: 80 Thoughts: Okay, let's dive into this. Here's how I'm thinking about it, step-by-step: **Dissecting Serial Driver Configuration** Alright, I'm going to start by focusing on the serial driver core. My initial investigation will center around `drivers/tty/serial/serial_core.c` and `drivers/tty/tty_port.c`. These are the core files where the logic of these drivers seems to reside. To get a handle on what's enabled, and possibly how to control this functionality, I need to check the Kconfig files. My next step is to examine the `drivers/tty/serial/Kconfig` file. I'm looking for configuration options that govern the serial core and related features. Specifically, I need to understand how `SERIAL_CORE` and `SERIAL_CORE_CONSOLE` are defined, as well as if they depend on, or are depended on by, the overarching `TTY` configuration option. This will tell me what the build environment will allow. |
| 18/2 | 2026/08/30 08:21 | tool | grepper |
0mArgs:{
"Expression": "config SERIAL_CORE",
"PathPrefix": "drivers/tty"
}Results: {
"Output": "drivers/tty/serial/Kconfig=695=config SERIAL_HS_LPC32XX_CONSOLE\n--\ndrivers/tty/serial/Kconfig-703-\ndrivers/tty/serial/Kconfig:704:config SERIAL_CORE\ndrivers/tty/serial/Kconfig-705-\ttristate\ndrivers/tty/serial/Kconfig-706-\ndrivers/tty/serial/Kconfig:707:config SERIAL_CORE_CONSOLE\ndrivers/tty/serial/Kconfig-708-\tbool\n"
} |
| 19/2 | 2026/08/30 08:21 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 30219 output: 26 thoughts: 21 Thoughts: Here's my summary, as though I'm thinking it: **Digging into the TTY Driver Build Configuration** Okay, so I need to understand how these TTY drivers are being built. My first move is to dive into the core makefiles. Let's see what `drivers/tty/Makefile` and `drivers/tty/serial/Makefile` are doing. Those should give me a good overview of the general build process and the specific configuration for serial TTYs. I'm expecting to find conditional logic, dependency definitions, and maybe some architecture-specific flags in those files. I'll need to pay close attention to any include statements too, that's often where the really interesting stuff gets defined. Time to get my hands dirty and understand the build flow. |
| 20/2 | 2026/08/30 08:22 | tool | grepper |
0mArgs:{
"Expression": "tty_port",
"PathPrefix": "drivers/tty"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 3576 lines.\nUse more precise expression if possible.\n\ndrivers/tty/Makefile=2=obj-$(CONFIG_TTY)\t\t+= tty_io.o n_tty.o tty_ioctl.o tty_ldisc.o \\\ndrivers/tty/Makefile:3:\t\t\t\t tty_buffer.o tty_port.o tty_mutex.o \\\ndrivers/tty/Makefile-4-\t\t\t\t tty_ldsem.o tty_baudrate.o tty_jobctrl.o \\\n--\ndrivers/tty/amiserial.c=70=struct serial_state {\ndrivers/tty/amiserial.c:71:\tstruct tty_port\t\ttport;\ndrivers/tty/amiserial.c-72-\tstruct circ_buf\t\txmit;\n--\ndrivers/tty/amiserial.c=303=static void check_modem_status(struct serial_state *info)\ndrivers/tty/amiserial.c-304-{\ndrivers/tty/amiserial.c:305:\tstruct tty_port *port = \u0026info-\u003etport;\ndrivers/tty/amiserial.c-306-\tunsigned char status = ciab.pra \u0026 (SER_DCD | SER_CTS | SER_DSR);\n--\ndrivers/tty/amiserial.c-326-\ndrivers/tty/amiserial.c:327:\tif (tty_port_check_carrier(port) \u0026\u0026 (dstatus \u0026 SER_DCD)) {\ndrivers/tty/amiserial.c-328-#if (defined(SERIAL_DEBUG_OPEN) || defined(SERIAL_DEBUG_INTR))\n--\ndrivers/tty/amiserial.c-341-\t}\ndrivers/tty/amiserial.c:342:\tif (tty_port_cts_enabled(port)) {\ndrivers/tty/amiserial.c-343-\t\tif (port-\u003etty-\u003ehw_stopped) {\n--\ndrivers/tty/amiserial.c=441=static int rs_startup(struct tty_struct *tty, struct serial_state *info)\ndrivers/tty/amiserial.c-442-{\ndrivers/tty/amiserial.c:443:\tstruct tty_port *port = \u0026info-\u003etport;\ndrivers/tty/amiserial.c-444-\tunsigned long flags;\n--\ndrivers/tty/amiserial.c-453-\ndrivers/tty/amiserial.c:454:\tif (tty_port_initialized(port)) {\ndrivers/tty/amiserial.c-455-\t\tkfree(buffer);\n--\ndrivers/tty/amiserial.c-502-\ndrivers/tty/amiserial.c:503:\ttty_port_set_initialized(port, true);\ndrivers/tty/amiserial.c-504-\tlocal_irq_restore(flags);\n--\ndrivers/tty/amiserial.c=516=static void rs_shutdown(struct tty_struct *tty, struct serial_state *info)\n--\ndrivers/tty/amiserial.c-519-\ndrivers/tty/amiserial.c:520:\tif (!tty_port_initialized(\u0026info-\u003etport))\ndrivers/tty/amiserial.c-521-\t\treturn;\n--\ndrivers/tty/amiserial.c-556-\ndrivers/tty/amiserial.c:557:\ttty_port_set_initialized(\u0026info-\u003etport, false);\ndrivers/tty/amiserial.c-558-\tlocal_irq_restore(flags);\n--\ndrivers/tty/amiserial.c=566=static void change_speed(struct tty_struct *tty, struct serial_state *info,\n--\ndrivers/tty/amiserial.c-568-{\ndrivers/tty/amiserial.c:569:\tstruct tty_port *port = \u0026info-\u003etport;\ndrivers/tty/amiserial.c-570-\tint\tquot = 0, baud_base, baud;\n--\ndrivers/tty/amiserial.c-636-\t\tinfo-\u003eIER |= UART_IER_MSI;\ndrivers/tty/amiserial.c:637:\ttty_port_set_cts_flow(port, cflag \u0026 CRTSCTS);\ndrivers/tty/amiserial.c-638-\tif (cflag \u0026 CRTSCTS)\ndrivers/tty/amiserial.c-639-\t\tinfo-\u003eIER |= UART_IER_MSI;\ndrivers/tty/amiserial.c:640:\ttty_port_set_check_carrier(port, ~cflag \u0026 CLOCAL);\ndrivers/tty/amiserial.c-641-\tif (~cflag \u0026 CLOCAL)\n--\ndrivers/tty/amiserial.c=915=static int set_serial_info(struct tty_struct *tty, struct serial_struct *ss)\n--\ndrivers/tty/amiserial.c-917-\tstruct serial_state *state = tty-\u003edriver_data;\ndrivers/tty/amiserial.c:918:\tstruct tty_port *port = \u0026state-\u003etport;\ndrivers/tty/amiserial.c-919-\tbool change_spd;\n--\ndrivers/tty/amiserial.c-969-check_and_exit:\ndrivers/tty/amiserial.c:970:\tif (tty_port_initialized(port)) {\ndrivers/tty/amiserial.c-971-\t\tif (change_spd) {\n--\ndrivers/tty/amiserial.c=1224=static void rs_close(struct tty_struct *tty, struct file * filp)\n--\ndrivers/tty/amiserial.c-1226-\tstruct serial_state *state = tty-\u003edriver_data;\ndrivers/tty/amiserial.c:1227:\tstruct tty_port *port = \u0026state-\u003etport;\ndrivers/tty/amiserial.c-1228-\ndrivers/tty/amiserial.c:1229:\tif (tty_port_close_start(port, tty, filp) == 0)\ndrivers/tty/amiserial.c-1230-\t\treturn;\n--\ndrivers/tty/amiserial.c-1238-\tstate-\u003eread_status_mask \u0026= ~UART_LSR_DR;\ndrivers/tty/amiserial.c:1239:\tif (tty_port_initialized(port)) {\ndrivers/tty/amiserial.c-1240-\t /* disable receive interrupts */\n--\ndrivers/tty/amiserial.c-1259-\ndrivers/tty/amiserial.c:1260:\ttty_port_close_end(port, tty);\ndrivers/tty/amiserial.c-1261-}\n--\ndrivers/tty/amiserial.c=1323=static void rs_hangup(struct tty_struct *tty)\n--\ndrivers/tty/amiserial.c-1329-\tinfo-\u003etport.count = 0;\ndrivers/tty/amiserial.c:1330:\ttty_port_set_active(\u0026info-\u003etport, false);\ndrivers/tty/amiserial.c-1331-\tinfo-\u003etport.tty = NULL;\n--\ndrivers/tty/amiserial.c=1341=static int rs_open(struct tty_struct *tty, struct file * filp)\ndrivers/tty/amiserial.c-1342-{\ndrivers/tty/amiserial.c:1343:\tstruct tty_port *port = tty-\u003eport;\ndrivers/tty/amiserial.c-1344-\tstruct serial_state *info = container_of(port, struct serial_state,\n--\ndrivers/tty/amiserial.c-1356-\ndrivers/tty/amiserial.c:1357:\treturn tty_port_block_til_ready(port, tty, filp);\ndrivers/tty/amiserial.c-1358-}\n--\ndrivers/tty/amiserial.c=1364=static inline void line_info(struct seq_file *m, int line,\n--\ndrivers/tty/amiserial.c-1373-\tstatus = ciab.pra;\ndrivers/tty/amiserial.c:1374:\tcontrol = tty_port_initialized(\u0026state-\u003etport) ? state-\u003eMCR : status;\ndrivers/tty/amiserial.c-1375-\tlocal_irq_restore(flags);\n--\ndrivers/tty/amiserial.c=1428=static const struct tty_operations serial_ops = {\n--\ndrivers/tty/amiserial.c-1454-\ndrivers/tty/amiserial.c:1455:static bool amiga_carrier_raised(struct tty_port *port)\ndrivers/tty/amiserial.c-1456-{\n--\ndrivers/tty/amiserial.c-1459-\ndrivers/tty/amiserial.c:1460:static void amiga_dtr_rts(struct tty_port *port, bool active)\ndrivers/tty/amiserial.c-1461-{\n--\ndrivers/tty/amiserial.c-1475-\ndrivers/tty/amiserial.c:1476:static const struct tty_port_operations amiga_port_ops = {\ndrivers/tty/amiserial.c-1477-\t.carrier_raised = amiga_carrier_raised,\n--\ndrivers/tty/amiserial.c=1484=static int __init amiga_serial_probe(struct platform_device *pdev)\n--\ndrivers/tty/amiserial.c-1509-\tstate-\u003eport = (int)\u0026amiga_custom.serdatr; /* Just to give it a value */\ndrivers/tty/amiserial.c:1510:\ttty_port_init(\u0026state-\u003etport);\ndrivers/tty/amiserial.c-1511-\tstate-\u003etport.ops = \u0026amiga_port_ops;\ndrivers/tty/amiserial.c:1512:\ttty_port_link_device(\u0026state-\u003etport, driver, 0);\ndrivers/tty/amiserial.c-1513-\n--\ndrivers/tty/amiserial.c-1563-fail_tty_driver_kref_put:\ndrivers/tty/amiserial.c:1564:\ttty_port_destroy(\u0026state-\u003etport);\ndrivers/tty/amiserial.c-1565-\ttty_driver_kref_put(driver);\n--\ndrivers/tty/amiserial.c=1569=static void __exit amiga_serial_remove(struct platform_device *pdev)\n--\ndrivers/tty/amiserial.c-1574-\ttty_driver_kref_put(serial_driver);\ndrivers/tty/amiserial.c:1575:\ttty_port_destroy(\u0026state-\u003etport);\ndrivers/tty/amiserial.c-1576-\n--\ndrivers/tty/ehv_bytechan.c=44=struct ehv_bc_data {\ndrivers/tty/ehv_bytechan.c-45-\tstruct device *dev;\ndrivers/tty/ehv_bytechan.c:46:\tstruct tty_port port;\ndrivers/tty/ehv_bytechan.c-47-\tuint32_t handle;\n--\ndrivers/tty/ehv_bytechan.c=451=static irqreturn_t ehv_bc_tty_tx_isr(int irq, void *data)\n--\ndrivers/tty/ehv_bytechan.c-455-\tehv_bc_tx_dequeue(bc);\ndrivers/tty/ehv_bytechan.c:456:\ttty_port_tty_wakeup(\u0026bc-\u003eport);\ndrivers/tty/ehv_bytechan.c-457-\n--\ndrivers/tty/ehv_bytechan.c=472=static ssize_t ehv_bc_tty_write(struct tty_struct *ttys, const u8 *s,\n--\ndrivers/tty/ehv_bytechan.c-503- * This function can be called multiple times for a given tty_struct, which is\ndrivers/tty/ehv_bytechan.c:504: * why we initialize bc-\u003ettys in ehv_bc_tty_port_activate() instead.\ndrivers/tty/ehv_bytechan.c-505- *\n--\ndrivers/tty/ehv_bytechan.c=511=static int ehv_bc_tty_open(struct tty_struct *ttys, struct file *filp)\n--\ndrivers/tty/ehv_bytechan.c-517-\ndrivers/tty/ehv_bytechan.c:518:\treturn tty_port_open(\u0026bc-\u003eport, ttys, filp);\ndrivers/tty/ehv_bytechan.c-519-}\n--\ndrivers/tty/ehv_bytechan.c=526=static void ehv_bc_tty_close(struct tty_struct *ttys, struct file *filp)\n--\ndrivers/tty/ehv_bytechan.c-530-\tif (bc-\u003edev)\ndrivers/tty/ehv_bytechan.c:531:\t\ttty_port_close(\u0026bc-\u003eport, ttys, filp);\ndrivers/tty/ehv_bytechan.c-532-}\n--\ndrivers/tty/ehv_bytechan.c=590=static void ehv_bc_tty_hangup(struct tty_struct *ttys)\n--\ndrivers/tty/ehv_bytechan.c-594-\tehv_bc_tx_dequeue(bc);\ndrivers/tty/ehv_bytechan.c:595:\ttty_port_hangup(\u0026bc-\u003eport);\ndrivers/tty/ehv_bytechan.c-596-}\n--\ndrivers/tty/ehv_bytechan.c=605=static const struct tty_operations ehv_bc_ops = {\n--\ndrivers/tty/ehv_bytechan.c-621- */\ndrivers/tty/ehv_bytechan.c:622:static int ehv_bc_tty_port_activate(struct tty_port *port,\ndrivers/tty/ehv_bytechan.c-623-\t\t\t\t struct tty_struct *ttys)\n--\ndrivers/tty/ehv_bytechan.c-655-\ndrivers/tty/ehv_bytechan.c:656:static void ehv_bc_tty_port_shutdown(struct tty_port *port)\ndrivers/tty/ehv_bytechan.c-657-{\n--\ndrivers/tty/ehv_bytechan.c-663-\ndrivers/tty/ehv_bytechan.c:664:static const struct tty_port_operations ehv_bc_tty_port_ops = {\ndrivers/tty/ehv_bytechan.c:665:\t.activate = ehv_bc_tty_port_activate,\ndrivers/tty/ehv_bytechan.c:666:\t.shutdown = ehv_bc_tty_port_shutdown,\ndrivers/tty/ehv_bytechan.c-667-};\n--\ndrivers/tty/ehv_bytechan.c=669=static int ehv_bc_tty_probe(struct platform_device *pdev)\n--\ndrivers/tty/ehv_bytechan.c-707-\ndrivers/tty/ehv_bytechan.c:708:\ttty_port_init(\u0026bc-\u003eport);\ndrivers/tty/ehv_bytechan.c:709:\tbc-\u003eport.ops = \u0026ehv_bc_tty_port_ops;\ndrivers/tty/ehv_bytechan.c-710-\ndrivers/tty/ehv_bytechan.c:711:\tbc-\u003edev = tty_port_register_device(\u0026bc-\u003eport, ehv_bc_driver, i,\ndrivers/tty/ehv_bytechan.c-712-\t\t\t\u0026pdev-\u003edev);\n--\ndrivers/tty/ehv_bytechan.c-726-error:\ndrivers/tty/ehv_bytechan.c:727:\ttty_port_destroy(\u0026bc-\u003eport);\ndrivers/tty/ehv_bytechan.c-728-\tirq_dispose_mapping(bc-\u003etx_irq);\n--\ndrivers/tty/goldfish.c=36=struct goldfish_tty {\ndrivers/tty/goldfish.c:37:\tstruct tty_port port;\ndrivers/tty/goldfish.c-38-\tspinlock_t lock;\n--\ndrivers/tty/goldfish.c=136=static irqreturn_t goldfish_tty_interrupt(int irq, void *dev_id)\n--\ndrivers/tty/goldfish.c-154-\ndrivers/tty/goldfish.c:155:static int goldfish_tty_activate(struct tty_port *port, struct tty_struct *tty)\ndrivers/tty/goldfish.c-156-{\n--\ndrivers/tty/goldfish.c-162-\ndrivers/tty/goldfish.c:163:static void goldfish_tty_shutdown(struct tty_port *port)\ndrivers/tty/goldfish.c-164-{\n--\ndrivers/tty/goldfish.c=170=static int goldfish_tty_open(struct tty_struct *tty, struct file *filp)\n--\ndrivers/tty/goldfish.c-172-\tstruct goldfish_tty *qtty = \u0026goldfish_ttys[tty-\u003eindex];\ndrivers/tty/goldfish.c:173:\treturn tty_port_open(\u0026qtty-\u003eport, tty, filp);\ndrivers/tty/goldfish.c-174-}\n--\ndrivers/tty/goldfish.c=176=static void goldfish_tty_close(struct tty_struct *tty, struct file *filp)\ndrivers/tty/goldfish.c-177-{\ndrivers/tty/goldfish.c:178:\ttty_port_close(tty-\u003eport, tty, filp);\ndrivers/tty/goldfish.c-179-}\n--\ndrivers/tty/goldfish.c=181=static void goldfish_tty_hangup(struct tty_struct *tty)\ndrivers/tty/goldfish.c-182-{\ndrivers/tty/goldfish.c:183:\ttty_port_hangup(tty-\u003eport);\ndrivers/tty/goldfish.c-184-}\n--\ndrivers/tty/goldfish.c=218=static int goldfish_tty_console_setup(struct console *co, char *options)\n--\ndrivers/tty/goldfish.c-226-\ndrivers/tty/goldfish.c:227:static const struct tty_port_operations goldfish_port_ops = {\ndrivers/tty/goldfish.c-228-\t.activate = goldfish_tty_activate,\n--\ndrivers/tty/goldfish.c=289=static int goldfish_tty_probe(struct platform_device *pdev)\n--\ndrivers/tty/goldfish.c-339-\tspin_lock_init(\u0026qtty-\u003elock);\ndrivers/tty/goldfish.c:340:\ttty_port_init(\u0026qtty-\u003eport);\ndrivers/tty/goldfish.c-341-\tqtty-\u003eport.ops = \u0026goldfish_port_ops;\n--\ndrivers/tty/goldfish.c-380-\ndrivers/tty/goldfish.c:381:\tttydev = tty_port_register_device(\u0026qtty-\u003eport, goldfish_tty_driver,\ndrivers/tty/goldfish.c-382-\t\t\t\t\t line, \u0026pdev-\u003edev);\n--\ndrivers/tty/goldfish.c-402-err_dec_line_count:\ndrivers/tty/goldfish.c:403:\ttty_port_destroy(\u0026qtty-\u003eport);\ndrivers/tty/goldfish.c-404-\tgoldfish_tty_current_line_count--;\n--\ndrivers/tty/goldfish.c=414=static void goldfish_tty_remove(struct platform_device *pdev)\n--\ndrivers/tty/goldfish.c-424-\tfree_irq(qtty-\u003eirq, qtty);\ndrivers/tty/goldfish.c:425:\ttty_port_destroy(\u0026qtty-\u003eport);\ndrivers/tty/goldfish.c-426-\tgoldfish_tty_current_line_count--;\n--\ndrivers/tty/hvc/hvc_console.c=90=static struct hvc_struct *hvc_get_by_index(int index)\n--\ndrivers/tty/hvc/hvc_console.c-99-\t\tif (hp-\u003eindex == index) {\ndrivers/tty/hvc/hvc_console.c:100:\t\t\ttty_port_get(\u0026hp-\u003eport);\ndrivers/tty/hvc/hvc_console.c-101-\t\t\tspin_unlock_irqrestore(\u0026hp-\u003elock, flags);\n--\ndrivers/tty/hvc/hvc_console.c=246=console_initcall(hvc_console_init);\n--\ndrivers/tty/hvc/hvc_console.c-248-/* callback when the kboject ref count reaches zero. */\ndrivers/tty/hvc/hvc_console.c:249:static void hvc_port_destruct(struct tty_port *port)\ndrivers/tty/hvc/hvc_console.c-250-{\n--\ndrivers/tty/hvc/hvc_console.c=285=int hvc_instantiate(uint32_t vtermno, int index, const struct hv_ops *ops)\n--\ndrivers/tty/hvc/hvc_console.c-297-\tif (hp) {\ndrivers/tty/hvc/hvc_console.c:298:\t\ttty_port_put(\u0026hp-\u003eport);\ndrivers/tty/hvc/hvc_console.c-299-\t\treturn -1;\n--\ndrivers/tty/hvc/hvc_console.c=325=static int hvc_install(struct tty_driver *driver, struct tty_struct *tty)\n--\ndrivers/tty/hvc/hvc_console.c-336-\ndrivers/tty/hvc/hvc_console.c:337:\trc = tty_port_install(\u0026hp-\u003eport, driver, tty);\ndrivers/tty/hvc/hvc_console.c-338-\tif (rc)\ndrivers/tty/hvc/hvc_console.c:339:\t\ttty_port_put(\u0026hp-\u003eport);\ndrivers/tty/hvc/hvc_console.c-340-\treturn rc;\n--\ndrivers/tty/hvc/hvc_console.c=347=static int hvc_open(struct tty_struct *tty, struct file * filp)\n--\ndrivers/tty/hvc/hvc_console.c-361-\ndrivers/tty/hvc/hvc_console.c:362:\ttty_port_tty_set(\u0026hp-\u003eport, tty);\ndrivers/tty/hvc/hvc_console.c-363-\n--\ndrivers/tty/hvc/hvc_console.c-379-\t\t\t\thp-\u003eops-\u003edtr_rts(hp, true);\ndrivers/tty/hvc/hvc_console.c:380:\t\ttty_port_set_initialized(\u0026hp-\u003eport, true);\ndrivers/tty/hvc/hvc_console.c-381-\t}\n--\ndrivers/tty/hvc/hvc_console.c=389=static void hvc_close(struct tty_struct *tty, struct file * filp)\n--\ndrivers/tty/hvc/hvc_console.c-401-\t\t/* We are done with the tty pointer now. */\ndrivers/tty/hvc/hvc_console.c:402:\t\ttty_port_tty_set(\u0026hp-\u003eport, NULL);\ndrivers/tty/hvc/hvc_console.c-403-\ndrivers/tty/hvc/hvc_console.c:404:\t\tif (!tty_port_initialized(\u0026hp-\u003eport))\ndrivers/tty/hvc/hvc_console.c-405-\t\t\treturn;\n--\ndrivers/tty/hvc/hvc_console.c-422-\t\ttty_wait_until_sent(tty, HVC_CLOSE_WAIT);\ndrivers/tty/hvc/hvc_console.c:423:\t\ttty_port_set_initialized(\u0026hp-\u003eport, false);\ndrivers/tty/hvc/hvc_console.c-424-\t} else {\n--\ndrivers/tty/hvc/hvc_console.c=432=static void hvc_cleanup(struct tty_struct *tty)\n--\ndrivers/tty/hvc/hvc_console.c-435-\ndrivers/tty/hvc/hvc_console.c:436:\ttty_port_put(\u0026hp-\u003eport);\ndrivers/tty/hvc/hvc_console.c-437-}\n--\ndrivers/tty/hvc/hvc_console.c=439=static void hvc_hangup(struct tty_struct *tty)\n--\ndrivers/tty/hvc/hvc_console.c-463-\tspin_unlock_irqrestore(\u0026hp-\u003eport.lock, flags);\ndrivers/tty/hvc/hvc_console.c:464:\ttty_port_tty_set(\u0026hp-\u003eport, NULL);\ndrivers/tty/hvc/hvc_console.c-465-\n--\ndrivers/tty/hvc/hvc_console.c=563=static void hvc_set_winsz(struct work_struct *work)\n--\ndrivers/tty/hvc/hvc_console.c-571-\ndrivers/tty/hvc/hvc_console.c:572:\ttty = tty_port_tty_get(\u0026hp-\u003eport);\ndrivers/tty/hvc/hvc_console.c-573-\tif (!tty)\n--\ndrivers/tty/hvc/hvc_console.c=632=static int __hvc_poll(struct hvc_struct *hp, bool may_sleep)\n--\ndrivers/tty/hvc/hvc_console.c-660-\t/* No tty attached, just skip */\ndrivers/tty/hvc/hvc_console.c:661:\ttty = tty_port_tty_get(\u0026hp-\u003eport);\ndrivers/tty/hvc/hvc_console.c-662-\tif (tty == NULL)\n--\ndrivers/tty/hvc/hvc_console.c=888=static const struct tty_operations hvc_ops = {\n--\ndrivers/tty/hvc/hvc_console.c-906-\ndrivers/tty/hvc/hvc_console.c:907:static const struct tty_port_operations hvc_port_ops = {\ndrivers/tty/hvc/hvc_console.c-908-\t.destruct = hvc_port_destruct,\n--\ndrivers/tty/hvc/hvc_console.c=911=struct hvc_struct *hvc_alloc(uint32_t vtermno, int data,\n--\ndrivers/tty/hvc/hvc_console.c-933-\ndrivers/tty/hvc/hvc_console.c:934:\ttty_port_init(\u0026hp-\u003eport);\ndrivers/tty/hvc/hvc_console.c-935-\thp-\u003eport.ops = \u0026hvc_port_ops;\n--\ndrivers/tty/hvc/hvc_console.c=977=void hvc_remove(struct hvc_struct *hp)\n--\ndrivers/tty/hvc/hvc_console.c-981-\ndrivers/tty/hvc/hvc_console.c:982:\ttty = tty_port_tty_get(\u0026hp-\u003eport);\ndrivers/tty/hvc/hvc_console.c-983-\n--\ndrivers/tty/hvc/hvc_console.c-1001-\t */\ndrivers/tty/hvc/hvc_console.c:1002:\ttty_port_put(\u0026hp-\u003eport);\ndrivers/tty/hvc/hvc_console.c-1003-\n--\ndrivers/tty/hvc/hvc_console.h=35=struct hvc_struct {\ndrivers/tty/hvc/hvc_console.h:36:\tstruct tty_port port;\ndrivers/tty/hvc/hvc_console.h-37-\tspinlock_t lock;\n--\ndrivers/tty/hvc/hvcs.c=250=struct hvcs_struct {\ndrivers/tty/hvc/hvcs.c:251:\tstruct tty_port port;\ndrivers/tty/hvc/hvcs.c-252-\tspinlock_t lock;\n--\ndrivers/tty/hvc/hvcs.c=651=static void hvcs_return_index(int index)\n--\ndrivers/tty/hvc/hvcs.c-663-\ndrivers/tty/hvc/hvcs.c:664:static void hvcs_destruct_port(struct tty_port *p)\ndrivers/tty/hvc/hvcs.c-665-{\n--\ndrivers/tty/hvc/hvcs.c-703-\ndrivers/tty/hvc/hvcs.c:704:static const struct tty_port_operations hvcs_port_ops = {\ndrivers/tty/hvc/hvcs.c-705-\t.destruct = hvcs_destruct_port,\n--\ndrivers/tty/hvc/hvcs.c=726=static int hvcs_probe(\n--\ndrivers/tty/hvc/hvcs.c-754-\ndrivers/tty/hvc/hvcs.c:755:\ttty_port_init(\u0026hvcsd-\u003eport);\ndrivers/tty/hvc/hvcs.c-756-\thvcsd-\u003eport.ops = \u0026hvcs_port_ops;\n--\ndrivers/tty/hvc/hvcs.c=797=static void hvcs_remove(struct vio_dev *dev)\n--\ndrivers/tty/hvc/hvcs.c-808-\thvcsd-\u003edestroyed = \u0026comp;\ndrivers/tty/hvc/hvcs.c:809:\ttty = tty_port_tty_get(\u0026hvcsd-\u003eport);\ndrivers/tty/hvc/hvcs.c-810-\n--\ndrivers/tty/hvc/hvcs.c-821-\ndrivers/tty/hvc/hvcs.c:822:\ttty_port_put(\u0026hvcsd-\u003eport);\ndrivers/tty/hvc/hvcs.c-823-\twait_for_completion(\u0026comp);\n--\ndrivers/tty/hvc/hvcs.c=1037=static struct hvcs_struct *hvcs_get_by_index(int index)\n--\ndrivers/tty/hvc/hvcs.c-1045-\t\tif (hvcsd-\u003eindex == index) {\ndrivers/tty/hvc/hvcs.c:1046:\t\t\ttty_port_get(\u0026hvcsd-\u003eport);\ndrivers/tty/hvc/hvcs.c-1047-\t\t\tspin_unlock_irqrestore(\u0026hvcsd-\u003elock, flags);\n--\ndrivers/tty/hvc/hvcs.c=1058=static int hvcs_install(struct tty_driver *driver, struct tty_struct *tty)\n--\ndrivers/tty/hvc/hvcs.c-1114-\ndrivers/tty/hvc/hvcs.c:1115:\tretval = tty_port_install(\u0026hvcsd-\u003eport, driver, tty);\ndrivers/tty/hvc/hvcs.c-1116-\tif (retval)\n--\ndrivers/tty/hvc/hvcs.c-1125-err_put:\ndrivers/tty/hvc/hvcs.c:1126:\ttty_port_put(\u0026hvcsd-\u003eport);\ndrivers/tty/hvc/hvcs.c-1127-\n--\ndrivers/tty/hvc/hvcs.c=1206=static void hvcs_cleanup(struct tty_struct * tty)\n--\ndrivers/tty/hvc/hvcs.c-1216-\ndrivers/tty/hvc/hvcs.c:1217:\ttty_port_put(\u0026hvcsd-\u003eport);\ndrivers/tty/hvc/hvcs.c-1218-}\n--\ndrivers/tty/hvc/hvsi.c=58=struct hvsi_struct {\ndrivers/tty/hvc/hvsi.c:59:\tstruct tty_port port;\ndrivers/tty/hvc/hvsi.c-60-\tstruct delayed_work writer;\n--\ndrivers/tty/hvc/hvsi.c=475=static irqreturn_t hvsi_interrupt(int irq, void *arg)\n--\ndrivers/tty/hvc/hvsi.c-484-\ndrivers/tty/hvc/hvsi.c:485:\ttty = tty_port_tty_get(\u0026hp-\u003eport);\ndrivers/tty/hvc/hvsi.c-486-\n--\ndrivers/tty/hvc/hvsi.c=699=static int hvsi_open(struct tty_struct *tty, struct file *filp)\n--\ndrivers/tty/hvc/hvsi.c-714-\ndrivers/tty/hvc/hvsi.c:715:\ttty_port_tty_set(\u0026hp-\u003eport, tty);\ndrivers/tty/hvc/hvsi.c-716-\tspin_lock_irqsave(\u0026hp-\u003elock, flags);\n--\ndrivers/tty/hvc/hvsi.c=762=static void hvsi_close(struct tty_struct *tty, struct file *filp)\n--\ndrivers/tty/hvc/hvsi.c-774-\tif (--hp-\u003eport.count == 0) {\ndrivers/tty/hvc/hvsi.c:775:\t\ttty_port_tty_set(\u0026hp-\u003eport, NULL);\ndrivers/tty/hvc/hvsi.c-776-\t\thp-\u003einbuf_end = hp-\u003einbuf; /* discard remaining partial packets */\n--\ndrivers/tty/hvc/hvsi.c=814=static void hvsi_hangup(struct tty_struct *tty)\n--\ndrivers/tty/hvc/hvsi.c-820-\ndrivers/tty/hvc/hvsi.c:821:\ttty_port_tty_set(\u0026hp-\u003eport, NULL);\ndrivers/tty/hvc/hvsi.c-822-\n--\ndrivers/tty/hvc/hvsi.c=849=static void hvsi_write_worker(struct work_struct *work)\n--\ndrivers/tty/hvc/hvsi.c-885-\t\twake_up_all(\u0026hp-\u003eemptyq);\ndrivers/tty/hvc/hvsi.c:886:\t\ttty_port_tty_wakeup(\u0026hp-\u003eport);\ndrivers/tty/hvc/hvsi.c-887-\t}\n--\ndrivers/tty/hvc/hvsi.c=1038=static int __init hvsi_init(void)\n--\ndrivers/tty/hvc/hvsi.c-1061-\ndrivers/tty/hvc/hvsi.c:1062:\t\ttty_port_link_device(\u0026hp-\u003eport, driver, i);\ndrivers/tty/hvc/hvsi.c-1063-\n--\ndrivers/tty/hvc/hvsi.c=1177=static int __init hvsi_console_init(void)\n--\ndrivers/tty/hvc/hvsi.c-1203-\t\tspin_lock_init(\u0026hp-\u003elock);\ndrivers/tty/hvc/hvsi.c:1204:\t\ttty_port_init(\u0026hp-\u003eport);\ndrivers/tty/hvc/hvsi.c-1205-\t\thp-\u003eindex = hvsi_count;\n--\ndrivers/tty/hvc/hvsi.c-1212-\t\t\t __func__, be32_to_cpup(irq));\ndrivers/tty/hvc/hvsi.c:1213:\t\t\ttty_port_destroy(\u0026hp-\u003eport);\ndrivers/tty/hvc/hvsi.c-1214-\t\t\tcontinue;\n--\ndrivers/tty/hvc/hvsi_lib.c=376=int hvsilib_open(struct hvsi_priv *pv, struct hvc_struct *hp)\n--\ndrivers/tty/hvc/hvsi_lib.c-380-\t/* Keep track of the tty data structure */\ndrivers/tty/hvc/hvsi_lib.c:381:\tpv-\u003etty = tty_port_tty_get(\u0026hp-\u003eport);\ndrivers/tty/hvc/hvsi_lib.c-382-\n--\ndrivers/tty/mips_ejtag_fdc.c=84=struct mips_ejtag_fdc_tty;\n--\ndrivers/tty/mips_ejtag_fdc.c-86-/**\ndrivers/tty/mips_ejtag_fdc.c:87: * struct mips_ejtag_fdc_tty_port - Wrapper struct for FDC tty_port.\ndrivers/tty/mips_ejtag_fdc.c-88- * @port:\t\tTTY port data\n--\ndrivers/tty/mips_ejtag_fdc.c-103- */\ndrivers/tty/mips_ejtag_fdc.c:104:struct mips_ejtag_fdc_tty_port {\ndrivers/tty/mips_ejtag_fdc.c:105:\tstruct tty_port\t\t\t port;\ndrivers/tty/mips_ejtag_fdc.c-106-\tstruct mips_ejtag_fdc_tty\t*driver;\n--\ndrivers/tty/mips_ejtag_fdc.c=141=struct mips_ejtag_fdc_tty {\n--\ndrivers/tty/mips_ejtag_fdc.c-146-\tchar\t\t\t\t driver_name[16];\ndrivers/tty/mips_ejtag_fdc.c:147:\tstruct mips_ejtag_fdc_tty_port\t ports[NUM_TTY_CHANNELS];\ndrivers/tty/mips_ejtag_fdc.c-148-\twait_queue_head_t\t\t waitqueue;\n--\ndrivers/tty/mips_ejtag_fdc.c=415=static unsigned int mips_ejtag_fdc_put_chan(struct mips_ejtag_fdc_tty *priv,\n--\ndrivers/tty/mips_ejtag_fdc.c-417-{\ndrivers/tty/mips_ejtag_fdc.c:418:\tstruct mips_ejtag_fdc_tty_port *dport;\ndrivers/tty/mips_ejtag_fdc.c-419-\tstruct tty_struct *tty;\n--\ndrivers/tty/mips_ejtag_fdc.c-465-\tif (sizes[0] \u0026\u0026 word.bytes) {\ndrivers/tty/mips_ejtag_fdc.c:466:\t\ttty = tty_port_tty_get(\u0026dport-\u003eport);\ndrivers/tty/mips_ejtag_fdc.c-467-\t\tif (tty) {\n--\ndrivers/tty/mips_ejtag_fdc.c=483=static int mips_ejtag_fdc_put(void *arg)\n--\ndrivers/tty/mips_ejtag_fdc.c-485-\tstruct mips_ejtag_fdc_tty *priv = arg;\ndrivers/tty/mips_ejtag_fdc.c:486:\tstruct mips_ejtag_fdc_tty_port *dport;\ndrivers/tty/mips_ejtag_fdc.c-487-\tunsigned int ret;\n--\ndrivers/tty/mips_ejtag_fdc.c=558=static void mips_ejtag_fdc_handle(struct mips_ejtag_fdc_tty *priv)\ndrivers/tty/mips_ejtag_fdc.c-559-{\ndrivers/tty/mips_ejtag_fdc.c:560:\tstruct mips_ejtag_fdc_tty_port *dport;\ndrivers/tty/mips_ejtag_fdc.c-561-\tunsigned int stat, channel, data, cfg, i, flipped;\n--\n\n"
} |
| 21/2 | 2026/08/30 08:22 | llm | patch-evaluator |
1mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 40641 output: 26 thoughts: 87 Thoughts: Okay, let's dive into this. Here's how I'd approach this task, thinking through it myself: **Investigating Serial Port Buffer Management in the Kernel** Alright, I'm going to start by looking at how the kernel manages transmit buffers for TTY ports. My initial focus is on understanding the allocation and deallocation of these buffers, specifically the functions `tty_port_alloc_xmit_buf` and `tty_port_free_xmit_buf`, as well as the destructor `tty_port_destructor`. Those seem like the likely key players in memory management for the serial port transmit path. My next step is clear: I'll need to do a thorough code search. I'll use `grep` (or my preferred search tool) and scour the entire kernel source tree. I want to see *where* these functions are called. This will give me crucial context. By examining the call sites, I can understand which drivers rely on these mechanisms, how they are being used, and in what scenarios. The goal here is a comprehensive understanding of the allocation, use, and deallocation lifecycle of these transmit buffers. |
| 22/2 | 2026/08/30 08:24 | tool | grepper |
0mArgs:{
"Expression": "tty_port_(alloc|free)_xmit_buf"
}Results: {
"Output": "drivers/ipack/devices/ipoctal.c=287=static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,\n--\ndrivers/ipack/devices/ipoctal.c-412-\t\ttty_port_init(\u0026channel-\u003etty_port);\ndrivers/ipack/devices/ipoctal.c:413:\t\tres = tty_port_alloc_xmit_buf(\u0026channel-\u003etty_port);\ndrivers/ipack/devices/ipoctal.c-414-\t\tif (res)\n--\ndrivers/ipack/devices/ipoctal.c-426-\t\t\tdev_err(\u0026ipoctal-\u003edev-\u003edev, \"Failed to register tty device.\\n\");\ndrivers/ipack/devices/ipoctal.c:427:\t\t\ttty_port_free_xmit_buf(\u0026channel-\u003etty_port);\ndrivers/ipack/devices/ipoctal.c-428-\t\t\ttty_port_destroy(\u0026channel-\u003etty_port);\n--\ndrivers/ipack/devices/ipoctal.c=757=static void __ipoctal_remove(struct ipoctal *ipoctal)\n--\ndrivers/ipack/devices/ipoctal.c-772-\t\ttty_unregister_device(ipoctal-\u003etty_drv, i);\ndrivers/ipack/devices/ipoctal.c:773:\t\ttty_port_free_xmit_buf(\u0026channel-\u003etty_port);\ndrivers/ipack/devices/ipoctal.c-774-\t\ttty_port_destroy(\u0026channel-\u003etty_port);\n--\ndrivers/tty/mips_ejtag_fdc.c=696=static int mips_ejtag_fdc_tty_port_activate(struct tty_port *port,\n--\ndrivers/tty/mips_ejtag_fdc.c-703-\t/* Allocate the buffer we use for writing data */\ndrivers/tty/mips_ejtag_fdc.c:704:\tif (tty_port_alloc_xmit_buf(port) \u003c 0)\ndrivers/tty/mips_ejtag_fdc.c-705-\t\tgoto err;\n--\ndrivers/tty/mips_ejtag_fdc.c-717-err_free_xmit:\ndrivers/tty/mips_ejtag_fdc.c:718:\ttty_port_free_xmit_buf(port);\ndrivers/tty/mips_ejtag_fdc.c-719-err:\n--\ndrivers/tty/mips_ejtag_fdc.c=723=static void mips_ejtag_fdc_tty_port_shutdown(struct tty_port *port)\n--\ndrivers/tty/mips_ejtag_fdc.c-751-\t/* Free the write buffer */\ndrivers/tty/mips_ejtag_fdc.c:752:\ttty_port_free_xmit_buf(port);\ndrivers/tty/mips_ejtag_fdc.c-753-}\n--\ndrivers/tty/mxser.c=718=static int mxser_activate(struct tty_port *port, struct tty_struct *tty)\n--\ndrivers/tty/mxser.c-723-\ndrivers/tty/mxser.c:724:\tret = tty_port_alloc_xmit_buf(port);\ndrivers/tty/mxser.c-725-\tif (ret \u003c 0)\n--\ndrivers/tty/mxser.c-801-err_free_xmit:\ndrivers/tty/mxser.c:802:\ttty_port_free_xmit_buf(port);\ndrivers/tty/mxser.c-803-\treturn ret;\n--\ndrivers/tty/mxser.c=823=static void mxser_shutdown_port(struct tty_port *port)\n--\ndrivers/tty/mxser.c-851-\ndrivers/tty/mxser.c:852:\ttty_port_free_xmit_buf(port);\ndrivers/tty/mxser.c-853-}\n--\ndrivers/tty/tty_port.c=239=EXPORT_SYMBOL_GPL(tty_port_unregister_device);\ndrivers/tty/tty_port.c-240-\ndrivers/tty/tty_port.c:241:int tty_port_alloc_xmit_buf(struct tty_port *port)\ndrivers/tty/tty_port.c-242-{\n--\ndrivers/tty/tty_port.c-256-}\ndrivers/tty/tty_port.c:257:EXPORT_SYMBOL(tty_port_alloc_xmit_buf);\ndrivers/tty/tty_port.c-258-\ndrivers/tty/tty_port.c:259:void tty_port_free_xmit_buf(struct tty_port *port)\ndrivers/tty/tty_port.c-260-{\n--\ndrivers/tty/tty_port.c-265-}\ndrivers/tty/tty_port.c:266:EXPORT_SYMBOL(tty_port_free_xmit_buf);\ndrivers/tty/tty_port.c-267-\n--\ninclude/linux/tty_port.h=155=void tty_port_unregister_device(struct tty_port *port,\ninclude/linux/tty_port.h-156-\t\tstruct tty_driver *driver, unsigned index);\ninclude/linux/tty_port.h:157:int tty_port_alloc_xmit_buf(struct tty_port *port);\ninclude/linux/tty_port.h:158:void tty_port_free_xmit_buf(struct tty_port *port);\ninclude/linux/tty_port.h-159-void tty_port_destroy(struct tty_port *port);\n"
} |
| 23/2 | 2026/08/30 08:24 | llm | patch-evaluator |
1mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 42463 output: 39 thoughts: 48 Thoughts: Okay, let's dive into this. I need to understand the lifecycle of transmit buffers, specifically focusing on `uart_alloc_xmit_buf` and `uart_free_xmit_buf`. I'm going to track those calls, looking for how they're used and what implications their implementation might have. To get a handle on the overall structure, I'll start with the heart of serial port management within the kernel, so I'm heading straight for `drivers/tty/serial/serial_core.c`. I expect this to reveal the allocation and deallocation strategies and how they interplay with the actual transmission process. Understanding this is key to grasping overall serial driver performance and identifying any potential bottlenecks or memory management issues. |
| 24/2 | 2026/08/30 08:25 | tool | read-file |
0mArgs:{
"File": "drivers/tty/serial/serial_core.c",
"FirstLine": 240,
"LineCount": 70
}Results: {
"Contents": " 240:\t\t\telse\n 241:\t\t\t\t__uart_start(state);\n 242:\t\t}\n 243:\t}\n 244:\t\n 245:\tstatic int uart_alloc_xmit_buf(struct tty_port *port)\n 246:\t{\n 247:\t\tstruct uart_state *state = container_of(port, struct uart_state, port);\n 248:\t\tstruct uart_port *uport;\n 249:\t\tunsigned long flags;\n 250:\t\tunsigned char *buf;\n 251:\t\n 252:\t\t/*\n 253:\t\t * Initialise and allocate the transmit and temporary\n 254:\t\t * buffer.\n 255:\t\t */\n 256:\t\tbuf = kzalloc(PAGE_SIZE, GFP_KERNEL);\n 257:\t\tif (!buf)\n 258:\t\t\treturn -ENOMEM;\n 259:\t\n 260:\t\tuport = uart_port_ref_lock(state, \u0026flags);\n 261:\t\tif (!state-\u003eport.xmit_buf) {\n 262:\t\t\tstate-\u003eport.xmit_buf = buf;\n 263:\t\t\tkfifo_init(\u0026state-\u003eport.xmit_fifo, state-\u003eport.xmit_buf,\n 264:\t\t\t\t\tPAGE_SIZE);\n 265:\t\t\tuart_port_unlock_deref(uport, flags);\n 266:\t\t} else {\n 267:\t\t\tuart_port_unlock_deref(uport, flags);\n 268:\t\t\t/*\n 269:\t\t\t * Do not free() the buffer under the port lock, see\n 270:\t\t\t * uart_free_xmit_buf().\n 271:\t\t\t */\n 272:\t\t\tkfree(buf);\n 273:\t\t}\n 274:\t\n 275:\t\treturn 0;\n 276:\t}\n 277:\t\n 278:\tstatic void uart_free_xmit_buf(struct tty_port *port)\n 279:\t{\n 280:\t\tstruct uart_state *state = container_of(port, struct uart_state, port);\n 281:\t\tstruct uart_port *uport;\n 282:\t\tunsigned long flags;\n 283:\t\tchar *xmit_buf;\n 284:\t\n 285:\t\t/*\n 286:\t\t * Do not free() the transmit buffer under the port lock since\n 287:\t\t * this can create various circular locking scenarios. For instance,\n 288:\t\t * console driver may need to allocate/free a debug object, which\n 289:\t\t * can end up in printk() recursion.\n 290:\t\t */\n 291:\t\tuport = uart_port_ref_lock(state, \u0026flags);\n 292:\t\txmit_buf = port-\u003exmit_buf;\n 293:\t\tport-\u003exmit_buf = NULL;\n 294:\t\tINIT_KFIFO(port-\u003exmit_fifo);\n 295:\t\tuart_port_unlock_deref(uport, flags);\n 296:\t\n 297:\t\tkfree(xmit_buf);\n 298:\t}\n 299:\t\n 300:\t/*\n 301:\t * Startup the port. This will be called once per open. All calls\n 302:\t * will be serialised by the per-port mutex.\n 303:\t */\n 304:\tstatic int uart_port_startup(struct tty_struct *tty, struct uart_state *state,\n 305:\t\t\t\t bool init_hw)\n 306:\t{\n 307:\t\tstruct uart_port *uport = uart_port_check(state);\n 308:\t\tint retval;\n 309:\t\n"
} |
| 25/2 | 2026/08/30 08:25 | llm | patch-evaluator |
1mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 43705 output: 37 thoughts: 16 Thoughts: Okay, let's dive into this. I'm looking at `drivers/tty/tty_port.c`. Right, so this is the heart of serial port management within the kernel. It's the central module for tty ports, which is crucial for anything involving serial communication, terminals, and devices that use a serial interface. I know this code, like the back of my hand, but let's review to make sure I'm still up to speed. **Deep Dive into `tty_port.c`** Alright, I see the typical structure here. This file is probably going to define the core `tty_port` structure and the associated functions. Let's think through what that means… The `tty_port` is the abstract representation of a serial port. It's the central data structure tying together all the different components: line disciplines, hardware-specific drivers (like the UART drivers), the core tty layer, and even things like flow control. It has to handle everything: opening and closing the port, setting up the line discipline, managing data buffers, and translating between the generic tty interface and the hardware-specific details. I bet it defines the functions for sending and receiving data: `tty_port_open`, `tty_port_close`, `tty_port_write`, `tty_port_read`, those key functions would have to be here. Plus all the associated locking, error handling, and resource management. We're also likely to find functions related to flow control (RTS/CTS, DTR/DSR, etc.), modem control, and potentially even support for different baud rates and character sizes. The code will likely be thread-safe with spinlocks and mutexes to protect the port's state during concurrent access, which is always something I look for. The file probably uses lots of callbacks and function pointers within the `tty_port` structure. This would allow the upper tty layer to interact with the underlying hardware-specific driver, so we're looking for the connection points and data structures that connect this abstract tty_port with the underlying hardware, like the UART. I expect to see implementations of various callbacks, like setting baud rates, configuring serial parameters, and handling interrupts. I wonder how the code handles error conditions. Serial communications are prone to errors – framing errors, parity errors, overrun errors, and so on. There will likely be mechanisms for reporting these errors to the user space and possibly reconfiguring the port to recover. In all, this file provides the abstraction layer, linking the hardware to the rest of the kernel, and the underlying communications. |
| 26/2 | 2026/08/30 08:26 | tool | read-file |
0mArgs:{
"File": "drivers/tty/tty_port.c",
"FirstLine": 240,
"LineCount": 60
}Results: {
"Contents": " 240:\t\n 241:\tint tty_port_alloc_xmit_buf(struct tty_port *port)\n 242:\t{\n 243:\t\t/* We may sleep in kzalloc() */\n 244:\t\tguard(mutex)(\u0026port-\u003ebuf_mutex);\n 245:\t\n 246:\t\tif (port-\u003exmit_buf)\n 247:\t\t\treturn 0;\n 248:\t\n 249:\t\tport-\u003exmit_buf = kzalloc(PAGE_SIZE, GFP_KERNEL);\n 250:\t\tif (port-\u003exmit_buf == NULL)\n 251:\t\t\treturn -ENOMEM;\n 252:\t\n 253:\t\tkfifo_init(\u0026port-\u003exmit_fifo, port-\u003exmit_buf, PAGE_SIZE);\n 254:\t\n 255:\t\treturn 0;\n 256:\t}\n 257:\tEXPORT_SYMBOL(tty_port_alloc_xmit_buf);\n 258:\t\n 259:\tvoid tty_port_free_xmit_buf(struct tty_port *port)\n 260:\t{\n 261:\t\tguard(mutex)(\u0026port-\u003ebuf_mutex);\n 262:\t\tkfree(port-\u003exmit_buf);\n 263:\t\tport-\u003exmit_buf = NULL;\n 264:\t\tINIT_KFIFO(port-\u003exmit_fifo);\n 265:\t}\n 266:\tEXPORT_SYMBOL(tty_port_free_xmit_buf);\n 267:\t\n 268:\t/**\n 269:\t * tty_port_destroy - destroy inited port\n 270:\t * @port: tty port to be destroyed\n 271:\t *\n 272:\t * When a port was initialized using tty_port_init(), one has to destroy the\n 273:\t * port by this function. Either indirectly by using \u0026tty_port refcounting\n 274:\t * (tty_port_put()) or directly if refcounting is not used.\n 275:\t */\n 276:\tvoid tty_port_destroy(struct tty_port *port)\n 277:\t{\n 278:\t\ttty_buffer_cancel_work(port);\n 279:\t\ttty_buffer_free_all(port);\n 280:\t\tWRITE_ONCE(port-\u003ebuf.flip_wq, NULL);\n 281:\t}\n 282:\tEXPORT_SYMBOL(tty_port_destroy);\n 283:\t\n 284:\tstatic void tty_port_destructor(struct kref *kref)\n 285:\t{\n 286:\t\tstruct tty_port *port = container_of(kref, struct tty_port, kref);\n 287:\t\n 288:\t\t/* check if last port ref was dropped before tty release */\n 289:\t\tif (WARN_ON(port-\u003eitty))\n 290:\t\t\treturn;\n 291:\t\tkfree(port-\u003exmit_buf);\n 292:\t\ttty_port_destroy(port);\n 293:\t\tif (port-\u003eops \u0026\u0026 port-\u003eops-\u003edestruct)\n 294:\t\t\tport-\u003eops-\u003edestruct(port);\n 295:\t\telse\n 296:\t\t\tkfree(port);\n 297:\t}\n 298:\t\n 299:\t/**\n"
} |
| 27/2 | 2026/08/30 08:26 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 45204 output: 29 thoughts: 72 Thoughts: **Analyzing Serial Port Transmission Buffers** Okay, let's dive in. My immediate focus is understanding the lifecycle of `port->xmit_buf`. I need to figure out the full scope of how this buffer is used. Specifically, I need to know where it's accessed and if any of those interactions could potentially introduce issues. Are there any other areas in the code that are potentially impacting the data in that buffer? Are there any obvious race conditions that might exist? To get a clearer picture, I'll start by systematically checking serial port usage across the relevant code. Given my familiarity with kernel architecture, I'll start looking in `drivers/tty/serial/` for instances of either `xmit_buf` itself or, since they are related, any mention of `xmit_fifo`. This should provide a good baseline and a good path forward to examine the buffer's interactions. |
| 28/2 | 2026/08/30 08:27 | tool | grepper |
0mArgs:{
"Expression": "xmit_buf",
"PathPrefix": "drivers/tty/serial"
}Results: {
"Output": "drivers/tty/serial/8250/8250_dma.c=223=int serial8250_request_dma(struct uart_8250_port *p)\n--\ndrivers/tty/serial/8250/8250_dma.c-297-\tdma-\u003etx_addr = dma_map_single(dma-\u003etxchan-\u003edevice-\u003edev,\ndrivers/tty/serial/8250/8250_dma.c:298:\t\t\t\t\tp-\u003eport.state-\u003eport.xmit_buf,\ndrivers/tty/serial/8250/8250_dma.c-299-\t\t\t\t\tUART_XMIT_SIZE,\n--\ndrivers/tty/serial/atmel_serial.c=1012=static int atmel_prepare_tx_dma(struct uart_port *port)\n--\ndrivers/tty/serial/atmel_serial.c-1035-\t/* UART circular tx buffer is an aligned page. */\ndrivers/tty/serial/atmel_serial.c:1036:\tBUG_ON(!PAGE_ALIGNED(tport-\u003exmit_buf));\ndrivers/tty/serial/atmel_serial.c:1037:\tatmel_port-\u003etx_phys = dma_map_single(port-\u003edev, tport-\u003exmit_buf,\ndrivers/tty/serial/atmel_serial.c-1038-\t\t\t\t\t UART_XMIT_SIZE, DMA_TO_DEVICE);\n--\ndrivers/tty/serial/atmel_serial.c-1044-\t\tdev_dbg(port-\u003edev, \"%s: mapped %lu@%p to %pad\\n\", __func__,\ndrivers/tty/serial/atmel_serial.c:1045:\t\t\tUART_XMIT_SIZE, tport-\u003exmit_buf,\ndrivers/tty/serial/atmel_serial.c-1046-\t\t\t\u0026atmel_port-\u003etx_phys);\n--\ndrivers/tty/serial/atmel_serial.c=1489=static int atmel_prepare_tx_pdc(struct uart_port *port)\n--\ndrivers/tty/serial/atmel_serial.c-1494-\ndrivers/tty/serial/atmel_serial.c:1495:\tpdc-\u003ebuf = tport-\u003exmit_buf;\ndrivers/tty/serial/atmel_serial.c-1496-\tpdc-\u003edma_addr = dma_map_single(port-\u003edev,\n--\ndrivers/tty/serial/icom.c=253=struct icom_port {\n--\ndrivers/tty/serial/icom.c-265-\tdma_addr_t xmitRestart_pci;\ndrivers/tty/serial/icom.c:266:\tunsigned char *xmit_buf;\ndrivers/tty/serial/icom.c:267:\tdma_addr_t xmit_buf_pci;\ndrivers/tty/serial/icom.c-268-\tunsigned char *recv_buf;\n--\ndrivers/tty/serial/icom.c=394=static void free_port_memory(struct icom_port *icom_port)\n--\ndrivers/tty/serial/icom.c-403-\t}\ndrivers/tty/serial/icom.c:404:\tif (icom_port-\u003exmit_buf) {\ndrivers/tty/serial/icom.c:405:\t\tdma_free_coherent(\u0026dev-\u003edev, 4096, icom_port-\u003exmit_buf,\ndrivers/tty/serial/icom.c:406:\t\t\t\t icom_port-\u003exmit_buf_pci);\ndrivers/tty/serial/icom.c:407:\t\ticom_port-\u003exmit_buf = NULL;\ndrivers/tty/serial/icom.c-408-\t}\n--\ndrivers/tty/serial/icom.c=422=static int get_port_memory(struct icom_port *icom_port)\n--\ndrivers/tty/serial/icom.c-429-\ndrivers/tty/serial/icom.c:430:\ticom_port-\u003exmit_buf =\ndrivers/tty/serial/icom.c:431:\t dma_alloc_coherent(\u0026dev-\u003edev, 4096, \u0026icom_port-\u003exmit_buf_pci,\ndrivers/tty/serial/icom.c-432-\t\t\t GFP_KERNEL);\ndrivers/tty/serial/icom.c:433:\tif (!icom_port-\u003exmit_buf) {\ndrivers/tty/serial/icom.c-434-\t\tdev_err(\u0026dev-\u003edev, \"Can not allocate Transmit buffer\\n\");\n--\ndrivers/tty/serial/icom.c-438-\ttrace(icom_port, \"GET_PORT_MEM\",\ndrivers/tty/serial/icom.c:439:\t (unsigned long) icom_port-\u003exmit_buf);\ndrivers/tty/serial/icom.c-440-\n--\ndrivers/tty/serial/icom.c-486-\t\t\ttrace(icom_port, \"FOD_XBUFF\",\ndrivers/tty/serial/icom.c:487:\t\t\t (unsigned long) icom_port-\u003exmit_buf);\ndrivers/tty/serial/icom.c-488-\t\t\ticom_port-\u003estatStg-\u003exmit[index].leBuffer =\ndrivers/tty/serial/icom.c:489:\t\t\t cpu_to_le32(icom_port-\u003exmit_buf_pci);\ndrivers/tty/serial/icom.c-490-\t\t} else if (index == (NUM_XBUFFS - 1)) {\n--\ndrivers/tty/serial/icom.c-494-\t\t\ttrace(icom_port, \"FOD_XBUFF\",\ndrivers/tty/serial/icom.c:495:\t\t\t (unsigned long) icom_port-\u003exmit_buf);\ndrivers/tty/serial/icom.c-496-\t\t\ticom_port-\u003estatStg-\u003exmit[index].leBuffer =\ndrivers/tty/serial/icom.c:497:\t\t\t cpu_to_le32(icom_port-\u003exmit_buf_pci);\ndrivers/tty/serial/icom.c-498-\t\t} else {\n--\ndrivers/tty/serial/icom.c=877=static int icom_write(struct uart_port *port)\n--\ndrivers/tty/serial/icom.c-892-\ndrivers/tty/serial/icom.c:893:\tdata_count = kfifo_out_peek(\u0026tport-\u003exmit_fifo, icom_port-\u003exmit_buf,\ndrivers/tty/serial/icom.c-894-\t\t\tXMIT_BUFF_SZ);\n--\ndrivers/tty/serial/icom.c=1341=static void icom_set_termios(struct uart_port *port, struct ktermios *termios,\n--\ndrivers/tty/serial/icom.c-1350-\tint index;\ndrivers/tty/serial/icom.c:1351:\tint rcv_buff, xmit_buff;\ndrivers/tty/serial/icom.c-1352-\tunsigned long offset;\n--\ndrivers/tty/serial/icom.c-1467-\ndrivers/tty/serial/icom.c:1468:\tfor (xmit_buff = 0; xmit_buff \u003c NUM_XBUFFS; xmit_buff++) {\ndrivers/tty/serial/icom.c:1469:\t\ticom_port-\u003estatStg-\u003exmit[xmit_buff].flags = 0;\ndrivers/tty/serial/icom.c-1470-\t}\n--\ndrivers/tty/serial/pch_uart.c=862=static unsigned int dma_handle_tx(struct eg20t_port *priv)\n--\ndrivers/tty/serial/pch_uart.c-934-\t\tif (i == (num - 1))\ndrivers/tty/serial/pch_uart.c:935:\t\t\tsg_set_page(sg, virt_to_page(tport-\u003exmit_buf),\ndrivers/tty/serial/pch_uart.c-936-\t\t\t\t rem, fifo_size * i);\ndrivers/tty/serial/pch_uart.c-937-\t\telse\ndrivers/tty/serial/pch_uart.c:938:\t\t\tsg_set_page(sg, virt_to_page(tport-\u003exmit_buf),\ndrivers/tty/serial/pch_uart.c-939-\t\t\t\t size, fifo_size * i);\n--\ndrivers/tty/serial/samsung_tty.c=1042=static int s3c24xx_serial_request_dma(struct s3c24xx_uart_port *p)\n--\ndrivers/tty/serial/samsung_tty.c-1113-\tdma-\u003etx_addr = dma_map_single(dma-\u003etx_chan-\u003edevice-\u003edev,\ndrivers/tty/serial/samsung_tty.c:1114:\t\t\t\t p-\u003eport.state-\u003eport.xmit_buf,\ndrivers/tty/serial/samsung_tty.c-1115-\t\t\t\t UART_XMIT_SIZE,\n--\ndrivers/tty/serial/serial-tegra.c=1141=static int tegra_uart_dma_channel_allocate(struct tegra_uart_port *tup,\n--\ndrivers/tty/serial/serial-tegra.c-1177-\t} else {\ndrivers/tty/serial/serial-tegra.c:1178:\t\tdma_buf = tup-\u003euport.state-\u003eport.xmit_buf;\ndrivers/tty/serial/serial-tegra.c-1179-\t\tdma_phys = dma_map_single(tup-\u003euport.dev,\n--\ndrivers/tty/serial/serial_core.c=202=static void uart_change_line_settings(struct tty_struct *tty, struct uart_state *state,\n--\ndrivers/tty/serial/serial_core.c-244-\ndrivers/tty/serial/serial_core.c:245:static int uart_alloc_xmit_buf(struct tty_port *port)\ndrivers/tty/serial/serial_core.c-246-{\n--\ndrivers/tty/serial/serial_core.c-260-\tuport = uart_port_ref_lock(state, \u0026flags);\ndrivers/tty/serial/serial_core.c:261:\tif (!state-\u003eport.xmit_buf) {\ndrivers/tty/serial/serial_core.c:262:\t\tstate-\u003eport.xmit_buf = buf;\ndrivers/tty/serial/serial_core.c:263:\t\tkfifo_init(\u0026state-\u003eport.xmit_fifo, state-\u003eport.xmit_buf,\ndrivers/tty/serial/serial_core.c-264-\t\t\t\tPAGE_SIZE);\n--\ndrivers/tty/serial/serial_core.c-269-\t\t * Do not free() the buffer under the port lock, see\ndrivers/tty/serial/serial_core.c:270:\t\t * uart_free_xmit_buf().\ndrivers/tty/serial/serial_core.c-271-\t\t */\n--\ndrivers/tty/serial/serial_core.c-277-\ndrivers/tty/serial/serial_core.c:278:static void uart_free_xmit_buf(struct tty_port *port)\ndrivers/tty/serial/serial_core.c-279-{\n--\ndrivers/tty/serial/serial_core.c-282-\tunsigned long flags;\ndrivers/tty/serial/serial_core.c:283:\tchar *xmit_buf;\ndrivers/tty/serial/serial_core.c-284-\n--\ndrivers/tty/serial/serial_core.c-291-\tuport = uart_port_ref_lock(state, \u0026flags);\ndrivers/tty/serial/serial_core.c:292:\txmit_buf = port-\u003exmit_buf;\ndrivers/tty/serial/serial_core.c:293:\tport-\u003exmit_buf = NULL;\ndrivers/tty/serial/serial_core.c-294-\tINIT_KFIFO(port-\u003exmit_fifo);\n--\ndrivers/tty/serial/serial_core.c-296-\ndrivers/tty/serial/serial_core.c:297:\tkfree(xmit_buf);\ndrivers/tty/serial/serial_core.c-298-}\n--\ndrivers/tty/serial/serial_core.c=304=static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,\n--\ndrivers/tty/serial/serial_core.c-317-\ndrivers/tty/serial/serial_core.c:318:\tretval = uart_alloc_xmit_buf(\u0026state-\u003eport);\ndrivers/tty/serial/serial_core.c-319-\tif (retval)\n--\ndrivers/tty/serial/serial_core.c=389=static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)\n--\ndrivers/tty/serial/serial_core.c-429-\ndrivers/tty/serial/serial_core.c:430:\tuart_free_xmit_buf(port);\ndrivers/tty/serial/serial_core.c-431-}\n--\ndrivers/tty/serial/serial_core.c=583=static int uart_put_char(struct tty_struct *tty, u8 c)\n--\ndrivers/tty/serial/serial_core.c-590-\tport = uart_port_ref_lock(state, \u0026flags);\ndrivers/tty/serial/serial_core.c:591:\tif (!state-\u003eport.xmit_buf) {\ndrivers/tty/serial/serial_core.c-592-\t\tuart_port_unlock_deref(port, flags);\n--\ndrivers/tty/serial/serial_core.c=607=static ssize_t uart_write(struct tty_struct *tty, const u8 *buf, size_t count)\n--\ndrivers/tty/serial/serial_core.c-621-\tport = uart_port_ref_lock(state, \u0026flags);\ndrivers/tty/serial/serial_core.c:622:\tif (!state-\u003eport.xmit_buf) {\ndrivers/tty/serial/serial_core.c-623-\t\tuart_port_unlock_deref(port, flags);\n--\ndrivers/tty/serial/serial_core.c=635=static unsigned int uart_write_room(struct tty_struct *tty)\n--\ndrivers/tty/serial/serial_core.c-642-\tport = uart_port_ref_lock(state, \u0026flags);\ndrivers/tty/serial/serial_core.c:643:\tif (!state-\u003eport.xmit_buf)\ndrivers/tty/serial/serial_core.c-644-\t\tret = 0;\n--\ndrivers/tty/serial/serial_core.c=1718=static void uart_tty_port_shutdown(struct tty_port *port)\n--\ndrivers/tty/serial/serial_core.c-1742-\ndrivers/tty/serial/serial_core.c:1743:\tuart_free_xmit_buf(port);\ndrivers/tty/serial/serial_core.c-1744-\n--\ndrivers/tty/serial/sh-sci.c=1642=static void sci_dma_tx_work_fn(struct work_struct *work)\n--\ndrivers/tty/serial/sh-sci.c-1692-\tdev_dbg(port-\u003edev, \"%s: %p: %u, cookie %d\\n\",\ndrivers/tty/serial/sh-sci.c:1693:\t\t__func__, tport-\u003exmit_buf, tail, s-\u003ecookie_tx);\ndrivers/tty/serial/sh-sci.c-1694-\n--\ndrivers/tty/serial/sh-sci.c=1805=static void sci_request_dma(struct uart_port *port)\n--\ndrivers/tty/serial/sh-sci.c-1836-\t\ts-\u003etx_dma_addr = dma_map_single(chan-\u003edevice-\u003edev,\ndrivers/tty/serial/sh-sci.c:1837:\t\t\t\t\t\ttport-\u003exmit_buf,\ndrivers/tty/serial/sh-sci.c-1838-\t\t\t\t\t\tUART_XMIT_SIZE,\n--\ndrivers/tty/serial/sh-sci.c-1845-\t\t\t\t__func__, UART_XMIT_SIZE,\ndrivers/tty/serial/sh-sci.c:1846:\t\t\t\ttport-\u003exmit_buf, \u0026s-\u003etx_dma_addr);\ndrivers/tty/serial/sh-sci.c-1847-\n"
} |
| 29/2 | 2026/08/30 08:27 | llm | patch-evaluator |
2mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 49688 output: 62 thoughts: 1269 Thoughts: **Patch Analysis: TTY and Serial Port Buffer Allocation** Okay, let's break this down. My initial thought was to look at how these buffer allocations work, specifically comparing `atmel_serial.c` and `pch_uart.c`. The `BUG_ON(!PAGE_ALIGNED)` check in `atmel_serial.c` immediately made me think about page alignment, which ties directly into the memory allocation strategies used. Seeing `virt_to_page` in `pch_uart.c` confirmed this focus, and I quickly recalled that `kzalloc` with `PAGE_SIZE` should, in theory, guarantee page-aligned allocations, regardless of the underlying allocator (SLUB or SLAB). In the case of SLUB, a `kmalloc-4k` object would be 4k aligned. However, the use of `virt_to_page` means we're dealing with `struct page` even for slab objects. But the more pressing question: *is this change worth fuzzing?* Let's carefully analyze the code changes. I'm seeing a pattern: the patch replaces `__get_free_page`/`free_page` with `kmalloc`/`kfree` and `get_zeroed_page`/`free_page` with `kzalloc`/`kfree` across `hvcs.c`, `serial_core.c`, and `tty_port.c`. Now, I'm referencing the rules for determining "WorthFuzzing." No documentation changes, no cosmetic logging, no constant modifications that don't change control flow, no unreachable code in emulated environments, and no vendor-specific hardware that is not emulated. This patch, specifically modifying the core kernel logic within `drivers/tty/serial/serial_core.c` and `drivers/tty/tty_port.c` – and to a lesser extent, `hvcs.c` – does appear to be worth fuzzing. The changes directly impact `tty_port_alloc_xmit_buf`, `tty_port_free_xmit_buf`, `uart_alloc_xmit_buf`, `uart_free_xmit_buf`, and `tty_port_destructor`. These are the core functions that handle allocation and destruction of transmit buffers for TTY and serial devices. These are *everywhere* in virtual environments; any serial console or tty port on QEMU, GCE, etc. can be exercised by the patch. Crucially, can this code be executed? Yes! Opening, writing to, or closing any serial port (like `/dev/ttyS0` or any pty/tty using tty_port transmit buffers) will execute these functions. Okay, next up: *FocusSymbols*. We need to identify key kernel functions for heavy fuzzing, avoiding generic hot-path functions. We want entrypoints that aren't static or inlined. Let's check the symbols in the modified code: - `tty_port_alloc_xmit_buf` - `tty_port_free_xmit_buf` - `tty_port_destroy` / `tty_port_destructor` - `uart_alloc_xmit_buf` (static but called by open/startup) - `uart_free_xmit_buf` (static but called by shutdown/close) - `hvcs_initialize` (static) From this list, the non-static or API entrypoints that would be useful are: - `tty_port_alloc_xmit_buf` (non-static) - `tty_port_free_xmit_buf` (non-static) - `uart_open`, `uart_startup`, `uart_shutdown`, or `uart_port_startup` (non-static). I need to confirm the export status of these `uart_*` and `tty_port_*` functions, but I'm leaning towards fuzzing those non-static functions as well as the open/close/startup paths. |
| 30/2 | 2026/08/30 08:29 | tool | grepper |
0mArgs:{
"Expression": "(uart_startup|uart_shutdown|uart_open|uart_close|tty_port_alloc_xmit_buf|tty_port_free_xmit_buf)",
"PathPrefix": "drivers/tty"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 653 lines.\nUse more precise expression if possible.\n\ndrivers/tty/mips_ejtag_fdc.c=696=static int mips_ejtag_fdc_tty_port_activate(struct tty_port *port,\n--\ndrivers/tty/mips_ejtag_fdc.c-703-\t/* Allocate the buffer we use for writing data */\ndrivers/tty/mips_ejtag_fdc.c:704:\tif (tty_port_alloc_xmit_buf(port) \u003c 0)\ndrivers/tty/mips_ejtag_fdc.c-705-\t\tgoto err;\n--\ndrivers/tty/mips_ejtag_fdc.c-717-err_free_xmit:\ndrivers/tty/mips_ejtag_fdc.c:718:\ttty_port_free_xmit_buf(port);\ndrivers/tty/mips_ejtag_fdc.c-719-err:\n--\ndrivers/tty/mips_ejtag_fdc.c=723=static void mips_ejtag_fdc_tty_port_shutdown(struct tty_port *port)\n--\ndrivers/tty/mips_ejtag_fdc.c-751-\t/* Free the write buffer */\ndrivers/tty/mips_ejtag_fdc.c:752:\ttty_port_free_xmit_buf(port);\ndrivers/tty/mips_ejtag_fdc.c-753-}\n--\ndrivers/tty/mxser.c=718=static int mxser_activate(struct tty_port *port, struct tty_struct *tty)\n--\ndrivers/tty/mxser.c-723-\ndrivers/tty/mxser.c:724:\tret = tty_port_alloc_xmit_buf(port);\ndrivers/tty/mxser.c-725-\tif (ret \u003c 0)\n--\ndrivers/tty/mxser.c-801-err_free_xmit:\ndrivers/tty/mxser.c:802:\ttty_port_free_xmit_buf(port);\ndrivers/tty/mxser.c-803-\treturn ret;\n--\ndrivers/tty/mxser.c=823=static void mxser_shutdown_port(struct tty_port *port)\n--\ndrivers/tty/mxser.c-851-\ndrivers/tty/mxser.c:852:\ttty_port_free_xmit_buf(port);\ndrivers/tty/mxser.c-853-}\n--\ndrivers/tty/serial/8250/8250_aspeed_vuart.c=231=static void aspeed_vuart_set_host_tx_discard(struct aspeed_vuart *vuart,\n--\ndrivers/tty/serial/8250/8250_aspeed_vuart.c-246-\ndrivers/tty/serial/8250/8250_aspeed_vuart.c:247:static int aspeed_vuart_startup(struct uart_port *uart_port)\ndrivers/tty/serial/8250/8250_aspeed_vuart.c-248-{\n--\ndrivers/tty/serial/8250/8250_aspeed_vuart.c-261-\ndrivers/tty/serial/8250/8250_aspeed_vuart.c:262:static void aspeed_vuart_shutdown(struct uart_port *uart_port)\ndrivers/tty/serial/8250/8250_aspeed_vuart.c-263-{\n--\ndrivers/tty/serial/8250/8250_aspeed_vuart.c=415=static int aspeed_vuart_probe(struct platform_device *pdev)\n--\ndrivers/tty/serial/8250/8250_aspeed_vuart.c-443-\tport.port.mapsize = resource_size(res);\ndrivers/tty/serial/8250/8250_aspeed_vuart.c:444:\tport.port.startup = aspeed_vuart_startup;\ndrivers/tty/serial/8250/8250_aspeed_vuart.c:445:\tport.port.shutdown = aspeed_vuart_shutdown;\ndrivers/tty/serial/8250/8250_aspeed_vuart.c-446-\tport.port.throttle = aspeed_vuart_throttle;\n--\ndrivers/tty/serial/8250/8250_bcm7271.c=553=static irqreturn_t brcmuart_isr(int irq, void *dev_id)\n--\ndrivers/tty/serial/8250/8250_bcm7271.c-584-\ndrivers/tty/serial/8250/8250_bcm7271.c:585:static int brcmuart_startup(struct uart_port *port)\ndrivers/tty/serial/8250/8250_bcm7271.c-586-{\n--\ndrivers/tty/serial/8250/8250_bcm7271.c-622-\ndrivers/tty/serial/8250/8250_bcm7271.c:623:static void brcmuart_shutdown(struct uart_port *port)\ndrivers/tty/serial/8250/8250_bcm7271.c-624-{\n--\ndrivers/tty/serial/8250/8250_bcm7271.c=952=static int brcmuart_probe(struct platform_device *pdev)\n--\ndrivers/tty/serial/8250/8250_bcm7271.c-1060-\ndrivers/tty/serial/8250/8250_bcm7271.c:1061:\tup.port.shutdown = brcmuart_shutdown;\ndrivers/tty/serial/8250/8250_bcm7271.c:1062:\tup.port.startup = brcmuart_startup;\ndrivers/tty/serial/8250/8250_bcm7271.c-1063-\tup.port.throttle = brcmuart_throttle;\n--\ndrivers/tty/serial/altera_jtaguart.c=160=static void altera_jtaguart_config_port(struct uart_port *port, int flags)\n--\ndrivers/tty/serial/altera_jtaguart.c-167-\ndrivers/tty/serial/altera_jtaguart.c:168:static int altera_jtaguart_startup(struct uart_port *port)\ndrivers/tty/serial/altera_jtaguart.c-169-{\n--\ndrivers/tty/serial/altera_jtaguart.c-192-\ndrivers/tty/serial/altera_jtaguart.c:193:static void altera_jtaguart_shutdown(struct uart_port *port)\ndrivers/tty/serial/altera_jtaguart.c-194-{\n--\ndrivers/tty/serial/altera_jtaguart.c=236=static const struct uart_ops altera_jtaguart_ops = {\n--\ndrivers/tty/serial/altera_jtaguart.c-243-\t.break_ctl\t= altera_jtaguart_break_ctl,\ndrivers/tty/serial/altera_jtaguart.c:244:\t.startup\t= altera_jtaguart_startup,\ndrivers/tty/serial/altera_jtaguart.c:245:\t.shutdown\t= altera_jtaguart_shutdown,\ndrivers/tty/serial/altera_jtaguart.c-246-\t.set_termios\t= altera_jtaguart_set_termios,\n--\ndrivers/tty/serial/altera_uart.c=285=static void altera_uart_config_port(struct uart_port *port, int flags)\n--\ndrivers/tty/serial/altera_uart.c-294-\ndrivers/tty/serial/altera_uart.c:295:static int altera_uart_startup(struct uart_port *port)\ndrivers/tty/serial/altera_uart.c-296-{\n--\ndrivers/tty/serial/altera_uart.c-325-\ndrivers/tty/serial/altera_uart.c:326:static void altera_uart_shutdown(struct uart_port *port)\ndrivers/tty/serial/altera_uart.c-327-{\n--\ndrivers/tty/serial/altera_uart.c=392=static const struct uart_ops altera_uart_ops = {\n--\ndrivers/tty/serial/altera_uart.c-399-\t.break_ctl\t= altera_uart_break_ctl,\ndrivers/tty/serial/altera_uart.c:400:\t.startup\t= altera_uart_startup,\ndrivers/tty/serial/altera_uart.c:401:\t.shutdown\t= altera_uart_shutdown,\ndrivers/tty/serial/altera_uart.c-402-\t.set_termios\t= altera_uart_set_termios,\n--\ndrivers/tty/serial/amba-pl011.c=1970=static int pl011_startup(struct uart_port *port)\n--\ndrivers/tty/serial/amba-pl011.c-2016-\ndrivers/tty/serial/amba-pl011.c:2017:static int sbsa_uart_startup(struct uart_port *port)\ndrivers/tty/serial/amba-pl011.c-2018-{\n--\ndrivers/tty/serial/amba-pl011.c=2085=static void pl011_shutdown(struct uart_port *port)\n--\ndrivers/tty/serial/amba-pl011.c-2128-\ndrivers/tty/serial/amba-pl011.c:2129:static void sbsa_uart_shutdown(struct uart_port *port)\ndrivers/tty/serial/amba-pl011.c-2130-{\n--\ndrivers/tty/serial/amba-pl011.c=2449=static const struct uart_ops sbsa_uart_pops = {\n--\ndrivers/tty/serial/amba-pl011.c-2455-\t.stop_rx\t= pl011_stop_rx,\ndrivers/tty/serial/amba-pl011.c:2456:\t.startup\t= sbsa_uart_startup,\ndrivers/tty/serial/amba-pl011.c:2457:\t.shutdown\t= sbsa_uart_shutdown,\ndrivers/tty/serial/amba-pl011.c-2458-\t.set_termios\t= sbsa_uart_set_termios,\n--\ndrivers/tty/serial/apbuart.c=166=static void apbuart_break_ctl(struct uart_port *port, int break_state)\n--\ndrivers/tty/serial/apbuart.c-170-\ndrivers/tty/serial/apbuart.c:171:static int apbuart_startup(struct uart_port *port)\ndrivers/tty/serial/apbuart.c-172-{\n--\ndrivers/tty/serial/apbuart.c-189-\ndrivers/tty/serial/apbuart.c:190:static void apbuart_shutdown(struct uart_port *port)\ndrivers/tty/serial/apbuart.c-191-{\n--\ndrivers/tty/serial/apbuart.c=295=static const struct uart_ops grlib_apbuart_ops = {\n--\ndrivers/tty/serial/apbuart.c-302-\t.break_ctl = apbuart_break_ctl,\ndrivers/tty/serial/apbuart.c:303:\t.startup = apbuart_startup,\ndrivers/tty/serial/apbuart.c:304:\t.shutdown = apbuart_shutdown,\ndrivers/tty/serial/apbuart.c-305-\t.set_termios = apbuart_set_termios,\n--\ndrivers/tty/serial/ar933x_uart.c=443=static irqreturn_t ar933x_uart_interrupt(int irq, void *dev_id)\n--\ndrivers/tty/serial/ar933x_uart.c-474-\ndrivers/tty/serial/ar933x_uart.c:475:static int ar933x_uart_startup(struct uart_port *port)\ndrivers/tty/serial/ar933x_uart.c-476-{\n--\ndrivers/tty/serial/ar933x_uart.c-504-\ndrivers/tty/serial/ar933x_uart.c:505:static void ar933x_uart_shutdown(struct uart_port *port)\ndrivers/tty/serial/ar933x_uart.c-506-{\n--\ndrivers/tty/serial/ar933x_uart.c=621=static const struct uart_ops ar933x_uart_ops = {\n--\ndrivers/tty/serial/ar933x_uart.c-628-\t.break_ctl\t= ar933x_uart_break_ctl,\ndrivers/tty/serial/ar933x_uart.c:629:\t.startup\t= ar933x_uart_startup,\ndrivers/tty/serial/ar933x_uart.c:630:\t.shutdown\t= ar933x_uart_shutdown,\ndrivers/tty/serial/ar933x_uart.c-631-\t.set_termios\t= ar933x_uart_set_termios,\n--\ndrivers/tty/serial/atmel_serial.c=2066=static void atmel_serial_pm(struct uart_port *port, unsigned int state,\n--\ndrivers/tty/serial/atmel_serial.c-2074-\t\t * Enable the peripheral clock for this serial port.\ndrivers/tty/serial/atmel_serial.c:2075:\t\t * This is called on uart_open() or a resume event.\ndrivers/tty/serial/atmel_serial.c-2076-\t\t */\n--\ndrivers/tty/serial/atmel_serial.c-2088-\t\t * Disable the peripheral clock for this serial port.\ndrivers/tty/serial/atmel_serial.c:2089:\t\t * This is called on uart_close() or a suspend event.\ndrivers/tty/serial/atmel_serial.c-2090-\t\t */\n--\ndrivers/tty/serial/bcm63xx_uart.c=390=static void bcm_uart_flush(struct uart_port *port)\n--\ndrivers/tty/serial/bcm63xx_uart.c-406- */\ndrivers/tty/serial/bcm63xx_uart.c:407:static int bcm_uart_startup(struct uart_port *port)\ndrivers/tty/serial/bcm63xx_uart.c-408-{\n--\ndrivers/tty/serial/bcm63xx_uart.c-451- */\ndrivers/tty/serial/bcm63xx_uart.c:452:static void bcm_uart_shutdown(struct uart_port *port)\ndrivers/tty/serial/bcm63xx_uart.c-453-{\n--\ndrivers/tty/serial/bcm63xx_uart.c=636=static const struct uart_ops bcm_uart_ops = {\n--\ndrivers/tty/serial/bcm63xx_uart.c-644-\t.break_ctl\t= bcm_uart_break_ctl,\ndrivers/tty/serial/bcm63xx_uart.c:645:\t.startup\t= bcm_uart_startup,\ndrivers/tty/serial/bcm63xx_uart.c:646:\t.shutdown\t= bcm_uart_shutdown,\ndrivers/tty/serial/bcm63xx_uart.c-647-\t.set_termios\t= bcm_uart_set_termios,\n--\ndrivers/tty/serial/cpm_uart.c=354=static irqreturn_t cpm_uart_int(int irq, void *data)\n--\ndrivers/tty/serial/cpm_uart.c-385-\ndrivers/tty/serial/cpm_uart.c:386:static int cpm_uart_startup(struct uart_port *port)\ndrivers/tty/serial/cpm_uart.c-387-{\n--\ndrivers/tty/serial/cpm_uart.c=433=inline void cpm_uart_wait_until_send(struct uart_cpm_port *pinfo)\n--\ndrivers/tty/serial/cpm_uart.c-441- */\ndrivers/tty/serial/cpm_uart.c:442:static void cpm_uart_shutdown(struct uart_port *port)\ndrivers/tty/serial/cpm_uart.c-443-{\n--\ndrivers/tty/serial/cpm_uart.c=1179=static const struct uart_ops cpm_uart_pops = {\n--\ndrivers/tty/serial/cpm_uart.c-1186-\t.break_ctl\t= cpm_uart_break_ctl,\ndrivers/tty/serial/cpm_uart.c:1187:\t.startup\t= cpm_uart_startup,\ndrivers/tty/serial/cpm_uart.c:1188:\t.shutdown\t= cpm_uart_shutdown,\ndrivers/tty/serial/cpm_uart.c-1189-\t.set_termios\t= cpm_uart_set_termios,\n--\ndrivers/tty/serial/digicolor-usart.c=249=static void digicolor_uart_break_ctl(struct uart_port *port, int state)\n--\ndrivers/tty/serial/digicolor-usart.c-252-\ndrivers/tty/serial/digicolor-usart.c:253:static int digicolor_uart_startup(struct uart_port *port)\ndrivers/tty/serial/digicolor-usart.c-254-{\n--\ndrivers/tty/serial/digicolor-usart.c-276-\ndrivers/tty/serial/digicolor-usart.c:277:static void digicolor_uart_shutdown(struct uart_port *port)\ndrivers/tty/serial/digicolor-usart.c-278-{\n--\ndrivers/tty/serial/digicolor-usart.c=367=static const struct uart_ops digicolor_uart_ops = {\n--\ndrivers/tty/serial/digicolor-usart.c-374-\t.break_ctl\t= digicolor_uart_break_ctl,\ndrivers/tty/serial/digicolor-usart.c:375:\t.startup\t= digicolor_uart_startup,\ndrivers/tty/serial/digicolor-usart.c:376:\t.shutdown\t= digicolor_uart_shutdown,\ndrivers/tty/serial/digicolor-usart.c-377-\t.set_termios\t= digicolor_uart_set_termios,\n--\ndrivers/tty/serial/fsl_lpuart.c=1815=static void lpuart_hw_setup(struct lpuart_port *sport)\n--\ndrivers/tty/serial/fsl_lpuart.c-1828-\ndrivers/tty/serial/fsl_lpuart.c:1829:static int lpuart_startup(struct uart_port *port)\ndrivers/tty/serial/fsl_lpuart.c-1830-{\n--\ndrivers/tty/serial/fsl_lpuart.c=1921=static void lpuart_dma_shutdown(struct lpuart_port *sport)\n--\ndrivers/tty/serial/fsl_lpuart.c-1942-\ndrivers/tty/serial/fsl_lpuart.c:1943:static void lpuart_shutdown(struct uart_port *port)\ndrivers/tty/serial/fsl_lpuart.c-1944-{\n--\ndrivers/tty/serial/fsl_lpuart.c=2440=static const struct uart_ops lpuart_pops = {\n--\ndrivers/tty/serial/fsl_lpuart.c-2447-\t.break_ctl\t= lpuart_break_ctl,\ndrivers/tty/serial/fsl_lpuart.c:2448:\t.startup\t= lpuart_startup,\ndrivers/tty/serial/fsl_lpuart.c:2449:\t.shutdown\t= lpuart_shutdown,\ndrivers/tty/serial/fsl_lpuart.c-2450-\t.set_termios\t= lpuart_set_termios,\n--\ndrivers/tty/serial/imx.c=1454=static void imx_uart_disable_dma(struct imx_port *sport)\n--\ndrivers/tty/serial/imx.c-1470-\ndrivers/tty/serial/imx.c:1471:static int imx_uart_startup(struct uart_port *port)\ndrivers/tty/serial/imx.c-1472-{\n--\ndrivers/tty/serial/imx.c-1590-\ndrivers/tty/serial/imx.c:1591:static void imx_uart_shutdown(struct uart_port *port)\ndrivers/tty/serial/imx.c-1592-{\n--\ndrivers/tty/serial/imx.c=2059=static const struct uart_ops imx_uart_pops = {\n--\ndrivers/tty/serial/imx.c-2067-\t.break_ctl\t= imx_uart_break_ctl,\ndrivers/tty/serial/imx.c:2068:\t.startup\t= imx_uart_startup,\ndrivers/tty/serial/imx.c:2069:\t.shutdown\t= imx_uart_shutdown,\ndrivers/tty/serial/imx.c-2070-\t.flush_buffer\t= imx_uart_flush_buffer,\n--\ndrivers/tty/serial/ip22zilog.c=724=static int ip22zilog_startup(struct uart_port *port)\n--\ndrivers/tty/serial/ip22zilog.c-748- * \u003e is open by kernel initially, this is not accounted\ndrivers/tty/serial/ip22zilog.c:749: * \u003e as an open, and uart_startup is not called.\ndrivers/tty/serial/ip22zilog.c-750- *\ndrivers/tty/serial/ip22zilog.c:751: * That is correct. We are unable to call uart_startup when the serial\ndrivers/tty/serial/ip22zilog.c-752- * console is initialised because it may need to allocate memory (as\n--\ndrivers/tty/serial/liteuart.c=176=static unsigned int liteuart_get_mctrl(struct uart_port *port)\n--\ndrivers/tty/serial/liteuart.c-180-\ndrivers/tty/serial/liteuart.c:181:static int liteuart_startup(struct uart_port *port)\ndrivers/tty/serial/liteuart.c-182-{\n--\ndrivers/tty/serial/liteuart.c-210-\ndrivers/tty/serial/liteuart.c:211:static void liteuart_shutdown(struct uart_port *port)\ndrivers/tty/serial/liteuart.c-212-{\n--\ndrivers/tty/serial/liteuart.c=265=static const struct uart_ops liteuart_ops = {\n--\ndrivers/tty/serial/liteuart.c-271-\t.stop_rx\t= liteuart_stop_rx,\ndrivers/tty/serial/liteuart.c:272:\t.startup\t= liteuart_startup,\ndrivers/tty/serial/liteuart.c:273:\t.shutdown\t= liteuart_shutdown,\ndrivers/tty/serial/liteuart.c-274-\t.set_termios\t= liteuart_set_termios,\n--\ndrivers/tty/serial/meson_uart.c=116=static void meson_uart_stop_rx(struct uart_port *port)\n--\ndrivers/tty/serial/meson_uart.c-124-\ndrivers/tty/serial/meson_uart.c:125:static void meson_uart_shutdown(struct uart_port *port)\ndrivers/tty/serial/meson_uart.c-126-{\n--\ndrivers/tty/serial/meson_uart.c=267=static void meson_uart_reset(struct uart_port *port)\n--\ndrivers/tty/serial/meson_uart.c-278-\ndrivers/tty/serial/meson_uart.c:279:static int meson_uart_startup(struct uart_port *port)\ndrivers/tty/serial/meson_uart.c-280-{\n--\ndrivers/tty/serial/meson_uart.c=512=static const struct uart_ops meson_uart_ops = {\n--\ndrivers/tty/serial/meson_uart.c-518-\t.stop_rx\t= meson_uart_stop_rx,\ndrivers/tty/serial/meson_uart.c:519:\t.startup\t= meson_uart_startup,\ndrivers/tty/serial/meson_uart.c:520:\t.shutdown\t= meson_uart_shutdown,\ndrivers/tty/serial/meson_uart.c-521-\t.set_termios\t= meson_uart_set_termios,\n--\ndrivers/tty/serial/mpc52xx_uart.c=1117=static int\ndrivers/tty/serial/mpc52xx_uart.c:1118:mpc52xx_uart_startup(struct uart_port *port)\ndrivers/tty/serial/mpc52xx_uart.c-1119-{\n--\ndrivers/tty/serial/mpc52xx_uart.c=1155=static void\ndrivers/tty/serial/mpc52xx_uart.c:1156:mpc52xx_uart_shutdown(struct uart_port *port)\ndrivers/tty/serial/mpc52xx_uart.c-1157-{\n--\ndrivers/tty/serial/mpc52xx_uart.c=1350=static const struct uart_ops mpc52xx_uart_ops = {\n--\ndrivers/tty/serial/mpc52xx_uart.c-1358-\t.break_ctl\t= mpc52xx_uart_break_ctl,\ndrivers/tty/serial/mpc52xx_uart.c:1359:\t.startup\t= mpc52xx_uart_startup,\ndrivers/tty/serial/mpc52xx_uart.c:1360:\t.shutdown\t= mpc52xx_uart_shutdown,\ndrivers/tty/serial/mpc52xx_uart.c-1361-\t.set_termios\t= mpc52xx_uart_set_termios,\n--\ndrivers/tty/serial/mps2-uart.c=252=static irqreturn_t mps2_uart_combinedirq(int irq, void *data)\n--\ndrivers/tty/serial/mps2-uart.c-265-\ndrivers/tty/serial/mps2-uart.c:266:static int mps2_uart_startup(struct uart_port *port)\ndrivers/tty/serial/mps2-uart.c-267-{\n--\ndrivers/tty/serial/mps2-uart.c-322-\ndrivers/tty/serial/mps2-uart.c:323:static void mps2_uart_shutdown(struct uart_port *port)\ndrivers/tty/serial/mps2-uart.c-324-{\n--\ndrivers/tty/serial/mps2-uart.c=395=static const struct uart_ops mps2_uart_pops = {\n--\ndrivers/tty/serial/mps2-uart.c-402-\t.break_ctl = mps2_uart_break_ctl,\ndrivers/tty/serial/mps2-uart.c:403:\t.startup = mps2_uart_startup,\ndrivers/tty/serial/mps2-uart.c:404:\t.shutdown = mps2_uart_shutdown,\ndrivers/tty/serial/mps2-uart.c-405-\t.set_termios = mps2_uart_set_termios,\n--\ndrivers/tty/serial/mvebu-uart.c=370=static irqreturn_t mvebu_uart_tx_isr(int irq, void *dev_id)\n--\ndrivers/tty/serial/mvebu-uart.c-380-\ndrivers/tty/serial/mvebu-uart.c:381:static int mvebu_uart_startup(struct uart_port *port)\ndrivers/tty/serial/mvebu-uart.c-382-{\n--\ndrivers/tty/serial/mvebu-uart.c-430-\ndrivers/tty/serial/mvebu-uart.c:431:static void mvebu_uart_shutdown(struct uart_port *port)\ndrivers/tty/serial/mvebu-uart.c-432-{\n--\ndrivers/tty/serial/mvebu-uart.c=628=static const struct uart_ops mvebu_uart_ops = {\n--\ndrivers/tty/serial/mvebu-uart.c-635-\t.break_ctl\t= mvebu_uart_break_ctl,\ndrivers/tty/serial/mvebu-uart.c:636:\t.startup\t= mvebu_uart_startup,\ndrivers/tty/serial/mvebu-uart.c:637:\t.shutdown\t= mvebu_uart_shutdown,\ndrivers/tty/serial/mvebu-uart.c-638-\t.set_termios\t= mvebu_uart_set_termios,\n--\ndrivers/tty/serial/mxs-auart.c=1141=static void mxs_auart_reset_assert(struct mxs_auart_port *s)\n--\ndrivers/tty/serial/mxs-auart.c-1164-\ndrivers/tty/serial/mxs-auart.c:1165:static int mxs_auart_startup(struct uart_port *u)\ndrivers/tty/serial/mxs-auart.c-1166-{\n--\ndrivers/tty/serial/mxs-auart.c-1202-\ndrivers/tty/serial/mxs-auart.c:1203:static void mxs_auart_shutdown(struct uart_port *u)\ndrivers/tty/serial/mxs-auart.c-1204-{\n--\ndrivers/tty/serial/mxs-auart.c=1270=static const struct uart_ops mxs_auart_ops = {\n--\ndrivers/tty/serial/mxs-auart.c-1278-\t.get_mctrl = mxs_auart_get_mctrl,\ndrivers/tty/serial/mxs-auart.c:1279:\t.startup\t= mxs_auart_startup,\ndrivers/tty/serial/mxs-auart.c:1280:\t.shutdown = mxs_auart_shutdown,\ndrivers/tty/serial/mxs-auart.c-1281-\t.set_termios = mxs_auart_settermios,\n--\ndrivers/tty/serial/owl-uart.c=232=static irqreturn_t owl_uart_irq(int irq, void *dev_id)\n--\ndrivers/tty/serial/owl-uart.c-255-\ndrivers/tty/serial/owl-uart.c:256:static void owl_uart_shutdown(struct uart_port *port)\ndrivers/tty/serial/owl-uart.c-257-{\n--\ndrivers/tty/serial/owl-uart.c-272-\ndrivers/tty/serial/owl-uart.c:273:static int owl_uart_startup(struct uart_port *port)\ndrivers/tty/serial/owl-uart.c-274-{\n--\ndrivers/tty/serial/owl-uart.c=474=static const struct uart_ops owl_uart_ops = {\n--\ndrivers/tty/serial/owl-uart.c-480-\t.stop_tx = owl_uart_stop_tx,\ndrivers/tty/serial/owl-uart.c:481:\t.startup = owl_uart_startup,\ndrivers/tty/serial/owl-uart.c:482:\t.shutdown = owl_uart_shutdown,\ndrivers/tty/serial/owl-uart.c-483-\t.set_termios = owl_uart_set_termios,\n--\ndrivers/tty/serial/pch_uart.c=1189=static void pch_uart_break_ctl(struct uart_port *port, int ctl)\n--\ndrivers/tty/serial/pch_uart.c-1200-/* Grab any interrupt resources and initialise any low level driver state. */\ndrivers/tty/serial/pch_uart.c:1201:static int pch_uart_startup(struct uart_port *port)\ndrivers/tty/serial/pch_uart.c-1202-{\n--\ndrivers/tty/serial/pch_uart.c-1276-\ndrivers/tty/serial/pch_uart.c:1277:static void pch_uart_shutdown(struct uart_port *port)\ndrivers/tty/serial/pch_uart.c-1278-{\n--\ndrivers/tty/serial/pch_uart.c=1518=static const struct uart_ops pch_uart_ops = {\n--\ndrivers/tty/serial/pch_uart.c-1526-\t.break_ctl = pch_uart_break_ctl,\ndrivers/tty/serial/pch_uart.c:1527:\t.startup = pch_uart_startup,\ndrivers/tty/serial/pch_uart.c:1528:\t.shutdown = pch_uart_shutdown,\ndrivers/tty/serial/pch_uart.c-1529-\t.set_termios = pch_uart_set_termios,\n--\ndrivers/tty/serial/pic32_uart.c=437=static void pic32_uart_dsbl_and_mask(struct uart_port *port)\n--\ndrivers/tty/serial/pic32_uart.c-450-/* serial core request to initialize uart and start rx operation */\ndrivers/tty/serial/pic32_uart.c:451:static int pic32_uart_startup(struct uart_port *port)\ndrivers/tty/serial/pic32_uart.c-452-{\n--\ndrivers/tty/serial/pic32_uart.c-574-/* serial core request to flush \u0026 disable uart */\ndrivers/tty/serial/pic32_uart.c:575:static void pic32_uart_shutdown(struct uart_port *port)\ndrivers/tty/serial/pic32_uart.c-576-{\n--\ndrivers/tty/serial/pic32_uart.c=743=static const struct uart_ops pic32_uart_ops = {\n--\ndrivers/tty/serial/pic32_uart.c-750-\t.break_ctl\t= pic32_uart_break_ctl,\ndrivers/tty/serial/pic32_uart.c:751:\t.startup\t= pic32_uart_startup,\ndrivers/tty/serial/pic32_uart.c:752:\t.shutdown\t= pic32_uart_shutdown,\ndrivers/tty/serial/pic32_uart.c-753-\t.set_termios\t= pic32_uart_set_termios,\n--\ndrivers/tty/serial/rda-uart.c=401=static irqreturn_t rda_interrupt(int irq, void *dev_id)\n--\ndrivers/tty/serial/rda-uart.c-427-\ndrivers/tty/serial/rda-uart.c:428:static int rda_uart_startup(struct uart_port *port)\ndrivers/tty/serial/rda-uart.c-429-{\n--\ndrivers/tty/serial/rda-uart.c-458-\ndrivers/tty/serial/rda-uart.c:459:static void rda_uart_shutdown(struct uart_port *port)\ndrivers/tty/serial/rda-uart.c-460-{\n--\ndrivers/tty/serial/rda-uart.c=553=static const struct uart_ops rda_uart_ops = {\n--\ndrivers/tty/serial/rda-uart.c-559-\t.stop_rx = rda_uart_stop_rx,\ndrivers/tty/serial/rda-uart.c:560:\t.startup = rda_uart_startup,\ndrivers/tty/serial/rda-uart.c:561:\t.shutdown = rda_uart_shutdown,\ndrivers/tty/serial/rda-uart.c-562-\t.set_termios = rda_uart_set_termios,\n--\ndrivers/tty/serial/rp2.c=487=static inline void rp2_flush_fifos(struct rp2_uart_port *up)\n--\ndrivers/tty/serial/rp2.c-496-\ndrivers/tty/serial/rp2.c:497:static int rp2_uart_startup(struct uart_port *port)\ndrivers/tty/serial/rp2.c-498-{\n--\ndrivers/tty/serial/rp2.c-510-\ndrivers/tty/serial/rp2.c:511:static void rp2_uart_shutdown(struct uart_port *port)\ndrivers/tty/serial/rp2.c-512-{\n--\ndrivers/tty/serial/rp2.c=555=static const struct uart_ops rp2_uart_ops = {\n--\ndrivers/tty/serial/rp2.c-563-\t.break_ctl\t= rp2_uart_break_ctl,\ndrivers/tty/serial/rp2.c:564:\t.startup\t= rp2_uart_startup,\ndrivers/tty/serial/rp2.c:565:\t.shutdown\t= rp2_uart_shutdown,\ndrivers/tty/serial/rp2.c-566-\t.set_termios\t= rp2_uart_set_termios,\n--\ndrivers/tty/serial/serial-tegra.c=1141=static int tegra_uart_dma_channel_allocate(struct tegra_uart_port *tup,\n--\ndrivers/tty/serial/serial-tegra.c-1204-\ndrivers/tty/serial/serial-tegra.c:1205:static int tegra_uart_startup(struct uart_port *u)\ndrivers/tty/serial/serial-tegra.c-1206-{\n--\ndrivers/tty/serial/serial-tegra.c=1258=static void tegra_uart_flush_buffer(struct uart_port *u)\n--\ndrivers/tty/serial/serial-tegra.c-1266-\ndrivers/tty/serial/serial-tegra.c:1267:static void tegra_uart_shutdown(struct uart_port *u)\ndrivers/tty/serial/serial-tegra.c-1268-{\n--\ndrivers/tty/serial/serial-tegra.c=1398=static const struct uart_ops tegra_uart_ops = {\n--\ndrivers/tty/serial/serial-tegra.c-1407-\t.break_ctl\t= tegra_uart_break_ctl,\ndrivers/tty/serial/serial-tegra.c:1408:\t.startup\t= tegra_uart_startup,\ndrivers/tty/serial/serial-tegra.c:1409:\t.shutdown\t= tegra_uart_shutdown,\ndrivers/tty/serial/serial-tegra.c-1410-\t.set_termios\t= tegra_uart_set_termios,\n--\ndrivers/tty/serial/serial_core.c=304=static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,\n--\ndrivers/tty/serial/serial_core.c-355-\ndrivers/tty/serial/serial_core.c:356:static int uart_startup(struct tty_struct *tty, struct uart_state *state,\ndrivers/tty/serial/serial_core.c-357-\t\t\tbool init_hw)\n--\ndrivers/tty/serial/serial_core.c-384- * DTR is dropped if the hangup on close termio flag is on. Calls to\ndrivers/tty/serial/serial_core.c:385: * uart_shutdown are serialised by the per-port semaphore.\ndrivers/tty/serial/serial_core.c-386- *\n--\ndrivers/tty/serial/serial_core.c-388- */\ndrivers/tty/serial/serial_core.c:389:static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)\ndrivers/tty/serial/serial_core.c-390-{\n--\ndrivers/tty/serial/serial_core.c=888=static int uart_set_info(struct tty_struct *tty, struct tty_port *port,\n--\ndrivers/tty/serial/serial_core.c-979-\t\t */\ndrivers/tty/serial/serial_core.c:980:\t\tuart_shutdown(tty, state);\ndrivers/tty/serial/serial_core.c-981-\t}\n--\ndrivers/tty/serial/serial_core.c-1023-\ndrivers/tty/serial/serial_core.c:1024:\tretval = uart_startup(tty, state, true);\ndrivers/tty/serial/serial_core.c-1025-\tif (retval \u003c 0)\n--\ndrivers/tty/serial/serial_core.c=1131=static int uart_do_autoconfig(struct tty_struct *tty, struct uart_state *state)\n--\ndrivers/tty/serial/serial_core.c-1152-\ndrivers/tty/serial/serial_core.c:1153:\t\tuart_shutdown(tty, state);\ndrivers/tty/serial/serial_core.c-1154-\n--\ndrivers/tty/serial/serial_core.c-1171-\ndrivers/tty/serial/serial_core.c:1172:\t\tret = uart_startup(tty, state, true);\ndrivers/tty/serial/serial_core.c-1173-\t\tif (ret \u003c 0)\n--\n\n"
} |
| 31/2 | 2026/08/30 08:29 | llm | patch-evaluator |
1mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 62723 output: 34 thoughts: 41 Thoughts: Okay, let's dive into this. Here's how I'd approach this task, as if these were my internal thoughts: **Analyzing Serial Driver Entry Points** Alright, I need to get a better handle on the serial driver architecture. I'm going to quickly scan `serial_core.c` and `tty_port.c`. My initial focus is on identifying all the primary entry points and what functionalities they provide, and how they relate. Specifically in `serial_core.c`, I'm looking for the operations and exported functions that dictate the basic functionality and structure. Knowing the exported symbols is going to give me the best insight into the core API exposed by that module. Let's see what the initial interface looks like. |
| 32/2 | 2026/08/30 08:31 | tool | grepper |
0mArgs:{
"Expression": "EXPORT_SYMBOL",
"PathPrefix": "drivers/tty/serial/serial_core.c"
}Results: {
"Output": "drivers/tty/serial/serial_core.c=114=void uart_write_wakeup(struct uart_port *port)\n--\ndrivers/tty/serial/serial_core.c-123-}\ndrivers/tty/serial/serial_core.c:124:EXPORT_SYMBOL(uart_write_wakeup);\ndrivers/tty/serial/serial_core.c-125-\n--\ndrivers/tty/serial/serial_core.c=446=uart_update_timeout(struct uart_port *port, unsigned int cflag,\n--\ndrivers/tty/serial/serial_core.c-453-}\ndrivers/tty/serial/serial_core.c:454:EXPORT_SYMBOL(uart_update_timeout);\ndrivers/tty/serial/serial_core.c-455-\n--\ndrivers/tty/serial/serial_core.c=478=uart_get_baud_rate(struct uart_port *port, struct ktermios *termios,\n--\ndrivers/tty/serial/serial_core.c-550-}\ndrivers/tty/serial/serial_core.c:551:EXPORT_SYMBOL(uart_get_baud_rate);\ndrivers/tty/serial/serial_core.c-552-\n--\ndrivers/tty/serial/serial_core.c=567=uart_get_divisor(struct uart_port *port, unsigned int baud)\n--\ndrivers/tty/serial/serial_core.c-580-}\ndrivers/tty/serial/serial_core.c:581:EXPORT_SYMBOL(uart_get_divisor);\ndrivers/tty/serial/serial_core.c-582-\n--\ndrivers/tty/serial/serial_core.c=695=void uart_xchar_out(struct uart_port *uport, int offset)\n--\ndrivers/tty/serial/serial_core.c-700-}\ndrivers/tty/serial/serial_core.c:701:EXPORT_SYMBOL_GPL(uart_xchar_out);\ndrivers/tty/serial/serial_core.c-702-\n--\ndrivers/tty/serial/serial_core.c=1966=bool uart_iotype_mmio(enum uart_iotype iotype)\n--\ndrivers/tty/serial/serial_core.c-1979-}\ndrivers/tty/serial/serial_core.c:1980:EXPORT_SYMBOL_GPL(uart_iotype_mmio);\ndrivers/tty/serial/serial_core.c-1981-\ndrivers/tty/serial/serial_core.c=1982=bool uart_iotype_io(enum uart_iotype iotype)\n--\ndrivers/tty/serial/serial_core.c-1991-}\ndrivers/tty/serial/serial_core.c:1992:EXPORT_SYMBOL_GPL(uart_iotype_io);\ndrivers/tty/serial/serial_core.c-1993-\n--\ndrivers/tty/serial/serial_core.c=2097=void uart_console_write(struct uart_port *port, const char *s,\n--\ndrivers/tty/serial/serial_core.c-2108-}\ndrivers/tty/serial/serial_core.c:2109:EXPORT_SYMBOL_GPL(uart_console_write);\ndrivers/tty/serial/serial_core.c-2110-\n--\ndrivers/tty/serial/serial_core.c=2130=int uart_parse_earlycon(char *p, enum uart_iotype *iotype,\n--\ndrivers/tty/serial/serial_core.c-2169-}\ndrivers/tty/serial/serial_core.c:2170:EXPORT_SYMBOL_GPL(uart_parse_earlycon);\ndrivers/tty/serial/serial_core.c-2171-\n--\ndrivers/tty/serial/serial_core.c=2185=uart_parse_options(const char *options, int *baud, int *parity,\n--\ndrivers/tty/serial/serial_core.c-2199-}\ndrivers/tty/serial/serial_core.c:2200:EXPORT_SYMBOL_GPL(uart_parse_options);\ndrivers/tty/serial/serial_core.c-2201-\n--\ndrivers/tty/serial/serial_core.c=2215=uart_set_options(struct uart_port *port, struct console *co,\n--\ndrivers/tty/serial/serial_core.c-2283-}\ndrivers/tty/serial/serial_core.c:2284:EXPORT_SYMBOL_GPL(uart_set_options);\ndrivers/tty/serial/serial_core.c-2285-#endif /* CONFIG_SERIAL_CORE_CONSOLE */\n--\ndrivers/tty/serial/serial_core.c=2322=int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)\n--\ndrivers/tty/serial/serial_core.c-2396-}\ndrivers/tty/serial/serial_core.c:2397:EXPORT_SYMBOL(uart_suspend_port);\ndrivers/tty/serial/serial_core.c-2398-\ndrivers/tty/serial/serial_core.c=2399=int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)\n--\ndrivers/tty/serial/serial_core.c-2485-}\ndrivers/tty/serial/serial_core.c:2486:EXPORT_SYMBOL(uart_resume_port);\ndrivers/tty/serial/serial_core.c-2487-\n--\ndrivers/tty/serial/serial_core.c=2503=void uart_get_ioinfos(struct uart_port *port, char *buf, size_t size)\n--\ndrivers/tty/serial/serial_core.c-2515-}\ndrivers/tty/serial/serial_core.c:2516:EXPORT_SYMBOL(uart_get_ioinfos);\ndrivers/tty/serial/serial_core.c-2517-\n--\ndrivers/tty/serial/serial_core.c=2760=int uart_register_driver(struct uart_driver *drv)\n--\ndrivers/tty/serial/serial_core.c-2820-}\ndrivers/tty/serial/serial_core.c:2821:EXPORT_SYMBOL(uart_register_driver);\ndrivers/tty/serial/serial_core.c-2822-\n--\ndrivers/tty/serial/serial_core.c=2833=void uart_unregister_driver(struct uart_driver *drv)\n--\ndrivers/tty/serial/serial_core.c-2845-}\ndrivers/tty/serial/serial_core.c:2846:EXPORT_SYMBOL(uart_unregister_driver);\ndrivers/tty/serial/serial_core.c-2847-\ndrivers/tty/serial/serial_core.c=2848=struct tty_driver *uart_console_device(struct console *co, int *index)\n--\ndrivers/tty/serial/serial_core.c-2853-}\ndrivers/tty/serial/serial_core.c:2854:EXPORT_SYMBOL_GPL(uart_console_device);\ndrivers/tty/serial/serial_core.c-2855-\n--\ndrivers/tty/serial/serial_core.c=3244=bool uart_match_port(const struct uart_port *port1,\n--\ndrivers/tty/serial/serial_core.c-3259-}\ndrivers/tty/serial/serial_core.c:3260:EXPORT_SYMBOL(uart_match_port);\ndrivers/tty/serial/serial_core.c-3261-\n--\ndrivers/tty/serial/serial_core.c=3400=void uart_handle_dcd_change(struct uart_port *uport, bool active)\n--\ndrivers/tty/serial/serial_core.c-3425-}\ndrivers/tty/serial/serial_core.c:3426:EXPORT_SYMBOL_GPL(uart_handle_dcd_change);\ndrivers/tty/serial/serial_core.c-3427-\n--\ndrivers/tty/serial/serial_core.c=3435=void uart_handle_cts_change(struct uart_port *uport, bool active)\n--\ndrivers/tty/serial/serial_core.c-3456-}\ndrivers/tty/serial/serial_core.c:3457:EXPORT_SYMBOL_GPL(uart_handle_cts_change);\ndrivers/tty/serial/serial_core.c-3458-\n--\ndrivers/tty/serial/serial_core.c=3471=void uart_insert_char(struct uart_port *port, unsigned int status,\n--\ndrivers/tty/serial/serial_core.c-3487-}\ndrivers/tty/serial/serial_core.c:3488:EXPORT_SYMBOL_GPL(uart_insert_char);\ndrivers/tty/serial/serial_core.c-3489-\n--\ndrivers/tty/serial/serial_core.c=3514=bool uart_try_toggle_sysrq(struct uart_port *port, u8 ch)\n--\ndrivers/tty/serial/serial_core.c-3536-}\ndrivers/tty/serial/serial_core.c:3537:EXPORT_SYMBOL_GPL(uart_try_toggle_sysrq);\ndrivers/tty/serial/serial_core.c-3538-#endif\n--\ndrivers/tty/serial/serial_core.c=3547=int uart_get_rs485_mode(struct uart_port *port)\n--\ndrivers/tty/serial/serial_core.c-3621-}\ndrivers/tty/serial/serial_core.c:3622:EXPORT_SYMBOL_GPL(uart_get_rs485_mode);\ndrivers/tty/serial/serial_core.c-3623-\n"
} |
| 33/2 | 2026/08/30 08:31 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 65421 output: 39 thoughts: 93 Thoughts: Okay, let's break this down. **Analyzing UART Operations in `serial_core.c`** Alright, I need to get a clear picture of how UART operations are handled in `serial_core.c`. My focus is on the `uart_ops` structure. Specifically, I'm going to look at implementations for functions such as `uart_open`, `uart_close`, `uart_write`, `uart_put_char`, `uart_hangup`, and `uart_install`. These are the core building blocks, and understanding their roles is key. I'll need to carefully examine the surrounding code around the `uart_ops` definition within the `drivers/tty/serial/serial_core.c` file. This should give me the context I need. |
| 34/2 | 2026/08/30 08:31 | tool | grepper |
0mArgs:{
"Expression": "struct tty_operations uart_ops",
"PathPrefix": "drivers/tty/serial/serial_core.c"
}Results: {
"Output": "drivers/tty/serial/serial_core.c=2685=static void uart_poll_put_char(struct tty_driver *driver, int line, char ch)\n--\ndrivers/tty/serial/serial_core.c-2701-\ndrivers/tty/serial/serial_core.c:2702:static const struct tty_operations uart_ops = {\ndrivers/tty/serial/serial_core.c-2703-\t.install\t= uart_install,\n"
} |
| 35/2 | 2026/08/30 08:31 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 65850 output: 40 thoughts: 25 Thoughts: Here's my summary, as though I'm thinking through this process: **Diving into the `uart_ops` Structure** Okay, time to dissect this `uart_ops` structure. I need to get a clear picture of what's inside and how it's defined within the serial core. Right, so, I'm heading over to `drivers/tty/serial/serial_core.c` – that's where the heart of the serial driver logic usually resides. I expect to find the declaration of `uart_ops` there, and I need to see what fields it contains. What operations are provided, what callbacks are available? Are there any unexpected or interesting members I should note? This is foundational to understanding the architecture of any serial driver that uses this core, so I need to make sure I grasp the components. This will give a good idea of which hardware interfaces it provides and it should offer a high-level view of how a specific UART implementation interacts with the core. Let's see what secrets this structure holds. |
| 36/2 | 2026/08/30 08:32 | tool | read-file |
0mArgs:{
"File": "drivers/tty/serial/serial_core.c",
"FirstLine": 2700,
"LineCount": 35
}Results: {
"Contents": "2700:\t#endif\n2701:\t\n2702:\tstatic const struct tty_operations uart_ops = {\n2703:\t\t.install\t= uart_install,\n2704:\t\t.open\t\t= uart_open,\n2705:\t\t.close\t\t= uart_close,\n2706:\t\t.write\t\t= uart_write,\n2707:\t\t.put_char\t= uart_put_char,\n2708:\t\t.flush_chars\t= uart_flush_chars,\n2709:\t\t.write_room\t= uart_write_room,\n2710:\t\t.chars_in_buffer= uart_chars_in_buffer,\n2711:\t\t.flush_buffer\t= uart_flush_buffer,\n2712:\t\t.ioctl\t\t= uart_ioctl,\n2713:\t\t.throttle\t= uart_throttle,\n2714:\t\t.unthrottle\t= uart_unthrottle,\n2715:\t\t.send_xchar\t= uart_send_xchar,\n2716:\t\t.set_termios\t= uart_set_termios,\n2717:\t\t.set_ldisc\t= uart_set_ldisc,\n2718:\t\t.stop\t\t= uart_stop,\n2719:\t\t.start\t\t= uart_start,\n2720:\t\t.hangup\t\t= uart_hangup,\n2721:\t\t.break_ctl\t= uart_break_ctl,\n2722:\t\t.wait_until_sent= uart_wait_until_sent,\n2723:\t#ifdef CONFIG_PROC_FS\n2724:\t\t.proc_show\t= uart_proc_show,\n2725:\t#endif\n2726:\t\t.tiocmget\t= uart_tiocmget,\n2727:\t\t.tiocmset\t= uart_tiocmset,\n2728:\t\t.set_serial\t= uart_set_info_user,\n2729:\t\t.get_serial\t= uart_get_info_user,\n2730:\t\t.get_icount\t= uart_get_icount,\n2731:\t#ifdef CONFIG_CONSOLE_POLL\n2732:\t\t.poll_init\t= uart_poll_init,\n2733:\t\t.poll_get_char\t= uart_poll_get_char,\n2734:\t\t.poll_put_char\t= uart_poll_put_char,\n"
} |
| 37/2 | 2026/08/30 08:32 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 66765 output: 32 thoughts: 19 Thoughts: Here's my take on those thoughts, tailored for an expert audience: **Diving into `tty_port.c` Exported Symbols** Okay, so we're looking at serial drivers, and I want to get a complete picture. Let's dig a little deeper into the exposed interfaces of the `tty_port.c` file. I'm thinking beyond just the core TTY layer abstractions and focusing on how these drivers actually interact with it. What symbols are they *really* making available for other parts of the kernel to leverage? Any potential surprises, or things that might inform future design decisions? Need to make sure I don't miss anything. Gotta make sure I'm thinking about how the symbols might play into potential lock contention, power management interactions, or DMA strategies, which are all key in this area. It's time to pull up the source and start grepping to find the critical exported function declarations. |
| 38/2 | 2026/08/30 08:32 | tool | grepper |
0mArgs:{
"Expression": "EXPORT_SYMBOL",
"PathPrefix": "drivers/tty/tty_port.c"
}Results: {
"Output": "drivers/tty/tty_port.c=70=const struct tty_port_client_operations tty_port_default_client_ops = {\n--\ndrivers/tty/tty_port.c-74-};\ndrivers/tty/tty_port.c:75:EXPORT_SYMBOL_GPL(tty_port_default_client_ops);\ndrivers/tty/tty_port.c-76-\n--\ndrivers/tty/tty_port.c=86=void tty_port_init(struct tty_port *port)\n--\ndrivers/tty/tty_port.c-99-}\ndrivers/tty/tty_port.c:100:EXPORT_SYMBOL(tty_port_init);\ndrivers/tty/tty_port.c-101-\n--\ndrivers/tty/tty_port.c=113=void tty_port_link_wq(struct tty_port *port, struct workqueue_struct *flip_wq)\n--\ndrivers/tty/tty_port.c-116-}\ndrivers/tty/tty_port.c:117:EXPORT_SYMBOL_GPL(tty_port_link_wq);\ndrivers/tty/tty_port.c-118-\n--\ndrivers/tty/tty_port.c=130=void tty_port_link_device(struct tty_port *port,\n--\ndrivers/tty/tty_port.c-136-}\ndrivers/tty/tty_port.c:137:EXPORT_SYMBOL_GPL(tty_port_link_device);\ndrivers/tty/tty_port.c-138-\n--\ndrivers/tty/tty_port.c=150=struct device *tty_port_register_device(struct tty_port *port,\n--\ndrivers/tty/tty_port.c-155-}\ndrivers/tty/tty_port.c:156:EXPORT_SYMBOL_GPL(tty_port_register_device);\ndrivers/tty/tty_port.c-157-\n--\ndrivers/tty/tty_port.c=171=struct device *tty_port_register_device_attr(struct tty_port *port,\n--\ndrivers/tty/tty_port.c-180-}\ndrivers/tty/tty_port.c:181:EXPORT_SYMBOL_GPL(tty_port_register_device_attr);\ndrivers/tty/tty_port.c-182-\n--\ndrivers/tty/tty_port.c=196=struct device *tty_port_register_device_attr_serdev(struct tty_port *port,\n--\ndrivers/tty/tty_port.c-214-}\ndrivers/tty/tty_port.c:215:EXPORT_SYMBOL_GPL(tty_port_register_device_attr_serdev);\ndrivers/tty/tty_port.c-216-\n--\ndrivers/tty/tty_port.c=227=void tty_port_unregister_device(struct tty_port *port,\n--\ndrivers/tty/tty_port.c-238-}\ndrivers/tty/tty_port.c:239:EXPORT_SYMBOL_GPL(tty_port_unregister_device);\ndrivers/tty/tty_port.c-240-\ndrivers/tty/tty_port.c=241=int tty_port_alloc_xmit_buf(struct tty_port *port)\n--\ndrivers/tty/tty_port.c-256-}\ndrivers/tty/tty_port.c:257:EXPORT_SYMBOL(tty_port_alloc_xmit_buf);\ndrivers/tty/tty_port.c-258-\ndrivers/tty/tty_port.c=259=void tty_port_free_xmit_buf(struct tty_port *port)\n--\ndrivers/tty/tty_port.c-265-}\ndrivers/tty/tty_port.c:266:EXPORT_SYMBOL(tty_port_free_xmit_buf);\ndrivers/tty/tty_port.c-267-\n--\ndrivers/tty/tty_port.c=276=void tty_port_destroy(struct tty_port *port)\n--\ndrivers/tty/tty_port.c-281-}\ndrivers/tty/tty_port.c:282:EXPORT_SYMBOL(tty_port_destroy);\ndrivers/tty/tty_port.c-283-\n--\ndrivers/tty/tty_port.c=306=void tty_port_put(struct tty_port *port)\n--\ndrivers/tty/tty_port.c-310-}\ndrivers/tty/tty_port.c:311:EXPORT_SYMBOL(tty_port_put);\ndrivers/tty/tty_port.c-312-\n--\ndrivers/tty/tty_port.c=320=struct tty_struct *tty_port_tty_get(struct tty_port *port)\n--\ndrivers/tty/tty_port.c-324-}\ndrivers/tty/tty_port.c:325:EXPORT_SYMBOL(tty_port_tty_get);\ndrivers/tty/tty_port.c-326-\n--\ndrivers/tty/tty_port.c=335=void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty)\n--\ndrivers/tty/tty_port.c-340-}\ndrivers/tty/tty_port.c:341:EXPORT_SYMBOL(tty_port_tty_set);\ndrivers/tty/tty_port.c-342-\n--\ndrivers/tty/tty_port.c=384=void tty_port_hangup(struct tty_port *port)\n--\ndrivers/tty/tty_port.c-401-}\ndrivers/tty/tty_port.c:402:EXPORT_SYMBOL(tty_port_hangup);\ndrivers/tty/tty_port.c-403-\ndrivers/tty/tty_port.c=404=void __tty_port_tty_hangup(struct tty_port *port, bool check_clocal, bool async)\n--\ndrivers/tty/tty_port.c-416-}\ndrivers/tty/tty_port.c:417:EXPORT_SYMBOL_GPL(__tty_port_tty_hangup);\ndrivers/tty/tty_port.c-418-\n--\ndrivers/tty/tty_port.c=423=void tty_port_tty_wakeup(struct tty_port *port)\n--\ndrivers/tty/tty_port.c-426-}\ndrivers/tty/tty_port.c:427:EXPORT_SYMBOL_GPL(tty_port_tty_wakeup);\ndrivers/tty/tty_port.c-428-\n--\ndrivers/tty/tty_port.c=437=bool tty_port_carrier_raised(struct tty_port *port)\n--\ndrivers/tty/tty_port.c-442-}\ndrivers/tty/tty_port.c:443:EXPORT_SYMBOL(tty_port_carrier_raised);\ndrivers/tty/tty_port.c-444-\n--\ndrivers/tty/tty_port.c=453=void tty_port_raise_dtr_rts(struct tty_port *port)\n--\ndrivers/tty/tty_port.c-457-}\ndrivers/tty/tty_port.c:458:EXPORT_SYMBOL(tty_port_raise_dtr_rts);\ndrivers/tty/tty_port.c-459-\n--\ndrivers/tty/tty_port.c=468=void tty_port_lower_dtr_rts(struct tty_port *port)\n--\ndrivers/tty/tty_port.c-472-}\ndrivers/tty/tty_port.c:473:EXPORT_SYMBOL(tty_port_lower_dtr_rts);\ndrivers/tty/tty_port.c-474-\n--\ndrivers/tty/tty_port.c=500=int tty_port_block_til_ready(struct tty_port *port,\n--\ndrivers/tty/tty_port.c-582-}\ndrivers/tty/tty_port.c:583:EXPORT_SYMBOL(tty_port_block_til_ready);\ndrivers/tty/tty_port.c-584-\n--\ndrivers/tty/tty_port.c=614=int tty_port_close_start(struct tty_port *port,\n--\ndrivers/tty/tty_port.c-652-}\ndrivers/tty/tty_port.c:653:EXPORT_SYMBOL(tty_port_close_start);\ndrivers/tty/tty_port.c-654-\n--\ndrivers/tty/tty_port.c=666=void tty_port_close_end(struct tty_port *port, struct tty_struct *tty)\n--\ndrivers/tty/tty_port.c-684-}\ndrivers/tty/tty_port.c:685:EXPORT_SYMBOL(tty_port_close_end);\ndrivers/tty/tty_port.c-686-\n--\ndrivers/tty/tty_port.c=700=void tty_port_close(struct tty_port *port, struct tty_struct *tty,\n--\ndrivers/tty/tty_port.c-710-}\ndrivers/tty/tty_port.c:711:EXPORT_SYMBOL(tty_port_close);\ndrivers/tty/tty_port.c-712-\n--\ndrivers/tty/tty_port.c=723=int tty_port_install(struct tty_port *port, struct tty_driver *driver,\n--\ndrivers/tty/tty_port.c-729-}\ndrivers/tty/tty_port.c:730:EXPORT_SYMBOL_GPL(tty_port_install);\ndrivers/tty/tty_port.c-731-\n--\ndrivers/tty/tty_port.c=751=int tty_port_open(struct tty_port *port, struct tty_struct *tty,\n--\ndrivers/tty/tty_port.c-776-}\ndrivers/tty/tty_port.c:777:EXPORT_SYMBOL(tty_port_open);\n"
} |
| 39/2 | 2026/08/30 08:32 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 69563 output: 28 thoughts: 87 Thoughts: **Kconfig Dependency Review for TTY Drivers** Okay, let's dive into the Kconfig dependencies for these TTY drivers. Specifically, I need to verify what options are necessary to build `drivers/tty/tty_port.c` and `drivers/tty/serial/serial_core.c`. First, I'll examine the `drivers/tty/Makefile`. I see that the object file `tty_port.o` is included under the `obj-$(CONFIG_TTY)` condition. So, `CONFIG_TTY` is clearly a prerequisite for this driver. Now, let's move on to the `drivers/tty/serial/Makefile` and see what's what there. |
| 40/2 | 2026/08/30 08:32 | tool | grepper |
0mArgs:{
"Expression": "serial_core",
"PathPrefix": "drivers/tty/serial"
}Results: {
"Output": "drivers/tty/serial/21285.c-13-#include \u003clinux/tty_flip.h\u003e\ndrivers/tty/serial/21285.c:14:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/21285.c-15-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/8250/8250.h-11-#include \u003clinux/serial_8250.h\u003e\ndrivers/tty/serial/8250/8250.h:12:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/8250/8250.h-13-#include \u003clinux/dmaengine.h\u003e\n--\ndrivers/tty/serial/8250/8250_acorn.c-9-#include \u003clinux/tty.h\u003e\ndrivers/tty/serial/8250/8250_acorn.c:10:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/8250/8250_acorn.c-11-#include \u003clinux/errno.h\u003e\n--\ndrivers/tty/serial/8250/8250_dwlib.c-11-#include \u003clinux/serial_8250.h\u003e\ndrivers/tty/serial/8250/8250_dwlib.c:12:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/8250/8250_dwlib.c-13-\n--\ndrivers/tty/serial/8250/8250_exar.c-26-#include \u003clinux/serial_8250.h\u003e\ndrivers/tty/serial/8250/8250_exar.c:27:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/8250/8250_exar.c-28-#include \u003clinux/serial_reg.h\u003e\n--\ndrivers/tty/serial/8250/8250_fintek.c-10-#include \u003clinux/kernel.h\u003e\ndrivers/tty/serial/8250/8250_fintek.c:11:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/8250/8250_fintek.c-12-#include \u003clinux/irq.h\u003e\n--\ndrivers/tty/serial/8250/8250_ingenic.c-17-#include \u003clinux/serial_8250.h\u003e\ndrivers/tty/serial/8250/8250_ingenic.c:18:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/8250/8250_ingenic.c-19-#include \u003clinux/serial_reg.h\u003e\n--\ndrivers/tty/serial/8250/8250_keba.c-16-#include \u003clinux/module.h\u003e\ndrivers/tty/serial/8250/8250_keba.c:17:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/8250/8250_keba.c-18-#include \u003clinux/spinlock.h\u003e\n--\ndrivers/tty/serial/8250/8250_men_mcb.c-7-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/8250/8250_men_mcb.c:8:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/8250/8250_men_mcb.c-9-#include \u003clinux/serial_8250.h\u003e\n--\ndrivers/tty/serial/8250/8250_ni.c-21-#include \u003clinux/property.h\u003e\ndrivers/tty/serial/8250/8250_ni.c:22:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/8250/8250_ni.c-23-#include \u003clinux/types.h\u003e\n--\ndrivers/tty/serial/8250/8250_of.c-13-#include \u003clinux/slab.h\u003e\ndrivers/tty/serial/8250/8250_of.c:14:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/8250/8250_of.c-15-#include \u003clinux/serial_reg.h\u003e\n--\ndrivers/tty/serial/8250/8250_parisc.c-12-#include \u003clinux/module.h\u003e\ndrivers/tty/serial/8250/8250_parisc.c:13:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/8250/8250_parisc.c-14-#include \u003clinux/signal.h\u003e\n--\ndrivers/tty/serial/8250/8250_pci.c-18-#include \u003clinux/serial_reg.h\u003e\ndrivers/tty/serial/8250/8250_pci.c:19:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/8250/8250_pci.c-20-#include \u003clinux/8250_pci.h\u003e\n--\ndrivers/tty/serial/8250/8250_pci1xxxx.c-24-#include \u003clinux/pm.h\u003e\ndrivers/tty/serial/8250/8250_pci1xxxx.c:25:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/8250/8250_pci1xxxx.c-26-#include \u003clinux/serial_reg.h\u003e\n--\ndrivers/tty/serial/8250/8250_pnp.c-17-#include \u003clinux/property.h\u003e\ndrivers/tty/serial/8250/8250_pnp.c:18:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/8250/8250_pnp.c-19-#include \u003clinux/bitops.h\u003e\n--\ndrivers/tty/serial/8250/8250_pxa.c-17-#include \u003clinux/serial_8250.h\u003e\ndrivers/tty/serial/8250/8250_pxa.c:18:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/8250/8250_pxa.c-19-#include \u003clinux/serial_reg.h\u003e\n--\ndrivers/tty/serial/8250/serial_cs.c-41-#include \u003clinux/timer.h\u003e\ndrivers/tty/serial/8250/serial_cs.c:42:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/8250/serial_cs.c-43-#include \u003clinux/delay.h\u003e\n--\ndrivers/tty/serial/Makefile=6=obj-$(CONFIG_SERIAL_CORE) += serial_base.o\ndrivers/tty/serial/Makefile:7:serial_base-y := serial_core.o serial_base_bus.o serial_ctrl.o serial_port.o\ndrivers/tty/serial/Makefile-8-\n--\ndrivers/tty/serial/altera_jtaguart.c-21-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/altera_jtaguart.c:22:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/altera_jtaguart.c-23-#include \u003clinux/platform_device.h\u003e\n--\ndrivers/tty/serial/altera_uart.c-20-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/altera_uart.c:21:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/altera_uart.c-22-#include \u003clinux/platform_device.h\u003e\n--\ndrivers/tty/serial/amba-pl010.c-25-#include \u003clinux/tty_flip.h\u003e\ndrivers/tty/serial/amba-pl010.c:26:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/amba-pl010.c-27-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/amba-pl011.c-27-#include \u003clinux/tty_flip.h\u003e\ndrivers/tty/serial/amba-pl011.c:28:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/amba-pl011.c-29-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/apbuart.c-26-#include \u003clinux/io.h\u003e\ndrivers/tty/serial/apbuart.c:27:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/apbuart.c-28-#include \u003casm/irq.h\u003e\n--\ndrivers/tty/serial/ar933x_uart.c-21-#include \u003clinux/tty_flip.h\u003e\ndrivers/tty/serial/ar933x_uart.c:22:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/ar933x_uart.c-23-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/arc_uart.c-30-#include \u003clinux/tty_flip.h\u003e\ndrivers/tty/serial/arc_uart.c:31:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/arc_uart.c-32-#include \u003clinux/io.h\u003e\n--\ndrivers/tty/serial/atmel_serial.c-51-\ndrivers/tty/serial/atmel_serial.c:52:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/atmel_serial.c-53-\n--\ndrivers/tty/serial/bcm63xx_uart.c-23-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/bcm63xx_uart.c:24:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/bcm63xx_uart.c-25-#include \u003clinux/serial_bcm63xx.h\u003e\n--\ndrivers/tty/serial/clps711x.c-13-#include \u003clinux/console.h\u003e\ndrivers/tty/serial/clps711x.c:14:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/clps711x.c-15-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/cpm_uart.c-40-\ndrivers/tty/serial/cpm_uart.c:41:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/cpm_uart.c-42-#include \u003clinux/kernel.h\u003e\n--\ndrivers/tty/serial/digicolor-usart.c-11-#include \u003clinux/console.h\u003e\ndrivers/tty/serial/digicolor-usart.c:12:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/digicolor-usart.c-13-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/dz.c-44-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/dz.c:45:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/dz.c-46-#include \u003clinux/sysrq.h\u003e\n--\ndrivers/tty/serial/earlycon-riscv-sbi.c-9-#include \u003clinux/init.h\u003e\ndrivers/tty/serial/earlycon-riscv-sbi.c:10:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/earlycon-riscv-sbi.c-11-#include \u003casm/sbi.h\u003e\n--\ndrivers/tty/serial/earlycon-semihost.c-12-#include \u003clinux/init.h\u003e\ndrivers/tty/serial/earlycon-semihost.c:13:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/earlycon-semihost.c-14-#include \u003casm/semihost.h\u003e\n--\ndrivers/tty/serial/earlycon.c-16-#include \u003clinux/io.h\u003e\ndrivers/tty/serial/earlycon.c:17:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/earlycon.c-18-#include \u003clinux/sizes.h\u003e\n--\ndrivers/tty/serial/fsl_linflexuart.c-14-#include \u003clinux/platform_device.h\u003e\ndrivers/tty/serial/fsl_linflexuart.c:15:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/fsl_linflexuart.c-16-#include \u003clinux/slab.h\u003e\n--\ndrivers/tty/serial/fsl_lpuart.c-25-#include \u003clinux/pm_runtime.h\u003e\ndrivers/tty/serial/fsl_lpuart.c:26:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/fsl_lpuart.c-27-#include \u003clinux/slab.h\u003e\n--\ndrivers/tty/serial/icom.c-21-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/icom.c:22:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/icom.c-23-#include \u003clinux/serial_reg.h\u003e\n--\ndrivers/tty/serial/imx.c-19-#include \u003clinux/tty_flip.h\u003e\ndrivers/tty/serial/imx.c:20:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/imx.c-21-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/imx_earlycon.c-8-#include \u003clinux/init.h\u003e\ndrivers/tty/serial/imx_earlycon.c:9:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/imx_earlycon.c-10-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/ip22zilog.c-41-\ndrivers/tty/serial/ip22zilog.c:42:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/ip22zilog.c-43-\n--\ndrivers/tty/serial/jsm/jsm.h-18-#include \u003clinux/tty.h\u003e\ndrivers/tty/serial/jsm/jsm.h:19:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/jsm/jsm.h-20-#include \u003clinux/device.h\u003e\n--\ndrivers/tty/serial/kgdboc.c-24-#include \u003clinux/platform_device.h\u003e\ndrivers/tty/serial/kgdboc.c:25:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/kgdboc.c-26-\n--\ndrivers/tty/serial/lantiq.c-22-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/lantiq.c:23:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/lantiq.c-24-#include \u003clinux/slab.h\u003e\n--\ndrivers/tty/serial/liteuart.c-15-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/liteuart.c:16:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/liteuart.c-17-#include \u003clinux/slab.h\u003e\n--\ndrivers/tty/serial/lpc32xx_hs.c-18-#include \u003clinux/tty_flip.h\u003e\ndrivers/tty/serial/lpc32xx_hs.c:19:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/lpc32xx_hs.c-20-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/ma35d1_serial.c-12-#include \u003clinux/iopoll.h\u003e\ndrivers/tty/serial/ma35d1_serial.c:13:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/ma35d1_serial.c-14-#include \u003clinux/slab.h\u003e\n--\ndrivers/tty/serial/max3100.c-26-#include \u003clinux/property.h\u003e\ndrivers/tty/serial/max3100.c:27:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/max3100.c-28-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/max310x.c-21-#include \u003clinux/regmap.h\u003e\ndrivers/tty/serial/max310x.c:22:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/max310x.c-23-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/mcf.c-19-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/mcf.c:20:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/mcf.c-21-#include \u003clinux/io.h\u003e\n--\ndrivers/tty/serial/men_z135_uart.c-12-#include \u003clinux/interrupt.h\u003e\ndrivers/tty/serial/men_z135_uart.c:13:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/men_z135_uart.c-14-#include \u003clinux/ioport.h\u003e\n--\ndrivers/tty/serial/meson_uart.c-18-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/meson_uart.c:19:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/meson_uart.c-20-#include \u003clinux/tty.h\u003e\n--\ndrivers/tty/serial/milbeaut_usio.c-10-#include \u003clinux/platform_device.h\u003e\ndrivers/tty/serial/milbeaut_usio.c:11:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/milbeaut_usio.c-12-#include \u003clinux/tty.h\u003e\n--\ndrivers/tty/serial/mpc52xx_uart.c-48-\ndrivers/tty/serial/mpc52xx_uart.c:49:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/mpc52xx_uart.c-50-\n--\ndrivers/tty/serial/mps2-uart.c-20-#include \u003clinux/platform_device.h\u003e\ndrivers/tty/serial/mps2-uart.c:21:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/mps2-uart.c-22-#include \u003clinux/tty_flip.h\u003e\n--\ndrivers/tty/serial/msm_serial.c-22-#include \u003clinux/tty_flip.h\u003e\ndrivers/tty/serial/msm_serial.c:23:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/msm_serial.c-24-#include \u003clinux/slab.h\u003e\n--\ndrivers/tty/serial/mux.c-28-#include \u003clinux/sysrq.h\u003e\ndrivers/tty/serial/mux.c:29:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/mux.c-30-\n--\ndrivers/tty/serial/mvebu-uart.c-25-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/mvebu-uart.c:26:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/mvebu-uart.c-27-#include \u003clinux/slab.h\u003e\n--\ndrivers/tty/serial/mxs-auart.c-26-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/mxs-auart.c:27:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/mxs-auart.c-28-#include \u003clinux/platform_device.h\u003e\n--\ndrivers/tty/serial/omap-serial.c-30-#include \u003clinux/clk.h\u003e\ndrivers/tty/serial/omap-serial.c:31:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/omap-serial.c-32-#include \u003clinux/irq.h\u003e\n--\ndrivers/tty/serial/owl-uart.c-19-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/owl-uart.c:20:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/owl-uart.c-21-#include \u003clinux/tty.h\u003e\n--\ndrivers/tty/serial/pch_uart.c-11-#include \u003clinux/console.h\u003e\ndrivers/tty/serial/pch_uart.c:12:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/pch_uart.c-13-#include \u003clinux/tty.h\u003e\n--\ndrivers/tty/serial/pic32_uart.c-22-#include \u003clinux/tty_flip.h\u003e\ndrivers/tty/serial/pic32_uart.c:23:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/pic32_uart.c-24-#include \u003clinux/delay.h\u003e\n--\ndrivers/tty/serial/pmac_zilog.c-61-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/pmac_zilog.c:62:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/pmac_zilog.c-63-\n--\ndrivers/tty/serial/pxa.c-34-#include \u003clinux/tty_flip.h\u003e\ndrivers/tty/serial/pxa.c:35:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/pxa.c-36-#include \u003clinux/clk.h\u003e\n--\ndrivers/tty/serial/qcom_geni_serial.c-29-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/qcom_geni_serial.c:30:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/qcom_geni_serial.c-31-#include \u003clinux/slab.h\u003e\n--\ndrivers/tty/serial/rda-uart.c-17-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/rda-uart.c:18:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/rda-uart.c-19-#include \u003clinux/tty.h\u003e\n--\ndrivers/tty/serial/rp2.c-30-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/rp2.c:31:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/rp2.c-32-#include \u003clinux/slab.h\u003e\n--\ndrivers/tty/serial/rsci.c-10-#include \u003clinux/module.h\u003e\ndrivers/tty/serial/rsci.c:11:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/rsci.c-12-#include \u003clinux/serial_sci.h\u003e\n--\ndrivers/tty/serial/sa1100.c-18-#include \u003clinux/tty_flip.h\u003e\ndrivers/tty/serial/sa1100.c:19:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/sa1100.c-20-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/samsung_tty.c-37-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/samsung_tty.c:38:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/samsung_tty.c-39-#include \u003clinux/serial_s3c.h\u003e\n--\ndrivers/tty/serial/sb1250-duart.c-28-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/sb1250-duart.c:29:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/sb1250-duart.c-30-#include \u003clinux/spinlock.h\u003e\n--\ndrivers/tty/serial/sc16is7xx.c-26-#include \u003clinux/sched.h\u003e\ndrivers/tty/serial/sc16is7xx.c:27:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/sc16is7xx.c-28-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/sccnxp.c-15-#include \u003clinux/console.h\u003e\ndrivers/tty/serial/sccnxp.c:16:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/sccnxp.c-17-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/serial-tegra.c-27-#include \u003clinux/serial_8250.h\u003e\ndrivers/tty/serial/serial-tegra.c:28:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/serial-tegra.c-29-#include \u003clinux/serial_reg.h\u003e\n--\ndrivers/tty/serial/serial_base.h=48=void serial_ctrl_unregister_port(struct uart_driver *drv, struct uart_port *port);\ndrivers/tty/serial/serial_base.h-49-\ndrivers/tty/serial/serial_base.h:50:int serial_core_register_port(struct uart_driver *drv, struct uart_port *port);\ndrivers/tty/serial/serial_base.h:51:void serial_core_unregister_port(struct uart_driver *drv, struct uart_port *port);\ndrivers/tty/serial/serial_base.h-52-\n--\ndrivers/tty/serial/serial_base_bus.c-16-#include \u003clinux/property.h\u003e\ndrivers/tty/serial/serial_base_bus.c:17:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/serial_base_bus.c-18-#include \u003clinux/slab.h\u003e\n--\ndrivers/tty/serial/serial_core.c-24-#include \u003clinux/serial.h\u003e /* for serial_state and serial_icounter_struct */\ndrivers/tty/serial/serial_core.c:25:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/serial_core.c-26-#include \u003clinux/sysrq.h\u003e\n--\ndrivers/tty/serial/serial_core.c=3074=static const struct attribute_group tty_dev_attr_group = {\n--\ndrivers/tty/serial/serial_core.c-3078-/**\ndrivers/tty/serial/serial_core.c:3079: * serial_core_add_one_port - attach a driver-defined port structure\ndrivers/tty/serial/serial_core.c-3080- * @drv: pointer to the uart low level driver structure for this port\n--\ndrivers/tty/serial/serial_core.c-3089- */\ndrivers/tty/serial/serial_core.c:3090:static int serial_core_add_one_port(struct uart_driver *drv, struct uart_port *uport)\ndrivers/tty/serial/serial_core.c-3091-{\n--\ndrivers/tty/serial/serial_core.c-3176-/**\ndrivers/tty/serial/serial_core.c:3177: * serial_core_remove_one_port - detach a driver defined port structure\ndrivers/tty/serial/serial_core.c-3178- * @drv: pointer to the uart low level driver structure for this port\n--\ndrivers/tty/serial/serial_core.c-3186- */\ndrivers/tty/serial/serial_core.c:3187:static void serial_core_remove_one_port(struct uart_driver *drv,\ndrivers/tty/serial/serial_core.c-3188-\t\t\t\t\tstruct uart_port *uport)\n--\ndrivers/tty/serial/serial_core.c=3262=static struct serial_ctrl_device *\ndrivers/tty/serial/serial_core.c:3263:serial_core_get_ctrl_dev(struct serial_port_device *port_dev)\ndrivers/tty/serial/serial_core.c-3264-{\n--\ndrivers/tty/serial/serial_core.c-3273- */\ndrivers/tty/serial/serial_core.c:3274:static struct serial_ctrl_device *serial_core_ctrl_find(struct uart_driver *drv,\ndrivers/tty/serial/serial_core.c-3275-\t\t\t\t\t\t\tstruct device *phys_dev,\n--\ndrivers/tty/serial/serial_core.c-3289-\t\t state-\u003euart_port-\u003ectrl_id == ctrl_id)\ndrivers/tty/serial/serial_core.c:3290:\t\t\treturn serial_core_get_ctrl_dev(state-\u003euart_port-\u003eport_dev);\ndrivers/tty/serial/serial_core.c-3291-\t}\n--\ndrivers/tty/serial/serial_core.c-3295-\ndrivers/tty/serial/serial_core.c:3296:static struct serial_ctrl_device *serial_core_ctrl_device_add(struct uart_port *port)\ndrivers/tty/serial/serial_core.c-3297-{\n--\ndrivers/tty/serial/serial_core.c-3300-\ndrivers/tty/serial/serial_core.c:3301:static int serial_core_port_device_add(struct serial_ctrl_device *ctrl_dev,\ndrivers/tty/serial/serial_core.c-3302-\t\t\t\t struct uart_port *port)\n--\ndrivers/tty/serial/serial_core.c-3317- */\ndrivers/tty/serial/serial_core.c:3318:int serial_core_register_port(struct uart_driver *drv, struct uart_port *port)\ndrivers/tty/serial/serial_core.c-3319-{\n--\ndrivers/tty/serial/serial_core.c-3326-\t * Prevent serial_port_runtime_resume() from trying to use the port\ndrivers/tty/serial/serial_core.c:3327:\t * until serial_core_add_one_port() has completed\ndrivers/tty/serial/serial_core.c-3328-\t */\n--\ndrivers/tty/serial/serial_core.c-3331-\t/* Inititalize a serial core controller device if needed */\ndrivers/tty/serial/serial_core.c:3332:\tctrl_dev = serial_core_ctrl_find(drv, port-\u003edev, port-\u003ectrl_id);\ndrivers/tty/serial/serial_core.c-3333-\tif (!ctrl_dev) {\ndrivers/tty/serial/serial_core.c:3334:\t\tnew_ctrl_dev = serial_core_ctrl_device_add(port);\ndrivers/tty/serial/serial_core.c-3335-\t\tif (IS_ERR(new_ctrl_dev))\n--\ndrivers/tty/serial/serial_core.c-3342-\t * serial_port_runtime_resume() trying to do anything until port has\ndrivers/tty/serial/serial_core.c:3343:\t * been registered. It gets cleared by serial_core_add_one_port().\ndrivers/tty/serial/serial_core.c-3344-\t */\ndrivers/tty/serial/serial_core.c:3345:\tret = serial_core_port_device_add(ctrl_dev, port);\ndrivers/tty/serial/serial_core.c-3346-\tif (ret)\n--\ndrivers/tty/serial/serial_core.c-3352-\ndrivers/tty/serial/serial_core.c:3353:\tret = serial_core_add_one_port(drv, port);\ndrivers/tty/serial/serial_core.c-3354-\tif (ret)\n--\ndrivers/tty/serial/serial_core.c-3371- */\ndrivers/tty/serial/serial_core.c:3372:void serial_core_unregister_port(struct uart_driver *drv, struct uart_port *port)\ndrivers/tty/serial/serial_core.c-3373-{\n--\ndrivers/tty/serial/serial_core.c-3375-\tstruct serial_port_device *port_dev = port-\u003eport_dev;\ndrivers/tty/serial/serial_core.c:3376:\tstruct serial_ctrl_device *ctrl_dev = serial_core_get_ctrl_dev(port_dev);\ndrivers/tty/serial/serial_core.c-3377-\tint ctrl_id = port-\u003ectrl_id;\n--\ndrivers/tty/serial/serial_core.c-3382-\ndrivers/tty/serial/serial_core.c:3383:\tserial_core_remove_one_port(drv, port);\ndrivers/tty/serial/serial_core.c-3384-\n--\ndrivers/tty/serial/serial_core.c-3388-\t/* Drop the serial core controller device if no ports are using it */\ndrivers/tty/serial/serial_core.c:3389:\tif (!serial_core_ctrl_find(drv, phys_dev, ctrl_id))\ndrivers/tty/serial/serial_core.c-3390-\t\tserial_base_ctrl_device_remove(ctrl_dev);\n--\ndrivers/tty/serial/serial_ctrl.c-15-#include \u003clinux/pm_runtime.h\u003e\ndrivers/tty/serial/serial_ctrl.c:16:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/serial_ctrl.c-17-#include \u003clinux/spinlock.h\u003e\n--\ndrivers/tty/serial/serial_ctrl.c=39=int serial_ctrl_register_port(struct uart_driver *drv, struct uart_port *port)\ndrivers/tty/serial/serial_ctrl.c-40-{\ndrivers/tty/serial/serial_ctrl.c:41:\treturn serial_core_register_port(drv, port);\ndrivers/tty/serial/serial_ctrl.c-42-}\n--\ndrivers/tty/serial/serial_ctrl.c=44=void serial_ctrl_unregister_port(struct uart_driver *drv, struct uart_port *port)\ndrivers/tty/serial/serial_ctrl.c-45-{\ndrivers/tty/serial/serial_ctrl.c:46:\tserial_core_unregister_port(drv, port);\ndrivers/tty/serial/serial_ctrl.c-47-}\n--\ndrivers/tty/serial/serial_mctrl_gpio.c-12-#include \u003clinux/termios.h\u003e\ndrivers/tty/serial/serial_mctrl_gpio.c:13:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/serial_mctrl_gpio.c-14-#include \u003clinux/module.h\u003e\n--\ndrivers/tty/serial/serial_port.c-15-#include \u003clinux/property.h\u003e\ndrivers/tty/serial/serial_port.c:16:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/serial_port.c-17-#include \u003clinux/spinlock.h\u003e\n--\ndrivers/tty/serial/serial_txx9.c-21-#include \u003clinux/pci.h\u003e\ndrivers/tty/serial/serial_txx9.c:22:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/serial_txx9.c-23-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/sh-sci-common.h-5-\ndrivers/tty/serial/sh-sci-common.h:6:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/sh-sci-common.h-7-\n--\ndrivers/tty/serial/sh-sci.c-44-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/sh-sci.c:45:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/sh-sci.c-46-#include \u003clinux/serial_sci.h\u003e\n--\ndrivers/tty/serial/sifive.c-40-#include \u003clinux/platform_device.h\u003e\ndrivers/tty/serial/sifive.c:41:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/sifive.c-42-#include \u003clinux/serial_reg.h\u003e\n--\ndrivers/tty/serial/sprd_serial.c-17-#include \u003clinux/platform_device.h\u003e\ndrivers/tty/serial/sprd_serial.c:18:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/sprd_serial.c-19-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/st-asc.c-21-#include \u003clinux/of_platform.h\u003e\ndrivers/tty/serial/st-asc.c:22:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/st-asc.c-23-#include \u003clinux/clk.h\u003e\n--\ndrivers/tty/serial/stm32-usart.c-28-#include \u003clinux/pm_wakeirq.h\u003e\ndrivers/tty/serial/stm32-usart.c:29:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/stm32-usart.c-30-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/suncore.c-18-#include \u003clinux/string.h\u003e\ndrivers/tty/serial/suncore.c:19:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/suncore.c-20-#include \u003clinux/sunserialcore.h\u003e\n--\ndrivers/tty/serial/sunhv.c-27-\ndrivers/tty/serial/sunhv.c:28:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/sunhv.c-29-#include \u003clinux/sunserialcore.h\u003e\n--\ndrivers/tty/serial/sunplus-uart.c-28-#include \u003clinux/reset.h\u003e\ndrivers/tty/serial/sunplus-uart.c:29:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/sunplus-uart.c-30-#include \u003clinux/serial_reg.h\u003e\n--\ndrivers/tty/serial/sunsab.c-43-\ndrivers/tty/serial/sunsab.c:44:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/sunsab.c-45-#include \u003clinux/sunserialcore.h\u003e\n--\ndrivers/tty/serial/sunsu.c-46-\ndrivers/tty/serial/sunsu.c:47:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/sunsu.c-48-#include \u003clinux/sunserialcore.h\u003e\n--\ndrivers/tty/serial/sunzilog.c-42-\ndrivers/tty/serial/sunzilog.c:43:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/sunzilog.c-44-#include \u003clinux/sunserialcore.h\u003e\n--\ndrivers/tty/serial/tegra-tcu.c-11-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/tegra-tcu.c:12:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/tegra-tcu.c-13-#include \u003clinux/slab.h\u003e\n--\ndrivers/tty/serial/tegra-utc.c-15-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/tegra-utc.c:16:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/tegra-utc.c-17-#include \u003clinux/slab.h\u003e\n--\ndrivers/tty/serial/timbuart.c-12-#include \u003clinux/interrupt.h\u003e\ndrivers/tty/serial/timbuart.c:13:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/timbuart.c-14-#include \u003clinux/tty.h\u003e\n--\ndrivers/tty/serial/uartlite.c-13-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/uartlite.c:14:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/uartlite.c-15-#include \u003clinux/tty.h\u003e\n--\ndrivers/tty/serial/ucc_uart.c-21-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/ucc_uart.c:22:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/ucc_uart.c-23-#include \u003clinux/slab.h\u003e\n--\ndrivers/tty/serial/vt8500_serial.c-19-#include \u003clinux/tty_flip.h\u003e\ndrivers/tty/serial/vt8500_serial.c:20:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/vt8500_serial.c-21-#include \u003clinux/serial.h\u003e\n--\ndrivers/tty/serial/xilinx_uartps.c-14-#include \u003clinux/console.h\u003e\ndrivers/tty/serial/xilinx_uartps.c:15:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/xilinx_uartps.c-16-#include \u003clinux/slab.h\u003e\n--\ndrivers/tty/serial/xilinx_uartps.c=1462=static int cdns_uart_suspend(struct device *device)\n--\ndrivers/tty/serial/xilinx_uartps.c-1484-\t/*\ndrivers/tty/serial/xilinx_uartps.c:1485:\t * Call the API provided in serial_core.c file which handles\ndrivers/tty/serial/xilinx_uartps.c-1486-\t * the suspend.\n--\ndrivers/tty/serial/zs.c-60-#include \u003clinux/serial.h\u003e\ndrivers/tty/serial/zs.c:61:#include \u003clinux/serial_core.h\u003e\ndrivers/tty/serial/zs.c-62-#include \u003clinux/spinlock.h\u003e\n"
} |
| 41/2 | 2026/08/30 08:32 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 80434 output: 32 thoughts: 129 Thoughts: **Examining Serial Driver Configuration** Okay, let's dive into this. First, I need to verify which serial drivers are enabled and what their respective configurations look like. I'll start by checking the `EnableConfigs` list. It appears we've got a few options: `TTY` for the `tty_port.c` module, `SERIAL_CORE` for `serial_core.c`, `SERIAL_8250` which could mean `SERIAL_8250_CONSOLE` or `SERIAL_OF_PLATFORM`, covering the classic 8250 serial driver commonly used in QEMU, x86, and arm64 environments, and lastly `HVCS` for the `hvcs.c` module. Now that I've reviewed the available configurations, let's zoom in on `SERIAL_8250` and take a look at its Kconfig dependencies to better understand how this specific driver is integrated and what other features it relies upon. That's the key to understanding its overall behavior in this context. |
| 42/2 | 2026/08/30 08:33 | tool | grepper |
0mArgs:{
"Expression": "config SERIAL_8250",
"PathPrefix": "drivers/tty/serial"
}Results: {
"Output": "drivers/tty/serial/8250/Kconfig-6-\ndrivers/tty/serial/8250/Kconfig:7:config SERIAL_8250\ndrivers/tty/serial/8250/Kconfig-8-\ttristate \"8250/16550 and compatible serial support\"\n--\ndrivers/tty/serial/8250/Kconfig-36-\ndrivers/tty/serial/8250/Kconfig:37:config SERIAL_8250_PNP\ndrivers/tty/serial/8250/Kconfig-38-\tbool \"8250/16550 PNP device support\" if EXPERT\n--\ndrivers/tty/serial/8250/Kconfig-44-\ndrivers/tty/serial/8250/Kconfig:45:config SERIAL_8250_16550A_VARIANTS\ndrivers/tty/serial/8250/Kconfig-46-\tbool \"Support for variants of the 16550A serial port\"\n--\ndrivers/tty/serial/8250/Kconfig-55-\ndrivers/tty/serial/8250/Kconfig:56:config SERIAL_8250_FINTEK\ndrivers/tty/serial/8250/Kconfig-57-\tbool \"Support for Fintek variants\"\n--\ndrivers/tty/serial/8250/Kconfig-69-\ndrivers/tty/serial/8250/Kconfig:70:config SERIAL_8250_CONSOLE\ndrivers/tty/serial/8250/Kconfig-71-\tbool \"Console on 8250/16550 and compatible serial port\"\n--\ndrivers/tty/serial/8250/Kconfig-103-\ndrivers/tty/serial/8250/Kconfig:104:config SERIAL_8250_PARISC\ndrivers/tty/serial/8250/Kconfig-105-\ttristate\n--\ndrivers/tty/serial/8250/Kconfig-108-\ndrivers/tty/serial/8250/Kconfig:109:config SERIAL_8250_DMA\ndrivers/tty/serial/8250/Kconfig-110-\tbool \"DMA support for 16550 compatible UART controllers\" if EXPERT\n--\ndrivers/tty/serial/8250/Kconfig-116-\ndrivers/tty/serial/8250/Kconfig:117:config SERIAL_8250_PCILIB\ndrivers/tty/serial/8250/Kconfig-118-\tbool\n--\ndrivers/tty/serial/8250/Kconfig-120-\ndrivers/tty/serial/8250/Kconfig:121:config SERIAL_8250_PCI\ndrivers/tty/serial/8250/Kconfig-122-\ttristate \"8250/16550 PCI device support\"\n--\ndrivers/tty/serial/8250/Kconfig-132-\ndrivers/tty/serial/8250/Kconfig:133:config SERIAL_8250_EXAR\ndrivers/tty/serial/8250/Kconfig-134-\ttristate \"8250/16550 Exar/Commtech PCI/PCIe device support\"\n--\ndrivers/tty/serial/8250/Kconfig-143-\ndrivers/tty/serial/8250/Kconfig:144:config SERIAL_8250_MOXA_PCIE\ndrivers/tty/serial/8250/Kconfig-145-\ttristate \"8250/16550 Moxa PCIe device support\"\n--\ndrivers/tty/serial/8250/Kconfig-153-\ndrivers/tty/serial/8250/Kconfig:154:config SERIAL_8250_HP300\ndrivers/tty/serial/8250/Kconfig-155-\ttristate\n--\ndrivers/tty/serial/8250/Kconfig-158-\ndrivers/tty/serial/8250/Kconfig:159:config SERIAL_8250_CS\ndrivers/tty/serial/8250/Kconfig-160-\ttristate \"8250/16550 PCMCIA device support\"\n--\ndrivers/tty/serial/8250/Kconfig-172-\ndrivers/tty/serial/8250/Kconfig:173:config SERIAL_8250_MEN_MCB\ndrivers/tty/serial/8250/Kconfig-174-\ttristate \"MEN MCB UART device support\"\n--\ndrivers/tty/serial/8250/Kconfig-184-\ndrivers/tty/serial/8250/Kconfig:185:config SERIAL_8250_NR_UARTS\ndrivers/tty/serial/8250/Kconfig-186-\tint \"Maximum number of 8250/16550 serial ports\"\n--\ndrivers/tty/serial/8250/Kconfig-194-\ndrivers/tty/serial/8250/Kconfig:195:config SERIAL_8250_RUNTIME_UARTS\ndrivers/tty/serial/8250/Kconfig-196-\tint \"Number of 8250/16550 serial ports to register at runtime\"\n--\ndrivers/tty/serial/8250/Kconfig-205-\ndrivers/tty/serial/8250/Kconfig:206:config SERIAL_8250_EXTENDED\ndrivers/tty/serial/8250/Kconfig-207-\tbool \"Extended 8250/16550 serial driver options\"\n--\ndrivers/tty/serial/8250/Kconfig-218-\ndrivers/tty/serial/8250/Kconfig:219:config SERIAL_8250_SHARE_IRQ\ndrivers/tty/serial/8250/Kconfig-220-\tbool \"Support for sharing serial interrupts\"\n--\ndrivers/tty/serial/8250/Kconfig-226-\ndrivers/tty/serial/8250/Kconfig:227:config SERIAL_8250_DETECT_IRQ\ndrivers/tty/serial/8250/Kconfig-228-\tbool \"Autodetect IRQ on standard ports (unsafe)\"\n--\ndrivers/tty/serial/8250/Kconfig-238-\ndrivers/tty/serial/8250/Kconfig:239:config SERIAL_8250_RSA\ndrivers/tty/serial/8250/Kconfig-240-\tbool \"Support RSA serial ports\"\n--\ndrivers/tty/serial/8250/Kconfig-249-\ndrivers/tty/serial/8250/Kconfig:250:config SERIAL_8250_MANY_PORTS\ndrivers/tty/serial/8250/Kconfig-251-\tbool \"Support more than 4 legacy serial ports\"\n--\ndrivers/tty/serial/8250/Kconfig-266-\ndrivers/tty/serial/8250/Kconfig:267:config SERIAL_8250_FOURPORT\ndrivers/tty/serial/8250/Kconfig-268-\ttristate \"Support Fourport cards\"\n--\ndrivers/tty/serial/8250/Kconfig-275-\ndrivers/tty/serial/8250/Kconfig:276:config SERIAL_8250_ACCENT\ndrivers/tty/serial/8250/Kconfig-277-\ttristate \"Support Accent cards\"\n--\ndrivers/tty/serial/8250/Kconfig-284-\ndrivers/tty/serial/8250/Kconfig:285:config SERIAL_8250_BOCA\ndrivers/tty/serial/8250/Kconfig-286-\ttristate \"Support Boca cards\"\n--\ndrivers/tty/serial/8250/Kconfig-294-\ndrivers/tty/serial/8250/Kconfig:295:config SERIAL_8250_EXAR_ST16C554\ndrivers/tty/serial/8250/Kconfig-296-\ttristate \"Support Exar ST16C554/554D Quad UART\"\n--\ndrivers/tty/serial/8250/Kconfig-305-\ndrivers/tty/serial/8250/Kconfig:306:config SERIAL_8250_HUB6\ndrivers/tty/serial/8250/Kconfig-307-\ttristate \"Support Hub6 cards\"\n--\ndrivers/tty/serial/8250/Kconfig-314-\ndrivers/tty/serial/8250/Kconfig:315:config SERIAL_8250_PCI1XXXX\ndrivers/tty/serial/8250/Kconfig-316-\ttristate \"Microchip 8250 based serial port\"\n--\ndrivers/tty/serial/8250/Kconfig-324-\ndrivers/tty/serial/8250/Kconfig:325:config SERIAL_8250_ASPEED_VUART\ndrivers/tty/serial/8250/Kconfig-326-\ttristate \"Aspeed Virtual UART\"\n--\ndrivers/tty/serial/8250/Kconfig-341-\ndrivers/tty/serial/8250/Kconfig:342:config SERIAL_8250_ACORN\ndrivers/tty/serial/8250/Kconfig-343-\ttristate \"Acorn expansion card serial port support\"\n--\ndrivers/tty/serial/8250/Kconfig-349-\ndrivers/tty/serial/8250/Kconfig:350:config SERIAL_8250_BCM2835AUX\ndrivers/tty/serial/8250/Kconfig-351-\ttristate \"BCM2835 auxiliar mini UART support\"\n--\ndrivers/tty/serial/8250/Kconfig-373-\ndrivers/tty/serial/8250/Kconfig:374:config SERIAL_8250_FSL\ndrivers/tty/serial/8250/Kconfig-375-\ttristate \"Freescale 16550 UART support\" if COMPILE_TEST \u0026\u0026 !(PPC || ARM || ARM64)\n--\ndrivers/tty/serial/8250/Kconfig-382-\ndrivers/tty/serial/8250/Kconfig:383:config SERIAL_8250_DFL\ndrivers/tty/serial/8250/Kconfig-384-\ttristate \"DFL bus driver for Altera 16550 UART\"\n--\ndrivers/tty/serial/8250/Kconfig-394-\ndrivers/tty/serial/8250/Kconfig:395:config SERIAL_8250_DW\ndrivers/tty/serial/8250/Kconfig-396-\ttristate \"Support for Synopsys DesignWare 8250 quirks\"\n--\ndrivers/tty/serial/8250/Kconfig-402-\ndrivers/tty/serial/8250/Kconfig:403:config SERIAL_8250_EM\ndrivers/tty/serial/8250/Kconfig-404-\ttristate \"Support for Emma Mobile integrated serial port\"\n--\ndrivers/tty/serial/8250/Kconfig-411-\ndrivers/tty/serial/8250/Kconfig:412:config SERIAL_8250_IOC3\ndrivers/tty/serial/8250/Kconfig-413-\ttristate \"SGI IOC3 8250 UART support\"\n--\ndrivers/tty/serial/8250/Kconfig-423-\ndrivers/tty/serial/8250/Kconfig:424:config SERIAL_8250_KEBA\ndrivers/tty/serial/8250/Kconfig-425-\ttristate \"Support for KEBA 8250 UART\"\n--\ndrivers/tty/serial/8250/Kconfig-436-\ndrivers/tty/serial/8250/Kconfig:437:config SERIAL_8250_RT288X\ndrivers/tty/serial/8250/Kconfig-438-\tbool \"Ralink RT288x/RT305x/RT3662/RT3883 serial port support\"\n--\ndrivers/tty/serial/8250/Kconfig-445-\ndrivers/tty/serial/8250/Kconfig:446:config SERIAL_8250_OMAP\ndrivers/tty/serial/8250/Kconfig-447-\ttristate \"Support for OMAP internal UART (8250 based driver)\"\n--\ndrivers/tty/serial/8250/Kconfig-455-\ndrivers/tty/serial/8250/Kconfig:456:config SERIAL_8250_OMAP_TTYO_FIXUP\ndrivers/tty/serial/8250/Kconfig-457-\tbool \"Replace ttyO with ttyS\"\n--\ndrivers/tty/serial/8250/Kconfig-474-\ndrivers/tty/serial/8250/Kconfig:475:config SERIAL_8250_LOONGSON\ndrivers/tty/serial/8250/Kconfig-476-\ttristate \"Loongson 8250 based serial port\"\n--\ndrivers/tty/serial/8250/Kconfig-485-\ndrivers/tty/serial/8250/Kconfig:486:config SERIAL_8250_LPC18XX\ndrivers/tty/serial/8250/Kconfig-487-\ttristate \"NXP LPC18xx/43xx serial port support\"\n--\ndrivers/tty/serial/8250/Kconfig-493-\ndrivers/tty/serial/8250/Kconfig:494:config SERIAL_8250_MT6577\ndrivers/tty/serial/8250/Kconfig-495-\ttristate \"Mediatek serial port support\"\n--\ndrivers/tty/serial/8250/Kconfig-501-\ndrivers/tty/serial/8250/Kconfig:502:config SERIAL_8250_UNIPHIER\ndrivers/tty/serial/8250/Kconfig-503-\ttristate \"Support for UniPhier on-chip UART\"\n--\ndrivers/tty/serial/8250/Kconfig-509-\ndrivers/tty/serial/8250/Kconfig:510:config SERIAL_8250_INGENIC\ndrivers/tty/serial/8250/Kconfig-511-\ttristate \"Support for Ingenic SoC serial ports\"\n--\ndrivers/tty/serial/8250/Kconfig-518-\ndrivers/tty/serial/8250/Kconfig:519:config SERIAL_8250_LPSS\ndrivers/tty/serial/8250/Kconfig-520-\ttristate \"Support for serial ports on Intel LPSS platforms\"\n--\ndrivers/tty/serial/8250/Kconfig-535-\ndrivers/tty/serial/8250/Kconfig:536:config SERIAL_8250_MID\ndrivers/tty/serial/8250/Kconfig-537-\ttristate \"Support for serial ports on Intel MID platforms\"\n--\ndrivers/tty/serial/8250/Kconfig-548-\ndrivers/tty/serial/8250/Kconfig:549:config SERIAL_8250_PERICOM\ndrivers/tty/serial/8250/Kconfig-550-\ttristate \"Support for Pericom and Acces I/O serial ports\"\n--\ndrivers/tty/serial/8250/Kconfig-557-\ndrivers/tty/serial/8250/Kconfig:558:config SERIAL_8250_PXA\ndrivers/tty/serial/8250/Kconfig-559-\ttristate \"PXA serial port support\"\n--\ndrivers/tty/serial/8250/Kconfig-567-\ndrivers/tty/serial/8250/Kconfig:568:config SERIAL_8250_TEGRA\ndrivers/tty/serial/8250/Kconfig-569-\ttristate \"8250 support for Tegra serial ports\"\n--\ndrivers/tty/serial/8250/Kconfig-576-\ndrivers/tty/serial/8250/Kconfig:577:config SERIAL_8250_BCM7271\ndrivers/tty/serial/8250/Kconfig-578-\ttristate \"Broadcom 8250 based serial port\"\n--\ndrivers/tty/serial/8250/Kconfig-586-\ndrivers/tty/serial/8250/Kconfig:587:config SERIAL_8250_NI\ndrivers/tty/serial/8250/Kconfig-588-\ttristate \"NI 16550 based serial port\"\n--\ndrivers/tty/serial/8250/Kconfig=600=config SERIAL_OF_PLATFORM\n--\ndrivers/tty/serial/8250/Kconfig-608-\ndrivers/tty/serial/8250/Kconfig:609:config SERIAL_8250_DWLIB\ndrivers/tty/serial/8250/Kconfig-610-\tbool\n"
} |
| 43/2 | 2026/08/30 08:33 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 85284 output: 26 thoughts: 75 Thoughts: Here's my thought process, as it relates to the kernel configuration: **Diving into Serial Driver Configuration** Okay, so I'm trying to understand the dependencies around the 8250 serial driver. My first step is to see what `SERIAL_8250` in `drivers/tty/serial/8250/Kconfig` tells me. Right, `SERIAL_8250` selects `SERIAL_CORE`. Good, that makes sense – it's inheriting core functionality. Now, I need to understand the connection to the TTY layer in general. I know that `TTY` gets enabled when `CONFIG_TTY` is enabled. Time to check `TTY` itself in `drivers/tty/Kconfig` to see the conditions that have to be met. I'll need to keep track of the dependencies and how they all fit together. |
| 44/2 | 2026/08/30 08:34 | tool | grepper |
0mArgs:{
"Expression": "config TTY",
"PathPrefix": "drivers/tty"
}Results: {
"Output": "drivers/tty/Kconfig-1-# SPDX-License-Identifier: GPL-2.0\ndrivers/tty/Kconfig:2:config TTY\ndrivers/tty/Kconfig-3-\tbool \"Enable TTY\" if EXPERT\n"
} |
| 45/2 | 2026/08/30 08:34 | llm | patch-evaluator |
1mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 85637 output: 187 thoughts: 850 Thoughts: **Analyzing TTY/Serial Core Changes for Fuzzing Focus** Okay, let's break this down systematically. First, I need to identify the key kernel functions that are affected by this patch. I started by listing the symbols mentioned in the initial prompt: `tty_port_alloc_xmit_buf`, `tty_port_free_xmit_buf`, `tty_port_destroy`, `uart_startup`, `uart_shutdown`, `uart_write`, `uart_open`, and `uart_close`. Now, I need to determine if these are likely entry points suitable for fuzzing. I checked their scope and location. I see `uart_open`, `uart_close`, `uart_write`, `uart_startup`, and `uart_shutdown` are static within `serial_core.c`. This suggests they are internal helpers, not the primary API entry points I want. I looked in `tty_port.c` and `serial_core.c` for any non-static alternatives. In `tty_port.c` I find: `tty_port_alloc_xmit_buf`, `tty_port_free_xmit_buf`, `tty_port_destroy`, `tty_port_open`, `tty_port_close`, `tty_port_hangup`, and `tty_port_install`. In `serial_core.c` I see: `uart_register_driver`, `uart_unregister_driver`, `serial_core_register_port`, `serial_core_unregister_port`, `uart_write_wakeup`, `uart_insert_char`, and `uart_handle_cts_change`, `uart_handle_dcd_change`. Considering the fuzzing criteria – non-static, non-inlined API entrypoints – I refined my list. The goal is to focus on entry points, and based on the prompt's instruction, I will pick these functions: `tty_port_alloc_xmit_buf`, `tty_port_free_xmit_buf`, `tty_port_destroy`, `tty_port_open`, and `tty_port_close`. These seem to represent the key entry points affected by the patch. I also need to note relevant configuration options: `TTY`, `SERIAL_CORE`, and `SERIAL_8250`. These are crucial for building a test configuration that covers the relevant code paths. Finally, I reviewed the diff summary. The core change is the replacement of page allocator (`__get_free_page`, `get_zeroed_page`, `free_page`) with slab allocator (`kmalloc`, `kzalloc`, `kfree`) for transmit buffer allocation in both the TTY and serial core subsystems. This means all of the selected functions are directly related to this allocation change. It affects `hvcs.c`, `serial_core.c` and `tty_port.c`. With this understanding, I'm confident in my analysis. It's time to call `set-results`. |
| 46/2 | 2026/08/30 08:35 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"TTY",
"SERIAL_CORE",
"SERIAL_8250"
],
"FocusSymbols": [
"tty_port_alloc_xmit_buf",
"tty_port_free_xmit_buf",
"tty_port_destroy",
"tty_port_open",
"tty_port_close"
],
"Reasoning": "The patch replaces page allocator calls (get_zeroed_page, free_page) with slab allocator calls (kzalloc, kfree) for transmit buffers in the core TTY and serial subsystems (tty_port, serial_core, and hvcs). These buffer allocations are executed during normal serial port and TTY device operations (open, close, destroy, startup, shutdown) and are reachable and testable in virtualized environments.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"TTY",
"SERIAL_CORE",
"SERIAL_8250"
],
"FocusSymbols": [
"tty_port_alloc_xmit_buf",
"tty_port_free_xmit_buf",
"tty_port_destroy",
"tty_port_open",
"tty_port_close"
],
"Reasoning": "The patch replaces page allocator calls (get_zeroed_page, free_page) with slab allocator calls (kzalloc, kfree) for transmit buffers in the core TTY and serial subsystems (tty_port, serial_core, and hvcs). These buffer allocations are executed during normal serial port and TTY device operations (open, close, destroy, startup, shutdown) and are reachable and testable in virtualized environments.",
"WorthFuzzing": true
} |
| 47/1 | 2026/08/30 08:35 | action | If |
16mArgs:{
"WorthFuzzing": true
}Results: null |
| 48/2 | 2026/08/30 08:35 | agent | kmsan-evaluator |
16mModel:core Args: null Results: {
"KMSANReasoning": "The patch converts page-allocator calls (`__get_free_page()`, `get_zeroed_page()`, `free_page()`) to slab-allocator calls (`kmalloc()`, `kzalloc()`, `kfree()`) for transmit buffers and partner info buffers in `drivers/tty/hvc/hvcs.c`, `drivers/tty/serial/serial_core.c`, and `drivers/tty/tty_port.c`.\n\n- In `serial_core.c` and `tty_port.c`, buffers are allocated with `kzalloc(PAGE_SIZE, GFP_KERNEL)`, ensuring full zero-initialization identical to `get_zeroed_page()`.\n- In `hvcs.c`, the allocated buffer is explicitly zeroed with `memset(pi_buff, 0x00, PAGE_SIZE)` in `hvcs_get_partner_info()` before use.\n- The changes do not introduce uninitialized stack/heap reads, uninitialized structure fields, padding leaks, or uninitialized conditional branching.\n- Any potential memory management issues (such as use-after-free, double free, or buffer overflow) are within the domain of standard KASAN and slab debuggers.\n\nTherefore, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false
}Instruction: You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.
CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
a comprehensive suite of debugging tools and sanitizers, including KASAN
(out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
(locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
or page allocations) and kernel-to-user memory info-leaks.
Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.
Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.
Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
attributes, ioctl output arguments, socket options, or BPF buffers) where fields
or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
uninitialized bytes of existing buffers.
Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
dereferences, locking deadlocks, or use-after-free bugs (these are already caught
by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.
Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: For your convenience, here is the diff of the changes:
commit 1254b278419dc0bc5d5f6417aed90b385082a335
Author: syz-cluster <triage@syzkaller.com>
Date: Sun Aug 30 08:01:48 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
index d32b1e3c50bfd..b94d59fa36274 100644
--- a/drivers/tty/hvc/hvcs.c
+++ b/drivers/tty/hvc/hvcs.c
@@ -1470,7 +1470,7 @@ static int hvcs_initialize(void)
goto register_fail;
}
- hvcs_pi_buff = (unsigned long *) __get_free_page(GFP_KERNEL);
+ hvcs_pi_buff = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!hvcs_pi_buff) {
rc = -ENOMEM;
goto buff_alloc_fail;
@@ -1486,7 +1486,7 @@ static int hvcs_initialize(void)
return 0;
kthread_fail:
- free_page((unsigned long)hvcs_pi_buff);
+ kfree(hvcs_pi_buff);
buff_alloc_fail:
tty_unregister_driver(hvcs_tty_driver);
register_fail:
@@ -1528,7 +1528,7 @@ static void __exit hvcs_module_exit(void)
kthread_stop(hvcs_task);
spin_lock(&hvcs_pi_lock);
- free_page((unsigned long)hvcs_pi_buff);
+ kfree(hvcs_pi_buff);
hvcs_pi_buff = NULL;
spin_unlock(&hvcs_pi_lock);
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 95774b0f1484b..f12ce7d190fe6 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -247,29 +247,29 @@ static int uart_alloc_xmit_buf(struct tty_port *port)
struct uart_state *state = container_of(port, struct uart_state, port);
struct uart_port *uport;
unsigned long flags;
- unsigned long page;
+ unsigned char *buf;
/*
* Initialise and allocate the transmit and temporary
* buffer.
*/
- page = get_zeroed_page(GFP_KERNEL);
- if (!page)
+ buf = kzalloc(PAGE_SIZE, GFP_KERNEL);
+ if (!buf)
return -ENOMEM;
uport = uart_port_ref_lock(state, &flags);
if (!state->port.xmit_buf) {
- state->port.xmit_buf = (unsigned char *)page;
+ state->port.xmit_buf = buf;
kfifo_init(&state->port.xmit_fifo, state->port.xmit_buf,
PAGE_SIZE);
uart_port_unlock_deref(uport, flags);
} else {
uart_port_unlock_deref(uport, flags);
/*
- * Do not free() the page under the port lock, see
+ * Do not free() the buffer under the port lock, see
* uart_free_xmit_buf().
*/
- free_page(page);
+ kfree(buf);
}
return 0;
@@ -283,7 +283,7 @@ static void uart_free_xmit_buf(struct tty_port *port)
char *xmit_buf;
/*
- * Do not free() the transmit buffer page under the port lock since
+ * Do not free() the transmit buffer under the port lock since
* this can create various circular locking scenarios. For instance,
* console driver may need to allocate/free a debug object, which
* can end up in printk() recursion.
@@ -294,7 +294,7 @@ static void uart_free_xmit_buf(struct tty_port *port)
INIT_KFIFO(port->xmit_fifo);
uart_port_unlock_deref(uport, flags);
- free_page((unsigned long)xmit_buf);
+ kfree(xmit_buf);
}
/*
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
index 54359310e293c..44122921fc45b 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
@@ -240,13 +240,13 @@ EXPORT_SYMBOL_GPL(tty_port_unregister_device);
int tty_port_alloc_xmit_buf(struct tty_port *port)
{
- /* We may sleep in get_zeroed_page() */
+ /* We may sleep in kzalloc() */
guard(mutex)(&port->buf_mutex);
if (port->xmit_buf)
return 0;
- port->xmit_buf = (u8 *)get_zeroed_page(GFP_KERNEL);
+ port->xmit_buf = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (port->xmit_buf == NULL)
return -ENOMEM;
@@ -259,7 +259,7 @@ EXPORT_SYMBOL(tty_port_alloc_xmit_buf);
void tty_port_free_xmit_buf(struct tty_port *port)
{
guard(mutex)(&port->buf_mutex);
- free_page((unsigned long)port->xmit_buf);
+ kfree(port->xmit_buf);
port->xmit_buf = NULL;
INIT_KFIFO(port->xmit_fifo);
}
@@ -288,7 +288,7 @@ static void tty_port_destructor(struct kref *kref)
/* check if last port ref was dropped before tty release */
if (WARN_ON(port->itty))
return;
- free_page((unsigned long)port->xmit_buf);
+ kfree(port->xmit_buf);
tty_port_destroy(port);
if (port->ops && port->ops->destruct)
port->ops->destruct(port);
|
| 49/3 | 2026/08/30 08:35 | llm | kmsan-evaluator |
4mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 3563 output: 37 thoughts: 378 Thoughts: **Analyzing the Patch for KMSAN Fuzzing Needs** Okay, let's take a look at this patch and decide if KMSAN fuzzing is necessary here. First, I need to understand what's changed. The core of this patch seems to be swapping out page allocations and deallocations for slab allocations. Specifically, the old `__get_free_page`, `get_zeroed_page`, and `free_page` functions are being replaced with `kmalloc`, `kzalloc`, and `kfree`, respectively. This looks like a fairly straightforward change, but the devil is always in the details, so let's break it down by file: 1. **`drivers/tty/hvc/hvcs.c`**: Here, `hvcs_pi_buff` goes from being allocated with `__get_free_page` to `kmalloc`. The corresponding deallocation changes from `free_page` to `kfree`. That's a direct replacement of page-level allocation with slab allocation for `hvcs_pi_buff`. 2. **`drivers/tty/serial/serial_core.c`**: In this file, both `page` and `xmit_buf` are affected. The patch replaces `get_zeroed_page` with `kzalloc` for `page` and `xmit_buf`, with `free_page` being switched to `kfree`. This also reflects a page to slab allocation substitution, but this time with zeroed memory. 3. **`drivers/tty/tty_port.c`**: Similar to the previous files, `port->xmit_buf` shifts from `get_zeroed_page` to `kzalloc`, and `free_page` is swapped with `kfree`. Again, it's a page allocation replacement for `port->xmit_buf`. My next thought is to investigate that first file, `drivers/tty/hvc/hvcs.c`, because the naming of `hvcs_pi_buff` is interesting. I'm going to want to understand *how* that buffer, allocated with `kmalloc`, is actually used within the `hvcs` driver. I need to understand the implications of this change and whether or not there are any subtle risks related to uninitialized memory access, use-after-free scenarios or other memory safety concerns that this change introduces or mitigates. Given the move to slab allocation, I'll need to think carefully about object lifetime and potential race conditions, although the basic change itself seems relatively innocuous. |
| 50/3 | 2026/08/30 08:39 | tool | grepper |
0mArgs:{
"Expression": "hvcs_pi_buff",
"PathPrefix": "drivers/tty/hvc/hvcs.c"
}Results: {
"Output": "drivers/tty/hvc/hvcs.c-89- * instances from hvcs_try_write(). They probably aren't needed with locking in\ndrivers/tty/hvc/hvcs.c:90: * place. Added check and cleanup for hvcs_pi_buff = kmalloc() in\ndrivers/tty/hvc/hvcs.c-91- * hvcs_module_init(). Exposed hvcs_struct.index via a sysfs attribute so that\n--\ndrivers/tty/hvc/hvcs.c=238=static struct task_struct *hvcs_task;\n--\ndrivers/tty/hvc/hvcs.c-243- */\ndrivers/tty/hvc/hvcs.c:244:static unsigned long *hvcs_pi_buff;\ndrivers/tty/hvc/hvcs.c-245-\ndrivers/tty/hvc/hvcs.c:246:/* Only allow one hvcs_struct to use the hvcs_pi_buff at a time. */\ndrivers/tty/hvc/hvcs.c-247-static DEFINE_SPINLOCK(hvcs_pi_lock);\n--\ndrivers/tty/hvc/hvcs.c=863=static int hvcs_get_pi(struct hvcs_struct *hvcsd)\n--\ndrivers/tty/hvc/hvcs.c-870-\tspin_lock(\u0026hvcs_pi_lock);\ndrivers/tty/hvc/hvcs.c:871:\tif (!hvcs_pi_buff) {\ndrivers/tty/hvc/hvcs.c-872-\t\tspin_unlock(\u0026hvcs_pi_lock);\n--\ndrivers/tty/hvc/hvcs.c-874-\t}\ndrivers/tty/hvc/hvcs.c:875:\tretval = hvcs_get_partner_info(unit_address, \u0026head, hvcs_pi_buff);\ndrivers/tty/hvc/hvcs.c-876-\tspin_unlock(\u0026hvcs_pi_lock);\n--\ndrivers/tty/hvc/hvcs.c=1414=static int hvcs_initialize(void)\n--\ndrivers/tty/hvc/hvcs.c-1472-\ndrivers/tty/hvc/hvcs.c:1473:\thvcs_pi_buff = kmalloc(PAGE_SIZE, GFP_KERNEL);\ndrivers/tty/hvc/hvcs.c:1474:\tif (!hvcs_pi_buff) {\ndrivers/tty/hvc/hvcs.c-1475-\t\trc = -ENOMEM;\n--\ndrivers/tty/hvc/hvcs.c-1488-kthread_fail:\ndrivers/tty/hvc/hvcs.c:1489:\tkfree(hvcs_pi_buff);\ndrivers/tty/hvc/hvcs.c-1490-buff_alloc_fail:\n--\ndrivers/tty/hvc/hvcs.c=1514=static void __exit hvcs_module_exit(void)\n--\ndrivers/tty/hvc/hvcs.c-1530-\tspin_lock(\u0026hvcs_pi_lock);\ndrivers/tty/hvc/hvcs.c:1531:\tkfree(hvcs_pi_buff);\ndrivers/tty/hvc/hvcs.c:1532:\thvcs_pi_buff = NULL;\ndrivers/tty/hvc/hvcs.c-1533-\tspin_unlock(\u0026hvcs_pi_lock);\n"
} |
| 51/3 | 2026/08/30 08:39 | llm | kmsan-evaluator |
1mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 5402 output: 22 thoughts: 31 Thoughts: Okay, here's my take on those thoughts, framed as a first-person summary, keeping in mind my expertise: **Hunting Down Partner Information in the HVC Subsystem** Alright, I'm thinking I need to find where the `hvcs_get_partner_info` function is defined and used. My initial gut feeling is that it's going to be within the `drivers/tty/hvc/` directory, specifically in `hvcs.c`. That's the most logical place to start, given the naming convention. However, I'm also keeping the possibility open that it's defined in another related file within that directory, or even a more general TTY-related location. I know the HVC subsystem pretty well, but it's always good to be thorough and quickly eliminate possibilities. I'll start with the obvious location, `hvcs.c`, and then expand my search if necessary, perhaps looking for header file includes or cross-references to understand the broader context. Time to dig in! |
| 52/3 | 2026/08/30 08:40 | tool | grepper |
0mArgs:{
"Expression": "hvcs_get_partner_info"
}Results: {
"Output": "arch/powerpc/include/asm/hvcserver.h=38=extern int hvcs_free_partner_info(struct list_head *head);\narch/powerpc/include/asm/hvcserver.h:39:extern int hvcs_get_partner_info(uint32_t unit_address,\narch/powerpc/include/asm/hvcserver.h-40-\t\tstruct list_head *head, unsigned long *pi_buff);\n--\narch/powerpc/platforms/pseries/hvcserver.c=31=static int hvcs_convert(long to_convert)\n--\narch/powerpc/platforms/pseries/hvcserver.c-54-/**\narch/powerpc/platforms/pseries/hvcserver.c:55: * hvcs_free_partner_info - free pi allocated by hvcs_get_partner_info\narch/powerpc/platforms/pseries/hvcserver.c-56- * @head: list_head pointer for an allocated list of partner info structs to\n--\narch/powerpc/platforms/pseries/hvcserver.c-59- * This function is used to free the partner info list that was returned by\narch/powerpc/platforms/pseries/hvcserver.c:60: * calling hvcs_get_partner_info().\narch/powerpc/platforms/pseries/hvcserver.c-61- */\n--\narch/powerpc/platforms/pseries/hvcserver.c=79=EXPORT_SYMBOL(hvcs_free_partner_info);\narch/powerpc/platforms/pseries/hvcserver.c-80-\narch/powerpc/platforms/pseries/hvcserver.c:81:/* Helper function for hvcs_get_partner_info */\narch/powerpc/platforms/pseries/hvcserver.c-82-static int hvcs_next_partner(uint32_t unit_address,\n--\narch/powerpc/platforms/pseries/hvcserver.c-94-/**\narch/powerpc/platforms/pseries/hvcserver.c:95: * hvcs_get_partner_info - Get all of the partner info for a vty-server adapter\narch/powerpc/platforms/pseries/hvcserver.c-96- * @unit_address: The unit_address of the vty-server adapter for which this\n--\narch/powerpc/platforms/pseries/hvcserver.c-118- */\narch/powerpc/platforms/pseries/hvcserver.c:119:int hvcs_get_partner_info(uint32_t unit_address, struct list_head *head,\narch/powerpc/platforms/pseries/hvcserver.c-120-\t\tunsigned long *pi_buff)\n--\narch/powerpc/platforms/pseries/hvcserver.c-189-}\narch/powerpc/platforms/pseries/hvcserver.c:190:EXPORT_SYMBOL(hvcs_get_partner_info);\narch/powerpc/platforms/pseries/hvcserver.c-191-\n--\narch/powerpc/platforms/pseries/hvcserver.c-203- * target unit address at which point the caller must invoke\narch/powerpc/platforms/pseries/hvcserver.c:204: * hvcs_get_partner_info() and then call this function again. If,\narch/powerpc/platforms/pseries/hvcserver.c-205- * for a second time, -EINVAL is returned then it indicates that\n--\ndrivers/tty/hvc/hvcs.c=863=static int hvcs_get_pi(struct hvcs_struct *hvcsd)\n--\ndrivers/tty/hvc/hvcs.c-874-\t}\ndrivers/tty/hvc/hvcs.c:875:\tretval = hvcs_get_partner_info(unit_address, \u0026head, hvcs_pi_buff);\ndrivers/tty/hvc/hvcs.c-876-\tspin_unlock(\u0026hvcs_pi_lock);\n"
} |
| 53/3 | 2026/08/30 08:40 | llm | kmsan-evaluator |
1mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 6671 output: 43 thoughts: 45 Thoughts: Here's my summary, as though I'm thinking through this process: **Diving into the HVC Server's Partner Information** Okay, time to get my hands dirty. I'm going to jump into the `arch/powerpc/platforms/pseries/hvcserver.c` file, specifically line 119. I need to understand how the `hvcs_get_partner_info` function handles the `pi_buff` variable. I suspect this is where the HVC server interacts with its communication partner on the hypervisor. This is a critical area for debugging any issues related to the hypervisor communication, especially concerning guest-to-host interactions. I need to trace how `pi_buff` is initialized, used, and modified within that function. This will give me a better understanding of how the server obtains partner information, and therefore where potential errors may arise. |
| 54/3 | 2026/08/30 08:42 | tool | read-file |
0mArgs:{
"File": "arch/powerpc/platforms/pseries/hvcserver.c",
"FirstLine": 115,
"LineCount": 50
}Results: {
"Contents": " 115:\t * Invocation of this function should always be followed by an invocation of\n 116:\t * hvcs_free_partner_info() using a pointer to the SAME list head instance\n 117:\t * that was passed as a parameter to this function.\n 118:\t */\n 119:\tint hvcs_get_partner_info(uint32_t unit_address, struct list_head *head,\n 120:\t\t\tunsigned long *pi_buff)\n 121:\t{\n 122:\t\t/*\n 123:\t\t * Dealt with as longs because of the hcall interface even though the\n 124:\t\t * values are uint32_t.\n 125:\t\t */\n 126:\t\tunsigned long\tlast_p_partition_ID;\n 127:\t\tunsigned long\tlast_p_unit_address;\n 128:\t\tstruct hvcs_partner_info *next_partner_info = NULL;\n 129:\t\tint more = 1;\n 130:\t\tint retval;\n 131:\t\n 132:\t\t/* invalid parameters */\n 133:\t\tif (!head || !pi_buff)\n 134:\t\t\treturn -EINVAL;\n 135:\t\n 136:\t\tmemset(pi_buff, 0x00, PAGE_SIZE);\n 137:\t\tlast_p_partition_ID = last_p_unit_address = ~0UL;\n 138:\t\tINIT_LIST_HEAD(head);\n 139:\t\n 140:\t\tdo {\n 141:\t\t\tretval = hvcs_next_partner(unit_address, last_p_partition_ID,\n 142:\t\t\t\t\tlast_p_unit_address, pi_buff);\n 143:\t\t\tif (retval) {\n 144:\t\t\t\t/*\n 145:\t\t\t\t * Don't indicate that we've failed if we have\n 146:\t\t\t\t * any list elements.\n 147:\t\t\t\t */\n 148:\t\t\t\tif (!list_empty(head))\n 149:\t\t\t\t\treturn 0;\n 150:\t\t\t\treturn retval;\n 151:\t\t\t}\n 152:\t\n 153:\t\t\tlast_p_partition_ID = be64_to_cpu(pi_buff[0]);\n 154:\t\t\tlast_p_unit_address = be64_to_cpu(pi_buff[1]);\n 155:\t\n 156:\t\t\t/* This indicates that there are no further partners */\n 157:\t\t\tif (last_p_partition_ID == ~0UL\n 158:\t\t\t\t\t\u0026\u0026 last_p_unit_address == ~0UL)\n 159:\t\t\t\tbreak;\n 160:\t\n 161:\t\t\t/* This is a very small struct and will be freed soon in\n 162:\t\t\t * hvcs_free_partner_info(). */\n 163:\t\t\tnext_partner_info = kmalloc_obj(struct hvcs_partner_info,\n 164:\t\t\t\t\t\t\tGFP_ATOMIC);\n"
} |
| 55/3 | 2026/08/30 08:42 | llm | kmsan-evaluator |
2mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 7731 output: 18 thoughts: 310 Thoughts: **Analyzing `xmit_buf` Allocation and Initialization** Okay, so I'm taking a look at how `xmit_buf` is handled across the serial driver code. I've noticed that `hvcs_get_partner_info` explicitly zero-fills `pi_buff` using `memset`, and I see similar zero-initialization with `get_zeroed_page` which is used in both `serial_core.c` and `tty_port.c`. Specifically, in `serial_core.c`, we're getting `kzalloc(PAGE_SIZE, GFP_KERNEL)` which, of course, gives us the same zero-initialized buffer as `get_zeroed_page(GFP_KERNEL)`. Then there's the `kfifo_init` call using it, and then the buffer is freed using `kfree`. `tty_port.c` seems to follow the same pattern - `kzalloc` followed by `kfree`. So, the initialization is consistent, using methods which guarantee a zeroed buffer. My immediate thought is, are there any *other* places, across the kernel *or* serial drivers, where we assume `xmit_buf` is a page allocation? For example, are there calls to `virt_to_page` or `free_page` with `xmit_buf`? We need to be absolutely certain we're consistent here to avoid any potential memory corruption or security vulnerabilities. It's time to thoroughly examine *every* use of `xmit_buf` in the codebase and verify our assumptions are solid. |
| 56/3 | 2026/08/30 08:45 | tool | grepper |
0mArgs:{
"Expression": "xmit_buf"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 796 lines.\nUse more precise expression if possible.\n\ndrivers/crypto/omap-sham.c=211=struct omap_sham_dev {\n--\ndrivers/crypto/omap-sham.c-220-\tu8\t\t\tpolling_mode;\ndrivers/crypto/omap-sham.c:221:\tu8\t\t\txmit_buf[BUFLEN] OMAP_ALIGNED;\ndrivers/crypto/omap-sham.c-222-\n--\ndrivers/crypto/omap-sham.c=624=static int omap_sham_copy_sg_lists(struct omap_sham_reqctx *ctx,\n--\ndrivers/crypto/omap-sham.c-646-\tif (ctx-\u003ebufcnt) {\ndrivers/crypto/omap-sham.c:647:\t\tsg_set_buf(tmp, ctx-\u003edd-\u003exmit_buf, ctx-\u003ebufcnt);\ndrivers/crypto/omap-sham.c-648-\t\ttmp = sg_next(tmp);\n--\ndrivers/crypto/omap-sham.c=690=static int omap_sham_copy_sgs(struct omap_sham_reqctx *ctx,\n--\ndrivers/crypto/omap-sham.c-705-\tif (ctx-\u003ebufcnt)\ndrivers/crypto/omap-sham.c:706:\t\tmemcpy(buf, ctx-\u003edd-\u003exmit_buf, ctx-\u003ebufcnt);\ndrivers/crypto/omap-sham.c-707-\n--\ndrivers/crypto/omap-sham.c=722=static int omap_sham_align_sgs(struct scatterlist *sg,\n--\ndrivers/crypto/omap-sham.c-737-\t\t\tsg_init_table(rctx-\u003esgl, 1);\ndrivers/crypto/omap-sham.c:738:\t\t\tsg_set_buf(rctx-\u003esgl, rctx-\u003edd-\u003exmit_buf, bufcnt);\ndrivers/crypto/omap-sham.c-739-\t\t\trctx-\u003esg = rctx-\u003esgl;\n--\ndrivers/crypto/omap-sham.c-829-\t\tsg_init_table(rctx-\u003esgl, 2);\ndrivers/crypto/omap-sham.c:830:\t\tsg_set_buf(rctx-\u003esgl, rctx-\u003edd-\u003exmit_buf, rctx-\u003ebufcnt);\ndrivers/crypto/omap-sham.c-831-\t\tsg_chain(rctx-\u003esgl, 2, sg);\n--\ndrivers/crypto/omap-sham.c=840=static int omap_sham_prepare_request(struct crypto_engine *engine, void *areq)\n--\ndrivers/crypto/omap-sham.c-880-\tif (rctx-\u003ebufcnt)\ndrivers/crypto/omap-sham.c:881:\t\tmemcpy(rctx-\u003edd-\u003exmit_buf, rctx-\u003ebuffer, rctx-\u003ebufcnt);\ndrivers/crypto/omap-sham.c-882-\n--\ndrivers/crypto/s5p-sss.c=247=struct s5p_aes_ctx {\n--\ndrivers/crypto/s5p-sss.c-287- * @hash_tasklet: New HASH request scheduling job.\ndrivers/crypto/s5p-sss.c:288: * @xmit_buf:\tBuffer for current HASH request transfer into SSS block.\ndrivers/crypto/s5p-sss.c-289- * @hash_req:\tCurrent request sending to SSS HASH block.\n--\ndrivers/crypto/s5p-sss.c=295=struct s5p_aes_dev {\n--\ndrivers/crypto/s5p-sss.c-323-\ndrivers/crypto/s5p-sss.c:324:\tu8\t\t\t\txmit_buf[BUFLEN];\ndrivers/crypto/s5p-sss.c-325-\tstruct ahash_request\t\t*hash_req;\n--\ndrivers/crypto/s5p-sss.c=963=static int s5p_hash_xmit_dma(struct s5p_aes_dev *dd, size_t length,\n--\ndrivers/crypto/s5p-sss.c-997- *\ndrivers/crypto/s5p-sss.c:998: * Allocate new buffer, copy data for HASH into it. If there was xmit_buf\ndrivers/crypto/s5p-sss.c-999- * filled, copy it first, then copy data from sg into it. Prepare one sgl[0]\n--\ndrivers/crypto/s5p-sss.c=1004=static int s5p_hash_copy_sgs(struct s5p_hash_reqctx *ctx,\n--\ndrivers/crypto/s5p-sss.c-1020-\tif (ctx-\u003ebufcnt)\ndrivers/crypto/s5p-sss.c:1021:\t\tmemcpy(buf, ctx-\u003edd-\u003exmit_buf, ctx-\u003ebufcnt);\ndrivers/crypto/s5p-sss.c-1022-\n--\ndrivers/crypto/s5p-sss.c-1041- * Allocate new scatterlist table, copy data for HASH into it. If there was\ndrivers/crypto/s5p-sss.c:1042: * xmit_buf filled, prepare it first, then copy page, length and offset from\ndrivers/crypto/s5p-sss.c-1043- * source sg into it, adjusting begin and/or end for skip offset and\n--\ndrivers/crypto/s5p-sss.c=1049=static int s5p_hash_copy_sg_lists(struct s5p_hash_reqctx *ctx,\n--\ndrivers/crypto/s5p-sss.c-1071-\tif (ctx-\u003ebufcnt) {\ndrivers/crypto/s5p-sss.c:1072:\t\tsg_set_buf(tmp, ctx-\u003edd-\u003exmit_buf, ctx-\u003ebufcnt);\ndrivers/crypto/s5p-sss.c-1073-\t\ttmp = sg_next(tmp);\n--\ndrivers/crypto/s5p-sss.c=1119=static int s5p_hash_prepare_sgs(struct s5p_hash_reqctx *ctx,\n--\ndrivers/crypto/s5p-sss.c-1170-\t\tsg_init_table(ctx-\u003esgl, 2);\ndrivers/crypto/s5p-sss.c:1171:\t\tsg_set_buf(ctx-\u003esgl, ctx-\u003edd-\u003exmit_buf, ctx-\u003ebufcnt);\ndrivers/crypto/s5p-sss.c-1172-\t\tsg_chain(ctx-\u003esgl, 2, sg);\n--\ndrivers/crypto/s5p-sss.c=1193=static int s5p_hash_prepare_request(struct ahash_request *req, bool update)\n--\ndrivers/crypto/s5p-sss.c-1224-\tif (ctx-\u003ebufcnt)\ndrivers/crypto/s5p-sss.c:1225:\t\tmemcpy(ctx-\u003edd-\u003exmit_buf, ctx-\u003ebuffer, ctx-\u003ebufcnt);\ndrivers/crypto/s5p-sss.c-1226-\n--\ndrivers/crypto/s5p-sss.c-1237-\t\t/* copy hash_later bytes from end of req-\u003esrc */\ndrivers/crypto/s5p-sss.c:1238:\t\t/* previous bytes are in xmit_buf, so no overwrite */\ndrivers/crypto/s5p-sss.c-1239-\t\tmemcpy_from_sglist(ctx-\u003ebuffer, req-\u003esrc,\n--\ndrivers/crypto/s5p-sss.c-1251-\t\t\t/* first update didn't fill up buffer */\ndrivers/crypto/s5p-sss.c:1252:\t\t\tmemcpy_from_sglist(ctx-\u003edd-\u003exmit_buf, req-\u003esrc,\ndrivers/crypto/s5p-sss.c-1253-\t\t\t\t\t 0, xmit_len);\n--\ndrivers/crypto/s5p-sss.c-1256-\t\tsg_init_table(ctx-\u003esgl, 1);\ndrivers/crypto/s5p-sss.c:1257:\t\tsg_set_buf(ctx-\u003esgl, ctx-\u003edd-\u003exmit_buf, xmit_len);\ndrivers/crypto/s5p-sss.c-1258-\n--\ndrivers/crypto/stm32/stm32-hash.c=193=struct stm32_hash_dev {\n--\ndrivers/crypto/stm32/stm32-hash.c-199-\tphys_addr_t\t\tphys_base;\ndrivers/crypto/stm32/stm32-hash.c:200:\tu8\t\t\txmit_buf[HASH_BUFLEN] __aligned(sizeof(u32));\ndrivers/crypto/stm32/stm32-hash.c-201-\tu32\t\t\tdma_mode;\n--\ndrivers/crypto/stm32/stm32-hash.c=1096=static int stm32_hash_copy_sgs(struct stm32_hash_request_ctx *rctx,\n--\ndrivers/crypto/stm32/stm32-hash.c-1111-\ndrivers/crypto/stm32/stm32-hash.c:1112:\tmemcpy(buf, rctx-\u003ehdev-\u003exmit_buf, state-\u003ebufcnt);\ndrivers/crypto/stm32/stm32-hash.c-1113-\n--\ndrivers/crypto/stm32/stm32-hash.c=1128=static int stm32_hash_align_sgs(struct scatterlist *sg,\n--\ndrivers/crypto/stm32/stm32-hash.c-1145-\t\t\tsg_init_table(rctx-\u003esgl, 1);\ndrivers/crypto/stm32/stm32-hash.c:1146:\t\t\tsg_set_buf(rctx-\u003esgl, rctx-\u003ehdev-\u003exmit_buf, bufcnt);\ndrivers/crypto/stm32/stm32-hash.c-1147-\t\t\trctx-\u003esg = rctx-\u003esgl;\n--\ndrivers/crypto/stm32/stm32-hash.c-1235-\t\tsg_init_table(rctx-\u003esgl, 2);\ndrivers/crypto/stm32/stm32-hash.c:1236:\t\tsg_set_buf(rctx-\u003esgl, rctx-\u003ehdev-\u003exmit_buf, state-\u003ebufcnt);\ndrivers/crypto/stm32/stm32-hash.c-1237-\t\tsg_chain(rctx-\u003esgl, 2, sg);\n--\ndrivers/crypto/stm32/stm32-hash.c=1246=static int stm32_hash_prepare_request(struct ahash_request *req)\n--\ndrivers/crypto/stm32/stm32-hash.c-1295-\t/* copy buffer in a temporary one that is used for sg alignment */\ndrivers/crypto/stm32/stm32-hash.c:1296:\tmemcpy(hdev-\u003exmit_buf, state-\u003ebuffer, state-\u003ebufcnt);\ndrivers/crypto/stm32/stm32-hash.c-1297-\n--\ndrivers/ipack/devices/ipoctal.c=216=static void ipoctal_irq_tx(struct ipoctal_channel *channel)\n--\ndrivers/ipack/devices/ipoctal.c-224-\tspin_lock(\u0026channel-\u003elock);\ndrivers/ipack/devices/ipoctal.c:225:\tvalue = channel-\u003etty_port.xmit_buf[*pointer_write];\ndrivers/ipack/devices/ipoctal.c-226-\tiowrite8(value, \u0026channel-\u003eregs-\u003ew.thr);\n--\ndrivers/ipack/devices/ipoctal.c=287=static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,\n--\ndrivers/ipack/devices/ipoctal.c-412-\t\ttty_port_init(\u0026channel-\u003etty_port);\ndrivers/ipack/devices/ipoctal.c:413:\t\tres = tty_port_alloc_xmit_buf(\u0026channel-\u003etty_port);\ndrivers/ipack/devices/ipoctal.c-414-\t\tif (res)\n--\ndrivers/ipack/devices/ipoctal.c-426-\t\t\tdev_err(\u0026ipoctal-\u003edev-\u003edev, \"Failed to register tty device.\\n\");\ndrivers/ipack/devices/ipoctal.c:427:\t\t\ttty_port_free_xmit_buf(\u0026channel-\u003etty_port);\ndrivers/ipack/devices/ipoctal.c-428-\t\t\ttty_port_destroy(\u0026channel-\u003etty_port);\n--\ndrivers/ipack/devices/ipoctal.c=452=static inline size_t ipoctal_copy_write_buffer(struct ipoctal_channel *channel,\n--\ndrivers/ipack/devices/ipoctal.c-462-\t\t\tspin_lock_irqsave(\u0026channel-\u003elock, flags);\ndrivers/ipack/devices/ipoctal.c:463:\t\t\tchannel-\u003etty_port.xmit_buf[*pointer_read] = buf[i];\ndrivers/ipack/devices/ipoctal.c-464-\t\t\t*pointer_read = (*pointer_read + 1) % PAGE_SIZE;\n--\ndrivers/ipack/devices/ipoctal.c=474=static ssize_t ipoctal_write_tty(struct tty_struct *tty, const u8 *buf,\n--\ndrivers/ipack/devices/ipoctal.c-481-\tguard(rwsem_read)(\u0026ipoctal-\u003eremove_sem);\ndrivers/ipack/devices/ipoctal.c:482:\tif (ipoctal-\u003eremoved || !channel-\u003etty_port.xmit_buf)\ndrivers/ipack/devices/ipoctal.c-483-\t\treturn 0;\n--\ndrivers/ipack/devices/ipoctal.c=757=static void __ipoctal_remove(struct ipoctal *ipoctal)\n--\ndrivers/ipack/devices/ipoctal.c-772-\t\ttty_unregister_device(ipoctal-\u003etty_drv, i);\ndrivers/ipack/devices/ipoctal.c:773:\t\ttty_port_free_xmit_buf(\u0026channel-\u003etty_port);\ndrivers/ipack/devices/ipoctal.c-774-\t\ttty_port_destroy(\u0026channel-\u003etty_port);\n--\ndrivers/net/ethernet/airoha/airoha_eth.c=916=static void airoha_qdma_wake_netdev_txqs(struct airoha_queue *q)\n--\ndrivers/net/ethernet/airoha/airoha_eth.c-951-\ndrivers/net/ethernet/airoha/airoha_eth.c:952:static void airoha_unmap_xmit_buf(struct airoha_eth *eth,\ndrivers/net/ethernet/airoha/airoha_eth.c-953-\t\t\t\t struct airoha_queue_entry *e)\n--\ndrivers/net/ethernet/airoha/airoha_eth.c=971=static int airoha_qdma_tx_napi_poll(struct napi_struct *napi, int budget)\n--\ndrivers/net/ethernet/airoha/airoha_eth.c-1032-\ndrivers/net/ethernet/airoha/airoha_eth.c:1033:\t\tairoha_unmap_xmit_buf(eth, e);\ndrivers/net/ethernet/airoha/airoha_eth.c-1034-\t\tlist_add_tail(\u0026e-\u003elist, \u0026q-\u003etx_list);\n--\ndrivers/net/ethernet/airoha/airoha_eth.c=1179=static void airoha_qdma_tx_cleanup(struct airoha_qdma *qdma)\n--\ndrivers/net/ethernet/airoha/airoha_eth.c-1210-\ndrivers/net/ethernet/airoha/airoha_eth.c:1211:\t\t\tairoha_unmap_xmit_buf(qdma-\u003eeth, e);\ndrivers/net/ethernet/airoha/airoha_eth.c-1212-\t\t\tlist_add_tail(\u0026e-\u003elist, \u0026q-\u003etx_list);\n--\ndrivers/net/ethernet/airoha/airoha_eth.c=2291=static netdev_tx_t airoha_dev_xmit(struct sk_buff *skb,\n--\ndrivers/net/ethernet/airoha/airoha_eth.c-2429-\tlist_for_each_entry(e, \u0026tx_list, list)\ndrivers/net/ethernet/airoha/airoha_eth.c:2430:\t\tairoha_unmap_xmit_buf(dev-\u003eeth, e);\ndrivers/net/ethernet/airoha/airoha_eth.c-2431-\tlist_splice(\u0026tx_list, \u0026q-\u003etx_list);\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c=145=struct priv\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c-154-\tvolatile struct scb_struct\t*scb;\t/* volatile is important */\ndrivers/net/ethernet/i825xx/sun3_82586.c:155:\tvolatile struct tbd_struct\t*xmit_buffs[NUM_XMIT_BUFFS];\ndrivers/net/ethernet/i825xx/sun3_82586.c-156-\tvolatile struct transmit_cmd_struct *xmit_cmds[NUM_XMIT_BUFFS];\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c=401=static int init586(struct net_device *dev)\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c-581-\t\tptr = (char *) ptr + XMIT_BUFF_SIZE;\ndrivers/net/ethernet/i825xx/sun3_82586.c:582:\t\tp-\u003exmit_buffs[i] = (struct tbd_struct *)ptr; /* TBD */\ndrivers/net/ethernet/i825xx/sun3_82586.c-583-\t\tptr = (char *) ptr + sizeof(struct tbd_struct);\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c-589-\t\tmemset((char *)(p-\u003exmit_cmds[i]) ,0, sizeof(struct transmit_cmd_struct));\ndrivers/net/ethernet/i825xx/sun3_82586.c:590:\t\tmemset((char *)(p-\u003exmit_buffs[i]),0, sizeof(struct tbd_struct));\ndrivers/net/ethernet/i825xx/sun3_82586.c-591-\t\tp-\u003exmit_cmds[i]-\u003ecmd_link = make16(p-\u003enop_cmds[(i+1)%NUM_XMIT_BUFFS]);\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c-593-\t\tp-\u003exmit_cmds[i]-\u003ecmd_cmd = swab16(CMD_XMIT | CMD_INT);\ndrivers/net/ethernet/i825xx/sun3_82586.c:594:\t\tp-\u003exmit_cmds[i]-\u003etbd_offset = make16((p-\u003exmit_buffs[i]));\ndrivers/net/ethernet/i825xx/sun3_82586.c:595:\t\tp-\u003exmit_buffs[i]-\u003enext = 0xffff;\ndrivers/net/ethernet/i825xx/sun3_82586.c:596:\t\tp-\u003exmit_buffs[i]-\u003ebuffer = make24((p-\u003exmit_cbuffs[i]));\ndrivers/net/ethernet/i825xx/sun3_82586.c-597-\t}\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c=1004=sun3_82586_send_packet(struct sk_buff *skb, struct net_device *dev)\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c-1047-\ndrivers/net/ethernet/i825xx/sun3_82586.c:1048:\t\tp-\u003exmit_buffs[0]-\u003esize = swab16(TBD_LAST | len);\ndrivers/net/ethernet/i825xx/sun3_82586.c-1049-\t\tfor(i=0;i\u003c16;i++)\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c-1073-\t\tnext_nop = (p-\u003enop_point + 1) \u0026 0x1;\ndrivers/net/ethernet/i825xx/sun3_82586.c:1074:\t\tp-\u003exmit_buffs[0]-\u003esize = swab16(TBD_LAST | len);\ndrivers/net/ethernet/i825xx/sun3_82586.c-1075-\n--\ndrivers/net/ethernet/i825xx/sun3_82586.c-1084-#else\ndrivers/net/ethernet/i825xx/sun3_82586.c:1085:\t\tp-\u003exmit_buffs[p-\u003exmit_count]-\u003esize = swab16(TBD_LAST | len);\ndrivers/net/ethernet/i825xx/sun3_82586.c-1086-\t\tif( (next_nop = p-\u003exmit_count + 1) == NUM_XMIT_BUFFS )\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h=691=struct mt76_sdio {\n--\ndrivers/net/wireless/mediatek/mt76/mt76.h-696-\ndrivers/net/wireless/mediatek/mt76/mt76.h:697:\tu8 *xmit_buf;\ndrivers/net/wireless/mediatek/mt76/mt76.h:698:\tu32 xmit_buf_sz;\ndrivers/net/wireless/mediatek/mt76/mt76.h-699-\n--\ndrivers/net/wireless/mediatek/mt76/sdio.c=644=int mt76s_init(struct mt76_dev *dev, struct sdio_func *func,\n--\ndrivers/net/wireless/mediatek/mt76/sdio.c-676-\t\t\t func-\u003ecard-\u003ehost-\u003emax_blk_count);\ndrivers/net/wireless/mediatek/mt76/sdio.c:677:\tdev-\u003esdio.xmit_buf_sz = min_t(u32, host_max_cap, MT76S_XMIT_BUF_SZ);\ndrivers/net/wireless/mediatek/mt76/sdio.c:678:\tdev-\u003esdio.xmit_buf = devm_kmalloc(dev-\u003edev, dev-\u003esdio.xmit_buf_sz,\ndrivers/net/wireless/mediatek/mt76/sdio.c-679-\t\t\t\t\t GFP_KERNEL);\ndrivers/net/wireless/mediatek/mt76/sdio.c:680:\tif (!dev-\u003esdio.xmit_buf)\ndrivers/net/wireless/mediatek/mt76/sdio.c-681-\t\terr = -ENOMEM;\n--\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c=245=static int mt76s_tx_run_queue(struct mt76_dev *dev, struct mt76_queue *q)\n--\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-275-\t\tpad = roundup(e-\u003eskb-\u003elen, 4) - e-\u003eskb-\u003elen;\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c:276:\t\tif (len + e-\u003eskb-\u003elen + pad + 4 \u003e dev-\u003esdio.xmit_buf_sz)\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-277-\t\t\tbreak;\n--\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-282-\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c:283:\t\tmemcpy(sdio-\u003exmit_buf + len, e-\u003eskb-\u003edata, skb_headlen(e-\u003eskb));\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-284-\t\tlen += skb_headlen(e-\u003eskb);\n--\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-287-\t\tskb_walk_frags(e-\u003eskb, iter) {\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c:288:\t\t\tmemcpy(sdio-\u003exmit_buf + len, iter-\u003edata, iter-\u003elen);\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-289-\t\t\tlen += iter-\u003elen;\n--\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-293-\t\tif (unlikely(pad)) {\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c:294:\t\t\tmemset(sdio-\u003exmit_buf + len, 0, pad);\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-295-\t\t\tlen += pad;\n--\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-302-\tif (nframes) {\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c:303:\t\tmemset(sdio-\u003exmit_buf + len, 0, 4);\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c:304:\t\terr = __mt76s_xmit_queue(dev, sdio-\u003exmit_buf, len + 4);\ndrivers/net/wireless/mediatek/mt76/sdio_txrx.c-305-\t\tif (err)\n--\ndrivers/staging/rtl8723bs/core/rtw_mlme_ext.c=1870=static struct xmit_frame *_alloc_mgtxmitframe(struct xmit_priv *pxmitpriv, bool once)\n--\ndrivers/staging/rtl8723bs/core/rtw_mlme_ext.c-1872-\tstruct xmit_frame *pmgntframe;\ndrivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1873:\tstruct xmit_buf *pxmitbuf;\ndrivers/staging/rtl8723bs/core/rtw_mlme_ext.c-1874-\n--\ndrivers/staging/rtl8723bs/core/rtw_mlme_ext.c=1974=s32 dump_mgntframe_and_wait(struct adapter *padapter, struct xmit_frame *pmgntframe, int timeout_ms)\n--\ndrivers/staging/rtl8723bs/core/rtw_mlme_ext.c-1978-\tstruct xmit_priv *pxmitpriv = \u0026padapter-\u003exmitpriv;\ndrivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1979:\tstruct xmit_buf *pxmitbuf = pmgntframe-\u003epxmitbuf;\ndrivers/staging/rtl8723bs/core/rtw_mlme_ext.c-1980-\tstruct submit_ctx sctx;\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c=36=static s32 rtw_alloc_hwxmits(struct adapter *padapter)\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-75-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:76:static int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 alloc_sz, u8 flag)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-77-{\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c=89=s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-91-\tint i;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:92:\tstruct xmit_buf *pxmitbuf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-93-\tstruct xmit_frame *pxframe;\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-153-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:154:\t/* init xmit_buf */\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-155-\tINIT_LIST_HEAD(\u0026pxmitpriv-\u003efree_xmitbuf_queue.queue);\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-159-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:160:\tpxmitpriv-\u003epallocated_xmitbuf = vzalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4);\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-161-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-166-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:167:\tpxmitbuf = (struct xmit_buf *)pxmitpriv-\u003epxmitbuf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-168-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-236-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:237:\tpxmitpriv-\u003epallocated_xmit_extbuf = vzalloc(NR_XMIT_EXTBUFF * sizeof(struct xmit_buf) + 4);\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-238-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-243-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:244:\tpxmitbuf = (struct xmit_buf *)pxmitpriv-\u003epxmit_extbuf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-245-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c=309=void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-313-\tstruct xmit_frame\t*pxmitframe = (struct xmit_frame *)pxmitpriv-\u003epxmit_frame_buf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:314:\tstruct xmit_buf *pxmitbuf = (struct xmit_buf *)pxmitpriv-\u003epxmitbuf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-315-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-347-\t/* free xmit extension buff */\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:348:\tpxmitbuf = (struct xmit_buf *)pxmitpriv-\u003epxmit_extbuf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-349-\tfor (i = 0; i \u003c NR_XMIT_EXTBUFF; i++) {\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c=1421=void rtw_count_tx_stats(struct adapter *padapter, struct xmit_frame *pxmitframe, int sz)\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1448-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1449:static struct xmit_buf *__rtw_alloc_cmd_xmitbuf(struct xmit_priv *pxmitpriv,\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1450-\t\tenum cmdbuf_type buf_type)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1451-{\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1452:\tstruct xmit_buf *pxmitbuf = NULL;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1453-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c=1470=struct xmit_frame *__rtw_alloc_cmdxmitframe(struct xmit_priv *pxmitpriv,\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1473-\tstruct xmit_frame\t\t*pcmdframe;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1474:\tstruct xmit_buf\t\t*pxmitbuf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1475-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1496-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1497:struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1498-{\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1499-\tunsigned long irqL;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1500:\tstruct xmit_buf *pxmitbuf = NULL;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1501-\tstruct list_head *plist, *phead;\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1512-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1513:\t\tpxmitbuf = container_of(plist, struct xmit_buf, list);\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1514-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1536-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1537:s32 rtw_free_xmitbuf_ext(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1538-{\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1556-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1557:struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1558-{\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1559-\tunsigned long irqL;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1560:\tstruct xmit_buf *pxmitbuf = NULL;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1561-\tstruct list_head *plist, *phead;\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1572-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1573:\t\tpxmitbuf = container_of(plist, struct xmit_buf, list);\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1574-\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1597-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:1598:s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-1599-{\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c=2319=void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *psta)\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2382-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:2383:void enqueue_pending_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2384-{\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2397-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:2398:void enqueue_pending_xmitbuf_to_head(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2399-{\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2409-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:2410:struct xmit_buf *dequeue_pending_xmitbuf(struct xmit_priv *pxmitpriv)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2411-{\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:2412:\tstruct xmit_buf *pxmitbuf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2413-\tstruct __queue *pqueue;\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2424-\t\tplist = get_next(phead);\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:2425:\t\tpxmitbuf = container_of(plist, struct xmit_buf, list);\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2426-\t\tlist_del_init(\u0026pxmitbuf-\u003elist);\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2433-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:2434:struct xmit_buf *dequeue_pending_xmitbuf_under_survey(struct xmit_priv *pxmitpriv)\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2435-{\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:2436:\tstruct xmit_buf *pxmitbuf;\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2437-\tstruct __queue *pqueue;\n--\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2454-\ndrivers/staging/rtl8723bs/core/rtw_xmit.c:2455:\t\t\tpxmitbuf = container_of(plist, struct xmit_buf, list);\ndrivers/staging/rtl8723bs/core/rtw_xmit.c-2456-\n--\ndrivers/staging/rtl8723bs/hal/hal_intf.c=227=s32 rtw_hal_xmit_thread_handler(struct adapter *padapter)\ndrivers/staging/rtl8723bs/hal/hal_intf.c-228-{\ndrivers/staging/rtl8723bs/hal/hal_intf.c:229:\treturn rtl8723bs_xmit_buf_handler(padapter);\ndrivers/staging/rtl8723bs/hal/hal_intf.c-230-}\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c=36=static s32 rtl8723_dequeue_writeport(struct adapter *padapter)\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-40-\tstruct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:41:\tstruct xmit_buf *pxmitbuf;\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-42-\tstruct adapter *pri_padapter = padapter;\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-120- */\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:121:s32 rtl8723bs_xmit_buf_handler(struct adapter *padapter)\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-122-{\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c=166=static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv)\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-175-\tstruct __queue *pframe_queue;\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:176:\tstruct xmit_buf *pxmitbuf;\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-177-\tu32 txlen, max_xmit_len;\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-231-\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:232:\t\t\t\t/* check xmit_buf size enough or not */\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-233-\t\t\t\ttxlen = txdesc_size + rtw_wlan_pkt_size(pxmitframe);\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-318-\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:319:\t\t/* dump xmit_buf to hw tx fifo */\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-320-\t\tif (pxmitbuf) {\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c=419=s32 rtl8723bs_mgnt_xmit(\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-424-\tstruct pkt_attrib *pattrib = \u0026pmgntframe-\u003eattrib;\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:425:\tstruct xmit_buf *pxmitbuf = pmgntframe-\u003epxmitbuf;\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-426-\tstruct xmit_priv *pxmitpriv = \u0026padapter-\u003exmitpriv;\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c=538=void rtl8723bs_free_xmit_priv(struct adapter *padapter)\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-540-\tstruct xmit_priv *pxmitpriv = \u0026padapter-\u003exmitpriv;\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:541:\tstruct xmit_buf *pxmitbuf;\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-542-\tstruct __queue *pqueue = \u0026pxmitpriv-\u003epending_xmitbuf_queue;\n--\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-562-\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c:563:\t\tpxmitbuf = container_of(plist, struct xmit_buf, list);\ndrivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c-564-\t\trtw_free_xmitframe(pxmitpriv, (struct xmit_frame *)pxmitbuf-\u003epriv_data);\n--\ndrivers/staging/rtl8723bs/hal/sdio_ops.c=313=static u32 sdio_write_port(\n--\ndrivers/staging/rtl8723bs/hal/sdio_ops.c-322-\ts32 err;\ndrivers/staging/rtl8723bs/hal/sdio_ops.c:323:\tstruct xmit_buf *xmitbuf = (struct xmit_buf *)mem;\ndrivers/staging/rtl8723bs/hal/sdio_ops.c-324-\n--\ndrivers/staging/rtl8723bs/include/rtl8723b_xmit.h=414=s32\trtl8723bs_hal_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitframe);\ndrivers/staging/rtl8723bs/include/rtl8723b_xmit.h:415:s32 rtl8723bs_xmit_buf_handler(struct adapter *padapter);\ndrivers/staging/rtl8723bs/include/rtl8723b_xmit.h-416-int rtl8723bs_xmit_thread(void *context);\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h=215=void rtw_sctx_done(struct submit_ctx **sctx);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-216-\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:217:struct xmit_buf {\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-218-\tstruct list_head\tlist;\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h=246=struct xmit_frame {\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-258-\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:259:\tstruct xmit_buf *pxmitbuf;\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-260-\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h=319=struct\txmit_priv {\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-388-\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:389:\tstruct xmit_buf\tpcmd_xmitbuf[CMDBUF_MAX];\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-390-\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h=400=extern struct xmit_frame *__rtw_alloc_cmdxmitframe(struct xmit_priv *pxmitpriv,\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-404-\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:405:extern struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:406:extern s32 rtw_free_xmitbuf_ext(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-407-\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:408:extern struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:409:extern s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-410-\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h=453=u8 qos_acm(u8 acm_mask, u8 priority);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-454-\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:455:void enqueue_pending_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:456:void enqueue_pending_xmitbuf_to_head(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:457:struct xmit_buf *dequeue_pending_xmitbuf(struct xmit_priv *pxmitpriv);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:458:struct xmit_buf *dequeue_pending_xmitbuf_under_survey(struct xmit_priv *pxmitpriv);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-459-signed int\tcheck_pending_xmitbuf(struct xmit_priv *pxmitpriv);\n--\ndrivers/staging/rtl8723bs/include/rtw_xmit.h=465=void rtw_ack_tx_done(struct xmit_priv *pxmitpriv, int status);\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-466-\ndrivers/staging/rtl8723bs/include/rtw_xmit.h:467:/* include after declaring struct xmit_buf, in order to avoid warning */\ndrivers/staging/rtl8723bs/include/rtw_xmit.h-468-#include \u003cxmit_osdep.h\u003e\n--\ndrivers/staging/rtl8723bs/include/xmit_osdep.h=25=struct xmit_frame;\ndrivers/staging/rtl8723bs/include/xmit_osdep.h:26:struct xmit_buf;\ndrivers/staging/rtl8723bs/include/xmit_osdep.h-27-\n--\ndrivers/staging/rtl8723bs/include/xmit_osdep.h=31=void rtw_os_xmit_schedule(struct adapter *padapter);\ndrivers/staging/rtl8723bs/include/xmit_osdep.h-32-\ndrivers/staging/rtl8723bs/include/xmit_osdep.h:33:void rtw_os_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 free_sz, u8 flag);\ndrivers/staging/rtl8723bs/include/xmit_osdep.h-34-\n--\ndrivers/staging/rtl8723bs/os_dep/xmit_linux.c=53=void rtw_os_xmit_resource_free(struct adapter *padapter,\ndrivers/staging/rtl8723bs/os_dep/xmit_linux.c:54:\t\t\t struct xmit_buf *pxmitbuf,\ndrivers/staging/rtl8723bs/os_dep/xmit_linux.c-55-\t\t\t u32 free_sz, u8 flag)\n--\ndrivers/tty/mips_ejtag_fdc.c=84=struct mips_ejtag_fdc_tty;\n--\ndrivers/tty/mips_ejtag_fdc.c-93- * @rx_buf:\t\tRead buffer.\ndrivers/tty/mips_ejtag_fdc.c:94: * @xmit_lock:\t\tLock for xmit_*, and port.xmit_buf.\ndrivers/tty/mips_ejtag_fdc.c-95- *\t\t\tThis protects between user context and kernel thread.\n--\ndrivers/tty/mips_ejtag_fdc.c=415=static unsigned int mips_ejtag_fdc_put_chan(struct mips_ejtag_fdc_tty *priv,\n--\ndrivers/tty/mips_ejtag_fdc.c-427-\tif (dport-\u003exmit_cnt) {\ndrivers/tty/mips_ejtag_fdc.c:428:\t\tptrs[0] = dport-\u003eport.xmit_buf + dport-\u003exmit_tail;\n\n"
} |
| 57/3 | 2026/08/30 08:45 | llm | kmsan-evaluator |
2mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 22486 output: 31 thoughts: 30 Thoughts: Here's my thought process, as requested: **Investigating `free_page` Usage within TTY Drivers** Okay, so I need to make sure I haven't missed any potential issues with how `free_page` is being used on `port->xmit_buf`. My gut feeling is to double-check within the `drivers/tty/` directory, specifically since that's where the context implies the likely issue. This is a common debugging approach - narrow the scope to the most relevant areas first. I need to ensure there are no other instances of this function call that are related to memory deallocation, particularly concerning `port->xmit_buf`. That specific buffer is critical, so a thorough search is warranted. Time to dive in and perform a targeted code review. I'll probably start with a `grep` or similar search to pinpoint potential uses of `free_page` and then manually inspect the surrounding code for each hit. That will quickly reveal any potential misuse or unexpected interactions. |
| 58/3 | 2026/08/30 08:48 | tool | grepper |
0mError:no matches Args: {
"Expression": "free_page.*xmit_buf",
"PathPrefix": "drivers/tty"
}Results: {
"error": "no matches"
} |
| 59/3 | 2026/08/30 08:48 | llm | kmsan-evaluator |
1mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 22771 output: 39 thoughts: 35 Thoughts: Okay, here's my interpretation of those thoughts, presented as a first-person expert summary: **Digging into TTY Driver Memory Allocation** Alright, the symptoms point towards a possible memory issue within the TTY driver. Given the context, the first thing that jumps to mind is how the driver is handling its transmit buffer, the `xmit_buf`. It's a classic area to look at when dealing with TTY-related problems, especially those involving data corruption or unexpected behavior. So, my immediate thought is to zero in on the memory allocation routines, specifically within the `drivers/tty/` directory. I want to examine how the driver is acquiring and releasing memory for that `xmit_buf`. The key functions I'd be looking at are `__get_free_page` or `get_zeroed_page`. These are fundamental page allocation functions, and a misconfiguration or misuse of them could lead to all sorts of nasty problems: memory leaks, buffer overflows, or even accessing uninitialized data. Understanding how these functions are used in conjunction with the `xmit_buf` is crucial to diagnosing the underlying issue. I'll need to trace the calls, check for any race conditions, and see if there are any potential buffer overflows or underflows, as well as ensure the allocations are handled in a thread-safe manner. |
| 60/3 | 2026/08/30 08:49 | tool | grepper |
0mError:no matches Args: {
"Expression": "(get_free_page|get_zeroed_page).*xmit",
"PathPrefix": "drivers/tty"
}Results: {
"error": "no matches"
} |
| 61/3 | 2026/08/30 08:49 | llm | kmsan-evaluator |
1mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 23141 output: 30 thoughts: 27 Thoughts: **Investigating Potential Serial Transmission Buffer Issues** Okay, let's dive in. I need to get a handle on potential issues related to transmission buffers. My initial focus is going to be within the `drivers/tty/serial/` and `drivers/tty/` directories. Specifically, I'm going to zero in on any instances of `xmit_buf`. That's a pretty standard naming convention, and it's a good starting point for locating areas where data is being staged for transmission over serial interfaces. I'll need to look at how these buffers are managed, allocated, filled, and, crucially, when they are emptied. The interaction with interrupt handling will be key here. Are we seeing any buffer overflows, data corruption, or potential lock contention problems related to transmission? I'm anticipating some intricate interactions with the hardware and timing that will need very careful review. |
| 62/3 | 2026/08/30 08:50 | tool | grepper |
0mArgs:{
"Expression": "xmit_buf",
"PathPrefix": "drivers/tty/serial/"
}Results: {
"Output": "drivers/tty/serial/8250/8250_dma.c=223=int serial8250_request_dma(struct uart_8250_port *p)\n--\ndrivers/tty/serial/8250/8250_dma.c-297-\tdma-\u003etx_addr = dma_map_single(dma-\u003etxchan-\u003edevice-\u003edev,\ndrivers/tty/serial/8250/8250_dma.c:298:\t\t\t\t\tp-\u003eport.state-\u003eport.xmit_buf,\ndrivers/tty/serial/8250/8250_dma.c-299-\t\t\t\t\tUART_XMIT_SIZE,\n--\ndrivers/tty/serial/atmel_serial.c=1012=static int atmel_prepare_tx_dma(struct uart_port *port)\n--\ndrivers/tty/serial/atmel_serial.c-1035-\t/* UART circular tx buffer is an aligned page. */\ndrivers/tty/serial/atmel_serial.c:1036:\tBUG_ON(!PAGE_ALIGNED(tport-\u003exmit_buf));\ndrivers/tty/serial/atmel_serial.c:1037:\tatmel_port-\u003etx_phys = dma_map_single(port-\u003edev, tport-\u003exmit_buf,\ndrivers/tty/serial/atmel_serial.c-1038-\t\t\t\t\t UART_XMIT_SIZE, DMA_TO_DEVICE);\n--\ndrivers/tty/serial/atmel_serial.c-1044-\t\tdev_dbg(port-\u003edev, \"%s: mapped %lu@%p to %pad\\n\", __func__,\ndrivers/tty/serial/atmel_serial.c:1045:\t\t\tUART_XMIT_SIZE, tport-\u003exmit_buf,\ndrivers/tty/serial/atmel_serial.c-1046-\t\t\t\u0026atmel_port-\u003etx_phys);\n--\ndrivers/tty/serial/atmel_serial.c=1489=static int atmel_prepare_tx_pdc(struct uart_port *port)\n--\ndrivers/tty/serial/atmel_serial.c-1494-\ndrivers/tty/serial/atmel_serial.c:1495:\tpdc-\u003ebuf = tport-\u003exmit_buf;\ndrivers/tty/serial/atmel_serial.c-1496-\tpdc-\u003edma_addr = dma_map_single(port-\u003edev,\n--\ndrivers/tty/serial/icom.c=253=struct icom_port {\n--\ndrivers/tty/serial/icom.c-265-\tdma_addr_t xmitRestart_pci;\ndrivers/tty/serial/icom.c:266:\tunsigned char *xmit_buf;\ndrivers/tty/serial/icom.c:267:\tdma_addr_t xmit_buf_pci;\ndrivers/tty/serial/icom.c-268-\tunsigned char *recv_buf;\n--\ndrivers/tty/serial/icom.c=394=static void free_port_memory(struct icom_port *icom_port)\n--\ndrivers/tty/serial/icom.c-403-\t}\ndrivers/tty/serial/icom.c:404:\tif (icom_port-\u003exmit_buf) {\ndrivers/tty/serial/icom.c:405:\t\tdma_free_coherent(\u0026dev-\u003edev, 4096, icom_port-\u003exmit_buf,\ndrivers/tty/serial/icom.c:406:\t\t\t\t icom_port-\u003exmit_buf_pci);\ndrivers/tty/serial/icom.c:407:\t\ticom_port-\u003exmit_buf = NULL;\ndrivers/tty/serial/icom.c-408-\t}\n--\ndrivers/tty/serial/icom.c=422=static int get_port_memory(struct icom_port *icom_port)\n--\ndrivers/tty/serial/icom.c-429-\ndrivers/tty/serial/icom.c:430:\ticom_port-\u003exmit_buf =\ndrivers/tty/serial/icom.c:431:\t dma_alloc_coherent(\u0026dev-\u003edev, 4096, \u0026icom_port-\u003exmit_buf_pci,\ndrivers/tty/serial/icom.c-432-\t\t\t GFP_KERNEL);\ndrivers/tty/serial/icom.c:433:\tif (!icom_port-\u003exmit_buf) {\ndrivers/tty/serial/icom.c-434-\t\tdev_err(\u0026dev-\u003edev, \"Can not allocate Transmit buffer\\n\");\n--\ndrivers/tty/serial/icom.c-438-\ttrace(icom_port, \"GET_PORT_MEM\",\ndrivers/tty/serial/icom.c:439:\t (unsigned long) icom_port-\u003exmit_buf);\ndrivers/tty/serial/icom.c-440-\n--\ndrivers/tty/serial/icom.c-486-\t\t\ttrace(icom_port, \"FOD_XBUFF\",\ndrivers/tty/serial/icom.c:487:\t\t\t (unsigned long) icom_port-\u003exmit_buf);\ndrivers/tty/serial/icom.c-488-\t\t\ticom_port-\u003estatStg-\u003exmit[index].leBuffer =\ndrivers/tty/serial/icom.c:489:\t\t\t cpu_to_le32(icom_port-\u003exmit_buf_pci);\ndrivers/tty/serial/icom.c-490-\t\t} else if (index == (NUM_XBUFFS - 1)) {\n--\ndrivers/tty/serial/icom.c-494-\t\t\ttrace(icom_port, \"FOD_XBUFF\",\ndrivers/tty/serial/icom.c:495:\t\t\t (unsigned long) icom_port-\u003exmit_buf);\ndrivers/tty/serial/icom.c-496-\t\t\ticom_port-\u003estatStg-\u003exmit[index].leBuffer =\ndrivers/tty/serial/icom.c:497:\t\t\t cpu_to_le32(icom_port-\u003exmit_buf_pci);\ndrivers/tty/serial/icom.c-498-\t\t} else {\n--\ndrivers/tty/serial/icom.c=877=static int icom_write(struct uart_port *port)\n--\ndrivers/tty/serial/icom.c-892-\ndrivers/tty/serial/icom.c:893:\tdata_count = kfifo_out_peek(\u0026tport-\u003exmit_fifo, icom_port-\u003exmit_buf,\ndrivers/tty/serial/icom.c-894-\t\t\tXMIT_BUFF_SZ);\n--\ndrivers/tty/serial/icom.c=1341=static void icom_set_termios(struct uart_port *port, struct ktermios *termios,\n--\ndrivers/tty/serial/icom.c-1350-\tint index;\ndrivers/tty/serial/icom.c:1351:\tint rcv_buff, xmit_buff;\ndrivers/tty/serial/icom.c-1352-\tunsigned long offset;\n--\ndrivers/tty/serial/icom.c-1467-\ndrivers/tty/serial/icom.c:1468:\tfor (xmit_buff = 0; xmit_buff \u003c NUM_XBUFFS; xmit_buff++) {\ndrivers/tty/serial/icom.c:1469:\t\ticom_port-\u003estatStg-\u003exmit[xmit_buff].flags = 0;\ndrivers/tty/serial/icom.c-1470-\t}\n--\ndrivers/tty/serial/pch_uart.c=862=static unsigned int dma_handle_tx(struct eg20t_port *priv)\n--\ndrivers/tty/serial/pch_uart.c-934-\t\tif (i == (num - 1))\ndrivers/tty/serial/pch_uart.c:935:\t\t\tsg_set_page(sg, virt_to_page(tport-\u003exmit_buf),\ndrivers/tty/serial/pch_uart.c-936-\t\t\t\t rem, fifo_size * i);\ndrivers/tty/serial/pch_uart.c-937-\t\telse\ndrivers/tty/serial/pch_uart.c:938:\t\t\tsg_set_page(sg, virt_to_page(tport-\u003exmit_buf),\ndrivers/tty/serial/pch_uart.c-939-\t\t\t\t size, fifo_size * i);\n--\ndrivers/tty/serial/samsung_tty.c=1042=static int s3c24xx_serial_request_dma(struct s3c24xx_uart_port *p)\n--\ndrivers/tty/serial/samsung_tty.c-1113-\tdma-\u003etx_addr = dma_map_single(dma-\u003etx_chan-\u003edevice-\u003edev,\ndrivers/tty/serial/samsung_tty.c:1114:\t\t\t\t p-\u003eport.state-\u003eport.xmit_buf,\ndrivers/tty/serial/samsung_tty.c-1115-\t\t\t\t UART_XMIT_SIZE,\n--\ndrivers/tty/serial/serial-tegra.c=1141=static int tegra_uart_dma_channel_allocate(struct tegra_uart_port *tup,\n--\ndrivers/tty/serial/serial-tegra.c-1177-\t} else {\ndrivers/tty/serial/serial-tegra.c:1178:\t\tdma_buf = tup-\u003euport.state-\u003eport.xmit_buf;\ndrivers/tty/serial/serial-tegra.c-1179-\t\tdma_phys = dma_map_single(tup-\u003euport.dev,\n--\ndrivers/tty/serial/serial_core.c=202=static void uart_change_line_settings(struct tty_struct *tty, struct uart_state *state,\n--\ndrivers/tty/serial/serial_core.c-244-\ndrivers/tty/serial/serial_core.c:245:static int uart_alloc_xmit_buf(struct tty_port *port)\ndrivers/tty/serial/serial_core.c-246-{\n--\ndrivers/tty/serial/serial_core.c-260-\tuport = uart_port_ref_lock(state, \u0026flags);\ndrivers/tty/serial/serial_core.c:261:\tif (!state-\u003eport.xmit_buf) {\ndrivers/tty/serial/serial_core.c:262:\t\tstate-\u003eport.xmit_buf = buf;\ndrivers/tty/serial/serial_core.c:263:\t\tkfifo_init(\u0026state-\u003eport.xmit_fifo, state-\u003eport.xmit_buf,\ndrivers/tty/serial/serial_core.c-264-\t\t\t\tPAGE_SIZE);\n--\ndrivers/tty/serial/serial_core.c-269-\t\t * Do not free() the buffer under the port lock, see\ndrivers/tty/serial/serial_core.c:270:\t\t * uart_free_xmit_buf().\ndrivers/tty/serial/serial_core.c-271-\t\t */\n--\ndrivers/tty/serial/serial_core.c-277-\ndrivers/tty/serial/serial_core.c:278:static void uart_free_xmit_buf(struct tty_port *port)\ndrivers/tty/serial/serial_core.c-279-{\n--\ndrivers/tty/serial/serial_core.c-282-\tunsigned long flags;\ndrivers/tty/serial/serial_core.c:283:\tchar *xmit_buf;\ndrivers/tty/serial/serial_core.c-284-\n--\ndrivers/tty/serial/serial_core.c-291-\tuport = uart_port_ref_lock(state, \u0026flags);\ndrivers/tty/serial/serial_core.c:292:\txmit_buf = port-\u003exmit_buf;\ndrivers/tty/serial/serial_core.c:293:\tport-\u003exmit_buf = NULL;\ndrivers/tty/serial/serial_core.c-294-\tINIT_KFIFO(port-\u003exmit_fifo);\n--\ndrivers/tty/serial/serial_core.c-296-\ndrivers/tty/serial/serial_core.c:297:\tkfree(xmit_buf);\ndrivers/tty/serial/serial_core.c-298-}\n--\ndrivers/tty/serial/serial_core.c=304=static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,\n--\ndrivers/tty/serial/serial_core.c-317-\ndrivers/tty/serial/serial_core.c:318:\tretval = uart_alloc_xmit_buf(\u0026state-\u003eport);\ndrivers/tty/serial/serial_core.c-319-\tif (retval)\n--\ndrivers/tty/serial/serial_core.c=389=static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)\n--\ndrivers/tty/serial/serial_core.c-429-\ndrivers/tty/serial/serial_core.c:430:\tuart_free_xmit_buf(port);\ndrivers/tty/serial/serial_core.c-431-}\n--\ndrivers/tty/serial/serial_core.c=583=static int uart_put_char(struct tty_struct *tty, u8 c)\n--\ndrivers/tty/serial/serial_core.c-590-\tport = uart_port_ref_lock(state, \u0026flags);\ndrivers/tty/serial/serial_core.c:591:\tif (!state-\u003eport.xmit_buf) {\ndrivers/tty/serial/serial_core.c-592-\t\tuart_port_unlock_deref(port, flags);\n--\ndrivers/tty/serial/serial_core.c=607=static ssize_t uart_write(struct tty_struct *tty, const u8 *buf, size_t count)\n--\ndrivers/tty/serial/serial_core.c-621-\tport = uart_port_ref_lock(state, \u0026flags);\ndrivers/tty/serial/serial_core.c:622:\tif (!state-\u003eport.xmit_buf) {\ndrivers/tty/serial/serial_core.c-623-\t\tuart_port_unlock_deref(port, flags);\n--\ndrivers/tty/serial/serial_core.c=635=static unsigned int uart_write_room(struct tty_struct *tty)\n--\ndrivers/tty/serial/serial_core.c-642-\tport = uart_port_ref_lock(state, \u0026flags);\ndrivers/tty/serial/serial_core.c:643:\tif (!state-\u003eport.xmit_buf)\ndrivers/tty/serial/serial_core.c-644-\t\tret = 0;\n--\ndrivers/tty/serial/serial_core.c=1718=static void uart_tty_port_shutdown(struct tty_port *port)\n--\ndrivers/tty/serial/serial_core.c-1742-\ndrivers/tty/serial/serial_core.c:1743:\tuart_free_xmit_buf(port);\ndrivers/tty/serial/serial_core.c-1744-\n--\ndrivers/tty/serial/sh-sci.c=1642=static void sci_dma_tx_work_fn(struct work_struct *work)\n--\ndrivers/tty/serial/sh-sci.c-1692-\tdev_dbg(port-\u003edev, \"%s: %p: %u, cookie %d\\n\",\ndrivers/tty/serial/sh-sci.c:1693:\t\t__func__, tport-\u003exmit_buf, tail, s-\u003ecookie_tx);\ndrivers/tty/serial/sh-sci.c-1694-\n--\ndrivers/tty/serial/sh-sci.c=1805=static void sci_request_dma(struct uart_port *port)\n--\ndrivers/tty/serial/sh-sci.c-1836-\t\ts-\u003etx_dma_addr = dma_map_single(chan-\u003edevice-\u003edev,\ndrivers/tty/serial/sh-sci.c:1837:\t\t\t\t\t\ttport-\u003exmit_buf,\ndrivers/tty/serial/sh-sci.c-1838-\t\t\t\t\t\tUART_XMIT_SIZE,\n--\ndrivers/tty/serial/sh-sci.c-1845-\t\t\t\t__func__, UART_XMIT_SIZE,\ndrivers/tty/serial/sh-sci.c:1846:\t\t\t\ttport-\u003exmit_buf, \u0026s-\u003etx_dma_addr);\ndrivers/tty/serial/sh-sci.c-1847-\n"
} |
| 63/3 | 2026/08/30 08:50 | llm | kmsan-evaluator |
1mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 27576 output: 303 thoughts: 928 Thoughts: **KMSAN Assessment: No Need for Intervention** Alright, let's break this down. My initial assessment of this patch is that KMSAN isn't needed here. The core change is the migration from the page allocator (`__get_free_page`, `get_zeroed_page`, `free_page`) to the slab allocator (`kmalloc`, `kzalloc`, `kfree`) across `hvcs.c`, `serial_core.c`, and `tty_port.c`. Here's the detailed justification, and why it doesn't trigger any KMSAN alarms: * **Zero-Initialization is Maintained:** In both `serial_core.c` and `tty_port.c`, we're replacing `get_zeroed_page` with `kzalloc`. This is a direct, safe replacement as `kzalloc` explicitly zeroes the allocated memory. A similar rationale applies to the use of `memset` in `hvcs_get_partner_info()` in `hvcs.c` so the behaviour has not changed with respect to memory initialisation. * **Risk Mitigation from the Slab Allocator:** The shift to the slab allocator and memory management means potential issues like double-frees, mismatched allocations, or use-after-free bugs are now squarely in the domain of KASAN (Kernel Address Sanitizer) and SLUB debug. These tools are designed to catch precisely these kinds of memory corruption issues, so they don't warrant KMSAN flagging. In other words, our risk profile has _decreased_ not increased. * **No Uninitialized Memory Exposure:** Crucially, there's no introduction or exposure of uninitialized memory reads, leakage of uninitialized struct members to userspace, or uninitialized conditions in any control flow. Everything is either explicitly zero-initialized using `kzalloc` or `memset` *before* being used. * **Alignment with KMSAN Guidelines:** The KMSAN guidelines explicitly state that we *don't* need to flag if changes primarily concern bugs like out-of-bounds access, use-after-free, or locking issues (all handled by other debug tools) or if *all* structures are fully initialized before read/copy, which is the case here. Therefore, given the nature of the change and the existing protections against memory corruption, a KMSAN intervention is unnecessary. I'll invoke set-results and move on. |
| 64/3 | 2026/08/30 08:51 | tool | set-results |
0mArgs:{
"KMSANReasoning": "The patch converts page-allocator calls (`__get_free_page()`, `get_zeroed_page()`, `free_page()`) to slab-allocator calls (`kmalloc()`, `kzalloc()`, `kfree()`) for transmit buffers and partner info buffers in `drivers/tty/hvc/hvcs.c`, `drivers/tty/serial/serial_core.c`, and `drivers/tty/tty_port.c`.\n\n- In `serial_core.c` and `tty_port.c`, buffers are allocated with `kzalloc(PAGE_SIZE, GFP_KERNEL)`, ensuring full zero-initialization identical to `get_zeroed_page()`.\n- In `hvcs.c`, the allocated buffer is explicitly zeroed with `memset(pi_buff, 0x00, PAGE_SIZE)` in `hvcs_get_partner_info()` before use.\n- The changes do not introduce uninitialized stack/heap reads, uninitialized structure fields, padding leaks, or uninitialized conditional branching.\n- Any potential memory management issues (such as use-after-free, double free, or buffer overflow) are within the domain of standard KASAN and slab debuggers.\n\nTherefore, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false
}Results: {
"KMSANReasoning": "The patch converts page-allocator calls (`__get_free_page()`, `get_zeroed_page()`, `free_page()`) to slab-allocator calls (`kmalloc()`, `kzalloc()`, `kfree()`) for transmit buffers and partner info buffers in `drivers/tty/hvc/hvcs.c`, `drivers/tty/serial/serial_core.c`, and `drivers/tty/tty_port.c`.\n\n- In `serial_core.c` and `tty_port.c`, buffers are allocated with `kzalloc(PAGE_SIZE, GFP_KERNEL)`, ensuring full zero-initialization identical to `get_zeroed_page()`.\n- In `hvcs.c`, the allocated buffer is explicitly zeroed with `memset(pi_buff, 0x00, PAGE_SIZE)` in `hvcs_get_partner_info()` before use.\n- The changes do not introduce uninitialized stack/heap reads, uninitialized structure fields, padding leaks, or uninitialized conditional branching.\n- Any potential memory management issues (such as use-after-free, double free, or buffer overflow) are within the domain of standard KASAN and slab debuggers.\n\nTherefore, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|