| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/22 17:22 | flow | patch-triage |
13mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies `nvmem_shift_read_buffer_in_place()` in `drivers/nvmem/core.c`, which is only invoked when reading nvmem cells with sub-byte alignment or width (`cell-\u003ebit_offset != 0` or `cell-\u003enbits != 0`). In the kernel, such cells are defined exclusively via Device Tree bindings (\"bits\" property) or vendor-specific ARM/SoC eFuse/OTP drivers (e.g., Qualcomm QFPROM, Tegra fuse, i.MX OCOTP, MediaTek eFuse). On the target architecture amd64, standard virtualized environments boot via ACPI rather than Device Trees, no amd64 driver defines nvmem cells with bit offsets or custom bit widths, and no userspace interface exists to register nvmem cells or inject Device Tree nodes. Consequently, the modified code is structurally unreachable on amd64.",
"WorthFuzzing": false
} |
| 1/1 | 2026/09/22 17:22 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 4da74d0352cad1ee0c07f09e61c60ef7b7d5c625\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Tue Sep 22 17:22:07 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c\nindex 0556d140170a4..b4e5069d9e380 100644\n--- a/drivers/nvmem/core.c\n+++ b/drivers/nvmem/core.c\n@@ -1598,12 +1598,14 @@ static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void\n \t\t*p = *b++ \u003e\u003e bit_offset;\n \n \t\t/* setup rest of the bytes if any */\n-\t\tfor (i = 1; i \u003c cell-\u003ebytes; i++) {\n+\t\tfor (i = 1; i \u003c (cell-\u003ebytes - bytes_offset); i++) {\n \t\t\t/* Get bits from next byte and shift them towards msb */\n \t\t\t*p++ |= *b \u003c\u003c (BITS_PER_BYTE - bit_offset);\n \n \t\t\t*p = *b++ \u003e\u003e bit_offset;\n \t\t}\n+\t\t/* point to end of the buffer unused bits will be cleared */\n+\t\tp = buf + cell-\u003ebytes - 1;\n \t} else if (p != b) {\n \t\tmemmove(p, b, cell-\u003ebytes - bytes_offset);\n \t\tp += cell-\u003ebytes - 1;\n"
} |
| 2/1 | 2026/09/22 17:22 | agent | patch-evaluator |
13mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies `nvmem_shift_read_buffer_in_place()` in `drivers/nvmem/core.c`, which is only invoked when reading nvmem cells with sub-byte alignment or width (`cell-\u003ebit_offset != 0` or `cell-\u003enbits != 0`). In the kernel, such cells are defined exclusively via Device Tree bindings (\"bits\" property) or vendor-specific ARM/SoC eFuse/OTP drivers (e.g., Qualcomm QFPROM, Tegra fuse, i.MX OCOTP, MediaTek eFuse). On the target architecture amd64, standard virtualized environments boot via ACPI rather than Device Trees, no amd64 driver defines nvmem cells with bit offsets or custom bit widths, and no userspace interface exists to register nvmem cells or inject Device Tree nodes. Consequently, the modified code is structurally unreachable on amd64.",
"WorthFuzzing": false
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any '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: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit 4da74d0352cad1ee0c07f09e61c60ef7b7d5c625
Author: syz-cluster <triage@syzkaller.com>
Date: Tue Sep 22 17:22:07 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 0556d140170a4..b4e5069d9e380 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -1598,12 +1598,14 @@ static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void
*p = *b++ >> bit_offset;
/* setup rest of the bytes if any */
- for (i = 1; i < cell->bytes; i++) {
+ for (i = 1; i < (cell->bytes - bytes_offset); i++) {
/* Get bits from next byte and shift them towards msb */
*p++ |= *b << (BITS_PER_BYTE - bit_offset);
*p = *b++ >> bit_offset;
}
+ /* point to end of the buffer unused bits will be cleared */
+ p = buf + cell->bytes - 1;
} else if (p != b) {
memmove(p, b, cell->bytes - bytes_offset);
p += cell->bytes - 1;
|
| 3/2 | 2026/09/22 17:22 | llm | patch-evaluator |
3mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 2991 output: 37 thoughts: 550 Thoughts: **Evaluating a Kernel Patch for Syzkaller Fuzzing** Alright, let's break this down. The user's requesting an evaluation of a Linux kernel patch affecting `drivers/nvmem/core.c`, specifically for syzkaller fuzzing purposes. My primary goal here is software QA, triage – essentially, determining if this patch warrants dedicated fuzzing attention, and if so, providing the necessary syzkaller configuration details. This falls squarely into the "benign" category: QA, defensive security, fuzzing configuration. No exploit dev. We're safe to proceed. First, I need to understand the change. Looking at the diff, it appears this patch is modifying the `nvmem_shift_read_buffer_in_place` function. It seems to be related to bit shifting operations within the NVMEM driver. The code itself looks like it's handling the shifting and copying of data within a buffer, likely during read operations from non-volatile memory. Specifically, there's a loop that appears to be iterating through the bytes of the `cell->bytes` value and shifting bits around, possibly to handle byte alignment. The `bytes_offset` variable seems important for handling scenarios where reads don't start at a byte boundary. Now, my key question is: Is this code path reachable via syzkaller, or, more broadly, a standard QEMU environment? I need to figure out how `nvmem_shift_read_buffer_in_place` is called. Is there a likely trigger for it via file operations or some other exposed interface within the NVMEM subsystem? I'll probably need to use either `read-file` or `grepper` to see where `nvmem_shift_read_buffer_in_place` is called and how NVMEM is used in the context of the driver. This will give me a clear picture of how easily a fuzzer can hit this code. |
| 4/2 | 2026/09/22 17:25 | tool | read-file |
0mArgs:{
"File": "drivers/nvmem/core.c",
"FirstLine": 1580,
"LineCount": 50
}Results: {
"Contents": "1580:\t\tnvmem_device_put(nvmem);\n1581:\t}\n1582:\tEXPORT_SYMBOL_GPL(nvmem_cell_put);\n1583:\t\n1584:\tstatic void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)\n1585:\t{\n1586:\t\tu8 *p, *b;\n1587:\t\tint i, extra, bytes_offset;\n1588:\t\tint bit_offset = cell-\u003ebit_offset;\n1589:\t\n1590:\t\tp = b = buf;\n1591:\t\n1592:\t\tbytes_offset = bit_offset / BITS_PER_BYTE;\n1593:\t\tb += bytes_offset;\n1594:\t\tbit_offset %= BITS_PER_BYTE;\n1595:\t\n1596:\t\tif (bit_offset % BITS_PER_BYTE) {\n1597:\t\t\t/* First shift */\n1598:\t\t\t*p = *b++ \u003e\u003e bit_offset;\n1599:\t\n1600:\t\t\t/* setup rest of the bytes if any */\n1601:\t\t\tfor (i = 1; i \u003c (cell-\u003ebytes - bytes_offset); i++) {\n1602:\t\t\t\t/* Get bits from next byte and shift them towards msb */\n1603:\t\t\t\t*p++ |= *b \u003c\u003c (BITS_PER_BYTE - bit_offset);\n1604:\t\n1605:\t\t\t\t*p = *b++ \u003e\u003e bit_offset;\n1606:\t\t\t}\n1607:\t\t\t/* point to end of the buffer unused bits will be cleared */\n1608:\t\t\tp = buf + cell-\u003ebytes - 1;\n1609:\t\t} else if (p != b) {\n1610:\t\t\tmemmove(p, b, cell-\u003ebytes - bytes_offset);\n1611:\t\t\tp += cell-\u003ebytes - 1;\n1612:\t\t} else {\n1613:\t\t\t/* point to the msb */\n1614:\t\t\tp += cell-\u003ebytes - 1;\n1615:\t\t}\n1616:\t\n1617:\t\t/* result fits in less bytes */\n1618:\t\textra = cell-\u003ebytes - DIV_ROUND_UP(cell-\u003enbits, BITS_PER_BYTE);\n1619:\t\twhile (--extra \u003e= 0)\n1620:\t\t\t*p-- = 0;\n1621:\t\n1622:\t\t/* clear msb bits if any leftover in the last byte */\n1623:\t\tif (cell-\u003enbits % BITS_PER_BYTE)\n1624:\t\t\t*p \u0026= GENMASK((cell-\u003enbits % BITS_PER_BYTE) - 1, 0);\n1625:\t}\n1626:\t\n1627:\tstatic int __nvmem_cell_read(struct nvmem_device *nvmem,\n1628:\t\t\t\t struct nvmem_cell_entry *cell,\n1629:\t\t\t\t void *buf, size_t *len, const char *id, int index)\n"
} |
| 5/2 | 2026/09/22 17:25 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 4795 output: 37 thoughts: 34 Thoughts: Here's my take on the thought process, as if it were my own: **Investigating `nvmem_shift_read_buffer_in_place` and `__nvmem_cell_read` Usage** Okay, so I'm diving into this code. I need to understand how these read functions, `nvmem_shift_read_buffer_in_place` and `__nvmem_cell_read`, are actually being used. It's crucial for me to grasp the context of these specific reads. I need to follow the trail of how the data flows in this system. I want to trace back from the calls to these functions to understand *why* they're being used, what they're reading, and what happens with the result. I expect this will give me insights into potential optimizations, identify potential error paths, and provide a fuller picture of the memory subsystem's operation. Time to dig deeper and see what's what. |
| 6/2 | 2026/09/22 17:25 | tool | read-file |
0mArgs:{
"File": "drivers/nvmem/core.c",
"FirstLine": 1630,
"LineCount": 80
}Results: {
"Contents": "1630:\t{\n1631:\t\tint rc;\n1632:\t\n1633:\t\trc = nvmem_reg_read(nvmem, cell-\u003eoffset, buf, cell-\u003eraw_len);\n1634:\t\n1635:\t\tif (rc)\n1636:\t\t\treturn rc;\n1637:\t\n1638:\t\t/* shift bits in-place */\n1639:\t\tif (cell-\u003ebit_offset || cell-\u003enbits)\n1640:\t\t\tnvmem_shift_read_buffer_in_place(cell, buf);\n1641:\t\n1642:\t\tif (cell-\u003eread_post_process) {\n1643:\t\t\trc = cell-\u003eread_post_process(cell-\u003epriv, id, index,\n1644:\t\t\t\t\t\t cell-\u003eoffset, buf, cell-\u003eraw_len);\n1645:\t\t\tif (rc)\n1646:\t\t\t\treturn rc;\n1647:\t\t}\n1648:\t\n1649:\t\tif (len)\n1650:\t\t\t*len = cell-\u003ebytes;\n1651:\t\n1652:\t\treturn 0;\n1653:\t}\n1654:\t\n1655:\t/**\n1656:\t * nvmem_cell_read() - Read a given nvmem cell\n1657:\t *\n1658:\t * @cell: nvmem cell to be read.\n1659:\t * @len: pointer to length of cell which will be populated on successful read;\n1660:\t *\t can be NULL.\n1661:\t *\n1662:\t * Return: ERR_PTR() on error or a valid pointer to a buffer on success. The\n1663:\t * buffer should be freed by the consumer with a kfree().\n1664:\t */\n1665:\tvoid *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)\n1666:\t{\n1667:\t\tstruct nvmem_cell_entry *entry = cell-\u003eentry;\n1668:\t\tstruct nvmem_device *nvmem = entry-\u003envmem;\n1669:\t\tu8 *buf;\n1670:\t\tint rc;\n1671:\t\n1672:\t\tif (!nvmem)\n1673:\t\t\treturn ERR_PTR(-EINVAL);\n1674:\t\n1675:\t\tbuf = kzalloc(max_t(size_t, entry-\u003eraw_len, entry-\u003ebytes), GFP_KERNEL);\n1676:\t\tif (!buf)\n1677:\t\t\treturn ERR_PTR(-ENOMEM);\n1678:\t\n1679:\t\trc = __nvmem_cell_read(nvmem, cell-\u003eentry, buf, len, cell-\u003eid, cell-\u003eindex);\n1680:\t\tif (rc) {\n1681:\t\t\tkfree(buf);\n1682:\t\t\treturn ERR_PTR(rc);\n1683:\t\t}\n1684:\t\n1685:\t\treturn buf;\n1686:\t}\n1687:\tEXPORT_SYMBOL_GPL(nvmem_cell_read);\n1688:\t\n1689:\tstatic void *nvmem_cell_prepare_write_buffer(struct nvmem_cell_entry *cell,\n1690:\t\t\t\t\t\t u8 *_buf, int len)\n1691:\t{\n1692:\t\tstruct nvmem_device *nvmem = cell-\u003envmem;\n1693:\t\tint i, rc, nbits, bit_offset = cell-\u003ebit_offset;\n1694:\t\tu8 v, *p, *buf, *b, pbyte, pbits;\n1695:\t\n1696:\t\tnbits = cell-\u003enbits;\n1697:\t\tbuf = kzalloc(cell-\u003ebytes, GFP_KERNEL);\n1698:\t\tif (!buf)\n1699:\t\t\treturn ERR_PTR(-ENOMEM);\n1700:\t\n1701:\t\tmemcpy(buf, _buf, len);\n1702:\t\tp = b = buf;\n1703:\t\n1704:\t\tif (bit_offset) {\n1705:\t\t\tpbyte = *b;\n1706:\t\t\t*b \u003c\u003c= bit_offset;\n1707:\t\n1708:\t\t\t/* setup the first byte with lsb bits from nvmem */\n1709:\t\t\trc = nvmem_reg_read(nvmem, cell-\u003eoffset, \u0026v, 1);\n"
} |
| 7/2 | 2026/09/22 17:25 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 6234 output: 31 thoughts: 50 Thoughts: **Investigating nvmem_cell_read Callers** Okay, so I need to understand the usage of `nvmem_cell_read` and, importantly, its internal counterpart `__nvmem_cell_read`. I know there's likely some indirectness involved, but I want to get a complete picture of its context. My first thought is to see where these functions are actually *called* within the code base. A targeted search is the best way to start. I'll focus on the `drivers/nvmem/` directory initially. A `grep` for `__nvmem_cell_read` in that specific location should give me a good handle on where this function is being invoked and, likely, provide some valuable clues about its intended purpose and usage patterns. Let's see what that uncovers. |
| 8/2 | 2026/09/22 17:25 | tool | grepper |
0mArgs:{
"Expression": "__nvmem_cell_read",
"PathPrefix": "drivers/nvmem"
}Results: {
"Output": "drivers/nvmem/core.c=1584=static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)\n--\ndrivers/nvmem/core.c-1626-\ndrivers/nvmem/core.c:1627:static int __nvmem_cell_read(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c-1628-\t\t\t struct nvmem_cell_entry *cell,\n--\ndrivers/nvmem/core.c=1665=void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)\n--\ndrivers/nvmem/core.c-1678-\ndrivers/nvmem/core.c:1679:\trc = __nvmem_cell_read(nvmem, cell-\u003eentry, buf, len, cell-\u003eid, cell-\u003eindex);\ndrivers/nvmem/core.c-1680-\tif (rc) {\n--\ndrivers/nvmem/core.c=1988=ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-2001-\ndrivers/nvmem/core.c:2002:\trc = __nvmem_cell_read(nvmem, \u0026cell, buf, \u0026len, NULL, 0);\ndrivers/nvmem/core.c-2003-\tif (rc)\n"
} |
| 9/2 | 2026/09/22 17:25 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 6862 output: 35 thoughts: 74 Thoughts: **Investigating NVMEM Cell Access Methods** Okay, so I'm diving into this `nvmem` code, specifically the `nvmem_cell_read` and `nvmem_device_cell_read` functions. My immediate question is, how are users actually *getting* at this data? Are there user-facing interfaces like sysfs or debugfs nodes that provide access to read these `nvmem` cells? My intuition says there should be, but I need to confirm. Time to start digging. I'll focus my search within `drivers/nvmem/core.c` first, given its core role in the NVMEM framework. But I'll also expand the search to the broader `drivers/nvmem` directory and possibly beyond, to ensure I don't miss anything. I'll be looking for any hints of sysfs, debugfs, or any other user-space mechanisms that facilitate reading these cells. I need to understand the complete picture of how the data is exposed. |
| 10/2 | 2026/09/22 17:25 | tool | grepper |
0mArgs:{
"Expression": "bin_attribute.*nvmem|sysfs.*cell",
"PathPrefix": "drivers/nvmem"
}Results: {
"Output": "drivers/nvmem/core.c=354=static ssize_t nvmem_cell_attr_read(struct file *filp, struct kobject *kobj,\n--\ndrivers/nvmem/core.c-388-/* default read/write permissions */\ndrivers/nvmem/core.c:389:static const struct bin_attribute bin_attr_rw_nvmem = {\ndrivers/nvmem/core.c-390-\t.attr\t= {\n--\ndrivers/nvmem/core.c-397-\ndrivers/nvmem/core.c:398:static const struct bin_attribute *const nvmem_bin_attributes[] = {\ndrivers/nvmem/core.c-399-\t\u0026bin_attr_rw_nvmem,\n--\ndrivers/nvmem/core.c=411=static const struct attribute_group *nvmem_dev_groups[] = {\n--\ndrivers/nvmem/core.c-415-\ndrivers/nvmem/core.c:416:static const struct bin_attribute bin_attr_nvmem_eeprom_compat = {\ndrivers/nvmem/core.c-417-\t.attr\t= {\n--\ndrivers/nvmem/core.c=463=static void nvmem_sysfs_remove_compat(struct nvmem_device *nvmem)\n--\ndrivers/nvmem/core.c-468-\ndrivers/nvmem/core.c:469:static int nvmem_populate_sysfs_cells(struct nvmem_device *nvmem)\ndrivers/nvmem/core.c-470-{\n--\ndrivers/nvmem/core.c-481-\ndrivers/nvmem/core.c:482:\tif (list_empty(\u0026nvmem-\u003ecells) || nvmem-\u003esysfs_cells_populated)\ndrivers/nvmem/core.c-483-\t\treturn 0;\n--\ndrivers/nvmem/core.c-519-\ndrivers/nvmem/core.c:520:\tnvmem-\u003esysfs_cells_populated = true;\ndrivers/nvmem/core.c-521-\n--\ndrivers/nvmem/core.c=847=int nvmem_layout_register(struct nvmem_layout *layout)\n--\ndrivers/nvmem/core.c-859-#ifdef CONFIG_NVMEM_SYSFS\ndrivers/nvmem/core.c:860:\tret = nvmem_populate_sysfs_cells(layout-\u003envmem);\ndrivers/nvmem/core.c-861-\tif (ret) {\n--\ndrivers/nvmem/core.c=887=struct nvmem_device *nvmem_register(const struct nvmem_config *config)\n--\ndrivers/nvmem/core.c-1019-#ifdef CONFIG_NVMEM_SYSFS\ndrivers/nvmem/core.c:1020:\trval = nvmem_populate_sysfs_cells(nvmem);\ndrivers/nvmem/core.c-1021-\tif (rval)\n--\ndrivers/nvmem/internals.h=16=struct nvmem_device {\n--\ndrivers/nvmem/internals.h-38-\tvoid *priv;\ndrivers/nvmem/internals.h:39:\tbool\t\t\tsysfs_cells_populated;\ndrivers/nvmem/internals.h-40-};\n"
} |
| 11/2 | 2026/09/22 17:25 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 8019 output: 36 thoughts: 58 Thoughts: **Diving into the nvmem Core** Okay, here we go. My focus is sharp, I'm zeroing in on this `nvmem` code. Let's see... Line 354, ah, that's where `nvmem_cell_attr_read` is defined. Right, now I'm reading the definition of the function itself. Time to dive into the core implementation. Let's look at `drivers/nvmem/core.c` around that line number. I need to understand what's happening in this read operation. What are the inputs? What's the flow? I need to analyze how data is being retrieved from the NVMEM cell via this attribute. Let's see... |
| 12/2 | 2026/09/22 17:26 | tool | read-file |
0mArgs:{
"File": "drivers/nvmem/core.c",
"FirstLine": 340,
"LineCount": 50
}Results: {
"Contents": " 340:\t\t * configuration as read-write.\n 341:\t\t * If the device is set as read-only by configuration, it\n 342:\t\t * can be forced into read-write mode using the 'force_ro'\n 343:\t\t * attribute.\n 344:\t\t */\n 345:\t\tif (attr == \u0026dev_attr_force_ro.attr \u0026\u0026 !ops-\u003ereg_write)\n 346:\t\t\treturn 0;\t/* Attribute not visible */\n 347:\t\n 348:\t\treturn attr-\u003emode;\n 349:\t}\n 350:\t\n 351:\tstatic struct nvmem_cell *nvmem_create_cell(struct nvmem_cell_entry *entry,\n 352:\t\t\t\t\t\t const char *id, int index);\n 353:\t\n 354:\tstatic ssize_t nvmem_cell_attr_read(struct file *filp, struct kobject *kobj,\n 355:\t\t\t\t\t const struct bin_attribute *attr, char *buf,\n 356:\t\t\t\t\t loff_t pos, size_t count)\n 357:\t{\n 358:\t\tstruct nvmem_cell_entry *entry;\n 359:\t\tstruct nvmem_cell *cell = NULL;\n 360:\t\tsize_t cell_sz, read_len;\n 361:\t\tvoid *content;\n 362:\t\n 363:\t\tentry = attr-\u003eprivate;\n 364:\t\tcell = nvmem_create_cell(entry, entry-\u003ename, 0);\n 365:\t\tif (IS_ERR(cell))\n 366:\t\t\treturn PTR_ERR(cell);\n 367:\t\n 368:\t\tif (!cell)\n 369:\t\t\treturn -EINVAL;\n 370:\t\n 371:\t\tcontent = nvmem_cell_read(cell, \u0026cell_sz);\n 372:\t\tif (IS_ERR(content)) {\n 373:\t\t\tread_len = PTR_ERR(content);\n 374:\t\t\tgoto destroy_cell;\n 375:\t\t}\n 376:\t\n 377:\t\tread_len = min_t(unsigned int, cell_sz - pos, count);\n 378:\t\tmemcpy(buf, content + pos, read_len);\n 379:\t\tkfree(content);\n 380:\t\n 381:\tdestroy_cell:\n 382:\t\tkfree_const(cell-\u003eid);\n 383:\t\tkfree(cell);\n 384:\t\n 385:\t\treturn read_len;\n 386:\t}\n 387:\t\n 388:\t/* default read/write permissions */\n 389:\tstatic const struct bin_attribute bin_attr_rw_nvmem = {\n"
} |
| 13/2 | 2026/09/22 17:26 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 9002 output: 26 thoughts: 96 Thoughts: Okay, here's my breakdown of what's going through my mind as I analyze this `nvmem` code, thinking like an expert in embedded systems and memory management: **Digging into the `nvmem_cell_attr_read` Function** Alright, so I'm looking at `nvmem_cell_attr_read`, and it's pretty clear it calls `nvmem_cell_read`, which then heads down the rabbit hole to `__nvmem_cell_read`, and finally to `nvmem_shift_read_buffer_in_place`. Makes sense; we're reading a non-volatile memory cell's attributes, so there's probably some shifting and buffer handling going on. That's a standard pattern for dealing with these types of memory devices. Wait a second, though! Before I get too deep into the nitty-gritty of the lower-level functions, I need to take a step back and think about the bigger picture. How are these `nvmem` devices *actually* created and initialized? Are we talking about a physical EEPROM, flash, or something else entirely? Can I even test this stuff in a virtual environment like QEMU or a standard virtualized setup? That's a crucial question, because debugging and iterating on this code becomes exponentially harder if I can't easily reproduce the environment. Okay, let's pause my current line of thinking and take a broader view. I need to get a handle on what `nvmem` providers are out there. So, I need to know what kinds of underlying storage technologies are being supported. The best place to find that would be to look at the relevant Makefile and Kconfig files for a quick overview. I'll check `drivers/nvmem/Makefile` and `drivers/nvmem/Kconfig` to get a list of the built-in providers. |
| 14/2 | 2026/09/22 17:26 | tool | grepper |
0mArgs:{
"Expression": "nvmem_register",
"PathPrefix": "drivers/"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 694 lines.\nUse more precise expression if possible.\n\ndrivers/hwmon/pmbus/adm1266.c=579=static int adm1266_config_nvmem(struct adm1266_data *data)\n--\ndrivers/hwmon/pmbus/adm1266.c-597-\ndrivers/hwmon/pmbus/adm1266.c:598:\tdata-\u003envmem = devm_nvmem_register(\u0026data-\u003eclient-\u003edev, \u0026data-\u003envmem_config);\ndrivers/hwmon/pmbus/adm1266.c-599-\tif (IS_ERR(data-\u003envmem)) {\n--\ndrivers/hwmon/pmbus/mpq8646.c=877=static int mpq8646_probe(struct i2c_client *client)\n--\ndrivers/hwmon/pmbus/mpq8646.c-941-\t\t};\ndrivers/hwmon/pmbus/mpq8646.c:942:\t\tstruct nvmem_device *nv = devm_nvmem_register(\u0026client-\u003edev, \u0026cfg);\ndrivers/hwmon/pmbus/mpq8646.c-943-\n--\ndrivers/hwmon/spd5118.c=384=static int spd5118_nvmem_init(struct device *dev, struct spd5118_data *data)\n--\ndrivers/hwmon/spd5118.c-403-\ndrivers/hwmon/spd5118.c:404:\tnvmem = devm_nvmem_register(dev, \u0026nvmem_config);\ndrivers/hwmon/spd5118.c-405-\treturn PTR_ERR_OR_ZERO(nvmem);\n--\ndrivers/iio/pressure/bmp280-core.c=2350=static int bmp580_preinit(struct bmp280_data *data)\n--\ndrivers/iio/pressure/bmp280-core.c-2393-\t/* Register nvmem device */\ndrivers/iio/pressure/bmp280-core.c:2394:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(config.dev, \u0026config));\ndrivers/iio/pressure/bmp280-core.c-2395-}\n--\ndrivers/media/i2c/ov2740.c=1250=static int ov2740_register_nvmem(struct i2c_client *client,\n--\ndrivers/media/i2c/ov2740.c-1280-\ndrivers/media/i2c/ov2740.c:1281:\tnvm-\u003envmem = devm_nvmem_register(dev, \u0026nvmem_config);\ndrivers/media/i2c/ov2740.c-1282-\tif (IS_ERR(nvm-\u003envmem))\n--\ndrivers/media/i2c/video-i2c.c=750=static int video_i2c_probe(struct i2c_client *client)\n--\ndrivers/media/i2c/video-i2c.c-844-\ndrivers/media/i2c/video-i2c.c:845:\t\tdevice = devm_nvmem_register(\u0026client-\u003edev, config);\ndrivers/media/i2c/video-i2c.c-846-\n--\ndrivers/misc/ds1682.c=226=static int ds1682_probe(struct i2c_client *client)\n--\ndrivers/misc/ds1682.c-246-\ndrivers/misc/ds1682.c:247:\tnvmem = devm_nvmem_register(\u0026client-\u003edev, \u0026config);\ndrivers/misc/ds1682.c-248-\tif (IS_ENABLED(CONFIG_NVMEM) \u0026\u0026 IS_ERR(nvmem))\n--\ndrivers/misc/keba/cp500.c=593=static int cp500_nvmem_write(void *priv, unsigned int offset, void *val,\n--\ndrivers/misc/keba/cp500.c-606-\ndrivers/misc/keba/cp500.c:607:static int cp500_nvmem_register(struct cp500 *cp500,\ndrivers/misc/keba/cp500.c-608-\t\t\t\tstruct nvmem_device *base_nvmem)\n--\ndrivers/misc/keba/cp500.c-634-\tnvmem_config.priv = \u0026cp500-\u003envmem_cpu;\ndrivers/misc/keba/cp500.c:635:\ttmp = nvmem_register(\u0026nvmem_config);\ndrivers/misc/keba/cp500.c-636-\tif (IS_ERR(tmp))\n--\ndrivers/misc/keba/cp500.c-644-\tnvmem_config.priv = \u0026cp500-\u003envmem_user;\ndrivers/misc/keba/cp500.c:645:\ttmp = nvmem_register(\u0026nvmem_config);\ndrivers/misc/keba/cp500.c-646-\tif (IS_ERR(tmp)) {\n--\ndrivers/misc/keba/cp500.c=693=static int cp500_nvmem(struct notifier_block *nb, unsigned long action,\n--\ndrivers/misc/keba/cp500.c-720-\ndrivers/misc/keba/cp500.c:721:\tret = cp500_nvmem_register(cp500, nvmem);\ndrivers/misc/keba/cp500.c-722-\tif (ret)\n--\ndrivers/misc/keba/cp500.c=863=static int cp500_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)\n--\ndrivers/misc/keba/cp500.c-920-\tcp500-\u003envmem_notifier.notifier_call = cp500_nvmem;\ndrivers/misc/keba/cp500.c:921:\tret = nvmem_register_notifier(\u0026cp500-\u003envmem_notifier);\ndrivers/misc/keba/cp500.c-922-\tif (ret != 0)\n--\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c=320=static int pci1xxxx_otp_eeprom_probe(struct auxiliary_device *aux_dev,\n--\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c-376-\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:377:\t\tpriv-\u003envmem_eeprom = devm_nvmem_register(\u0026aux_dev-\u003edev,\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c-378-\t\t\t\t\t\t\t \u0026priv-\u003envmem_config_eeprom);\n--\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c-396-\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:397:\tpriv-\u003envmem_otp = devm_nvmem_register(\u0026aux_dev-\u003edev,\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c-398-\t\t\t\t\t \u0026priv-\u003envmem_config_otp);\n--\ndrivers/mtd/mtdcore.c=607=static int mtd_nvmem_add(struct mtd_info *mtd)\n--\ndrivers/mtd/mtdcore.c-625-\ndrivers/mtd/mtdcore.c:626:\tmtd-\u003envmem = nvmem_register(\u0026config);\ndrivers/mtd/mtdcore.c-627-\tif (IS_ERR(mtd-\u003envmem)) {\n--\ndrivers/mtd/mtdcore.c=923=static ssize_t mtd_otp_size(struct mtd_info *mtd, bool is_user)\n--\ndrivers/mtd/mtdcore.c-954-\ndrivers/mtd/mtdcore.c:955:static struct nvmem_device *mtd_otp_nvmem_register(struct mtd_info *mtd,\ndrivers/mtd/mtdcore.c-956-\t\t\t\t\t\t const char *compatible,\n--\ndrivers/mtd/mtdcore.c-980-\ndrivers/mtd/mtdcore.c:981:\tnvmem = nvmem_register(\u0026config);\ndrivers/mtd/mtdcore.c-982-\t/* Just ignore if there is no NVMEM support in the kernel */\n--\ndrivers/mtd/mtdcore.c=1019=static int mtd_otp_nvmem_add(struct mtd_info *mtd)\n--\ndrivers/mtd/mtdcore.c-1033-\t\tif (size \u003e 0) {\ndrivers/mtd/mtdcore.c:1034:\t\t\tnvmem = mtd_otp_nvmem_register(mtd, \"user-otp\", size,\ndrivers/mtd/mtdcore.c-1035-\t\t\t\t\t\t mtd_nvmem_user_otp_reg_read);\n--\ndrivers/mtd/mtdcore.c-1071-\ndrivers/mtd/mtdcore.c:1072:\t\t\tnvmem = mtd_otp_nvmem_register(mtd, \"factory-otp\", size,\ndrivers/mtd/mtdcore.c-1073-\t\t\t\t\t\t mtd_nvmem_fact_otp_reg_read);\n--\ndrivers/mtd/ubi/nvmem.c=61=static int ubi_nvmem_add(struct ubi_volume_info *vi)\n--\ndrivers/mtd/ubi/nvmem.c-98-\tunv-\u003eusable_leb_size = vi-\u003eusable_leb_size;\ndrivers/mtd/ubi/nvmem.c:99:\tunv-\u003envmem = nvmem_register(\u0026config);\ndrivers/mtd/ubi/nvmem.c-100-\tif (IS_ERR(unv-\u003envmem)) {\n--\ndrivers/nvmem/airoha-smc-efuses.c=50=static int airoha_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/airoha-smc-efuses.c-99-\t\tnvmem_config.of_node = child;\ndrivers/nvmem/airoha-smc-efuses.c:100:\t\tnvmem = devm_nvmem_register(dev, \u0026nvmem_config);\ndrivers/nvmem/airoha-smc-efuses.c-101-\t\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/an8855-efuse.c=25=static int an8855_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/an8855-efuse.c-44-\tan8855_nvmem_config.dev = dev;\ndrivers/nvmem/an8855-efuse.c:45:\tnvmem = devm_nvmem_register(dev, \u0026an8855_nvmem_config);\ndrivers/nvmem/an8855-efuse.c-46-\n--\ndrivers/nvmem/apple-efuses.c=32=static int apple_efuses_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/apple-efuses.c-58-\ndrivers/nvmem/apple-efuses.c:59:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(config.dev, \u0026config));\ndrivers/nvmem/apple-efuses.c-60-}\n--\ndrivers/nvmem/apple-spmi-nvmem.c=37=static int apple_spmi_nvmem_probe(struct spmi_device *sdev)\n--\ndrivers/nvmem/apple-spmi-nvmem.c-56-\ndrivers/nvmem/apple-spmi-nvmem.c:57:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(\u0026sdev-\u003edev, \u0026nvmem_cfg));\ndrivers/nvmem/apple-spmi-nvmem.c-58-}\n--\ndrivers/nvmem/at24.c=595=static int at24_probe(struct i2c_client *client)\n--\ndrivers/nvmem/at24.c-778-\ndrivers/nvmem/at24.c:779:\tat24-\u003envmem = devm_nvmem_register(dev, \u0026nvmem_config);\ndrivers/nvmem/at24.c-780-\tif (IS_ERR(at24-\u003envmem)) {\n--\ndrivers/nvmem/at25.c=482=static int at25_probe(struct spi_mem *mem)\n--\ndrivers/nvmem/at25.c-552-\ndrivers/nvmem/at25.c:553:\tat25-\u003envmem = devm_nvmem_register(\u0026spi-\u003edev, \u0026at25-\u003envmem_config);\ndrivers/nvmem/at25.c-554-\tif (IS_ERR(at25-\u003envmem))\n--\ndrivers/nvmem/bcm-ocotp.c=243=static int bcm_otpc_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/bcm-ocotp.c-292-\ndrivers/nvmem/bcm-ocotp.c:293:\tnvmem = devm_nvmem_register(dev, \u0026bcm_otpc_nvmem_config);\ndrivers/nvmem/bcm-ocotp.c-294-\tif (IS_ERR(nvmem)) {\n--\ndrivers/nvmem/brcm_nvram.c=212=static int brcm_nvram_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/brcm_nvram.c-240-\ndrivers/nvmem/brcm_nvram.c:241:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(dev, \u0026config));\ndrivers/nvmem/brcm_nvram.c-242-}\n--\ndrivers/nvmem/core.c=681=static int nvmem_add_cells(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-696-/**\ndrivers/nvmem/core.c:697: * nvmem_register_notifier() - Register a notifier block for nvmem events.\ndrivers/nvmem/core.c-698- *\n--\ndrivers/nvmem/core.c-702- */\ndrivers/nvmem/core.c:703:int nvmem_register_notifier(struct notifier_block *nb)\ndrivers/nvmem/core.c-704-{\n--\ndrivers/nvmem/core.c-706-}\ndrivers/nvmem/core.c:707:EXPORT_SYMBOL_GPL(nvmem_register_notifier);\ndrivers/nvmem/core.c-708-\n--\ndrivers/nvmem/core.c=875=EXPORT_SYMBOL_GPL(nvmem_layout_unregister);\n--\ndrivers/nvmem/core.c-877-/**\ndrivers/nvmem/core.c:878: * nvmem_register() - Register a nvmem device for given nvmem_config.\ndrivers/nvmem/core.c-879- * Also creates a binary entry in /sys/bus/nvmem/devices/dev-name/nvmem\n--\ndrivers/nvmem/core.c-886-\ndrivers/nvmem/core.c:887:struct nvmem_device *nvmem_register(const struct nvmem_config *config)\ndrivers/nvmem/core.c-888-{\n--\ndrivers/nvmem/core.c-1042-}\ndrivers/nvmem/core.c:1043:EXPORT_SYMBOL_GPL(nvmem_register);\ndrivers/nvmem/core.c-1044-\n--\ndrivers/nvmem/core.c=1072=static void devm_nvmem_unregister(void *nvmem)\n--\ndrivers/nvmem/core.c-1077-/**\ndrivers/nvmem/core.c:1078: * devm_nvmem_register() - Register a managed nvmem device for given\ndrivers/nvmem/core.c-1079- * nvmem_config.\n--\ndrivers/nvmem/core.c-1087- */\ndrivers/nvmem/core.c:1088:struct nvmem_device *devm_nvmem_register(struct device *dev,\ndrivers/nvmem/core.c-1089-\t\t\t\t\t const struct nvmem_config *config)\n--\ndrivers/nvmem/core.c-1093-\ndrivers/nvmem/core.c:1094:\tnvmem = nvmem_register(config);\ndrivers/nvmem/core.c-1095-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/core.c-1103-}\ndrivers/nvmem/core.c:1104:EXPORT_SYMBOL_GPL(devm_nvmem_register);\ndrivers/nvmem/core.c-1105-\n--\ndrivers/nvmem/ee1004.c=278=static int ee1004_probe(struct i2c_client *client)\n--\ndrivers/nvmem/ee1004.c-326-\ndrivers/nvmem/ee1004.c:327:\tndev = devm_nvmem_register(\u0026client-\u003edev, \u0026config);\ndrivers/nvmem/ee1004.c-328-\tif (IS_ERR(ndev))\n--\ndrivers/nvmem/eeprom_93xx46.c=458=static int eeprom_93xx46_probe(struct spi_device *spi)\n--\ndrivers/nvmem/eeprom_93xx46.c-518-\ndrivers/nvmem/eeprom_93xx46.c:519:\tedev-\u003envmem = devm_nvmem_register(\u0026spi-\u003edev, \u0026edev-\u003envmem_config);\ndrivers/nvmem/eeprom_93xx46.c-520-\tif (IS_ERR(edev-\u003envmem))\n--\ndrivers/nvmem/imx-iim.c=96=static int imx_iim_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/imx-iim.c-126-\ndrivers/nvmem/imx-iim.c:127:\tnvmem = devm_nvmem_register(dev, \u0026cfg);\ndrivers/nvmem/imx-iim.c-128-\n--\ndrivers/nvmem/imx-ocotp-ele.c=138=static int imx_ele_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/imx-ocotp-ele.c-167-\ndrivers/nvmem/imx-ocotp-ele.c:168:\tnvmem = devm_nvmem_register(dev, \u0026priv-\u003econfig);\ndrivers/nvmem/imx-ocotp-ele.c-169-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/imx-ocotp-scu.c=239=static int imx_scu_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/imx-ocotp-scu.c-258-\timx_scu_ocotp_nvmem_config.priv = priv;\ndrivers/nvmem/imx-ocotp-scu.c:259:\tnvmem = devm_nvmem_register(dev, \u0026imx_scu_ocotp_nvmem_config);\ndrivers/nvmem/imx-ocotp-scu.c-260-\n--\ndrivers/nvmem/imx-ocotp.c=596=static int imx_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/imx-ocotp.c-628-\ndrivers/nvmem/imx-ocotp.c:629:\tnvmem = devm_nvmem_register(dev, \u0026imx_ocotp_nvmem_config);\ndrivers/nvmem/imx-ocotp.c-630-\n--\ndrivers/nvmem/jz4780-efuse.c=139=static int jz4780_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/jz4780-efuse.c-212-\ndrivers/nvmem/jz4780-efuse.c:213:\tnvmem = devm_nvmem_register(dev, \u0026cfg);\ndrivers/nvmem/jz4780-efuse.c-214-\n--\ndrivers/nvmem/lan9662-otpc.c=180=static int lan9662_otp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/lan9662-otpc.c-198-\ndrivers/nvmem/lan9662-otpc.c:199:\tnvmem = devm_nvmem_register(dev, \u0026otp_config);\ndrivers/nvmem/lan9662-otpc.c-200-\n--\ndrivers/nvmem/layerscape-sfp.c=45=static int layerscape_sfp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/layerscape-sfp.c-74-\ndrivers/nvmem/layerscape-sfp.c:75:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026layerscape_sfp_nvmem_config);\ndrivers/nvmem/layerscape-sfp.c-76-\n--\ndrivers/nvmem/lpc18xx_eeprom.c=161=static int lpc18xx_eeprom_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/lpc18xx_eeprom.c-234-\ndrivers/nvmem/lpc18xx_eeprom.c:235:\teeprom-\u003envmem = devm_nvmem_register(dev, \u0026lpc18xx_nvmem_config);\ndrivers/nvmem/lpc18xx_eeprom.c-236-\tif (IS_ERR(eeprom-\u003envmem)) {\n--\ndrivers/nvmem/lpc18xx_otp.c=66=static int lpc18xx_otp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/lpc18xx_otp.c-82-\ndrivers/nvmem/lpc18xx_otp.c:83:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026lpc18xx_otp_nvmem_config);\ndrivers/nvmem/lpc18xx_otp.c-84-\n--\ndrivers/nvmem/m24lr.c=488=static int m24lr_probe(struct i2c_client *client)\n--\ndrivers/nvmem/m24lr.c-556-\ndrivers/nvmem/m24lr.c:557:\tnvmem = devm_nvmem_register(dev, \u0026nvmem_conf);\ndrivers/nvmem/m24lr.c-558-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/max77759-nvmem.c=90=static int max77759_nvmem_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/max77759-nvmem.c-114-\ndrivers/nvmem/max77759-nvmem.c:115:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(config.dev, \u0026config));\ndrivers/nvmem/max77759-nvmem.c-116-}\n--\ndrivers/nvmem/meson-efuse.c=47=static int meson_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/meson-efuse.c-89-\ndrivers/nvmem/meson-efuse.c:90:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, econfig);\ndrivers/nvmem/meson-efuse.c-91-\n--\ndrivers/nvmem/meson-mx-efuse.c=191=static int meson_mx_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/meson-mx-efuse.c-225-\ndrivers/nvmem/meson-mx-efuse.c:226:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026efuse-\u003econfig);\ndrivers/nvmem/meson-mx-efuse.c-227-\n--\ndrivers/nvmem/microchip-otpc.c=243=static int mchp_otpc_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/microchip-otpc.c-266-\tmchp_nvmem_config.priv = otpc;\ndrivers/nvmem/microchip-otpc.c:267:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026mchp_nvmem_config);\ndrivers/nvmem/microchip-otpc.c-268-\n--\ndrivers/nvmem/mtk-efuse.c=62=static int mtk_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/mtk-efuse.c-89-\t\teconfig.fixup_dt_cell_info = \u0026mtk_efuse_fixup_dt_cell_info;\ndrivers/nvmem/mtk-efuse.c:90:\tnvmem = devm_nvmem_register(dev, \u0026econfig);\ndrivers/nvmem/mtk-efuse.c-91-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/mxs-ocotp.c=139=static int mxs_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/mxs-ocotp.c-174-\tocotp_config.dev = dev;\ndrivers/nvmem/mxs-ocotp.c:175:\totp-\u003envmem = devm_nvmem_register(dev, \u0026ocotp_config);\ndrivers/nvmem/mxs-ocotp.c-176-\tif (IS_ERR(otp-\u003envmem))\n--\ndrivers/nvmem/nintendo-otp.c=73=static int nintendo_otp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/nintendo-otp.c-104-\ndrivers/nvmem/nintendo-otp.c:105:\tnvmem = devm_nvmem_register(dev, \u0026config);\ndrivers/nvmem/nintendo-otp.c-106-\n--\ndrivers/nvmem/qcom-spmi-sdam.c=111=static int sdam_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/qcom-spmi-sdam.c-152-\ndrivers/nvmem/qcom-spmi-sdam.c:153:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026sdam-\u003esdam_config);\ndrivers/nvmem/qcom-spmi-sdam.c-154-\tif (IS_ERR(nvmem)) {\n--\ndrivers/nvmem/qfprom.c=368=static int qfprom_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/qfprom.c-453-\ndrivers/nvmem/qfprom.c:454:\tnvmem = devm_nvmem_register(dev, \u0026econfig);\ndrivers/nvmem/qfprom.c-455-\n--\ndrivers/nvmem/qnap-mcu-eeprom.c=74=static int qnap_mcu_eeprom_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/qnap-mcu-eeprom.c-93-\ndrivers/nvmem/qnap-mcu-eeprom.c:94:\tndev = devm_nvmem_register(\u0026pdev-\u003edev, \u0026nvcfg);\ndrivers/nvmem/qnap-mcu-eeprom.c-95-\tif (IS_ERR(ndev))\n--\ndrivers/nvmem/qoriq-efuse.c=29=static int qoriq_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/qoriq-efuse.c-54-\tconfig.priv = priv;\ndrivers/nvmem/qoriq-efuse.c:55:\tnvmem = devm_nvmem_register(config.dev, \u0026config);\ndrivers/nvmem/qoriq-efuse.c-56-\n--\ndrivers/nvmem/rave-sp-eeprom.c=287=static int rave_sp_eeprom_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/rave-sp-eeprom.c-337-\ndrivers/nvmem/rave-sp-eeprom.c:338:\tnvmem = devm_nvmem_register(dev, \u0026config);\ndrivers/nvmem/rave-sp-eeprom.c-339-\n--\ndrivers/nvmem/rcar-efuse.c=46=static int rcar_fuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/rcar-efuse.c-89-\ndrivers/nvmem/rcar-efuse.c:90:\tfuse-\u003envmem = devm_nvmem_register(dev, \u0026config);\ndrivers/nvmem/rcar-efuse.c-91-\tif (IS_ERR(fuse-\u003envmem))\n--\ndrivers/nvmem/rmem.c=119=static int rmem_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/rmem.c-152-\ndrivers/nvmem/rmem.c:153:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(dev, \u0026config));\ndrivers/nvmem/rmem.c-154-}\n--\ndrivers/nvmem/rockchip-efuse.c=253=static int rockchip_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/rockchip-efuse.c-286-\teconfig.dev = efuse-\u003edev;\ndrivers/nvmem/rockchip-efuse.c:287:\tnvmem = devm_nvmem_register(dev, \u0026econfig);\ndrivers/nvmem/rockchip-efuse.c-288-\n--\ndrivers/nvmem/rockchip-otp.c=415=static int rockchip_otp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/rockchip-otp.c-454-\ndrivers/nvmem/rockchip-otp.c:455:\tnvmem = devm_nvmem_register(dev, \u0026otp_config);\ndrivers/nvmem/rockchip-otp.c-456-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/s32g-ocotp-nvmem.c=64=static int s32g_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/s32g-ocotp-nvmem.c-84-\ndrivers/nvmem/s32g-ocotp-nvmem.c:85:\tnvmem = devm_nvmem_register(dev, \u0026s32g_ocotp_nvmem_config);\ndrivers/nvmem/s32g-ocotp-nvmem.c-86-\n--\ndrivers/nvmem/sc27xx-efuse.c=202=static int sc27xx_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/sc27xx-efuse.c-250-\teconfig.add_legacy_fixed_of_cells = true;\ndrivers/nvmem/sc27xx-efuse.c:251:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026econfig);\ndrivers/nvmem/sc27xx-efuse.c-252-\tif (IS_ERR(nvmem)) {\n--\ndrivers/nvmem/sec-qfprom.c=45=static int sec_qfprom_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/sec-qfprom.c-75-\ndrivers/nvmem/sec-qfprom.c:76:\tnvmem = devm_nvmem_register(dev, \u0026econfig);\ndrivers/nvmem/sec-qfprom.c-77-\n--\ndrivers/nvmem/snvs_lpgpr.c=89=static int snvs_lpgpr_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/snvs_lpgpr.c-131-\ndrivers/nvmem/snvs_lpgpr.c:132:\tnvmem = devm_nvmem_register(dev, cfg);\ndrivers/nvmem/snvs_lpgpr.c-133-\n--\ndrivers/nvmem/sprd-efuse.c=361=static int sprd_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/sprd-efuse.c-415-\teconfig.dev = \u0026pdev-\u003edev;\ndrivers/nvmem/sprd-efuse.c:416:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026econfig);\ndrivers/nvmem/sprd-efuse.c-417-\tif (IS_ERR(nvmem)) {\n--\ndrivers/nvmem/stm32-romem.c=189=static int stm32_romem_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/stm32-romem.c-248-\ndrivers/nvmem/stm32-romem.c:249:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(dev, \u0026priv-\u003ecfg));\ndrivers/nvmem/stm32-romem.c-250-}\n--\ndrivers/nvmem/sunplus-ocotp.c=156=static int sp_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/sunplus-ocotp.c-190-\ndrivers/nvmem/sunplus-ocotp.c:191:\tnvmem = devm_nvmem_register(dev, \u0026sp_ocotp_nvmem_config);\ndrivers/nvmem/sunplus-ocotp.c-192-\tif (IS_ERR(nvmem)) {\n--\ndrivers/nvmem/sunxi_sid.c=124=static int sunxi_sid_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/sunxi_sid.c-166-\ndrivers/nvmem/sunxi_sid.c:167:\tnvmem = devm_nvmem_register(dev, nvmem_cfg);\ndrivers/nvmem/sunxi_sid.c-168-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/u-boot-env.c=45=static int u_boot_env_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/u-boot-env.c-71-\ndrivers/nvmem/u-boot-env.c:72:\tpriv-\u003envmem = devm_nvmem_register(dev, \u0026config);\ndrivers/nvmem/u-boot-env.c-73-\tif (IS_ERR(priv-\u003envmem))\n--\ndrivers/nvmem/uniphier-efuse.c=31=static int uniphier_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/uniphier-efuse.c-54-\teconfig.add_legacy_fixed_of_cells = true;\ndrivers/nvmem/uniphier-efuse.c:55:\tnvmem = devm_nvmem_register(dev, \u0026econfig);\ndrivers/nvmem/uniphier-efuse.c-56-\n--\ndrivers/nvmem/vf610-ocotp.c=212=static int vf610_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/vf610-ocotp.c-238-\ndrivers/nvmem/vf610-ocotp.c:239:\tocotp_dev-\u003envmem = devm_nvmem_register(dev, \u0026ocotp_config);\ndrivers/nvmem/vf610-ocotp.c-240-\n--\ndrivers/nvmem/zynqmp_nvmem.c=206=static int zynqmp_nvmem_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/zynqmp_nvmem.c-220-\ndrivers/nvmem/zynqmp_nvmem.c:221:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(dev, \u0026econfig));\ndrivers/nvmem/zynqmp_nvmem.c-222-}\n--\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c=876=static int mtk_mfg_init_nvmem_provider(struct mtk_mfg *mfg)\n--\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c-890-\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:891:\tnvdev = devm_nvmem_register(dev, \u0026config);\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c-892-\tif (IS_ERR(nvdev))\n--\ndrivers/power/supply/max1720x_battery.c=514=static int max1720x_probe_nvmem(struct i2c_client *client,\n--\ndrivers/power/supply/max1720x_battery.c-565-\ndrivers/power/supply/max1720x_battery.c:566:\tnvmem = devm_nvmem_register(dev, \u0026nvmem_config);\ndrivers/power/supply/max1720x_battery.c-567-\tif (IS_ERR(nvmem)) {\n--\ndrivers/rtc/nvmem.c-12-\ndrivers/rtc/nvmem.c:13:int devm_rtc_nvmem_register(struct rtc_device *rtc,\ndrivers/rtc/nvmem.c-14-\t\t struct nvmem_config *nvmem_config)\n--\ndrivers/rtc/nvmem.c-24-\tnvmem_config-\u003eadd_legacy_fixed_of_cells = true;\ndrivers/rtc/nvmem.c:25:\tnvmem = devm_nvmem_register(dev, nvmem_config);\ndrivers/rtc/nvmem.c-26-\tif (IS_ERR(nvmem))\n--\ndrivers/rtc/nvmem.c-30-}\ndrivers/rtc/nvmem.c:31:EXPORT_SYMBOL_GPL(devm_rtc_nvmem_register);\n--\ndrivers/rtc/rtc-abx80x.c=742=static int abx80x_setup_nvmem(struct abx80x_priv *priv)\n--\ndrivers/rtc/rtc-abx80x.c-751-\ndrivers/rtc/rtc-abx80x.c:752:\treturn devm_rtc_nvmem_register(priv-\u003ertc, \u0026config);\ndrivers/rtc/rtc-abx80x.c-753-}\n--\ndrivers/rtc/rtc-cmos.c=930=cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)\n--\ndrivers/rtc/rtc-cmos.c-1120-\tnvmem_cfg.size = address_space - NVRAM_OFFSET;\ndrivers/rtc/rtc-cmos.c:1121:\tdevm_rtc_nvmem_register(cmos_rtc.rtc, \u0026nvmem_cfg);\ndrivers/rtc/rtc-cmos.c-1122-\n--\ndrivers/rtc/rtc-ds1305.c=543=static int ds1305_probe(struct spi_device *spi)\n--\ndrivers/rtc/rtc-ds1305.c-700-\ndrivers/rtc/rtc-ds1305.c:701:\tdevm_rtc_nvmem_register(ds1305-\u003ertc, \u0026ds1305_nvmem_cfg);\ndrivers/rtc/rtc-ds1305.c-702-\n--\ndrivers/rtc/rtc-ds1307.c=1876=static int ds1307_probe(struct i2c_client *client)\n--\ndrivers/rtc/rtc-ds1307.c-2152-\ndrivers/rtc/rtc-ds1307.c:2153:\t\tdevm_rtc_nvmem_register(ds1307-\u003ertc, \u0026nvmem_cfg);\ndrivers/rtc/rtc-ds1307.c-2154-\t}\n--\ndrivers/rtc/rtc-ds1343.c=344=static int ds1343_probe(struct spi_device *spi)\n--\ndrivers/rtc/rtc-ds1343.c-415-\tnvmem_cfg.priv = priv;\ndrivers/rtc/rtc-ds1343.c:416:\tdevm_rtc_nvmem_register(priv-\u003ertc, \u0026nvmem_cfg);\ndrivers/rtc/rtc-ds1343.c-417-\n--\ndrivers/rtc/rtc-ds1511.c=272=static int ds1511_rtc_probe(struct platform_device *pdev)\n--\ndrivers/rtc/rtc-ds1511.c-348-\n\n"
} |
| 15/2 | 2026/09/22 17:26 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 20218 output: 39 thoughts: 158 Thoughts: **RTC-CMOS NVMEM Investigation** Okay, so I see this line: `drivers/rtc/rtc-cmos.c:1121: devm_rtc_nvmem_register(cmos_rtc.rtc, &nvmem_cfg);`. Immediately, alarm bells are going off. Hang on... `rtc-cmos`? That's the *standard* PC CMOS Real-Time Clock, the one QEMU emulates. I need to figure out what's happening with NVMEM here. Is `rtc-cmos` actually registering NVMEM cells or a whole NVMEM device? Wait, hold on, this is significant. Considering how syzkaller hits MTD via `mtdram`, `block2mtd`, `nandsim`, and so on... how does this fit in? Could `rtc-cmos` interact with MTD or even UBI-backed NVMEM somehow? I have to consider all the angles. And, of course, the sysfs. Does `rtc-cmos` have cells that are exposed through sysfs? Let's not get ahead of ourselves. I need to drill down into `rtc-cmos.c` and figure this out. Time to go hunting in the source. |
| 16/2 | 2026/09/22 17:26 | tool | read-file |
0mArgs:{
"File": "drivers/rtc/rtc-cmos.c",
"FirstLine": 1115,
"LineCount": 20
}Results: {
"Contents": "1115:\t\n1116:\t\t/* Set the sync offset for the periodic 11min update correct */\n1117:\t\tcmos_rtc.rtc-\u003eset_offset_nsec = NSEC_PER_SEC / 2;\n1118:\t\n1119:\t\t/* export at least the first block of NVRAM */\n1120:\t\tnvmem_cfg.size = address_space - NVRAM_OFFSET;\n1121:\t\tdevm_rtc_nvmem_register(cmos_rtc.rtc, \u0026nvmem_cfg);\n1122:\t\n1123:\t\t/*\n1124:\t\t * Everything has gone well so far, so by default register a handler for\n1125:\t\t * the ACPI RTC fixed event.\n1126:\t\t */\n1127:\t\tif (!info)\n1128:\t\t\tacpi_rtc_event_setup(dev);\n1129:\t\n1130:\t\tdev_info(dev, \"%s%s, %d bytes nvram%s\\n\",\n1131:\t\t\t cmos_no_alarm(\u0026cmos_rtc) ? \"no alarms\" :\n1132:\t\t\t cmos_rtc.mon_alrm ? \"alarms up to one year\" :\n1133:\t\t\t cmos_rtc.day_alrm ? \"alarms up to one month\" :\n1134:\t\t\t \"alarms up to one day\",\n"
} |
| 17/2 | 2026/09/22 17:26 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 21053 output: 34 thoughts: 27 Thoughts: Okay, let's dive into this. Here's my thought process on what I'm looking at: **Diving into `rtc-cmos.c` - Checking `nvmem_cfg`** Right, let me pull up `rtc-cmos.c` and specifically focus on the `nvmem_cfg` structure. Now, I need to quickly assess if it defines any "cells." Knowing if it has cells is fundamental to understanding how this driver interacts with non-volatile memory and, consequently, how it manages configuration data. Are there cells? The structure's definition will give me the answer quickly. Time to take a look. |
| 18/2 | 2026/09/22 17:26 | tool | grepper |
0mArgs:{
"Expression": "nvmem_cfg",
"PathPrefix": "drivers/rtc/rtc-cmos.c"
}Results: {
"Output": "drivers/rtc/rtc-cmos.c=930=cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)\n--\ndrivers/rtc/rtc-cmos.c-937-\tbool\t\t\t\thpet_registered = false;\ndrivers/rtc/rtc-cmos.c:938:\tstruct nvmem_config nvmem_cfg = {\ndrivers/rtc/rtc-cmos.c-939-\t\t.name = \"cmos_nvram\",\n--\ndrivers/rtc/rtc-cmos.c-1119-\t/* export at least the first block of NVRAM */\ndrivers/rtc/rtc-cmos.c:1120:\tnvmem_cfg.size = address_space - NVRAM_OFFSET;\ndrivers/rtc/rtc-cmos.c:1121:\tdevm_rtc_nvmem_register(cmos_rtc.rtc, \u0026nvmem_cfg);\ndrivers/rtc/rtc-cmos.c-1122-\n--\ndrivers/rtc/rtc-cmos.c-1135-\t\t cmos_rtc.century ? \", y3k\" : \"\",\ndrivers/rtc/rtc-cmos.c:1136:\t\t nvmem_cfg.size,\ndrivers/rtc/rtc-cmos.c-1137-\t\t use_hpet_alarm() ? \", hpet irqs\" : \"\");\n"
} |
| 19/2 | 2026/09/22 17:26 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 21603 output: 30 thoughts: 68 Thoughts: Here's my thought process, as requested: **Investigating Non-Volatile Memory Cell Configuration in the Kernel** Okay, so I'm digging into how non-volatile memory (NVMEM) cells are handled, specifically focusing on `rtc-cmos.c` and its interaction with `nvmem_cfg`. I know that in this context, the typical static declaration of cells isn't present in `nvmem_cfg`, which is a key observation. The absence of static definition immediately raises a question: how *are* these cells being instantiated or managed? It's time to dig deeper. My immediate next step is to perform a targeted search within the kernel source. I'll need to use my typical grep-fu and I'll focus on terms that are highly indicative of NVMEM cell creation and management. Let's start by grepping for "cells," hoping to catch any direct references to cell structures or configurations. Following that, I'll expand the search to include `nvmem_add_cells`, since it's almost certainly the function responsible for adding these cells to the system, and then to `nvmem_cell_info`, just in case that's the data structure being used to describe the cells. This should give me a pretty good picture of where and how these things are being put together. |
| 20/2 | 2026/09/22 17:26 | tool | grepper |
0mArgs:{
"Expression": "nvmem_add_cells",
"PathPrefix": "drivers/nvmem"
}Results: {
"Output": "drivers/nvmem/core.c=670=EXPORT_SYMBOL_GPL(nvmem_add_one_cell);\n--\ndrivers/nvmem/core.c-672-/**\ndrivers/nvmem/core.c:673: * nvmem_add_cells() - Add cell information to an nvmem device\ndrivers/nvmem/core.c-674- *\n--\ndrivers/nvmem/core.c-680- */\ndrivers/nvmem/core.c:681:static int nvmem_add_cells(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c-682-\t\t const struct nvmem_cell_info *info,\n--\ndrivers/nvmem/core.c=739=static int nvmem_validate_keepouts(struct nvmem_device *nvmem)\n--\ndrivers/nvmem/core.c-791-\ndrivers/nvmem/core.c:792:int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)\ndrivers/nvmem/core.c-793-{\n--\ndrivers/nvmem/core.c-839-}\ndrivers/nvmem/core.c:840:EXPORT_SYMBOL_GPL(nvmem_add_cells_from_dt);\ndrivers/nvmem/core.c-841-\ndrivers/nvmem/core.c:842:static int nvmem_add_cells_from_legacy_of(struct nvmem_device *nvmem)\ndrivers/nvmem/core.c-843-{\ndrivers/nvmem/core.c:844:\treturn nvmem_add_cells_from_dt(nvmem, nvmem-\u003edev.of_node);\ndrivers/nvmem/core.c-845-}\n--\ndrivers/nvmem/core.c=887=struct nvmem_device *nvmem_register(const struct nvmem_config *config)\n--\ndrivers/nvmem/core.c-993-\tif (config-\u003ecells) {\ndrivers/nvmem/core.c:994:\t\trval = nvmem_add_cells(nvmem, config-\u003ecells, config-\u003encells);\ndrivers/nvmem/core.c-995-\t\tif (rval)\n--\ndrivers/nvmem/core.c-999-\tif (config-\u003eadd_legacy_fixed_of_cells) {\ndrivers/nvmem/core.c:1000:\t\trval = nvmem_add_cells_from_legacy_of(nvmem);\ndrivers/nvmem/core.c-1001-\t\tif (rval)\n--\ndrivers/nvmem/internals.h=16=struct nvmem_device {\n--\ndrivers/nvmem/internals.h-41-\ndrivers/nvmem/internals.h:42:int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np);\ndrivers/nvmem/internals.h-43-\n--\ndrivers/nvmem/layouts/fixed-layout.c=13=static int fixed_layout_add_cells(struct nvmem_layout *layout)\n--\ndrivers/nvmem/layouts/fixed-layout.c-21-\ndrivers/nvmem/layouts/fixed-layout.c:22:\tret = nvmem_add_cells_from_dt(layout-\u003envmem, np);\ndrivers/nvmem/layouts/fixed-layout.c-23-\tof_node_put(np);\n"
} |
| 21/2 | 2026/09/22 17:26 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 22856 output: 30 thoughts: 59 Thoughts: Here's my take on the thought process, as if it were my own: **Investigating `nvmem_add_cells` Usage** Okay, so I'm digging into how `nvmem_add_cells` is used. Right, I remember now, `nvmem_add_cells` gets called by `nvmem_register` too, but only if the `config->cells` member is actually set. Good, that helps narrow things down a bit. Now, I should probably understand if this can ever be indirectly called. I should probably focus on `nvmem_add_one_cell` and figure out where that's called from. That's probably my best path towards truly understanding the big picture here. Okay, where do we use `nvmem_add_one_cell`? I better figure that out. |
| 22/2 | 2026/09/22 17:26 | tool | grepper |
0mArgs:{
"Expression": "nvmem_add_one_cell",
"PathPrefix": "drivers/"
}Results: {
"Output": "drivers/nvmem/core.c=625=static int nvmem_cell_info_to_nvmem_cell_entry(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-642-/**\ndrivers/nvmem/core.c:643: * nvmem_add_one_cell() - Add one cell information to an nvmem device\ndrivers/nvmem/core.c-644- *\n--\ndrivers/nvmem/core.c-649- */\ndrivers/nvmem/core.c:650:int nvmem_add_one_cell(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c-651-\t\t const struct nvmem_cell_info *info)\n--\ndrivers/nvmem/core.c-669-}\ndrivers/nvmem/core.c:670:EXPORT_SYMBOL_GPL(nvmem_add_one_cell);\ndrivers/nvmem/core.c-671-\n--\ndrivers/nvmem/core.c=681=static int nvmem_add_cells(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-687-\tfor (i = 0; i \u003c ncells; i++) {\ndrivers/nvmem/core.c:688:\t\trval = nvmem_add_one_cell(nvmem, \u0026info[i]);\ndrivers/nvmem/core.c-689-\t\tif (rval)\n--\ndrivers/nvmem/core.c=792=int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)\n--\ndrivers/nvmem/core.c-829-\ndrivers/nvmem/core.c:830:\t\tret = nvmem_add_one_cell(nvmem, \u0026info);\ndrivers/nvmem/core.c-831-\t\tkfree(info.name);\n--\ndrivers/nvmem/layouts/onie-tlv.c=98=static int onie_tlv_add_cells(struct device *dev, struct nvmem_device *nvmem,\n--\ndrivers/nvmem/layouts/onie-tlv.c-128-\ndrivers/nvmem/layouts/onie-tlv.c:129:\t\tret = nvmem_add_one_cell(nvmem, \u0026cell);\ndrivers/nvmem/layouts/onie-tlv.c-130-\t\tif (ret) {\n--\ndrivers/nvmem/layouts/sl28vpd.c=83=static int sl28vpd_add_cells(struct nvmem_layout *layout)\n--\ndrivers/nvmem/layouts/sl28vpd.c-126-\ndrivers/nvmem/layouts/sl28vpd.c:127:\t\tret = nvmem_add_one_cell(nvmem, \u0026info);\ndrivers/nvmem/layouts/sl28vpd.c-128-\t\tif (ret) {\n--\ndrivers/nvmem/layouts/u-boot-env.c=52=static int u_boot_env_parse_cells(struct device *dev, struct nvmem_device *nvmem, uint8_t *buf,\n--\ndrivers/nvmem/layouts/u-boot-env.c-80-\ndrivers/nvmem/layouts/u-boot-env.c:81:\t\tnvmem_add_one_cell(nvmem, \u0026info);\ndrivers/nvmem/layouts/u-boot-env.c-82-\t}\n--\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c=876=static int mtk_mfg_init_nvmem_provider(struct mtk_mfg *mfg)\n--\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c-899-\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:900:\tret = nvmem_add_one_cell(nvdev, \u0026cell);\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c-901-\tif (ret) {\n--\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c-905-\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:906:\t/* cell.np purposefully not put as nvmem_add_one_cell does not increase refcount */\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c-907-\n"
} |
| 23/2 | 2026/09/22 17:26 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 24243 output: 27 thoughts: 34 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Investigating NVMem Cell Registrations** Alright, I need to understand the interplay between NVMem and cell-based drivers. My initial thought process is to quickly get a lay of the land. So, I'm thinking, "Let's first determine which drivers are actually using the `nvmem` framework alongside their cell registration or maybe vice versa – which drivers are registering cells directly." I want to know who the players are, and how they relate. The natural next step to determine this is to perform a targeted code search to identify which drivers interact with the core concepts. To accomplish this quickly, I will leverage `grep` and a targeted directory to refine the search. My hypothesis is that a direct search for `.cells =` within the `drivers/` directory should highlight the relevant code areas, enabling me to identify the involved drivers efficiently. This should provide me with an initial list to work from. Let's see what that search turns up. |
| 24/2 | 2026/09/22 17:27 | tool | grepper |
0mArgs:{
"Expression": "\\.cells\\s*=",
"PathPrefix": "drivers/"
}Results: {
"Output": "drivers/hwmon/pmbus/adm1266.c=579=static int adm1266_config_nvmem(struct adm1266_data *data)\n--\ndrivers/hwmon/pmbus/adm1266.c-586-\tdata-\u003envmem_config.reg_read = adm1266_nvmem_read;\ndrivers/hwmon/pmbus/adm1266.c:587:\tdata-\u003envmem_config.cells = adm1266_nvmem_cells;\ndrivers/hwmon/pmbus/adm1266.c-588-\tdata-\u003envmem_config.ncells = ARRAY_SIZE(adm1266_nvmem_cells);\n--\ndrivers/mfd/intel-m10-bmc-pmci.c=376=static const struct intel_m10bmc_platform_info m10bmc_pmci_n6000 = {\ndrivers/mfd/intel-m10-bmc-pmci.c:377:\t.cells = m10bmc_pmci_n6000_bmc_subdevs,\ndrivers/mfd/intel-m10-bmc-pmci.c-378-\t.n_cells = ARRAY_SIZE(m10bmc_pmci_n6000_bmc_subdevs),\n--\ndrivers/mfd/intel-m10-bmc-spi.c=138=static const struct intel_m10bmc_platform_info m10bmc_spi_n3000 = {\ndrivers/mfd/intel-m10-bmc-spi.c:139:\t.cells = m10bmc_pacn3000_subdevs,\ndrivers/mfd/intel-m10-bmc-spi.c-140-\t.n_cells = ARRAY_SIZE(m10bmc_pacn3000_subdevs),\n--\ndrivers/mfd/intel-m10-bmc-spi.c=146=static const struct intel_m10bmc_platform_info m10bmc_spi_d5005 = {\ndrivers/mfd/intel-m10-bmc-spi.c:147:\t.cells = m10bmc_d5005_subdevs,\ndrivers/mfd/intel-m10-bmc-spi.c-148-\t.n_cells = ARRAY_SIZE(m10bmc_d5005_subdevs),\n--\ndrivers/mfd/intel-m10-bmc-spi.c=154=static const struct intel_m10bmc_platform_info m10bmc_spi_n5010 = {\ndrivers/mfd/intel-m10-bmc-spi.c:155:\t.cells = m10bmc_n5010_subdevs,\ndrivers/mfd/intel-m10-bmc-spi.c-156-\t.n_cells = ARRAY_SIZE(m10bmc_n5010_subdevs),\n--\ndrivers/mfd/mt6397-core.c=296=static const struct chip_data mt6323_core = {\n--\ndrivers/mfd/mt6397-core.c-298-\t.cid_shift = 0,\ndrivers/mfd/mt6397-core.c:299:\t.cells = mt6323_devs,\ndrivers/mfd/mt6397-core.c-300-\t.cell_size = ARRAY_SIZE(mt6323_devs),\n--\ndrivers/mfd/mt6397-core.c=304=static const struct chip_data mt6328_core = {\n--\ndrivers/mfd/mt6397-core.c-306-\t.cid_shift = 8,\ndrivers/mfd/mt6397-core.c:307:\t.cells = mt6328_devs,\ndrivers/mfd/mt6397-core.c-308-\t.cell_size = ARRAY_SIZE(mt6328_devs),\n--\ndrivers/mfd/mt6397-core.c=312=static const struct chip_data mt6357_core = {\n--\ndrivers/mfd/mt6397-core.c-314-\t.cid_shift = 8,\ndrivers/mfd/mt6397-core.c:315:\t.cells = mt6357_devs,\ndrivers/mfd/mt6397-core.c-316-\t.cell_size = ARRAY_SIZE(mt6357_devs),\n--\ndrivers/mfd/mt6397-core.c=320=static const struct chip_data mt6331_mt6332_core = {\n--\ndrivers/mfd/mt6397-core.c-322-\t.cid_shift = 8,\ndrivers/mfd/mt6397-core.c:323:\t.cells = mt6331_mt6332_devs,\ndrivers/mfd/mt6397-core.c-324-\t.cell_size = ARRAY_SIZE(mt6331_mt6332_devs),\n--\ndrivers/mfd/mt6397-core.c=328=static const struct chip_data mt6358_core = {\n--\ndrivers/mfd/mt6397-core.c-330-\t.cid_shift = 8,\ndrivers/mfd/mt6397-core.c:331:\t.cells = mt6358_devs,\ndrivers/mfd/mt6397-core.c-332-\t.cell_size = ARRAY_SIZE(mt6358_devs),\n--\ndrivers/mfd/mt6397-core.c=336=static const struct chip_data mt6359_core = {\n--\ndrivers/mfd/mt6397-core.c-338-\t.cid_shift = 8,\ndrivers/mfd/mt6397-core.c:339:\t.cells = mt6359_devs,\ndrivers/mfd/mt6397-core.c-340-\t.cell_size = ARRAY_SIZE(mt6359_devs),\n--\ndrivers/mfd/mt6397-core.c=344=static const struct chip_data mt6397_core = {\n--\ndrivers/mfd/mt6397-core.c-346-\t.cid_shift = 0,\ndrivers/mfd/mt6397-core.c:347:\t.cells = mt6397_devs,\ndrivers/mfd/mt6397-core.c-348-\t.cell_size = ARRAY_SIZE(mt6397_devs),\n--\ndrivers/mfd/rohm-bd96801.c=583=static const struct bd968xx bd96801_data = {\n--\ndrivers/mfd/rohm-bd96801.c-590-\t.regmap_config = \u0026bd96801_regmap_config,\ndrivers/mfd/rohm-bd96801.c:591:\t.cells = bd96801_cells,\ndrivers/mfd/rohm-bd96801.c-592-\t.num_cells = ARRAY_SIZE(bd96801_cells),\n--\ndrivers/mfd/rohm-bd96801.c=597=static const struct bd968xx bd96802_data = {\n--\ndrivers/mfd/rohm-bd96801.c-604-\t.regmap_config = \u0026bd96802_regmap_config,\ndrivers/mfd/rohm-bd96801.c:605:\t.cells = bd96802_cells,\ndrivers/mfd/rohm-bd96801.c-606-\t.num_cells = ARRAY_SIZE(bd96802_cells),\n--\ndrivers/mfd/rohm-bd96801.c=611=static const struct bd968xx bd96805_data = {\n--\ndrivers/mfd/rohm-bd96801.c-618-\t.regmap_config = \u0026bd96801_regmap_config,\ndrivers/mfd/rohm-bd96801.c:619:\t.cells = bd96805_cells,\ndrivers/mfd/rohm-bd96801.c-620-\t.num_cells = ARRAY_SIZE(bd96805_cells),\n--\ndrivers/mfd/rohm-bd96801.c=625=static struct bd968xx bd96806_data = {\n--\ndrivers/mfd/rohm-bd96801.c-632-\t.regmap_config = \u0026bd96802_regmap_config,\ndrivers/mfd/rohm-bd96801.c:633:\t.cells = bd96806_cells,\ndrivers/mfd/rohm-bd96801.c-634-\t.num_cells = ARRAY_SIZE(bd96806_cells),\n--\ndrivers/mfd/ti-lmu.c=122=static const struct ti_lmu_data chip##_data =\t\\\ndrivers/mfd/ti-lmu.c-123-{\t\t\t\t\t\t\\\ndrivers/mfd/ti-lmu.c:124:\t.cells = chip##_devices,\t\t\\\ndrivers/mfd/ti-lmu.c-125-\t.num_cells = ARRAY_SIZE(chip##_devices),\\\n--\ndrivers/mfd/tps65219.c=458=static const struct tps65219_chip_data chip_info_table[] = {\n--\ndrivers/mfd/tps65219.c-460-\t\t.irq_chip = \u0026tps65214_irq_chip,\ndrivers/mfd/tps65219.c:461:\t\t.cells = tps65214_cells,\ndrivers/mfd/tps65219.c-462-\t\t.n_cells = ARRAY_SIZE(tps65214_cells),\n--\ndrivers/mfd/tps65219.c-465-\t\t.irq_chip = \u0026tps65215_irq_chip,\ndrivers/mfd/tps65219.c:466:\t\t.cells = tps65215_cells,\ndrivers/mfd/tps65219.c-467-\t\t.n_cells = ARRAY_SIZE(tps65215_cells),\n--\ndrivers/mfd/tps65219.c-470-\t\t.irq_chip = \u0026tps65219_irq_chip,\ndrivers/mfd/tps65219.c:471:\t\t.cells = tps65219_cells,\ndrivers/mfd/tps65219.c-472-\t\t.n_cells = ARRAY_SIZE(tps65219_cells),\n--\ndrivers/nvmem/brcm_nvram.c=212=static int brcm_nvram_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/brcm_nvram.c-235-\tconfig.dev = dev;\ndrivers/nvmem/brcm_nvram.c:236:\tconfig.cells = priv-\u003ecells;\ndrivers/nvmem/brcm_nvram.c-237-\tconfig.ncells = priv-\u003encells;\n--\ndrivers/power/supply/max1720x_battery.c=514=static int max1720x_probe_nvmem(struct i2c_client *client,\n--\ndrivers/power/supply/max1720x_battery.c-520-\t\t.name = \"max1720x_nvmem\",\ndrivers/power/supply/max1720x_battery.c:521:\t\t.cells = max1720x_nvmem_cells,\ndrivers/power/supply/max1720x_battery.c-522-\t\t.ncells = ARRAY_SIZE(max1720x_nvmem_cells),\n--\ndrivers/s390/char/con3270.c=891=static struct tty3270_line *tty3270_alloc_screen(struct tty3270 *tp, unsigned int rows,\n--\ndrivers/s390/char/con3270.c-901-\tfor (lines = 0; lines \u003c allocated; lines++) {\ndrivers/s390/char/con3270.c:902:\t\tscreen[lines].cells = kzalloc_objs(struct tty3270_cell, cols);\ndrivers/s390/char/con3270.c-903-\t\tif (!screen[lines].cells)\n--\ndrivers/soc/tegra/fuse/fuse-tegra.c=139=static int tegra_fuse_probe(struct platform_device *pdev)\n--\ndrivers/soc/tegra/fuse/fuse-tegra.c-207-\tnvmem.owner = THIS_MODULE;\ndrivers/soc/tegra/fuse/fuse-tegra.c:208:\tnvmem.cells = fuse-\u003esoc-\u003ecells;\ndrivers/soc/tegra/fuse/fuse-tegra.c-209-\tnvmem.ncells = fuse-\u003esoc-\u003enum_cells;\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=220=const struct tegra_fuse_soc tegra114_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-225-\t.num_lookups = ARRAY_SIZE(tegra114_fuse_lookups),\ndrivers/soc/tegra/fuse/fuse-tegra30.c:226:\t.cells = tegra114_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-227-\t.num_cells = ARRAY_SIZE(tegra114_fuse_cells),\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=380=const struct tegra_fuse_soc tegra124_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-385-\t.num_lookups = ARRAY_SIZE(tegra124_fuse_lookups),\ndrivers/soc/tegra/fuse/fuse-tegra30.c:386:\t.cells = tegra124_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-387-\t.num_cells = ARRAY_SIZE(tegra124_fuse_cells),\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=551=const struct tegra_fuse_soc tegra210_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-555-\t.lookups = tegra210_fuse_lookups,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:556:\t.cells = tegra210_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-557-\t.num_cells = ARRAY_SIZE(tegra210_fuse_cells),\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=609=const struct tegra_fuse_soc tegra186_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-613-\t.num_lookups = ARRAY_SIZE(tegra186_fuse_lookups),\ndrivers/soc/tegra/fuse/fuse-tegra30.c:614:\t.cells = tegra186_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-615-\t.num_cells = ARRAY_SIZE(tegra186_fuse_cells),\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=702=const struct tegra_fuse_soc tegra194_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-706-\t.num_lookups = ARRAY_SIZE(tegra194_fuse_lookups),\ndrivers/soc/tegra/fuse/fuse-tegra30.c:707:\t.cells = tegra194_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-708-\t.num_cells = ARRAY_SIZE(tegra194_fuse_cells),\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=772=const struct tegra_fuse_soc tegra234_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-776-\t.num_lookups = ARRAY_SIZE(tegra234_fuse_lookups),\ndrivers/soc/tegra/fuse/fuse-tegra30.c:777:\t.cells = tegra234_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-778-\t.num_cells = ARRAY_SIZE(tegra234_fuse_cells),\n"
} |
| 25/2 | 2026/09/22 17:27 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 29063 output: 30 thoughts: 33 Thoughts: Okay, here's my take on those thoughts, framed as my own: **Considering Non-Volatile Memory Layouts** Alright, hang on a second. We're talking about non-volatile memory and its structure, and I'm immediately thinking, "But what about the *actual* layouts?" My mind immediately jumps to how the data is physically organized, especially in the context of Memory Technology Devices (MTD) partitions. That's a critical aspect we can't gloss over. We can't dive too deeply without considering the underlying physical structure. So, where's the best place to find that information? Let's not reinvent the wheel. I'm going to quickly check in the kernel documentation. We need to look up `nvmem/layouts/` directory or anything related to `nvmem_layout` right away. That should give me a solid foundation for understanding the data organization. Let's see what's in those docs. That's the first step. |
| 26/2 | 2026/09/22 17:27 | tool | grepper |
0mArgs:{
"Expression": "nvmem_layout_register",
"PathPrefix": "drivers/nvmem"
}Results: {
"Output": "drivers/nvmem/core.c=842=static int nvmem_add_cells_from_legacy_of(struct nvmem_device *nvmem)\n--\ndrivers/nvmem/core.c-846-\ndrivers/nvmem/core.c:847:int nvmem_layout_register(struct nvmem_layout *layout)\ndrivers/nvmem/core.c-848-{\n--\ndrivers/nvmem/core.c-868-}\ndrivers/nvmem/core.c:869:EXPORT_SYMBOL_GPL(nvmem_layout_register);\ndrivers/nvmem/core.c-870-\n--\ndrivers/nvmem/layouts/fixed-layout.c=28=static int fixed_layout_probe(struct nvmem_layout *layout)\n--\ndrivers/nvmem/layouts/fixed-layout.c-31-\ndrivers/nvmem/layouts/fixed-layout.c:32:\treturn nvmem_layout_register(layout);\ndrivers/nvmem/layouts/fixed-layout.c-33-}\n--\ndrivers/nvmem/layouts/onie-tlv.c=231=static int onie_tlv_probe(struct nvmem_layout *layout)\n--\ndrivers/nvmem/layouts/onie-tlv.c-234-\ndrivers/nvmem/layouts/onie-tlv.c:235:\treturn nvmem_layout_register(layout);\ndrivers/nvmem/layouts/onie-tlv.c-236-}\n--\ndrivers/nvmem/layouts/sl28vpd.c=139=static int sl28vpd_probe(struct nvmem_layout *layout)\n--\ndrivers/nvmem/layouts/sl28vpd.c-142-\ndrivers/nvmem/layouts/sl28vpd.c:143:\treturn nvmem_layout_register(layout);\ndrivers/nvmem/layouts/sl28vpd.c-144-}\n--\ndrivers/nvmem/layouts/u-boot-env.c=178=static int u_boot_env_probe(struct nvmem_layout *layout)\n--\ndrivers/nvmem/layouts/u-boot-env.c-181-\ndrivers/nvmem/layouts/u-boot-env.c:182:\treturn nvmem_layout_register(layout);\ndrivers/nvmem/layouts/u-boot-env.c-183-}\n"
} |
| 27/2 | 2026/09/22 17:27 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 29933 output: 33 thoughts: 364 Thoughts: **My Initial Thoughts on Runtime NVMem Instantiation** Okay, so I'm trying to figure out the dynamic instantiation of NVMem layouts and cells. The core question is: can *any* layout or cell be created at runtime, dynamically? If so, how? And what process creates these layouts in the first place? My first instinct is to explore the `nvmem/layouts/` directory within the kernel source. That's the obvious starting point. Then, I need to understand how the Device Tree (OF), platform setup, and other hardware-specific configurations interface with the NVMem subsystem. Specifically, I'm curious about the x86/amd64 QEMU environment. Can I load Device Tree overlays via configfs within that setup? Let me check for `CONFIG_OF_CONFIGFS`. This could be a key. Then I wondered how syzkaller handles the creation of these devices. Let me see if there are any NVMem descriptions or usage within syzkaller. Hmm, this note says: "CRITICAL INSTRUCTION: this tool CANNOT be used to search syzkaller syzlang descriptions (e.g. 'dev_*.txt', 'socket_*.txt', etc.) or expressions containing 'long syz_'. Those pseudo-syscalls are not present in the Linux kernel. Use the read-syz-spec and syz-grepper tools instead." Unfortunately, `syz-grepper` and `read-syz-spec` don't seem available from the tool declaration list. I'm left with `default_api:grepper`, `default_api:read-file`, `default_api:codesearch-dir-index`, and `default_api:set-results`. Looks like I'll have to go directly to the kernel source code. So, I'll need to check the kernel source directly. My next step is to determine if NVMem devices or cells can be registered or accessed in standard amd64 Linux environments. To start, I need a clearer understanding of the purpose of the `nvmem` subsystem. Let me investigate `drivers/nvmem/Kconfig` to get a general overview. |
| 28/2 | 2026/09/22 17:27 | tool | read-file |
0mArgs:{
"File": "drivers/nvmem/Kconfig",
"FirstLine": 1,
"LineCount": 50
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: GPL-2.0-only\n 2:\tmenuconfig NVMEM\n 3:\t\tbool \"NVMEM Support\"\n 4:\t\timply NVMEM_LAYOUTS\n 5:\t\thelp\n 6:\t\t Support for NVMEM(Non Volatile Memory) devices like EEPROM, EFUSES...\n 7:\t\n 8:\t\t This framework is designed to provide a generic interface to NVMEM\n 9:\t\t from both the Linux Kernel and the userspace.\n 10:\t\n 11:\t\t If unsure, say no.\n 12:\t\n 13:\tif NVMEM\n 14:\t\n 15:\tconfig NVMEM_SYSFS\n 16:\t\tbool \"/sys/bus/nvmem/devices/*/nvmem (sysfs interface)\"\n 17:\t\tdepends on SYSFS\n 18:\t\tdefault y\n 19:\t\thelp\n 20:\t\t Say Y here to add a sysfs interface for NVMEM.\n 21:\t\n 22:\t\t This interface is mostly used by userspace applications to\n 23:\t\t read/write directly into nvmem.\n 24:\t\n 25:\t# Layouts\n 26:\t\n 27:\tsource \"drivers/nvmem/layouts/Kconfig\"\n 28:\t\n 29:\t# Devices\n 30:\t\n 31:\tif NVMEM_SYSFS\n 32:\t\n 33:\tconfig EEPROM_AT24\n 34:\t\ttristate \"I2C EEPROMs / RAMs / ROMs from most vendors\"\n 35:\t\tdepends on I2C \u0026\u0026 SYSFS\n 36:\t\tselect REGMAP\n 37:\t\tselect REGMAP_I2C\n 38:\t\thelp\n 39:\t\t Enable this driver to get read/write support to most I2C EEPROMs\n 40:\t\t and compatible devices like FRAMs, SRAMs, ROMs etc. After you\n 41:\t\t configure the driver to know about each chip on your target\n 42:\t\t board. Use these generic chip names, instead of vendor-specific\n 43:\t\t ones like at24c64, 24lc02 or fm24c04:\n 44:\t\n 45:\t\t 24c00, 24c01, 24c02, spd (readonly 24c02), 24c04, 24c08,\n 46:\t\t 24c16, 24c32, 24c64, 24c128, 24c256, 24c512, 24c1024, 24c2048\n 47:\t\n 48:\t\t Unless you like data loss puzzles, always be sure that any chip\n 49:\t\t you configure as a 24c32 (32 kbit) or larger is NOT really a\n 50:\t\t 24c16 (16 kbit) or smaller, and vice versa. Marking the chip\n"
} |
| 29/2 | 2026/09/22 17:27 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 31576 output: 36 thoughts: 356 Thoughts: **Exploring Kernel NVMEM Device Interactions** Okay, so I'm thinking... Can you actually create I2C devices from user space? *Yes*, using `/sys/bus/i2c/devices/i2c-*/new_device`. Hmm, but what about SPI? And USB? Then, something else clicks – what about NVMEM devices within QEMU? Right, let's see what NVMEM devices are typically present on an amd64 system or in QEMU. Then, specific to QEMU: Does QEMU even have `rtc-cmos`? Let's verify how `rtc-cmos` probes. On x86 PC/QEMU, `rtc-cmos` probes on boot. Does this probe register an nvmem device? Yep, looks like `devm_rtc_nvmem_register(cmos_rtc.rtc, &nvmem_cfg);` is the key. Hang on... does `rtc-cmos` have cells? I need to check if cells are registered or can be added to it. Back to the `rtc-cmos` code. Okay, here's what's happening: `nvmem_cfg.size = address_space - NVRAM_OFFSET;` and it registers an nvmem device named `cmos_nvram`. But… are cells being registered? No, `nvmem_cfg.cells` is NULL. So, the big question is, can cells be *added* to an existing nvmem device? I need to know. Time to examine the kernel code and see what functions call `nvmem_add_cells`, `nvmem_add_one_cell`, or even `nvmem_shift_read_buffer_in_place`. Let's start with all callers of `nvmem_shift_read_buffer_in_place`. |
| 30/2 | 2026/09/22 17:27 | tool | grepper |
0mArgs:{
"Expression": "nvmem_shift_read_buffer_in_place",
"PathPrefix": "drivers/nvmem"
}Results: {
"Output": "drivers/nvmem/core.c=1582=EXPORT_SYMBOL_GPL(nvmem_cell_put);\ndrivers/nvmem/core.c-1583-\ndrivers/nvmem/core.c:1584:static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)\ndrivers/nvmem/core.c-1585-{\n--\ndrivers/nvmem/core.c=1627=static int __nvmem_cell_read(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-1639-\tif (cell-\u003ebit_offset || cell-\u003enbits)\ndrivers/nvmem/core.c:1640:\t\tnvmem_shift_read_buffer_in_place(cell, buf);\ndrivers/nvmem/core.c-1641-\n"
} |
| 31/2 | 2026/09/22 17:27 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 32598 output: 21 thoughts: 49 Thoughts: Here's my analysis of the situation: **Investigating the Data Flow of `nvmem_shift_read_buffer_in_place`** Okay, so `nvmem_shift_read_buffer_in_place` is solely called by `__nvmem_cell_read`. That's a key observation. Now, to truly understand the context and potential implications, I need to see *where* `__nvmem_cell_read` is being used throughout the kernel. This will give me the complete picture of the read operations this function chain is involved in. Let's see how deep this rabbit hole goes... I'll check all the callers of `__nvmem_cell_read` to map out the entire data flow. This is where I'll get a good grasp of the control flow. |
| 32/2 | 2026/09/22 17:27 | tool | grepper |
0mArgs:{
"Expression": "__nvmem_cell_read"
}Results: {
"Output": "drivers/nvmem/core.c=1584=static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)\n--\ndrivers/nvmem/core.c-1626-\ndrivers/nvmem/core.c:1627:static int __nvmem_cell_read(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c-1628-\t\t\t struct nvmem_cell_entry *cell,\n--\ndrivers/nvmem/core.c=1665=void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)\n--\ndrivers/nvmem/core.c-1678-\ndrivers/nvmem/core.c:1679:\trc = __nvmem_cell_read(nvmem, cell-\u003eentry, buf, len, cell-\u003eid, cell-\u003eindex);\ndrivers/nvmem/core.c-1680-\tif (rc) {\n--\ndrivers/nvmem/core.c=1988=ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-2001-\ndrivers/nvmem/core.c:2002:\trc = __nvmem_cell_read(nvmem, \u0026cell, buf, \u0026len, NULL, 0);\ndrivers/nvmem/core.c-2003-\tif (rc)\n"
} |
| 33/2 | 2026/09/22 17:27 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 33217 output: 22 thoughts: 85 Thoughts: Here's my thought process, as if I were analyzing this code: **Analyzing the Call Chain: `__nvmem_cell_read`** Okay, so I'm looking at `__nvmem_cell_read`. I know it's a key function in this NVMEM subsystem, and I want to understand its call hierarchy. My initial focus is on *who* calls this thing. I see two direct callers immediately: `nvmem_cell_read` with a struct nvmem_cell *cell, and a `nvmem_device_cell_read` method which takes a struct nvmem_device *nvmem parameter. That tells me a lot about the core interaction points; data is read either at a cell level or a device level. Now, that's useful, but I'm going to dig a bit deeper. To fully understand the broader context, I need to investigate what's calling that `nvmem_device_cell_read` function. That gives me a higher level context for the initial call, and will further illuminate this call chain. Let's see who triggers *that* one. |
| 34/2 | 2026/09/22 17:27 | tool | grepper |
0mArgs:{
"Expression": "nvmem_device_cell_read"
}Results: {
"Output": "Documentation/driver-api/nvmem.rst=117=To facilitate such consumers NVMEM framework provides below apis::\n--\nDocumentation/driver-api/nvmem.rst-128-\t\t size_t bytes, void *buf);\nDocumentation/driver-api/nvmem.rst:129: int nvmem_device_cell_read(struct nvmem_device *nvmem,\nDocumentation/driver-api/nvmem.rst-130-\t\t\t struct nvmem_cell_info *info, void *buf);\n--\ndrivers/nvmem/core.c=1976=EXPORT_SYMBOL_GPL(nvmem_cell_read_variable_le_u64);\n--\ndrivers/nvmem/core.c-1978-/**\ndrivers/nvmem/core.c:1979: * nvmem_device_cell_read() - Read a given nvmem device and cell\ndrivers/nvmem/core.c-1980- *\n--\ndrivers/nvmem/core.c-1987- */\ndrivers/nvmem/core.c:1988:ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c-1989-\t\t\t struct nvmem_cell_info *info, void *buf)\n--\ndrivers/nvmem/core.c-2007-}\ndrivers/nvmem/core.c:2008:EXPORT_SYMBOL_GPL(nvmem_device_cell_read);\ndrivers/nvmem/core.c-2009-\n--\ninclude/linux/nvmem-consumer.h=76=int nvmem_device_write(struct nvmem_device *nvmem, unsigned int offset,\ninclude/linux/nvmem-consumer.h-77-\t\t size_t bytes, void *buf);\ninclude/linux/nvmem-consumer.h:78:ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,\ninclude/linux/nvmem-consumer.h-79-\t\t\t struct nvmem_cell_info *info, void *buf);\n--\ninclude/linux/nvmem-consumer.h=185=static inline void devm_nvmem_device_put(struct device *dev,\n--\ninclude/linux/nvmem-consumer.h-189-\ninclude/linux/nvmem-consumer.h:190:static inline ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,\ninclude/linux/nvmem-consumer.h-191-\t\t\t\t\t struct nvmem_cell_info *info,\n"
} |
| 35/2 | 2026/09/22 17:27 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 34210 output: 21 thoughts: 15 Thoughts: Here's a summary of my thought process: **Diving into `nvmem_cell_read` Callers** Alright, let's get down to brass tacks. I need to understand how `nvmem_cell_read` is being used. Where are the calls originating from? What contexts are they operating within? Knowing this is crucial for understanding the overall system behavior and potential impact of changes or debugging issues related to this specific function. I'm going to start by tracing the callers and mapping out the call graph. This should give me a solid foundation for further analysis. Let's see what we can find. |
| 36/2 | 2026/09/22 17:27 | tool | grepper |
0mArgs:{
"Expression": "nvmem_cell_read\\("
}Results: {
"Output": "Documentation/driver-api/nvmem.rst=97=The NVMEM framework provides 3 APIs to read/write NVMEM cells::\n--\nDocumentation/driver-api/nvmem.rst-104-\nDocumentation/driver-api/nvmem.rst:105: void *nvmem_cell_read(struct nvmem_cell *cell, ssize_t *len);\nDocumentation/driver-api/nvmem.rst-106- int nvmem_cell_write(struct nvmem_cell *cell, void *buf, ssize_t len);\n--\ndrivers/bluetooth/hci_ll.c=692=static int hci_ti_probe(struct serdev_device *serdev)\n--\ndrivers/bluetooth/hci_ll.c-750-\ndrivers/bluetooth/hci_ll.c:751:\t\tbdaddr = nvmem_cell_read(bdaddr_cell, \u0026len);\ndrivers/bluetooth/hci_ll.c-752-\t\tnvmem_cell_put(bdaddr_cell);\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c=72=static int qcom_cpufreq_simple_get_version(struct device *cpu_dev,\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-79-\t*pvs_name = NULL;\ndrivers/cpufreq/qcom-cpufreq-nvmem.c:80:\tspeedbin = nvmem_cell_read(speedbin_nvmem, NULL);\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-81-\tif (IS_ERR(speedbin))\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c=168=static int qcom_cpufreq_kryo_name_version(struct device *cpu_dev,\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-182-\ndrivers/cpufreq/qcom-cpufreq-nvmem.c:183:\tspeedbin = nvmem_cell_read(speedbin_nvmem, \u0026len);\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-184-\tif (IS_ERR(speedbin))\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c=227=static int qcom_cpufreq_krait_name_version(struct device *cpu_dev,\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-236-\ndrivers/cpufreq/qcom-cpufreq-nvmem.c:237:\tspeedbin = nvmem_cell_read(speedbin_nvmem, \u0026len);\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-238-\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c=276=static int qcom_cpufreq_ipq8064_name_version(struct device *cpu_dev,\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-285-\ndrivers/cpufreq/qcom-cpufreq-nvmem.c:286:\tspeedbin = nvmem_cell_read(speedbin_nvmem, \u0026len);\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-287-\tif (IS_ERR(speedbin))\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c=345=static int qcom_cpufreq_ipq6018_name_version(struct device *cpu_dev,\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-358-\ndrivers/cpufreq/qcom-cpufreq-nvmem.c:359:\tspeedbin = nvmem_cell_read(speedbin_nvmem, NULL);\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-360-\tif (IS_ERR(speedbin))\n--\ndrivers/cpufreq/sun50i-cpufreq-nvmem.c=191=static int sun50i_cpufreq_get_efuse(void)\n--\ndrivers/cpufreq/sun50i-cpufreq-nvmem.c-221-\ndrivers/cpufreq/sun50i-cpufreq-nvmem.c:222:\tspeedbin_ptr = nvmem_cell_read(speedbin_nvmem, \u0026len);\ndrivers/cpufreq/sun50i-cpufreq-nvmem.c-223-\tnvmem_cell_put(speedbin_nvmem);\n--\ndrivers/extcon/extcon-rtk-type-c.c=872=static int __updated_type_c_parameter_by_efuse(struct type_c_data *type_c)\n--\ndrivers/extcon/extcon-rtk-type-c.c-901-\ndrivers/extcon/extcon-rtk-type-c.c:902:\t\tbuf = nvmem_cell_read(cell, \u0026buf_size);\ndrivers/extcon/extcon-rtk-type-c.c-903-\t\tif (!IS_ERR(buf)) {\n--\ndrivers/extcon/extcon-rtk-type-c.c=956=static int __updated_type_c_parameter_by_efuse_v2(struct type_c_data *type_c)\n--\ndrivers/extcon/extcon-rtk-type-c.c-985-\ndrivers/extcon/extcon-rtk-type-c.c:986:\t\tbuf = nvmem_cell_read(cell, \u0026buf_size);\ndrivers/extcon/extcon-rtk-type-c.c-987-\t\tif (!IS_ERR(buf)) {\n--\ndrivers/gpu/drm/mediatek/mtk_dp.c=1164=static void mtk_dp_get_calibration_data(struct mtk_dp *mtk_dp)\n--\ndrivers/gpu/drm/mediatek/mtk_dp.c-1179-\ndrivers/gpu/drm/mediatek/mtk_dp.c:1180:\tbuf = (u32 *)nvmem_cell_read(cell, \u0026len);\ndrivers/gpu/drm/mediatek/mtk_dp.c-1181-\tnvmem_cell_put(cell);\n--\ndrivers/gpu/drm/msm/adreno/a5xx_gpu.c=1690=static void check_speed_bin(struct device *dev)\n--\ndrivers/gpu/drm/msm/adreno/a5xx_gpu.c-1706-\tif (!IS_ERR(cell)) {\ndrivers/gpu/drm/msm/adreno/a5xx_gpu.c:1707:\t\tvoid *buf = nvmem_cell_read(cell, NULL);\ndrivers/gpu/drm/msm/adreno/a5xx_gpu.c-1708-\n--\ndrivers/iio/adc/at91-sama5d2_adc.c=2248=static int at91_adc_temp_sensor_init(struct at91_adc_state *st,\n--\ndrivers/iio/adc/at91-sama5d2_adc.c-2268-\ndrivers/iio/adc/at91-sama5d2_adc.c:2269:\tbuf = nvmem_cell_read(temp_calib, \u0026len);\ndrivers/iio/adc/at91-sama5d2_adc.c-2270-\tnvmem_cell_put(temp_calib);\n--\ndrivers/iio/adc/meson_saradc.c=786=static int meson_sar_adc_temp_sensor_init(struct iio_dev *indio_dev)\n--\ndrivers/iio/adc/meson_saradc.c-809-\tread_len = MESON_SAR_ADC_EFUSE_BYTES;\ndrivers/iio/adc/meson_saradc.c:810:\tbuf = nvmem_cell_read(temperature_calib, \u0026read_len);\ndrivers/iio/adc/meson_saradc.c-811-\tnvmem_cell_put(temperature_calib);\n--\ndrivers/iio/adc/sc27xx_adc.c=165=static int adc_nvmem_cell_calib_data(struct sc27xx_adc_data *data, const char *cell_name)\n--\ndrivers/iio/adc/sc27xx_adc.c-178-\ndrivers/iio/adc/sc27xx_adc.c:179:\tbuf = nvmem_cell_read(cell, \u0026len);\ndrivers/iio/adc/sc27xx_adc.c-180-\tif (IS_ERR(buf)) {\n--\ndrivers/net/ethernet/ni/nixge.c=1234=static void *nixge_get_nvmem_address(struct device *dev)\n--\ndrivers/net/ethernet/ni/nixge.c-1243-\ndrivers/net/ethernet/ni/nixge.c:1244:\tmac = nvmem_cell_read(cell, \u0026cell_size);\ndrivers/net/ethernet/ni/nixge.c-1245-\tnvmem_cell_put(cell);\n--\ndrivers/net/ethernet/sunplus/spl2sw_driver.c=221=static int spl2sw_nvmem_get_mac_address(struct device *dev, struct device_node *np,\n--\ndrivers/net/ethernet/sunplus/spl2sw_driver.c-233-\t/* Read mac address from nvmem cell. */\ndrivers/net/ethernet/sunplus/spl2sw_driver.c:234:\tmac = nvmem_cell_read(cell, \u0026len);\ndrivers/net/ethernet/sunplus/spl2sw_driver.c-235-\tnvmem_cell_put(cell);\n--\ndrivers/net/phy/aquantia/aquantia_firmware.c=296=static int aqr_firmware_load_nvmem(struct phy_device *phydev)\n--\ndrivers/net/phy/aquantia/aquantia_firmware.c-306-\ndrivers/net/phy/aquantia/aquantia_firmware.c:307:\tbuf = nvmem_cell_read(cell, \u0026size);\ndrivers/net/phy/aquantia/aquantia_firmware.c-308-\tif (IS_ERR(buf)) {\n--\ndrivers/net/phy/dp83867.c=528=static int dp83867_of_init_io_impedance(struct phy_device *phydev)\n--\ndrivers/net/phy/dp83867.c-554-\ndrivers/net/phy/dp83867.c:555:\tbuf = nvmem_cell_read(cell, NULL);\ndrivers/net/phy/dp83867.c-556-\tnvmem_cell_put(cell);\n--\ndrivers/net/phy/mediatek/mtk-ge-soc.c=1164=static int mt798x_phy_calibration(struct phy_device *phydev)\n--\ndrivers/net/phy/mediatek/mtk-ge-soc.c-1177-\ndrivers/net/phy/mediatek/mtk-ge-soc.c:1178:\tbuf = (u32 *)nvmem_cell_read(cell, \u0026len);\ndrivers/net/phy/mediatek/mtk-ge-soc.c-1179-\tnvmem_cell_put(cell);\n--\ndrivers/net/wireless/ath/ath10k/core.c=1976=static int ath10k_download_cal_nvmem(struct ath10k *ar, const char *cell_name)\n--\ndrivers/net/wireless/ath/ath10k/core.c-1988-\ndrivers/net/wireless/ath/ath10k/core.c:1989:\tbuf = nvmem_cell_read(cell, \u0026len);\ndrivers/net/wireless/ath/ath10k/core.c-1990-\tif (IS_ERR(buf))\n--\ndrivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c=140=static void owl_nvmem_work(struct work_struct *work)\n--\ndrivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c-147-\ndrivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c:148:\tbuf = nvmem_cell_read(ctx-\u003ecell, \u0026len);\ndrivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c-149-\tif (!IS_ERR(buf)) {\n--\ndrivers/net/wireless/ath/ath9k/init.c=569=static int ath9k_nvmem_request_eeprom(struct ath_softc *sc)\n--\ndrivers/net/wireless/ath/ath9k/init.c-592-\ndrivers/net/wireless/ath/ath9k/init.c:593:\tbuf = nvmem_cell_read(cell, \u0026len);\ndrivers/net/wireless/ath/ath9k/init.c-594-\tnvmem_cell_put(cell);\n--\ndrivers/net/wireless/mediatek/mt76/eeprom.c=121=int mt76_get_of_data_from_nvmem(struct mt76_dev *dev, void *eep,\n--\ndrivers/net/wireless/mediatek/mt76/eeprom.c-133-\ndrivers/net/wireless/mediatek/mt76/eeprom.c:134:\tdata = nvmem_cell_read(cell, \u0026retlen);\ndrivers/net/wireless/mediatek/mt76/eeprom.c-135-\tnvmem_cell_put(cell);\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c=10966=int rt2800_read_eeprom_nvmem(struct rt2x00_dev *rt2x00dev)\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-10977-\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:10978:\tdata = nvmem_cell_read(cell, \u0026retlen);\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-10979-\tnvmem_cell_put(cell);\n--\ndrivers/nvmem/core.c=354=static ssize_t nvmem_cell_attr_read(struct file *filp, struct kobject *kobj,\n--\ndrivers/nvmem/core.c-370-\ndrivers/nvmem/core.c:371:\tcontent = nvmem_cell_read(cell, \u0026cell_sz);\ndrivers/nvmem/core.c-372-\tif (IS_ERR(content)) {\n--\ndrivers/nvmem/core.c=1584=static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)\n--\ndrivers/nvmem/core.c-1626-\ndrivers/nvmem/core.c:1627:static int __nvmem_cell_read(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c-1628-\t\t\t struct nvmem_cell_entry *cell,\n--\ndrivers/nvmem/core.c-1655-/**\ndrivers/nvmem/core.c:1656: * nvmem_cell_read() - Read a given nvmem cell\ndrivers/nvmem/core.c-1657- *\n--\ndrivers/nvmem/core.c-1664- */\ndrivers/nvmem/core.c:1665:void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)\ndrivers/nvmem/core.c-1666-{\n--\ndrivers/nvmem/core.c-1678-\ndrivers/nvmem/core.c:1679:\trc = __nvmem_cell_read(nvmem, cell-\u003eentry, buf, len, cell-\u003eid, cell-\u003eindex);\ndrivers/nvmem/core.c-1680-\tif (rc) {\n--\ndrivers/nvmem/core.c=1795=static int nvmem_cell_read_common(struct device *dev, const char *cell_id,\n--\ndrivers/nvmem/core.c-1805-\ndrivers/nvmem/core.c:1806:\tbuf = nvmem_cell_read(cell, \u0026len);\ndrivers/nvmem/core.c-1807-\tif (IS_ERR(buf)) {\n--\ndrivers/nvmem/core.c=1883=static const void *nvmem_cell_read_variable_common(struct device *dev,\n--\ndrivers/nvmem/core.c-1895-\tnbits = cell-\u003eentry-\u003enbits;\ndrivers/nvmem/core.c:1896:\tbuf = nvmem_cell_read(cell, len);\ndrivers/nvmem/core.c-1897-\tnvmem_cell_put(cell);\n--\ndrivers/nvmem/core.c-1901-\t/*\ndrivers/nvmem/core.c:1902:\t * If nbits is set then nvmem_cell_read() can significantly exaggerate\ndrivers/nvmem/core.c-1903-\t * the length of the real data. Throw away the extra junk.\n--\ndrivers/nvmem/core.c=1988=ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-2001-\ndrivers/nvmem/core.c:2002:\trc = __nvmem_cell_read(nvmem, \u0026cell, buf, \u0026len, NULL, 0);\ndrivers/nvmem/core.c-2003-\tif (rc)\n--\ndrivers/phy/mediatek/phy-mtk-mipi-dsi.c=67=static void mtk_mipi_tx_get_calibration_datal(struct mtk_mipi_tx *mipi_tx)\n--\ndrivers/phy/mediatek/phy-mtk-mipi-dsi.c-77-\t}\ndrivers/phy/mediatek/phy-mtk-mipi-dsi.c:78:\tbuf = (u32 *)nvmem_cell_read(cell, \u0026len);\ndrivers/phy/mediatek/phy-mtk-mipi-dsi.c-79-\tnvmem_cell_put(cell);\n--\ndrivers/phy/qualcomm/phy-qcom-qusb2.c=594=static void qusb2_phy_set_tune2_param(struct qusb2_phy *qphy)\n--\ndrivers/phy/qualcomm/phy-qcom-qusb2.c-610-\t */\ndrivers/phy/qualcomm/phy-qcom-qusb2.c:611:\tval = nvmem_cell_read(qphy-\u003ecell, NULL);\ndrivers/phy/qualcomm/phy-qcom-qusb2.c-612-\tif (IS_ERR(val)) {\n--\ndrivers/phy/realtek/phy-rtk-usb2.c=870=static int get_phy_data_by_efuse(struct rtk_phy *rtk_phy,\n--\ndrivers/phy/realtek/phy-rtk-usb2.c-891-\ndrivers/phy/realtek/phy-rtk-usb2.c:892:\t\tbuf = nvmem_cell_read(cell, \u0026buf_size);\ndrivers/phy/realtek/phy-rtk-usb2.c-893-\t\tif (!IS_ERR(buf)) {\n--\ndrivers/phy/realtek/phy-rtk-usb2.c-933-\ndrivers/phy/realtek/phy-rtk-usb2.c:934:\t\tbuf = nvmem_cell_read(cell, \u0026buf_size);\ndrivers/phy/realtek/phy-rtk-usb2.c-935-\t\tif (!IS_ERR(buf)) {\n--\ndrivers/phy/realtek/phy-rtk-usb3.c=433=static int get_phy_data_by_efuse(struct rtk_phy *rtk_phy,\n--\ndrivers/phy/realtek/phy-rtk-usb3.c-450-\ndrivers/phy/realtek/phy-rtk-usb3.c:451:\t\tbuf = nvmem_cell_read(cell, \u0026buf_size);\ndrivers/phy/realtek/phy-rtk-usb3.c-452-\t\tif (!IS_ERR(buf)) {\n--\ndrivers/phy/rockchip/phy-rockchip-inno-hdmi.c=1174=static int inno_hdmi_phy_rk3328_init(struct inno_hdmi_phy *inno)\n--\ndrivers/phy/rockchip/phy-rockchip-inno-hdmi.c-1203-\ndrivers/phy/rockchip/phy-rockchip-inno-hdmi.c:1204:\tefuse_buf = nvmem_cell_read(cell, \u0026len);\ndrivers/phy/rockchip/phy-rockchip-inno-hdmi.c-1205-\tnvmem_cell_put(cell);\n--\ndrivers/phy/socionext/phy-uniphier-usb3hs.c=101=static int uniphier_u3hsphy_get_nvparam(struct uniphier_u3hsphy_priv *priv,\n--\ndrivers/phy/socionext/phy-uniphier-usb3hs.c-110-\ndrivers/phy/socionext/phy-uniphier-usb3hs.c:111:\tbuf = nvmem_cell_read(cell, NULL);\ndrivers/phy/socionext/phy-uniphier-usb3hs.c-112-\tif (IS_ERR(buf))\n--\ndrivers/phy/sunplus/phy-sunplus-usb2.c=78=static int update_disc_vol(struct sp_usbphy *usbphy)\n--\ndrivers/phy/sunplus/phy-sunplus-usb2.c-91-\ndrivers/phy/sunplus/phy-sunplus-usb2.c:92:\totp_v = nvmem_cell_read(cell, \u0026otp_l);\ndrivers/phy/sunplus/phy-sunplus-usb2.c-93-\tnvmem_cell_put(cell);\n--\ndrivers/power/reset/macsmc-reboot.c=48=static int nvmem_cell_get_u8(struct nvmem_cell *cell)\n--\ndrivers/power/reset/macsmc-reboot.c-53-\ndrivers/power/reset/macsmc-reboot.c:54:\tbfr = nvmem_cell_read(cell, \u0026len);\ndrivers/power/reset/macsmc-reboot.c-55-\tif (IS_ERR(bfr))\n--\ndrivers/power/reset/nvmem-reboot-mode.c=20=static int nvmem_reboot_mode_write(struct reboot_mode_driver *reboot,\n--\ndrivers/power/reset/nvmem-reboot-mode.c-29-\ndrivers/power/reset/nvmem-reboot-mode.c:30:\tbuf = nvmem_cell_read(nvmem_rbm-\u003ecell, \u0026buf_len);\ndrivers/power/reset/nvmem-reboot-mode.c-31-\tif (IS_ERR(buf))\n--\ndrivers/power/supply/sc27xx_fuel_gauge.c=958=static int sc27xx_fgu_calibration(struct sc27xx_fgu_data *data)\n--\ndrivers/power/supply/sc27xx_fuel_gauge.c-968-\ndrivers/power/supply/sc27xx_fuel_gauge.c:969:\tbuf = nvmem_cell_read(cell, \u0026len);\ndrivers/power/supply/sc27xx_fuel_gauge.c-970-\tnvmem_cell_put(cell);\n--\ndrivers/rtc/rtc-macsmc.c=30=static int macsmc_rtc_get_time(struct device *dev, struct rtc_time *tm)\n--\ndrivers/rtc/rtc-macsmc.c-44-\ndrivers/rtc/rtc-macsmc.c:45:\tp_off = nvmem_cell_read(rtc-\u003ertc_offset, \u0026len);\ndrivers/rtc/rtc-macsmc.c-46-\tif (IS_ERR(p_off))\n--\ndrivers/rtc/rtc-pm8xxx.c=170=static int pm8xxx_rtc_read_nvmem_offset(struct pm8xxx_rtc *rtc_dd)\n--\ndrivers/rtc/rtc-pm8xxx.c-175-\ndrivers/rtc/rtc-pm8xxx.c:176:\tbuf = nvmem_cell_read(rtc_dd-\u003envmem_cell, \u0026len);\ndrivers/rtc/rtc-pm8xxx.c-177-\tif (IS_ERR(buf)) {\n--\ndrivers/soc/mediatek/mtk-svs.c=1859=static int svs_get_efuse_data(struct svs_platform *svsp,\n--\ndrivers/soc/mediatek/mtk-svs.c-1871-\ndrivers/soc/mediatek/mtk-svs.c:1872:\t*svsp_efuse = nvmem_cell_read(cell, svsp_efuse_max);\ndrivers/soc/mediatek/mtk-svs.c-1873-\tif (IS_ERR(*svsp_efuse)) {\n--\ndrivers/thermal/imx8mm_thermal.c=198=static int imx8mm_tmu_probe_set_calib_v2(struct platform_device *pdev,\n--\ndrivers/thermal/imx8mm_thermal.c-210-\ndrivers/thermal/imx8mm_thermal.c:211:\tbuf = nvmem_cell_read(cell, \u0026len);\ndrivers/thermal/imx8mm_thermal.c-212-\tnvmem_cell_put(cell);\n--\ndrivers/thermal/mediatek/auxadc_thermal.c=1073=static int mtk_thermal_get_calibration_data(struct device *dev,\n--\ndrivers/thermal/mediatek/auxadc_thermal.c-1095-\ndrivers/thermal/mediatek/auxadc_thermal.c:1096:\tbuf = (u32 *)nvmem_cell_read(cell, \u0026len);\ndrivers/thermal/mediatek/auxadc_thermal.c-1097-\n--\ndrivers/thermal/mediatek/lvts_thermal.c=876=static int lvts_calibration_read(struct device *dev, struct lvts_domain *lvts_td,\n--\ndrivers/thermal/mediatek/lvts_thermal.c-893-\ndrivers/thermal/mediatek/lvts_thermal.c:894:\t\tefuse = nvmem_cell_read(cell, \u0026len);\ndrivers/thermal/mediatek/lvts_thermal.c-895-\n--\ndrivers/thermal/qcom/tsens.c=58=char *qfprom_read(struct device *dev, const char *cname)\n--\ndrivers/thermal/qcom/tsens.c-67-\ndrivers/thermal/qcom/tsens.c:68:\tret = nvmem_cell_read(cell, \u0026data);\ndrivers/thermal/qcom/tsens.c-69-\tnvmem_cell_put(cell);\n--\ndrivers/thermal/rockchip_thermal.c=1470=static int rockchip_get_efuse_value(struct device_node *np, const char *cell_name,\n--\ndrivers/thermal/rockchip_thermal.c-1482-\ndrivers/thermal/rockchip_thermal.c:1483:\tbuf = nvmem_cell_read(cell, \u0026len);\ndrivers/thermal/rockchip_thermal.c-1484-\n--\ndrivers/thermal/sprd_thermal.c=121=static int sprd_thm_cal_read(struct device_node *np, const char *cell_id,\n--\ndrivers/thermal/sprd_thermal.c-131-\ndrivers/thermal/sprd_thermal.c:132:\tbuf = nvmem_cell_read(cell, \u0026len);\ndrivers/thermal/sprd_thermal.c-133-\tnvmem_cell_put(cell);\n--\ndrivers/thermal/sun8i_thermal.c=301=static int sun8i_ths_calibrate(struct ths_device *tmdev)\n--\ndrivers/thermal/sun8i_thermal.c-328-\ndrivers/thermal/sun8i_thermal.c:329:\tcaldata = nvmem_cell_read(calcell, \u0026callen);\ndrivers/thermal/sun8i_thermal.c-330-\tif (IS_ERR(caldata)) {\n--\ndrivers/ufs/host/ufs-renesas.c=448=static int ufs_renesas_init(struct ufs_hba *hba)\n--\ndrivers/ufs/host/ufs-renesas.c-480-\ndrivers/ufs/host/ufs-renesas.c:481:\tdata = nvmem_cell_read(cell, \u0026len);\ndrivers/ufs/host/ufs-renesas.c-482-\tif (IS_ERR(data)) {\n--\ndrivers/watchdog/rave-sp-wdt.c=253=static int rave_sp_wdt_probe(struct platform_device *pdev)\n--\ndrivers/watchdog/rave-sp-wdt.c-280-\t\tsize_t len;\ndrivers/watchdog/rave-sp-wdt.c:281:\t\tvoid *value = nvmem_cell_read(cell, \u0026len);\ndrivers/watchdog/rave-sp-wdt.c-282-\n--\ninclude/linux/nvmem-consumer.h=56=void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell);\ninclude/linux/nvmem-consumer.h:57:void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len);\ninclude/linux/nvmem-consumer.h-58-int nvmem_cell_write(struct nvmem_cell *cell, void *buf, size_t len);\n--\ninclude/linux/nvmem-consumer.h=116=static inline void nvmem_cell_put(struct nvmem_cell *cell)\n--\ninclude/linux/nvmem-consumer.h-119-\ninclude/linux/nvmem-consumer.h:120:static inline void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)\ninclude/linux/nvmem-consumer.h-121-{\n--\nnet/core/of_net.c=61=int of_get_mac_address_nvmem(struct device_node *np, u8 *addr)\n--\nnet/core/of_net.c-81-\nnet/core/of_net.c:82:\tmac = nvmem_cell_read(cell, \u0026len);\nnet/core/of_net.c-83-\tnvmem_cell_put(cell);\n--\nnet/ethernet/eth.c=532=int nvmem_get_mac_address(struct device *dev, void *addrbuf)\n--\nnet/ethernet/eth.c-541-\nnet/ethernet/eth.c:542:\tmac = nvmem_cell_read(cell, \u0026len);\nnet/ethernet/eth.c-543-\tnvmem_cell_put(cell);\n"
} |
| 37/2 | 2026/09/22 17:27 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 42469 output: 32 thoughts: 239 Thoughts: **Analyzing `nvmem_cell_attr_read` in `nvmem/core.c`** Okay, so I'm digging into this `nvmem/core.c` file and, specifically, line 354 of the code. Looks like we're looking at `nvmem_cell_attr_read`, which is defined as a `static ssize_t` function. I see it takes the standard file and kobject structures, a `bin_attribute` struct, a buffer, and offset/count parameters – the usual suspects for a file-like interface. Right, `attr->private` points to a `nvmem_cell_entry`, which is then used to create a `nvmem_cell` via `nvmem_create_cell`. Let's create a cell based on the entry and its name. I'll need to double-check error handling here; that `IS_ERR` macro is a red flag, and the null check on the cell is good defensive coding. Finally, the crux of the operation seems to be the `nvmem_cell_read` function. This function's role is going to be important to understand how we actually get the data. I'm curious as to where this `nvmem_cell_attr_read` function is used. Time to find out! |
| 38/2 | 2026/09/22 17:28 | tool | grepper |
0mArgs:{
"Expression": "nvmem_cell_attr_read",
"PathPrefix": "drivers/nvmem"
}Results: {
"Output": "drivers/nvmem/core.c=351=static struct nvmem_cell *nvmem_create_cell(struct nvmem_cell_entry *entry,\n--\ndrivers/nvmem/core.c-353-\ndrivers/nvmem/core.c:354:static ssize_t nvmem_cell_attr_read(struct file *filp, struct kobject *kobj,\ndrivers/nvmem/core.c-355-\t\t\t\t const struct bin_attribute *attr, char *buf,\n--\ndrivers/nvmem/core.c=469=static int nvmem_populate_sysfs_cells(struct nvmem_device *nvmem)\n--\ndrivers/nvmem/core.c-504-\t\tattrs[i].size = entry-\u003ebytes;\ndrivers/nvmem/core.c:505:\t\tattrs[i].read = \u0026nvmem_cell_attr_read;\ndrivers/nvmem/core.c-506-\t\tattrs[i].private = entry;\n"
} |
| 39/2 | 2026/09/22 17:28 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 43275 output: 36 thoughts: 149 Thoughts: Okay, here's my take on those thoughts, framed from my expert perspective: **Diving into the nvmem Sysfs Attribute Read Path** Right, so `nvmem_populate_sysfs_cells` is responsible for setting up those sysfs attributes. Interesting that it's using `attrs[i].read = &nvmem_cell_attr_read`. That's the key. So, every time a user, or something acting on behalf of a user, tries to read one of those sysfs files, `nvmem_cell_attr_read` gets invoked. That's the entry point to handle the read operation, naturally. And then, *that* function, `nvmem_cell_attr_read`, calls `nvmem_cell_read`, which further cascades down to `__nvmem_cell_read`, and ultimately, `nvmem_shift_read_buffer_in_place`. That last function is the one that's actually doing the work, likely shifting the data within the buffer to the user space. I need to be more mindful of that "shifting". The next question in my mind is always: How do we actually *get* an nvmem device with these cells created in the first place? I know that's the setup, but I want to understand the bigger picture. Let's trace that `nvmem_populate_sysfs_cells` call, see where it's called from. That's the real key to figuring out the overall nvmem device and cell initialization sequence. Time to dig in there. |
| 40/2 | 2026/09/22 17:28 | tool | read-file |
0mArgs:{
"File": "drivers/nvmem/core.c",
"FirstLine": 468,
"LineCount": 60
}Results: {
"Contents": " 468:\t\n 469:\tstatic int nvmem_populate_sysfs_cells(struct nvmem_device *nvmem)\n 470:\t{\n 471:\t\tstruct attribute_group group = {\n 472:\t\t\t.name\t= \"cells\",\n 473:\t\t};\n 474:\t\tstruct nvmem_cell_entry *entry;\n 475:\t\tconst struct bin_attribute **pattrs;\n 476:\t\tstruct bin_attribute *attrs;\n 477:\t\tunsigned int ncells = 0, i = 0;\n 478:\t\tint ret;\n 479:\t\n 480:\t\tguard(mutex)(\u0026nvmem_mutex);\n 481:\t\n 482:\t\tif (list_empty(\u0026nvmem-\u003ecells) || nvmem-\u003esysfs_cells_populated)\n 483:\t\t\treturn 0;\n 484:\t\n 485:\t\t/* Allocate an array of attributes with a sentinel */\n 486:\t\tncells = list_count_nodes(\u0026nvmem-\u003ecells);\n 487:\t\tpattrs = devm_kcalloc(\u0026nvmem-\u003edev, ncells + 1,\n 488:\t\t\t\t sizeof(struct bin_attribute *), GFP_KERNEL);\n 489:\t\tif (!pattrs)\n 490:\t\t\treturn -ENOMEM;\n 491:\t\n 492:\t\tattrs = devm_kcalloc(\u0026nvmem-\u003edev, ncells, sizeof(struct bin_attribute), GFP_KERNEL);\n 493:\t\tif (!attrs)\n 494:\t\t\treturn -ENOMEM;\n 495:\t\n 496:\t\t/* Initialize each attribute to take the name and size of the cell */\n 497:\t\tlist_for_each_entry(entry, \u0026nvmem-\u003ecells, node) {\n 498:\t\t\tsysfs_bin_attr_init(\u0026attrs[i]);\n 499:\t\t\tattrs[i].attr.name = devm_kasprintf(\u0026nvmem-\u003edev, GFP_KERNEL,\n 500:\t\t\t\t\t\t\t \"%s@%x,%x\", entry-\u003ename,\n 501:\t\t\t\t\t\t\t entry-\u003eoffset,\n 502:\t\t\t\t\t\t\t entry-\u003ebit_offset);\n 503:\t\t\tattrs[i].attr.mode = 0444 \u0026 nvmem_bin_attr_get_umode(nvmem);\n 504:\t\t\tattrs[i].size = entry-\u003ebytes;\n 505:\t\t\tattrs[i].read = \u0026nvmem_cell_attr_read;\n 506:\t\t\tattrs[i].private = entry;\n 507:\t\t\tif (!attrs[i].attr.name)\n 508:\t\t\t\treturn -ENOMEM;\n 509:\t\n 510:\t\t\tpattrs[i] = \u0026attrs[i];\n 511:\t\t\ti++;\n 512:\t\t}\n 513:\t\n 514:\t\tgroup.bin_attrs = pattrs;\n 515:\t\n 516:\t\tret = device_add_group(\u0026nvmem-\u003edev, \u0026group);\n 517:\t\tif (ret)\n 518:\t\t\treturn ret;\n 519:\t\n 520:\t\tnvmem-\u003esysfs_cells_populated = true;\n 521:\t\n 522:\t\treturn ret;\n 523:\t}\n 524:\t\n 525:\t#else /* CONFIG_NVMEM_SYSFS */\n 526:\t\n 527:\tstatic int nvmem_sysfs_setup_compat(struct nvmem_device *nvmem,\n"
} |
| 41/2 | 2026/09/22 17:28 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 44716 output: 36 thoughts: 217 Thoughts: **My Deep Dive into the NVMEM Sysfs Interaction** Okay, so I'm digging into how these NVMEM cells actually work within the sysfs. My understanding is that `nvmem_populate_sysfs_cells` is responsible for setting up those crucial sysfs attributes under `/sys/bus/nvmem/devices/*/cells/<name>@<offset>,<bit_offset>`. That's where all the magic happens when someone wants to interact with the memory. Now, when that sysfs file gets read, the kernel triggers a cascade of function calls: `nvmem_cell_attr_read` then calls `nvmem_cell_read`, which then goes to `__nvmem_cell_read` and finally `nvmem_shift_read_buffer_in_place`. This series of calls gets me to the actual data. But a question popped into my head: where do these nvmem devices, specifically the ones *with* cells, originate? Are there virtual or emulated devices that dynamically create them? Or are MTD devices involved? I need to trace back from the cell creation. I've got to find the layout or cell creators. My next thought is, let's look at `drivers/mtd/mtdcore.c`! I need to check how MTD devices contribute to this. I'll search for `mtd_otp_nvmem_register` and `mtd_nvmem_add`. My suspicion is that they hold the key. I should look around line 607 and 955 in `drivers/mtd/mtdcore.c`, I bet those lines are important. |
| 42/2 | 2026/09/22 17:28 | tool | read-file |
0mArgs:{
"File": "drivers/mtd/mtdcore.c",
"FirstLine": 605,
"LineCount": 40
}Results: {
"Contents": " 605:\t}\n 606:\t\n 607:\tstatic int mtd_nvmem_add(struct mtd_info *mtd)\n 608:\t{\n 609:\t\tstruct device_node *node = mtd_get_of_node(mtd);\n 610:\t\tstruct nvmem_config config = {};\n 611:\t\n 612:\t\tconfig.id = NVMEM_DEVID_NONE;\n 613:\t\tconfig.dev = \u0026mtd-\u003edev;\n 614:\t\tconfig.name = dev_name(\u0026mtd-\u003edev);\n 615:\t\tconfig.owner = THIS_MODULE;\n 616:\t\tconfig.add_legacy_fixed_of_cells = of_device_is_compatible(node, \"nvmem-cells\");\n 617:\t\tconfig.reg_read = mtd_nvmem_reg_read;\n 618:\t\tconfig.size = mtd-\u003esize;\n 619:\t\tconfig.word_size = 1;\n 620:\t\tconfig.stride = 1;\n 621:\t\tconfig.read_only = true;\n 622:\t\tconfig.root_only = true;\n 623:\t\tconfig.ignore_wp = true;\n 624:\t\tconfig.priv = mtd;\n 625:\t\n 626:\t\tmtd-\u003envmem = nvmem_register(\u0026config);\n 627:\t\tif (IS_ERR(mtd-\u003envmem)) {\n 628:\t\t\t/* Just ignore if there is no NVMEM support in the kernel */\n 629:\t\t\tif (PTR_ERR(mtd-\u003envmem) == -EOPNOTSUPP)\n 630:\t\t\t\tmtd-\u003envmem = NULL;\n 631:\t\t\telse\n 632:\t\t\t\treturn dev_err_probe(\u0026mtd-\u003edev, PTR_ERR(mtd-\u003envmem),\n 633:\t\t\t\t\t\t \"Failed to register NVMEM device\\n\");\n 634:\t\t}\n 635:\t\n 636:\t\treturn 0;\n 637:\t}\n 638:\t\n 639:\tstatic void mtd_check_of_node(struct mtd_info *mtd)\n 640:\t{\n 641:\t\tstruct device_node *partitions, *parent_dn, *mtd_dn = NULL;\n 642:\t\tconst char *pname, *prefix = \"partition-\";\n 643:\t\tint plen, mtd_name_len, offset, prefix_len;\n 644:\t\n"
} |
| 43/2 | 2026/09/22 17:28 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 45974 output: 35 thoughts: 80 Thoughts: **Exploring the Nuances of ConfigFS and Device Tree Overlays** Okay, so I'm thinking about how these technologies interact, specifically `CONFIG_OF_CONFIGFS` and device tree overlays. The question that immediately comes to mind is whether users can actually create device nodes through configfs. That's a key point to understand the potential of the system. Now, I need to check how syzkaller is handling all of this. Does it test configfs specifically, or does it incorporate testing for device tree overlays as well? This is important because it highlights what is supported and has undergone testing. Wait, I need to expand my thought process. What about the concept of layouts? This brings other considerations. Let's see if there is information available. Okay, I'll go check out the `drivers/nvmem/layouts/` directory. Now I need to get the Kconfig to see how the configurations work. I'll go see what is in `drivers/nvmem/layouts/Kconfig`. |
| 44/2 | 2026/09/22 17:28 | tool | read-file |
0mArgs:{
"File": "drivers/nvmem/layouts/Kconfig",
"FirstLine": 1,
"LineCount": 50
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: GPL-2.0\n 2:\t\n 3:\tconfig NVMEM_LAYOUTS\n 4:\t\tbool\n 5:\t\tdepends on OF\n 6:\t\n 7:\tif NVMEM_LAYOUTS\n 8:\t\n 9:\tmenu \"Layout Types\"\n 10:\t\n 11:\tconfig NVMEM_LAYOUT_SL28_VPD\n 12:\t\ttristate \"Kontron sl28 VPD layout support\"\n 13:\t\tselect CRC8\n 14:\t\thelp\n 15:\t\t Say Y here if you want to support the VPD layout of the Kontron\n 16:\t\t SMARC-sAL28 boards.\n 17:\t\n 18:\t\t If unsure, say N.\n 19:\t\n 20:\tconfig NVMEM_LAYOUT_ONIE_TLV\n 21:\t\ttristate \"ONIE tlv support\"\n 22:\t\tselect CRC32\n 23:\t\thelp\n 24:\t\t Say Y here if you want to support the Open Compute Project ONIE\n 25:\t\t Type-Length-Value standard table.\n 26:\t\n 27:\t\t If unsure, say N.\n 28:\t\n 29:\tconfig NVMEM_LAYOUT_U_BOOT_ENV\n 30:\t\ttristate \"U-Boot environment variables layout\"\n 31:\t\tselect CRC32\n 32:\t\tselect GENERIC_NET_UTILS\n 33:\t\thelp\n 34:\t\t U-Boot stores its setup as environment variables. This driver adds\n 35:\t\t support for verifying \u0026 exporting such data. It also exposes variables\n 36:\t\t as NVMEM cells so they can be referenced by other drivers.\n 37:\t\n 38:\t\t If unsure, say N.\n 39:\t\n 40:\tendmenu\n 41:\t\n 42:\tendif\n"
} |
| 45/2 | 2026/09/22 17:28 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 46801 output: 42 thoughts: 56 Thoughts: Here's my summary, as if I were thinking these thoughts: **Digging into the U-Boot Environment Probe** Hold on a second! I need to refresh my memory on the U-Boot environment probing process. Let's see...I need to remember exactly how `u_boot_env_probe` gets called. Right, I know that function is defined in `drivers/nvmem/layouts/u-boot-env.c`. I need to start by examining that file and trace the call chain. Let's head over to `drivers/nvmem/layouts/u-boot-env.c` and figure this out. |
| 46/2 | 2026/09/22 17:28 | tool | read-file |
0mArgs:{
"File": "drivers/nvmem/layouts/u-boot-env.c",
"FirstLine": 180,
"LineCount": 40
}Results: {
"Contents": " 180:\t\tlayout-\u003eadd_cells = u_boot_env_add_cells;\n 181:\t\n 182:\t\treturn nvmem_layout_register(layout);\n 183:\t}\n 184:\t\n 185:\tstatic void u_boot_env_remove(struct nvmem_layout *layout)\n 186:\t{\n 187:\t\tnvmem_layout_unregister(layout);\n 188:\t}\n 189:\t\n 190:\tstatic const struct of_device_id u_boot_env_of_match_table[] = {\n 191:\t\t{ .compatible = \"u-boot,env\", .data = (void *)U_BOOT_FORMAT_SINGLE, },\n 192:\t\t{ .compatible = \"u-boot,env-redundant-bool\", .data = (void *)U_BOOT_FORMAT_REDUNDANT, },\n 193:\t\t{ .compatible = \"u-boot,env-redundant-count\", .data = (void *)U_BOOT_FORMAT_REDUNDANT, },\n 194:\t\t{ .compatible = \"brcm,env\", .data = (void *)U_BOOT_FORMAT_BROADCOM, },\n 195:\t\t{},\n 196:\t};\n 197:\t\n 198:\tstatic struct nvmem_layout_driver u_boot_env_layout = {\n 199:\t\t.driver = {\n 200:\t\t\t.name = \"u-boot-env-layout\",\n 201:\t\t\t.of_match_table = u_boot_env_of_match_table,\n 202:\t\t},\n 203:\t\t.probe = u_boot_env_probe,\n 204:\t\t.remove = u_boot_env_remove,\n 205:\t};\n 206:\tmodule_nvmem_layout_driver(u_boot_env_layout);\n 207:\t\n 208:\tMODULE_AUTHOR(\"Rafał Miłecki\");\n 209:\tMODULE_LICENSE(\"GPL\");\n 210:\tMODULE_DEVICE_TABLE(of, u_boot_env_of_match_table);\n 211:\tMODULE_DESCRIPTION(\"NVMEM layout driver for U-Boot environment variables\");\n"
} |
| 47/2 | 2026/09/22 17:28 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 47621 output: 27 thoughts: 76 Thoughts: Here's my thought process, as it stands: **Navigating Device Tree Dependencies** Okay, so I'm looking at `of_match_table` and immediately see that the `NVMEM_LAYOUTS` code is reliant on `OF` – that's Open Firmware, or, more likely in this context, Device Tree. *Wait a minute*, are we even using Device Tree on amd64? This is something I need to verify. My gut says it's not the usual case, but assumptions are dangerous. I'll need to check the Kconfig settings. I'll quickly check if `CONFIG_OF` is even *available* on x86 or amd64. Let's start by looking into `drivers/of/Kconfig`. That's where I would expect to find the configuration options related to OF/Device Tree and the architecture dependencies. |
| 48/2 | 2026/09/22 17:28 | tool | grepper |
0mArgs:{
"Expression": "config OF\\b",
"PathPrefix": "drivers/of"
}Results: {
"Output": "drivers/of/Kconfig=8=config BUILTIN_DTB_ALL\n--\ndrivers/of/Kconfig-10-\ndrivers/of/Kconfig:11:menuconfig OF\ndrivers/of/Kconfig-12-\tbool \"Device Tree and Open Firmware support\"\n"
} |
| 49/2 | 2026/09/22 17:28 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 47991 output: 31 thoughts: 261 Thoughts: **My Investigation into OF and Device Tree Usage** Okay, so I'm digging into how the `OF` (Open Firmware) configuration is used, specifically within the kernel's device tree setup. I'm starting with `drivers/of/Kconfig`, and the immediate question is whether `OF` is even relevant on x86 architectures. I see it's a boolean, defaulted to 'y' on architectures like PowerPC and ARM, which is expected. But then I remember, and confirmed by the Kconfig file, that x86 *can* utilize `OF` in certain situations, like for testing (`OF_UNITTEST`) or with device tree overlays through `OF_CONFIGFS`. Interesting. Now, my real interest is in finding places where drivers on amd64/x86 might be registering memory cells without explicitly using the `OF` configuration. I need to understand this pattern to determine if this is intentional, or if we need to modify the drivers. Back to the `grep` results for `.cells =`, let's see what's popping up: 1. `drivers/hwmon/pmbus/adm1266.c`: Okay, this one has `data->nvmem_config.cells = adm1266_nvmem_cells;` 2. `drivers/power/supply/max1720x_battery.c`: and the driver has `max1720x_nvmem_cells`. 3. `drivers/nvmem/brcm_nvram.c`: It looks like `config.cells = priv->cells;` is used. 4. Hang on, what about `at24`? Does `at24` in `drivers/nvmem` have cells defined? I'll need to go look at `drivers/nvmem/at24.c` to be sure. |
| 50/2 | 2026/09/22 17:28 | tool | grepper |
0mError:no matches Args: {
"Expression": "cells",
"PathPrefix": "drivers/nvmem/at24.c"
}Results: {
"error": "no matches"
} |
| 51/2 | 2026/09/22 17:28 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 48702 output: 40 thoughts: 540 Thoughts: **Analyzing `nvmem_shift_read_buffer_in_place`** Okay, hold on a second. What exactly *does* `nvmem_shift_read_buffer_in_place` do, I should really refresh my memory about this. Let me break it down: I see, it takes a `struct nvmem_cell_entry` and a buffer `buf`. The goal here is clearly to read data from a non-byte-aligned location within an NVMEM cell and shift it into a contiguous byte buffer. It looks like the function first calculates `bytes_offset` and `bit_offset` to determine where the data starts within the buffer. The initial conditional block looks like it handles the case where the data isn't byte-aligned, involving bit-shifting operations to combine bits from adjacent bytes. The `for` loop seems to do the shifting and bit extraction, byte by byte. The corrected `for` loop condition is important, it makes sure to stop at the correct offset by subtracting `bytes_offset`. There's a special case handling in the `else if` using `memmove` for byte-aligned reads. If the start of the buffer happens to be the same pointer as the buffer pointer then this part is skipped. The last block zeros out any unused bytes at the end of the buffer, and then clears any leftover bits in the most significant byte to mask off bits that don't belong to the cell's `nbits`. I wonder what bug this commit fixed! It seems like the original code might have had an issue with calculating the number of bytes to process during the shift, possibly leading to out-of-bounds reads or writes. To be more precise, let me go check the git logs, or commit messages in `drivers/nvmem/core.c` for some clues on what this change fixed. |
| 52/2 | 2026/09/22 17:28 | tool | grepper |
0mArgs:{
"Expression": "nvmem_shift_read_buffer_in_place",
"PathPrefix": "drivers/nvmem/core.c"
}Results: {
"Output": "drivers/nvmem/core.c=1582=EXPORT_SYMBOL_GPL(nvmem_cell_put);\ndrivers/nvmem/core.c-1583-\ndrivers/nvmem/core.c:1584:static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)\ndrivers/nvmem/core.c-1585-{\n--\ndrivers/nvmem/core.c=1627=static int __nvmem_cell_read(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-1639-\tif (cell-\u003ebit_offset || cell-\u003enbits)\ndrivers/nvmem/core.c:1640:\t\tnvmem_shift_read_buffer_in_place(cell, buf);\ndrivers/nvmem/core.c-1641-\n"
} |
| 53/2 | 2026/09/22 17:28 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 49904 output: 31 thoughts: 52 Thoughts: Okay, let's dive into this code. **Investigating `cell->bytes` and `cell->raw_len`** Alright, my immediate thought is to understand the relationship between `cell->bytes` and `cell->raw_len`. What are their specific purposes in the larger picture? I need to understand what they represent in the context of the data structure. The first step is figuring out where `cell->bytes` is calculated. Is it assigned directly, or is it derived from something else? I'm going to track it down. Let's use `grep` in `drivers/nvmem/core.c` for finding all the instances where `cell->bytes` is used. This should help me pinpoint where the value is set and calculated. Hopefully, that will give me enough information to work from. |
| 54/2 | 2026/09/22 17:28 | tool | grepper |
0mArgs:{
"Expression": "bytes\\b",
"PathPrefix": "drivers/nvmem/core.c"
}Results: {
"Output": "drivers/nvmem/core.c=29=struct nvmem_cell_entry {\n--\ndrivers/nvmem/core.c-32-\tsize_t\t\t\traw_len;\ndrivers/nvmem/core.c:33:\tint\t\t\tbytes;\ndrivers/nvmem/core.c-34-\tint\t\t\tbit_offset;\n--\ndrivers/nvmem/core.c=57=static int __nvmem_reg_read(struct nvmem_device *nvmem, unsigned int offset,\ndrivers/nvmem/core.c:58:\t\t\t void *val, size_t bytes)\ndrivers/nvmem/core.c-59-{\n--\ndrivers/nvmem/core.c-64-\ndrivers/nvmem/core.c:65:\treturn ops-\u003ereg_read(nvmem-\u003epriv, offset, val, bytes);\ndrivers/nvmem/core.c-66-}\n--\ndrivers/nvmem/core.c=68=static int __nvmem_reg_write(struct nvmem_device *nvmem, unsigned int offset,\ndrivers/nvmem/core.c:69:\t\t\t void *val, size_t bytes)\ndrivers/nvmem/core.c-70-{\n--\ndrivers/nvmem/core.c-80-\ndrivers/nvmem/core.c:81:\twr_ok = ops-\u003ereg_write(nvmem-\u003epriv, offset, val, bytes);\ndrivers/nvmem/core.c-82-\n--\ndrivers/nvmem/core.c=90=static int nvmem_access_with_keepouts(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c-91-\t\t\t\t unsigned int offset, void *val,\ndrivers/nvmem/core.c:92:\t\t\t\t size_t bytes, int write)\ndrivers/nvmem/core.c-93-{\ndrivers/nvmem/core.c-94-\ndrivers/nvmem/core.c:95:\tunsigned int end = offset + bytes;\ndrivers/nvmem/core.c-96-\tunsigned int kend, ksize;\n--\ndrivers/nvmem/core.c=154=static int nvmem_reg_read(struct nvmem_device *nvmem, unsigned int offset,\ndrivers/nvmem/core.c:155:\t\t\t void *val, size_t bytes)\ndrivers/nvmem/core.c-156-{\ndrivers/nvmem/core.c-157-\tif (!nvmem-\u003enkeepout)\ndrivers/nvmem/core.c:158:\t\treturn __nvmem_reg_read(nvmem, offset, val, bytes);\ndrivers/nvmem/core.c-159-\ndrivers/nvmem/core.c:160:\treturn nvmem_access_with_keepouts(nvmem, offset, val, bytes, false);\ndrivers/nvmem/core.c-161-}\n--\ndrivers/nvmem/core.c=163=static int nvmem_reg_write(struct nvmem_device *nvmem, unsigned int offset,\ndrivers/nvmem/core.c:164:\t\t\t void *val, size_t bytes)\ndrivers/nvmem/core.c-165-{\ndrivers/nvmem/core.c-166-\tif (!nvmem-\u003enkeepout)\ndrivers/nvmem/core.c:167:\t\treturn __nvmem_reg_write(nvmem, offset, val, bytes);\ndrivers/nvmem/core.c-168-\ndrivers/nvmem/core.c:169:\treturn nvmem_access_with_keepouts(nvmem, offset, val, bytes, true);\ndrivers/nvmem/core.c-170-}\n--\ndrivers/nvmem/core.c=469=static int nvmem_populate_sysfs_cells(struct nvmem_device *nvmem)\n--\ndrivers/nvmem/core.c-503-\t\tattrs[i].attr.mode = 0444 \u0026 nvmem_bin_attr_get_umode(nvmem);\ndrivers/nvmem/core.c:504:\t\tattrs[i].size = entry-\u003ebytes;\ndrivers/nvmem/core.c-505-\t\tattrs[i].read = \u0026nvmem_cell_attr_read;\n--\ndrivers/nvmem/core.c=581=static int nvmem_cell_info_to_nvmem_cell_entry_nodup(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-586-\tcell-\u003eoffset = info-\u003eoffset;\ndrivers/nvmem/core.c:587:\tcell-\u003eraw_len = info-\u003eraw_len ?: info-\u003ebytes;\ndrivers/nvmem/core.c:588:\tcell-\u003ebytes = info-\u003ebytes;\ndrivers/nvmem/core.c-589-\tcell-\u003ename = info-\u003ename;\n--\ndrivers/nvmem/core.c-597-\tif (cell-\u003enbits) {\ndrivers/nvmem/core.c:598:\t\tcell-\u003ebytes = DIV_ROUND_UP(cell-\u003enbits + cell-\u003ebit_offset,\ndrivers/nvmem/core.c-599-\t\t\t\t\t BITS_PER_BYTE);\ndrivers/nvmem/core.c:600:\t\tcell-\u003eraw_len = ALIGN(cell-\u003ebytes, nvmem-\u003eword_size);\ndrivers/nvmem/core.c-601-\t}\n--\ndrivers/nvmem/core.c=792=int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)\n--\ndrivers/nvmem/core.c-809-\t\tinfo.offset = be32_to_cpup(addr++);\ndrivers/nvmem/core.c:810:\t\tinfo.bytes = be32_to_cpup(addr);\ndrivers/nvmem/core.c-811-\t\tinfo.name = kasprintf(GFP_KERNEL, \"%pOFn\", child);\n--\ndrivers/nvmem/core.c-816-\t\t\tinfo.nbits = be32_to_cpup(addr);\ndrivers/nvmem/core.c:817:\t\t\tif (info.bit_offset \u003e= BITS_PER_BYTE * info.bytes ||\ndrivers/nvmem/core.c-818-\t\t\t info.nbits \u003c 1 ||\ndrivers/nvmem/core.c:819:\t\t\t info.bit_offset + info.nbits \u003e BITS_PER_BYTE * info.bytes) {\ndrivers/nvmem/core.c-820-\t\t\t\tdev_err(dev, \"nvmem: invalid bits on %pOF\\n\", child);\n--\ndrivers/nvmem/core.c=1584=static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)\n--\ndrivers/nvmem/core.c-1599-\ndrivers/nvmem/core.c:1600:\t\t/* setup rest of the bytes if any */\ndrivers/nvmem/core.c:1601:\t\tfor (i = 1; i \u003c (cell-\u003ebytes - bytes_offset); i++) {\ndrivers/nvmem/core.c-1602-\t\t\t/* Get bits from next byte and shift them towards msb */\n--\ndrivers/nvmem/core.c-1607-\t\t/* point to end of the buffer unused bits will be cleared */\ndrivers/nvmem/core.c:1608:\t\tp = buf + cell-\u003ebytes - 1;\ndrivers/nvmem/core.c-1609-\t} else if (p != b) {\ndrivers/nvmem/core.c:1610:\t\tmemmove(p, b, cell-\u003ebytes - bytes_offset);\ndrivers/nvmem/core.c:1611:\t\tp += cell-\u003ebytes - 1;\ndrivers/nvmem/core.c-1612-\t} else {\ndrivers/nvmem/core.c-1613-\t\t/* point to the msb */\ndrivers/nvmem/core.c:1614:\t\tp += cell-\u003ebytes - 1;\ndrivers/nvmem/core.c-1615-\t}\ndrivers/nvmem/core.c-1616-\ndrivers/nvmem/core.c:1617:\t/* result fits in less bytes */\ndrivers/nvmem/core.c:1618:\textra = cell-\u003ebytes - DIV_ROUND_UP(cell-\u003enbits, BITS_PER_BYTE);\ndrivers/nvmem/core.c-1619-\twhile (--extra \u003e= 0)\n--\ndrivers/nvmem/core.c=1627=static int __nvmem_cell_read(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-1649-\tif (len)\ndrivers/nvmem/core.c:1650:\t\t*len = cell-\u003ebytes;\ndrivers/nvmem/core.c-1651-\n--\ndrivers/nvmem/core.c=1665=void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)\n--\ndrivers/nvmem/core.c-1674-\ndrivers/nvmem/core.c:1675:\tbuf = kzalloc(max_t(size_t, entry-\u003eraw_len, entry-\u003ebytes), GFP_KERNEL);\ndrivers/nvmem/core.c-1676-\tif (!buf)\n--\ndrivers/nvmem/core.c=1689=static void *nvmem_cell_prepare_write_buffer(struct nvmem_cell_entry *cell,\n--\ndrivers/nvmem/core.c-1696-\tnbits = cell-\u003enbits;\ndrivers/nvmem/core.c:1697:\tbuf = kzalloc(cell-\u003ebytes, GFP_KERNEL);\ndrivers/nvmem/core.c-1698-\tif (!buf)\n--\ndrivers/nvmem/core.c-1714-\t\t/* setup rest of the byte if any */\ndrivers/nvmem/core.c:1715:\t\tfor (i = 1; i \u003c cell-\u003ebytes; i++) {\ndrivers/nvmem/core.c-1716-\t\t\t/* Get last byte bits and shift them towards lsb */\n--\ndrivers/nvmem/core.c-1728-\t\trc = nvmem_reg_read(nvmem,\ndrivers/nvmem/core.c:1729:\t\t\t\t cell-\u003eoffset + cell-\u003ebytes - 1, \u0026v, 1);\ndrivers/nvmem/core.c-1730-\t\tif (rc)\n--\ndrivers/nvmem/core.c=1742=static int __nvmem_cell_entry_write(struct nvmem_cell_entry *cell, void *buf, size_t len)\n--\ndrivers/nvmem/core.c-1747-\tif (!nvmem || nvmem-\u003eread_only ||\ndrivers/nvmem/core.c:1748:\t (cell-\u003ebit_offset == 0 \u0026\u0026 len != cell-\u003ebytes))\ndrivers/nvmem/core.c-1749-\t\treturn -EINVAL;\n--\ndrivers/nvmem/core.c-1759-\tif (cell-\u003ebit_offset || cell-\u003enbits) {\ndrivers/nvmem/core.c:1760:\t\tif (len != BITS_TO_BYTES(cell-\u003enbits) \u0026\u0026 len != cell-\u003ebytes)\ndrivers/nvmem/core.c-1761-\t\t\treturn -EINVAL;\n--\ndrivers/nvmem/core.c-1766-\ndrivers/nvmem/core.c:1767:\trc = nvmem_reg_write(nvmem, cell-\u003eoffset, buf, cell-\u003ebytes);\ndrivers/nvmem/core.c-1768-\n--\ndrivers/nvmem/core.c-1785- *\ndrivers/nvmem/core.c:1786: * Return: length of bytes written or negative on failure.\ndrivers/nvmem/core.c-1787- */\n--\ndrivers/nvmem/core.c=1976=EXPORT_SYMBOL_GPL(nvmem_cell_read_variable_le_u64);\n--\ndrivers/nvmem/core.c-1984- *\ndrivers/nvmem/core.c:1985: * Return: length of successful bytes read on success and negative\ndrivers/nvmem/core.c-1986- * error code on error.\n--\ndrivers/nvmem/core.c=2008=EXPORT_SYMBOL_GPL(nvmem_device_cell_read);\n--\ndrivers/nvmem/core.c-2016- *\ndrivers/nvmem/core.c:2017: * Return: length of bytes written or negative error code on failure.\ndrivers/nvmem/core.c-2018- */\ndrivers/nvmem/core.c=2019=int nvmem_device_cell_write(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-2031-\ndrivers/nvmem/core.c:2032:\treturn __nvmem_cell_entry_write(\u0026cell, buf, cell.bytes);\ndrivers/nvmem/core.c-2033-}\ndrivers/nvmem/core.c=2034=EXPORT_SYMBOL_GPL(nvmem_device_cell_write);\n--\ndrivers/nvmem/core.c-2040- * @offset: offset in nvmem device.\ndrivers/nvmem/core.c:2041: * @bytes: number of bytes to read.\ndrivers/nvmem/core.c-2042- * @buf: buffer pointer which will be populated on successful read.\ndrivers/nvmem/core.c-2043- *\ndrivers/nvmem/core.c:2044: * Return: length of successful bytes read on success and negative\ndrivers/nvmem/core.c-2045- * error code on error.\n--\ndrivers/nvmem/core.c=2047=int nvmem_device_read(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c-2048-\t\t unsigned int offset,\ndrivers/nvmem/core.c:2049:\t\t size_t bytes, void *buf)\ndrivers/nvmem/core.c-2050-{\n--\ndrivers/nvmem/core.c-2055-\ndrivers/nvmem/core.c:2056:\trc = nvmem_reg_read(nvmem, offset, buf, bytes);\ndrivers/nvmem/core.c-2057-\n--\ndrivers/nvmem/core.c-2060-\ndrivers/nvmem/core.c:2061:\treturn bytes;\ndrivers/nvmem/core.c-2062-}\ndrivers/nvmem/core.c=2063=EXPORT_SYMBOL_GPL(nvmem_device_read);\n--\ndrivers/nvmem/core.c-2069- * @offset: offset in nvmem device.\ndrivers/nvmem/core.c:2070: * @bytes: number of bytes to write.\ndrivers/nvmem/core.c-2071- * @buf: buffer to be written.\ndrivers/nvmem/core.c-2072- *\ndrivers/nvmem/core.c:2073: * Return: length of bytes written or negative error code on failure.\ndrivers/nvmem/core.c-2074- */\ndrivers/nvmem/core.c=2075=int nvmem_device_write(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c-2076-\t\t unsigned int offset,\ndrivers/nvmem/core.c:2077:\t\t size_t bytes, void *buf)\ndrivers/nvmem/core.c-2078-{\n--\ndrivers/nvmem/core.c-2083-\ndrivers/nvmem/core.c:2084:\trc = nvmem_reg_write(nvmem, offset, buf, bytes);\ndrivers/nvmem/core.c-2085-\n--\ndrivers/nvmem/core.c-2089-\ndrivers/nvmem/core.c:2090:\treturn bytes;\ndrivers/nvmem/core.c-2091-}\n"
} |
| 55/2 | 2026/09/22 17:28 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 54209 output: 43 thoughts: 1651 Thoughts: **Analyzing a Potential Out-of-Bounds Read in `nvmem_shift_read_buffer_in_place`**
Okay, let's break this down. I'm looking at `nvmem_shift_read_buffer_in_place`, specifically this code:
```c
for (i = 1; i < (cell->bytes - bytes_offset); i++) {
*p++ |= *b << (BITS_PER_BYTE - bit_offset);
*p = *b++ >> bit_offset;
}
p = buf + cell->bytes - 1;
```
I see a vulnerability. Before this patch, the loop condition was `i < cell->bytes`, and `b` was incremented even if `bytes_offset` was greater than zero. That meant that `b` could easily go past the end of the `buf` if `bytes_offset` was set. And, with the old loop, `p` would also be advanced past the end of the `buf`. Now, this code seems to be fixed. It reads up to `cell->bytes - bytes_offset` and then correctly aligns the pointer `p`. However, the question of whether this function is actually *reachable* from userspace is what I am focused on.
So, let's trace this back. `nvmem_shift_read_buffer_in_place` is called by `__nvmem_cell_read`, which, in turn, is called by `nvmem_cell_read` and `nvmem_device_cell_read`. `nvmem_cell_read` is triggered by `nvmem_cell_attr_read`, which is the sysfs read handler for `/sys/bus/nvmem/devices/*/cells/*`. That means userspace *can* directly interact with `nvmem_shift_read_buffer_in_place` via the sysfs interface. Kernel drivers (like those for network MAC addresses, thermal sensors, and so on) also call it, too.
But, where do these cells come from in the first place? They're added via `nvmem_add_cells`, `nvmem_add_one_cell`, and `nvmem_add_cells_from_dt`, or by `nvmem_layout` drivers. Specifically: `sl28vpd.c`, `onie-tlv.c`, `u-boot-env.c`. I see some are tied to device tree matches like `onie,tlv-layout`.
Okay, so are there any "standard" devices? Let's check where `.cells` is set in `struct nvmem_config`. The code reveals several places where `nvmem_config.cells` is set:
1. `drivers/hwmon/pmbus/adm1266.c` (an I2C device)
2. `drivers/power/supply/max1720x_battery.c` (another I2C device)
3. `drivers/nvmem/brcm_nvram.c` (a Broadcom platform device)
4. `drivers/soc/tegra/fuse/fuse-tegra.c` (Tegra fuse)
The real question is if userspace can trigger those, or somehow cause a configuration which uses it. Can I2C devices be created from userspace? The answer is *yes*, if `i2c-dev` is loaded, a user can instantiate a new device. The `echo` command creates the device.
Now, can I instantiate a device, like an `adm1266`, in QEMU? Yes, QEMU has I2C busses like `i2c-i801` (Intel SMBus). If I instantiate an `adm1266` on `i2c-0` in QEMU, what happens? I'd need to look at the probe function of `adm1266.c` to see how it initializes. This looks to be a significant security risk. A malicious user *could* potentially create a vulnerable configuration that leads to an out-of-bounds read and possible information disclosure or even a denial of service! I need to test all these configurations.
|
| 56/2 | 2026/09/22 17:29 | tool | read-file |
0mArgs:{
"File": "drivers/hwmon/pmbus/adm1266.c",
"FirstLine": 570,
"LineCount": 40
}Results: {
"Contents": " 570:\t\t\t\treturn ret;\n 571:\t\t\t}\n 572:\t\t}\n 573:\t\n 574:\t\tmemcpy(val, data-\u003edev_mem + offset, bytes);\n 575:\t\n 576:\t\treturn 0;\n 577:\t}\n 578:\t\n 579:\tstatic int adm1266_config_nvmem(struct adm1266_data *data)\n 580:\t{\n 581:\t\tdata-\u003envmem_config.name = dev_name(\u0026data-\u003eclient-\u003edev);\n 582:\t\tdata-\u003envmem_config.dev = \u0026data-\u003eclient-\u003edev;\n 583:\t\tdata-\u003envmem_config.root_only = true;\n 584:\t\tdata-\u003envmem_config.read_only = true;\n 585:\t\tdata-\u003envmem_config.owner = THIS_MODULE;\n 586:\t\tdata-\u003envmem_config.reg_read = adm1266_nvmem_read;\n 587:\t\tdata-\u003envmem_config.cells = adm1266_nvmem_cells;\n 588:\t\tdata-\u003envmem_config.ncells = ARRAY_SIZE(adm1266_nvmem_cells);\n 589:\t\tdata-\u003envmem_config.priv = data;\n 590:\t\tdata-\u003envmem_config.stride = 1;\n 591:\t\tdata-\u003envmem_config.word_size = 1;\n 592:\t\tdata-\u003envmem_config.size = adm1266_nvmem_cells[0].bytes;\n 593:\t\n 594:\t\tdata-\u003edev_mem = devm_kzalloc(\u0026data-\u003eclient-\u003edev, data-\u003envmem_config.size, GFP_KERNEL);\n 595:\t\tif (!data-\u003edev_mem)\n 596:\t\t\treturn -ENOMEM;\n 597:\t\n 598:\t\tdata-\u003envmem = devm_nvmem_register(\u0026data-\u003eclient-\u003edev, \u0026data-\u003envmem_config);\n 599:\t\tif (IS_ERR(data-\u003envmem)) {\n 600:\t\t\tdev_err(\u0026data-\u003eclient-\u003edev, \"Could not register nvmem!\");\n 601:\t\t\treturn PTR_ERR(data-\u003envmem);\n 602:\t\t}\n 603:\t\n 604:\t\treturn 0;\n 605:\t}\n 606:\t\n 607:\tstatic int adm1266_probe(struct i2c_client *client)\n 608:\t{\n 609:\t\tstruct adm1266_data *data;\n"
} |
| 57/2 | 2026/09/22 17:29 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 57514 output: 43 thoughts: 25 Thoughts: Here's my take on the scenario, as I understand it: **Testing `adm1266_probe` in a Simulated Environment** Alright, let's dive in. I need to understand how the `adm1266_probe` function behaves under controlled conditions. The obvious first step is to simulate an I2C bus environment – a "fake" bus, as it were. This isn't about real hardware interaction; it's about isolating and observing the function's internal logic and error handling. I want to see how `adm1266_probe` responds when presented with data that *isn't* from a genuine ADM1266 chip. Essentially, I'm going to feed it junk data, or perhaps deliberately crafted data that mimics incorrect device responses, and see how it reacts. What's the error handling like? Does it correctly identify the "fake" device, or does it try to interpret the garbled data, leading to unexpected behavior or even crashes? I anticipate the probe function to fail when a valid ADM1266 isn't detected, but I'm eager to see what exactly is happening during that process. This gives me insight into the code's robustness and how it handles edge cases or possibly malicious inputs. This controlled testing on a simulated bus is crucial for understanding the function's reliability. |
| 58/2 | 2026/09/22 17:29 | tool | read-file |
0mArgs:{
"File": "drivers/hwmon/pmbus/adm1266.c",
"FirstLine": 610,
"LineCount": 40
}Results: {
"Contents": " 610:\t\tint ret;\n 611:\t\tint i;\n 612:\t\n 613:\t\tdata = devm_kzalloc(\u0026client-\u003edev, sizeof(struct adm1266_data), GFP_KERNEL);\n 614:\t\tif (!data)\n 615:\t\t\treturn -ENOMEM;\n 616:\t\n 617:\t\tdata-\u003eclient = client;\n 618:\t\tdata-\u003einfo.pages = 17;\n 619:\t\tdata-\u003einfo.format[PSC_VOLTAGE_OUT] = linear;\n 620:\t\tfor (i = 0; i \u003c data-\u003einfo.pages; i++)\n 621:\t\t\tdata-\u003einfo.func[i] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT;\n 622:\t\n 623:\t\tcrc8_populate_msb(pmbus_crc_table, 0x7);\n 624:\t\tmutex_init(\u0026data-\u003ebuf_mutex);\n 625:\t\n 626:\t\tret = pmbus_do_probe(client, \u0026data-\u003einfo);\n 627:\t\tif (ret)\n 628:\t\t\treturn ret;\n 629:\t\n 630:\t\tret = adm1266_rtc_set(client, 0);\n 631:\t\tif (ret \u003c 0)\n 632:\t\t\treturn ret;\n 633:\t\n 634:\t\tret = adm1266_config_nvmem(data);\n 635:\t\tif (ret \u003c 0)\n 636:\t\t\treturn ret;\n 637:\t\n 638:\t\tret = adm1266_config_gpio(data);\n 639:\t\tif (ret \u003c 0)\n 640:\t\t\treturn ret;\n 641:\t\n 642:\t\tadm1266_init_debugfs(data);\n 643:\t\n 644:\t\treturn 0;\n 645:\t}\n 646:\t\n 647:\tstatic const struct of_device_id adm1266_of_match[] = {\n 648:\t\t{ .compatible = \"adi,adm1266\" },\n 649:\t\t{ }\n"
} |
| 59/2 | 2026/09/22 17:29 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 58468 output: 44 thoughts: 46 Thoughts: Okay, here's my assessment of the situation: **Probing the I2C Bus: A Hardware Reality Check** Alright, so the `pmbus_do_probe` function is the one that's directly interacting with the hardware via I2C. And, if I'm understanding this correctly, it means that a probe will *fail* if there's no actual hardware present and responding on that I2C bus. That's a significant point, because that means we're dealing with a hard dependency on the physical world. If there is no device, there can be no detection. Let me just quickly take a peek into `max1720x_battery.c` and see if anything jumps out to provide additional insight. I want to see how *that* specific driver handles the probing and interaction with its target hardware. This might offer clues about the kinds of failures that are possible. |
| 60/2 | 2026/09/22 17:29 | tool | read-file |
0mArgs:{
"File": "drivers/power/supply/max1720x_battery.c",
"FirstLine": 510,
"LineCount": 40
}Results: {
"Contents": " 510:\t\n 511:\t\ti2c_unregister_device(info-\u003eancillary);\n 512:\t}\n 513:\t\n 514:\tstatic int max1720x_probe_nvmem(struct i2c_client *client,\n 515:\t\t\t\t\tstruct max1720x_device_info *info)\n 516:\t{\n 517:\t\tstruct device *dev = \u0026client-\u003edev;\n 518:\t\tstruct nvmem_config nvmem_config = {\n 519:\t\t\t.dev = dev,\n 520:\t\t\t.name = \"max1720x_nvmem\",\n 521:\t\t\t.cells = max1720x_nvmem_cells,\n 522:\t\t\t.ncells = ARRAY_SIZE(max1720x_nvmem_cells),\n 523:\t\t\t.read_only = true,\n 524:\t\t\t.root_only = true,\n 525:\t\t\t.reg_read = max1720x_nvmem_reg_read,\n 526:\t\t\t.size = ARRAY_SIZE(max1720x_nvmem_cells) * 2,\n 527:\t\t\t.word_size = 2,\n 528:\t\t\t.stride = 2,\n 529:\t\t\t.priv = info,\n 530:\t\t};\n 531:\t\tstruct nvmem_device *nvmem;\n 532:\t\tunsigned int val;\n 533:\t\tint ret;\n 534:\t\n 535:\t\tinfo-\u003eancillary = i2c_new_ancillary_device(client, \"nvmem\", 0xb);\n 536:\t\tif (IS_ERR(info-\u003eancillary)) {\n 537:\t\t\tdev_err(dev, \"Failed to initialize ancillary i2c device\\n\");\n 538:\t\t\treturn PTR_ERR(info-\u003eancillary);\n 539:\t\t}\n 540:\t\n 541:\t\tret = devm_add_action_or_reset(dev, max1720x_unregister_ancillary, info);\n 542:\t\tif (ret) {\n 543:\t\t\tdev_err(dev, \"Failed to add unregister callback\\n\");\n 544:\t\t\treturn ret;\n 545:\t\t}\n 546:\t\n 547:\t\tinfo-\u003eregmap_nv = devm_regmap_init_i2c(info-\u003eancillary,\n 548:\t\t\t\t\t\t \u0026max1720x_nvmem_regmap_cfg);\n 549:\t\tif (IS_ERR(info-\u003eregmap_nv)) {\n"
} |
| 61/2 | 2026/09/22 17:29 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 59439 output: 29 thoughts: 32 Thoughts: Okay, here's my take on those thoughts, framed as an expert's internal monologue: **USB and NVMEM: A Quick Check** Hmm, just a moment. My mind is wandering. We were discussing NVMEM, but what about the often-overlooked area of USB devices? Could a USB device, in any conceivable scenario, be designed to register itself as an NVMEM device? That sounds a little unusual, but not impossible, and it’s always worth considering the edge cases. Let me quickly cross-reference my mental database, then quickly and intuitively query my knowledgebase. I need to eliminate this possibility before I start work on the original problem. Let’s do a quick scan of my existing framework for drivers and device interactions. The most immediate thing to do is determine if any existing USB driver is known to register an NVMEM device. Let's see if I can recall any past work or examples I've encountered that would clarify this question. |
| 62/2 | 2026/09/22 17:29 | tool | grepper |
0mError:no matches Args: {
"Expression": "nvmem_register",
"PathPrefix": "drivers/net/usb"
}Results: {
"error": "no matches"
} |
| 63/2 | 2026/09/22 17:29 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 59720 output: 27 thoughts: 10 Thoughts: Here's a summary of my thought process: **USB Driver Investigation - Time to Dive In** Okay, so I need to get started. My instinct tells me the place to begin is the `drivers/usb/` directory. That's the logical starting point for investigating anything USB-related within this kernel context. I need to understand what's there and what might be relevant to the issue at hand. It's time to dig into the source code and start building a mental model of the USB driver architecture. Let's see what we can find. |
| 64/2 | 2026/09/22 17:29 | tool | grepper |
0mError:no matches Args: {
"Expression": "nvmem_register",
"PathPrefix": "drivers/usb"
}Results: {
"error": "no matches"
} |
| 65/2 | 2026/09/22 17:29 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 59889 output: 24 thoughts: 42 Thoughts: Here's my thought process, as requested: **Investigating NVMEM Driver Usage** Okay, before I go any further down this particular rabbit hole, I need a broader understanding of how NVMEM is currently being used within the kernel's device driver landscape. Instead of diving into specific driver code first, I'm going to take a more systematic approach. Let's start by querying the source tree. I want to see a map of the existing ecosystem. Let's `grep` the entire `drivers/` directory to discover instances of `nvmem_register` or, even better, the managed version `devm_nvmem_register`. That should provide a useful overview of which devices are already leveraging the NVMEM framework. Knowing this upfront will inform my subsequent investigation and help me avoid duplicating effort or overlooking existing design patterns. This is a crucial first step in any driver-related investigation to avoid reinventing the wheel and to establish a base context. |
| 66/2 | 2026/09/22 17:29 | tool | grepper |
0mArgs:{
"Expression": "(devm_)?nvmem_register\\("
}Results: {
"Output": "\nFull output is too long, showing 500 out of 709 lines.\nUse more precise expression if possible.\n\nDocumentation/driver-api/driver-model/devres.rst=446=RTC\n--\nDocumentation/driver-api/driver-model/devres.rst-449- devm_rtc_register_device()\nDocumentation/driver-api/driver-model/devres.rst:450: devm_rtc_nvmem_register()\nDocumentation/driver-api/driver-model/devres.rst-451-\n--\nDocumentation/driver-api/nvmem.rst=40=A NVMEM provider can register with NVMEM core by supplying relevant\nDocumentation/driver-api/nvmem.rst:41:nvmem configuration to nvmem_register(), on success core would return a valid\nDocumentation/driver-api/nvmem.rst-42-nvmem_device pointer.\n--\nDocumentation/driver-api/nvmem.rst=46=For example, a simple nvram case::\n--\nDocumentation/driver-api/nvmem.rst-58-\nDocumentation/driver-api/nvmem.rst:59:\tdevm_nvmem_register(\u0026config);\nDocumentation/driver-api/nvmem.rst-60- }\n--\ndrivers/hwmon/pmbus/adm1266.c=579=static int adm1266_config_nvmem(struct adm1266_data *data)\n--\ndrivers/hwmon/pmbus/adm1266.c-597-\ndrivers/hwmon/pmbus/adm1266.c:598:\tdata-\u003envmem = devm_nvmem_register(\u0026data-\u003eclient-\u003edev, \u0026data-\u003envmem_config);\ndrivers/hwmon/pmbus/adm1266.c-599-\tif (IS_ERR(data-\u003envmem)) {\n--\ndrivers/hwmon/pmbus/mpq8646.c=877=static int mpq8646_probe(struct i2c_client *client)\n--\ndrivers/hwmon/pmbus/mpq8646.c-941-\t\t};\ndrivers/hwmon/pmbus/mpq8646.c:942:\t\tstruct nvmem_device *nv = devm_nvmem_register(\u0026client-\u003edev, \u0026cfg);\ndrivers/hwmon/pmbus/mpq8646.c-943-\n--\ndrivers/hwmon/spd5118.c=384=static int spd5118_nvmem_init(struct device *dev, struct spd5118_data *data)\n--\ndrivers/hwmon/spd5118.c-403-\ndrivers/hwmon/spd5118.c:404:\tnvmem = devm_nvmem_register(dev, \u0026nvmem_config);\ndrivers/hwmon/spd5118.c-405-\treturn PTR_ERR_OR_ZERO(nvmem);\n--\ndrivers/iio/pressure/bmp280-core.c=2350=static int bmp580_preinit(struct bmp280_data *data)\n--\ndrivers/iio/pressure/bmp280-core.c-2393-\t/* Register nvmem device */\ndrivers/iio/pressure/bmp280-core.c:2394:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(config.dev, \u0026config));\ndrivers/iio/pressure/bmp280-core.c-2395-}\n--\ndrivers/media/i2c/ov2740.c=1250=static int ov2740_register_nvmem(struct i2c_client *client,\n--\ndrivers/media/i2c/ov2740.c-1280-\ndrivers/media/i2c/ov2740.c:1281:\tnvm-\u003envmem = devm_nvmem_register(dev, \u0026nvmem_config);\ndrivers/media/i2c/ov2740.c-1282-\tif (IS_ERR(nvm-\u003envmem))\n--\ndrivers/media/i2c/video-i2c.c=750=static int video_i2c_probe(struct i2c_client *client)\n--\ndrivers/media/i2c/video-i2c.c-844-\ndrivers/media/i2c/video-i2c.c:845:\t\tdevice = devm_nvmem_register(\u0026client-\u003edev, config);\ndrivers/media/i2c/video-i2c.c-846-\n--\ndrivers/misc/ds1682.c=226=static int ds1682_probe(struct i2c_client *client)\n--\ndrivers/misc/ds1682.c-246-\ndrivers/misc/ds1682.c:247:\tnvmem = devm_nvmem_register(\u0026client-\u003edev, \u0026config);\ndrivers/misc/ds1682.c-248-\tif (IS_ENABLED(CONFIG_NVMEM) \u0026\u0026 IS_ERR(nvmem))\n--\ndrivers/misc/keba/cp500.c=593=static int cp500_nvmem_write(void *priv, unsigned int offset, void *val,\n--\ndrivers/misc/keba/cp500.c-606-\ndrivers/misc/keba/cp500.c:607:static int cp500_nvmem_register(struct cp500 *cp500,\ndrivers/misc/keba/cp500.c-608-\t\t\t\tstruct nvmem_device *base_nvmem)\n--\ndrivers/misc/keba/cp500.c-634-\tnvmem_config.priv = \u0026cp500-\u003envmem_cpu;\ndrivers/misc/keba/cp500.c:635:\ttmp = nvmem_register(\u0026nvmem_config);\ndrivers/misc/keba/cp500.c-636-\tif (IS_ERR(tmp))\n--\ndrivers/misc/keba/cp500.c-644-\tnvmem_config.priv = \u0026cp500-\u003envmem_user;\ndrivers/misc/keba/cp500.c:645:\ttmp = nvmem_register(\u0026nvmem_config);\ndrivers/misc/keba/cp500.c-646-\tif (IS_ERR(tmp)) {\n--\ndrivers/misc/keba/cp500.c=693=static int cp500_nvmem(struct notifier_block *nb, unsigned long action,\n--\ndrivers/misc/keba/cp500.c-720-\ndrivers/misc/keba/cp500.c:721:\tret = cp500_nvmem_register(cp500, nvmem);\ndrivers/misc/keba/cp500.c-722-\tif (ret)\n--\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c=320=static int pci1xxxx_otp_eeprom_probe(struct auxiliary_device *aux_dev,\n--\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c-376-\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:377:\t\tpriv-\u003envmem_eeprom = devm_nvmem_register(\u0026aux_dev-\u003edev,\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c-378-\t\t\t\t\t\t\t \u0026priv-\u003envmem_config_eeprom);\n--\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c-396-\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:397:\tpriv-\u003envmem_otp = devm_nvmem_register(\u0026aux_dev-\u003edev,\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c-398-\t\t\t\t\t \u0026priv-\u003envmem_config_otp);\n--\ndrivers/mtd/mtdcore.c=607=static int mtd_nvmem_add(struct mtd_info *mtd)\n--\ndrivers/mtd/mtdcore.c-625-\ndrivers/mtd/mtdcore.c:626:\tmtd-\u003envmem = nvmem_register(\u0026config);\ndrivers/mtd/mtdcore.c-627-\tif (IS_ERR(mtd-\u003envmem)) {\n--\ndrivers/mtd/mtdcore.c=923=static ssize_t mtd_otp_size(struct mtd_info *mtd, bool is_user)\n--\ndrivers/mtd/mtdcore.c-954-\ndrivers/mtd/mtdcore.c:955:static struct nvmem_device *mtd_otp_nvmem_register(struct mtd_info *mtd,\ndrivers/mtd/mtdcore.c-956-\t\t\t\t\t\t const char *compatible,\n--\ndrivers/mtd/mtdcore.c-980-\ndrivers/mtd/mtdcore.c:981:\tnvmem = nvmem_register(\u0026config);\ndrivers/mtd/mtdcore.c-982-\t/* Just ignore if there is no NVMEM support in the kernel */\n--\ndrivers/mtd/mtdcore.c=1019=static int mtd_otp_nvmem_add(struct mtd_info *mtd)\n--\ndrivers/mtd/mtdcore.c-1033-\t\tif (size \u003e 0) {\ndrivers/mtd/mtdcore.c:1034:\t\t\tnvmem = mtd_otp_nvmem_register(mtd, \"user-otp\", size,\ndrivers/mtd/mtdcore.c-1035-\t\t\t\t\t\t mtd_nvmem_user_otp_reg_read);\n--\ndrivers/mtd/mtdcore.c-1071-\ndrivers/mtd/mtdcore.c:1072:\t\t\tnvmem = mtd_otp_nvmem_register(mtd, \"factory-otp\", size,\ndrivers/mtd/mtdcore.c-1073-\t\t\t\t\t\t mtd_nvmem_fact_otp_reg_read);\n--\ndrivers/mtd/ubi/nvmem.c=61=static int ubi_nvmem_add(struct ubi_volume_info *vi)\n--\ndrivers/mtd/ubi/nvmem.c-98-\tunv-\u003eusable_leb_size = vi-\u003eusable_leb_size;\ndrivers/mtd/ubi/nvmem.c:99:\tunv-\u003envmem = nvmem_register(\u0026config);\ndrivers/mtd/ubi/nvmem.c-100-\tif (IS_ERR(unv-\u003envmem)) {\n--\ndrivers/nvmem/airoha-smc-efuses.c=50=static int airoha_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/airoha-smc-efuses.c-99-\t\tnvmem_config.of_node = child;\ndrivers/nvmem/airoha-smc-efuses.c:100:\t\tnvmem = devm_nvmem_register(dev, \u0026nvmem_config);\ndrivers/nvmem/airoha-smc-efuses.c-101-\t\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/an8855-efuse.c=25=static int an8855_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/an8855-efuse.c-44-\tan8855_nvmem_config.dev = dev;\ndrivers/nvmem/an8855-efuse.c:45:\tnvmem = devm_nvmem_register(dev, \u0026an8855_nvmem_config);\ndrivers/nvmem/an8855-efuse.c-46-\n--\ndrivers/nvmem/apple-efuses.c=32=static int apple_efuses_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/apple-efuses.c-58-\ndrivers/nvmem/apple-efuses.c:59:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(config.dev, \u0026config));\ndrivers/nvmem/apple-efuses.c-60-}\n--\ndrivers/nvmem/apple-spmi-nvmem.c=37=static int apple_spmi_nvmem_probe(struct spmi_device *sdev)\n--\ndrivers/nvmem/apple-spmi-nvmem.c-56-\ndrivers/nvmem/apple-spmi-nvmem.c:57:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(\u0026sdev-\u003edev, \u0026nvmem_cfg));\ndrivers/nvmem/apple-spmi-nvmem.c-58-}\n--\ndrivers/nvmem/at24.c=595=static int at24_probe(struct i2c_client *client)\n--\ndrivers/nvmem/at24.c-778-\ndrivers/nvmem/at24.c:779:\tat24-\u003envmem = devm_nvmem_register(dev, \u0026nvmem_config);\ndrivers/nvmem/at24.c-780-\tif (IS_ERR(at24-\u003envmem)) {\n--\ndrivers/nvmem/at25.c=482=static int at25_probe(struct spi_mem *mem)\n--\ndrivers/nvmem/at25.c-552-\ndrivers/nvmem/at25.c:553:\tat25-\u003envmem = devm_nvmem_register(\u0026spi-\u003edev, \u0026at25-\u003envmem_config);\ndrivers/nvmem/at25.c-554-\tif (IS_ERR(at25-\u003envmem))\n--\ndrivers/nvmem/bcm-ocotp.c=243=static int bcm_otpc_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/bcm-ocotp.c-292-\ndrivers/nvmem/bcm-ocotp.c:293:\tnvmem = devm_nvmem_register(dev, \u0026bcm_otpc_nvmem_config);\ndrivers/nvmem/bcm-ocotp.c-294-\tif (IS_ERR(nvmem)) {\n--\ndrivers/nvmem/brcm_nvram.c=212=static int brcm_nvram_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/brcm_nvram.c-240-\ndrivers/nvmem/brcm_nvram.c:241:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(dev, \u0026config));\ndrivers/nvmem/brcm_nvram.c-242-}\n--\ndrivers/nvmem/core.c=875=EXPORT_SYMBOL_GPL(nvmem_layout_unregister);\n--\ndrivers/nvmem/core.c-877-/**\ndrivers/nvmem/core.c:878: * nvmem_register() - Register a nvmem device for given nvmem_config.\ndrivers/nvmem/core.c-879- * Also creates a binary entry in /sys/bus/nvmem/devices/dev-name/nvmem\n--\ndrivers/nvmem/core.c-886-\ndrivers/nvmem/core.c:887:struct nvmem_device *nvmem_register(const struct nvmem_config *config)\ndrivers/nvmem/core.c-888-{\n--\ndrivers/nvmem/core.c=1072=static void devm_nvmem_unregister(void *nvmem)\n--\ndrivers/nvmem/core.c-1077-/**\ndrivers/nvmem/core.c:1078: * devm_nvmem_register() - Register a managed nvmem device for given\ndrivers/nvmem/core.c-1079- * nvmem_config.\n--\ndrivers/nvmem/core.c-1087- */\ndrivers/nvmem/core.c:1088:struct nvmem_device *devm_nvmem_register(struct device *dev,\ndrivers/nvmem/core.c-1089-\t\t\t\t\t const struct nvmem_config *config)\n--\ndrivers/nvmem/core.c-1093-\ndrivers/nvmem/core.c:1094:\tnvmem = nvmem_register(config);\ndrivers/nvmem/core.c-1095-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/ee1004.c=278=static int ee1004_probe(struct i2c_client *client)\n--\ndrivers/nvmem/ee1004.c-326-\ndrivers/nvmem/ee1004.c:327:\tndev = devm_nvmem_register(\u0026client-\u003edev, \u0026config);\ndrivers/nvmem/ee1004.c-328-\tif (IS_ERR(ndev))\n--\ndrivers/nvmem/eeprom_93xx46.c=458=static int eeprom_93xx46_probe(struct spi_device *spi)\n--\ndrivers/nvmem/eeprom_93xx46.c-518-\ndrivers/nvmem/eeprom_93xx46.c:519:\tedev-\u003envmem = devm_nvmem_register(\u0026spi-\u003edev, \u0026edev-\u003envmem_config);\ndrivers/nvmem/eeprom_93xx46.c-520-\tif (IS_ERR(edev-\u003envmem))\n--\ndrivers/nvmem/imx-iim.c=96=static int imx_iim_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/imx-iim.c-126-\ndrivers/nvmem/imx-iim.c:127:\tnvmem = devm_nvmem_register(dev, \u0026cfg);\ndrivers/nvmem/imx-iim.c-128-\n--\ndrivers/nvmem/imx-ocotp-ele.c=138=static int imx_ele_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/imx-ocotp-ele.c-167-\ndrivers/nvmem/imx-ocotp-ele.c:168:\tnvmem = devm_nvmem_register(dev, \u0026priv-\u003econfig);\ndrivers/nvmem/imx-ocotp-ele.c-169-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/imx-ocotp-scu.c=239=static int imx_scu_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/imx-ocotp-scu.c-258-\timx_scu_ocotp_nvmem_config.priv = priv;\ndrivers/nvmem/imx-ocotp-scu.c:259:\tnvmem = devm_nvmem_register(dev, \u0026imx_scu_ocotp_nvmem_config);\ndrivers/nvmem/imx-ocotp-scu.c-260-\n--\ndrivers/nvmem/imx-ocotp.c=596=static int imx_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/imx-ocotp.c-628-\ndrivers/nvmem/imx-ocotp.c:629:\tnvmem = devm_nvmem_register(dev, \u0026imx_ocotp_nvmem_config);\ndrivers/nvmem/imx-ocotp.c-630-\n--\ndrivers/nvmem/jz4780-efuse.c=139=static int jz4780_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/jz4780-efuse.c-212-\ndrivers/nvmem/jz4780-efuse.c:213:\tnvmem = devm_nvmem_register(dev, \u0026cfg);\ndrivers/nvmem/jz4780-efuse.c-214-\n--\ndrivers/nvmem/lan9662-otpc.c=180=static int lan9662_otp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/lan9662-otpc.c-198-\ndrivers/nvmem/lan9662-otpc.c:199:\tnvmem = devm_nvmem_register(dev, \u0026otp_config);\ndrivers/nvmem/lan9662-otpc.c-200-\n--\ndrivers/nvmem/layerscape-sfp.c=45=static int layerscape_sfp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/layerscape-sfp.c-74-\ndrivers/nvmem/layerscape-sfp.c:75:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026layerscape_sfp_nvmem_config);\ndrivers/nvmem/layerscape-sfp.c-76-\n--\ndrivers/nvmem/lpc18xx_eeprom.c=161=static int lpc18xx_eeprom_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/lpc18xx_eeprom.c-234-\ndrivers/nvmem/lpc18xx_eeprom.c:235:\teeprom-\u003envmem = devm_nvmem_register(dev, \u0026lpc18xx_nvmem_config);\ndrivers/nvmem/lpc18xx_eeprom.c-236-\tif (IS_ERR(eeprom-\u003envmem)) {\n--\ndrivers/nvmem/lpc18xx_otp.c=66=static int lpc18xx_otp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/lpc18xx_otp.c-82-\ndrivers/nvmem/lpc18xx_otp.c:83:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026lpc18xx_otp_nvmem_config);\ndrivers/nvmem/lpc18xx_otp.c-84-\n--\ndrivers/nvmem/m24lr.c=488=static int m24lr_probe(struct i2c_client *client)\n--\ndrivers/nvmem/m24lr.c-556-\ndrivers/nvmem/m24lr.c:557:\tnvmem = devm_nvmem_register(dev, \u0026nvmem_conf);\ndrivers/nvmem/m24lr.c-558-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/max77759-nvmem.c=90=static int max77759_nvmem_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/max77759-nvmem.c-114-\ndrivers/nvmem/max77759-nvmem.c:115:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(config.dev, \u0026config));\ndrivers/nvmem/max77759-nvmem.c-116-}\n--\ndrivers/nvmem/meson-efuse.c=47=static int meson_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/meson-efuse.c-89-\ndrivers/nvmem/meson-efuse.c:90:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, econfig);\ndrivers/nvmem/meson-efuse.c-91-\n--\ndrivers/nvmem/meson-mx-efuse.c=191=static int meson_mx_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/meson-mx-efuse.c-225-\ndrivers/nvmem/meson-mx-efuse.c:226:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026efuse-\u003econfig);\ndrivers/nvmem/meson-mx-efuse.c-227-\n--\ndrivers/nvmem/microchip-otpc.c=243=static int mchp_otpc_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/microchip-otpc.c-266-\tmchp_nvmem_config.priv = otpc;\ndrivers/nvmem/microchip-otpc.c:267:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026mchp_nvmem_config);\ndrivers/nvmem/microchip-otpc.c-268-\n--\ndrivers/nvmem/mtk-efuse.c=62=static int mtk_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/mtk-efuse.c-89-\t\teconfig.fixup_dt_cell_info = \u0026mtk_efuse_fixup_dt_cell_info;\ndrivers/nvmem/mtk-efuse.c:90:\tnvmem = devm_nvmem_register(dev, \u0026econfig);\ndrivers/nvmem/mtk-efuse.c-91-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/mxs-ocotp.c=139=static int mxs_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/mxs-ocotp.c-174-\tocotp_config.dev = dev;\ndrivers/nvmem/mxs-ocotp.c:175:\totp-\u003envmem = devm_nvmem_register(dev, \u0026ocotp_config);\ndrivers/nvmem/mxs-ocotp.c-176-\tif (IS_ERR(otp-\u003envmem))\n--\ndrivers/nvmem/nintendo-otp.c=73=static int nintendo_otp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/nintendo-otp.c-104-\ndrivers/nvmem/nintendo-otp.c:105:\tnvmem = devm_nvmem_register(dev, \u0026config);\ndrivers/nvmem/nintendo-otp.c-106-\n--\ndrivers/nvmem/qcom-spmi-sdam.c=111=static int sdam_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/qcom-spmi-sdam.c-152-\ndrivers/nvmem/qcom-spmi-sdam.c:153:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026sdam-\u003esdam_config);\ndrivers/nvmem/qcom-spmi-sdam.c-154-\tif (IS_ERR(nvmem)) {\n--\ndrivers/nvmem/qfprom.c=368=static int qfprom_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/qfprom.c-453-\ndrivers/nvmem/qfprom.c:454:\tnvmem = devm_nvmem_register(dev, \u0026econfig);\ndrivers/nvmem/qfprom.c-455-\n--\ndrivers/nvmem/qnap-mcu-eeprom.c=74=static int qnap_mcu_eeprom_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/qnap-mcu-eeprom.c-93-\ndrivers/nvmem/qnap-mcu-eeprom.c:94:\tndev = devm_nvmem_register(\u0026pdev-\u003edev, \u0026nvcfg);\ndrivers/nvmem/qnap-mcu-eeprom.c-95-\tif (IS_ERR(ndev))\n--\ndrivers/nvmem/qoriq-efuse.c=29=static int qoriq_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/qoriq-efuse.c-54-\tconfig.priv = priv;\ndrivers/nvmem/qoriq-efuse.c:55:\tnvmem = devm_nvmem_register(config.dev, \u0026config);\ndrivers/nvmem/qoriq-efuse.c-56-\n--\ndrivers/nvmem/rave-sp-eeprom.c=287=static int rave_sp_eeprom_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/rave-sp-eeprom.c-337-\ndrivers/nvmem/rave-sp-eeprom.c:338:\tnvmem = devm_nvmem_register(dev, \u0026config);\ndrivers/nvmem/rave-sp-eeprom.c-339-\n--\ndrivers/nvmem/rcar-efuse.c=46=static int rcar_fuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/rcar-efuse.c-89-\ndrivers/nvmem/rcar-efuse.c:90:\tfuse-\u003envmem = devm_nvmem_register(dev, \u0026config);\ndrivers/nvmem/rcar-efuse.c-91-\tif (IS_ERR(fuse-\u003envmem))\n--\ndrivers/nvmem/rmem.c=119=static int rmem_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/rmem.c-152-\ndrivers/nvmem/rmem.c:153:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(dev, \u0026config));\ndrivers/nvmem/rmem.c-154-}\n--\ndrivers/nvmem/rockchip-efuse.c=253=static int rockchip_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/rockchip-efuse.c-286-\teconfig.dev = efuse-\u003edev;\ndrivers/nvmem/rockchip-efuse.c:287:\tnvmem = devm_nvmem_register(dev, \u0026econfig);\ndrivers/nvmem/rockchip-efuse.c-288-\n--\ndrivers/nvmem/rockchip-otp.c=415=static int rockchip_otp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/rockchip-otp.c-454-\ndrivers/nvmem/rockchip-otp.c:455:\tnvmem = devm_nvmem_register(dev, \u0026otp_config);\ndrivers/nvmem/rockchip-otp.c-456-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/s32g-ocotp-nvmem.c=64=static int s32g_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/s32g-ocotp-nvmem.c-84-\ndrivers/nvmem/s32g-ocotp-nvmem.c:85:\tnvmem = devm_nvmem_register(dev, \u0026s32g_ocotp_nvmem_config);\ndrivers/nvmem/s32g-ocotp-nvmem.c-86-\n--\ndrivers/nvmem/sc27xx-efuse.c=202=static int sc27xx_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/sc27xx-efuse.c-250-\teconfig.add_legacy_fixed_of_cells = true;\ndrivers/nvmem/sc27xx-efuse.c:251:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026econfig);\ndrivers/nvmem/sc27xx-efuse.c-252-\tif (IS_ERR(nvmem)) {\n--\ndrivers/nvmem/sec-qfprom.c=45=static int sec_qfprom_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/sec-qfprom.c-75-\ndrivers/nvmem/sec-qfprom.c:76:\tnvmem = devm_nvmem_register(dev, \u0026econfig);\ndrivers/nvmem/sec-qfprom.c-77-\n--\ndrivers/nvmem/snvs_lpgpr.c=89=static int snvs_lpgpr_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/snvs_lpgpr.c-131-\ndrivers/nvmem/snvs_lpgpr.c:132:\tnvmem = devm_nvmem_register(dev, cfg);\ndrivers/nvmem/snvs_lpgpr.c-133-\n--\ndrivers/nvmem/sprd-efuse.c=361=static int sprd_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/sprd-efuse.c-415-\teconfig.dev = \u0026pdev-\u003edev;\ndrivers/nvmem/sprd-efuse.c:416:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026econfig);\ndrivers/nvmem/sprd-efuse.c-417-\tif (IS_ERR(nvmem)) {\n--\ndrivers/nvmem/stm32-romem.c=189=static int stm32_romem_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/stm32-romem.c-248-\ndrivers/nvmem/stm32-romem.c:249:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(dev, \u0026priv-\u003ecfg));\ndrivers/nvmem/stm32-romem.c-250-}\n--\ndrivers/nvmem/sunplus-ocotp.c=156=static int sp_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/sunplus-ocotp.c-190-\ndrivers/nvmem/sunplus-ocotp.c:191:\tnvmem = devm_nvmem_register(dev, \u0026sp_ocotp_nvmem_config);\ndrivers/nvmem/sunplus-ocotp.c-192-\tif (IS_ERR(nvmem)) {\n--\ndrivers/nvmem/sunxi_sid.c=124=static int sunxi_sid_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/sunxi_sid.c-166-\ndrivers/nvmem/sunxi_sid.c:167:\tnvmem = devm_nvmem_register(dev, nvmem_cfg);\ndrivers/nvmem/sunxi_sid.c-168-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/u-boot-env.c=45=static int u_boot_env_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/u-boot-env.c-71-\ndrivers/nvmem/u-boot-env.c:72:\tpriv-\u003envmem = devm_nvmem_register(dev, \u0026config);\ndrivers/nvmem/u-boot-env.c-73-\tif (IS_ERR(priv-\u003envmem))\n--\ndrivers/nvmem/uniphier-efuse.c=31=static int uniphier_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/uniphier-efuse.c-54-\teconfig.add_legacy_fixed_of_cells = true;\ndrivers/nvmem/uniphier-efuse.c:55:\tnvmem = devm_nvmem_register(dev, \u0026econfig);\ndrivers/nvmem/uniphier-efuse.c-56-\n--\ndrivers/nvmem/vf610-ocotp.c=212=static int vf610_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/vf610-ocotp.c-238-\ndrivers/nvmem/vf610-ocotp.c:239:\tocotp_dev-\u003envmem = devm_nvmem_register(dev, \u0026ocotp_config);\ndrivers/nvmem/vf610-ocotp.c-240-\n--\ndrivers/nvmem/zynqmp_nvmem.c=206=static int zynqmp_nvmem_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/zynqmp_nvmem.c-220-\ndrivers/nvmem/zynqmp_nvmem.c:221:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(dev, \u0026econfig));\ndrivers/nvmem/zynqmp_nvmem.c-222-}\n--\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c=876=static int mtk_mfg_init_nvmem_provider(struct mtk_mfg *mfg)\n--\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c-890-\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:891:\tnvdev = devm_nvmem_register(dev, \u0026config);\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c-892-\tif (IS_ERR(nvdev))\n--\ndrivers/power/supply/max1720x_battery.c=514=static int max1720x_probe_nvmem(struct i2c_client *client,\n--\ndrivers/power/supply/max1720x_battery.c-565-\ndrivers/power/supply/max1720x_battery.c:566:\tnvmem = devm_nvmem_register(dev, \u0026nvmem_config);\ndrivers/power/supply/max1720x_battery.c-567-\tif (IS_ERR(nvmem)) {\n--\ndrivers/rtc/nvmem.c-12-\ndrivers/rtc/nvmem.c:13:int devm_rtc_nvmem_register(struct rtc_device *rtc,\ndrivers/rtc/nvmem.c-14-\t\t struct nvmem_config *nvmem_config)\n--\ndrivers/rtc/nvmem.c-24-\tnvmem_config-\u003eadd_legacy_fixed_of_cells = true;\ndrivers/rtc/nvmem.c:25:\tnvmem = devm_nvmem_register(dev, nvmem_config);\ndrivers/rtc/nvmem.c-26-\tif (IS_ERR(nvmem))\n--\ndrivers/rtc/rtc-abx80x.c=742=static int abx80x_setup_nvmem(struct abx80x_priv *priv)\n--\ndrivers/rtc/rtc-abx80x.c-751-\ndrivers/rtc/rtc-abx80x.c:752:\treturn devm_rtc_nvmem_register(priv-\u003ertc, \u0026config);\ndrivers/rtc/rtc-abx80x.c-753-}\n--\ndrivers/rtc/rtc-cmos.c=930=cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)\n--\ndrivers/rtc/rtc-cmos.c-1120-\tnvmem_cfg.size = address_space - NVRAM_OFFSET;\ndrivers/rtc/rtc-cmos.c:1121:\tdevm_rtc_nvmem_register(cmos_rtc.rtc, \u0026nvmem_cfg);\ndrivers/rtc/rtc-cmos.c-1122-\n--\ndrivers/rtc/rtc-ds1305.c=543=static int ds1305_probe(struct spi_device *spi)\n--\ndrivers/rtc/rtc-ds1305.c-700-\ndrivers/rtc/rtc-ds1305.c:701:\tdevm_rtc_nvmem_register(ds1305-\u003ertc, \u0026ds1305_nvmem_cfg);\ndrivers/rtc/rtc-ds1305.c-702-\n--\ndrivers/rtc/rtc-ds1307.c=1876=static int ds1307_probe(struct i2c_client *client)\n--\ndrivers/rtc/rtc-ds1307.c-2152-\ndrivers/rtc/rtc-ds1307.c:2153:\t\tdevm_rtc_nvmem_register(ds1307-\u003ertc, \u0026nvmem_cfg);\ndrivers/rtc/rtc-ds1307.c-2154-\t}\n--\ndrivers/rtc/rtc-ds1343.c=344=static int ds1343_probe(struct spi_device *spi)\n--\ndrivers/rtc/rtc-ds1343.c-415-\tnvmem_cfg.priv = priv;\ndrivers/rtc/rtc-ds1343.c:416:\tdevm_rtc_nvmem_register(priv-\u003ertc, \u0026nvmem_cfg);\ndrivers/rtc/rtc-ds1343.c-417-\n--\ndrivers/rtc/rtc-ds1511.c=272=static int ds1511_rtc_probe(struct platform_device *pdev)\n--\ndrivers/rtc/rtc-ds1511.c-348-\ndrivers/rtc/rtc-ds1511.c:349:\tdevm_rtc_nvmem_register(ds1511-\u003ertc, \u0026ds1511_nvmem_cfg);\ndrivers/rtc/rtc-ds1511.c-350-\n--\ndrivers/rtc/rtc-ds1553.c=250=static int ds1553_rtc_probe(struct platform_device *pdev)\n--\ndrivers/rtc/rtc-ds1553.c-311-\ndrivers/rtc/rtc-ds1553.c:312:\tdevm_rtc_nvmem_register(pdata-\u003ertc, \u0026nvmem_cfg);\ndrivers/rtc/rtc-ds1553.c-313-\n--\ndrivers/rtc/rtc-ds1685.c=1068=ds1685_rtc_probe(struct platform_device *pdev)\n--\ndrivers/rtc/rtc-ds1685.c-1310-\tnvmem_cfg.priv = rtc;\ndrivers/rtc/rtc-ds1685.c:1311:\tret = devm_rtc_nvmem_register(rtc_dev, \u0026nvmem_cfg);\ndrivers/rtc/rtc-ds1685.c-1312-\tif (ret)\n--\n\n"
} |
| 67/2 | 2026/09/22 17:29 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 70922 output: 38 thoughts: 16 Thoughts: Here's a summary of my thought process, as requested: **Checking `adm1266_nvmem_cells`** Alright, time to dig into this `adm1266_nvmem_cells` thing. I'm going to quickly refresh my understanding of how this specific non-volatile memory cell interacts within the overall system architecture. Is this a custom implementation, or something we're leveraging from a standard library? I need to quickly identify its role – data storage, configuration registers, security keys, or something else entirely. Context is key, and I’m making some initial assumptions here. Next, I'll consider typical failure modes: wear-out, data corruption, access issues, and power-cycling problems. I'll need to think about how these cells are read, written, and validated. Do we have ECC, CRC, or any kind of error detection/correction mechanisms in place? The code should immediately flag these things. I'm hoping for well-documented code with clear comments, robust error handling, and perhaps some instrumentation for diagnostics. Any past issues with these cells? Were there previous patches to this area? A quick glance at the commit history would be helpful. Finally, I'll need to determine the test coverage for this module. Are there unit tests, integration tests, and system-level tests that cover read/write operations and fault scenarios? I want to know how confident we are in this component. Let's get to work! |
| 68/2 | 2026/09/22 17:29 | tool | grepper |
0mArgs:{
"Expression": "adm1266_nvmem_cells",
"PathPrefix": "drivers/hwmon/pmbus/"
}Results: {
"Output": "drivers/hwmon/pmbus/adm1266.c=55=struct adm1266_data {\n--\ndrivers/hwmon/pmbus/adm1266.c-68-\ndrivers/hwmon/pmbus/adm1266.c:69:static const struct nvmem_cell_info adm1266_nvmem_cells[] = {\ndrivers/hwmon/pmbus/adm1266.c-70-\t{\n--\ndrivers/hwmon/pmbus/adm1266.c=579=static int adm1266_config_nvmem(struct adm1266_data *data)\n--\ndrivers/hwmon/pmbus/adm1266.c-586-\tdata-\u003envmem_config.reg_read = adm1266_nvmem_read;\ndrivers/hwmon/pmbus/adm1266.c:587:\tdata-\u003envmem_config.cells = adm1266_nvmem_cells;\ndrivers/hwmon/pmbus/adm1266.c:588:\tdata-\u003envmem_config.ncells = ARRAY_SIZE(adm1266_nvmem_cells);\ndrivers/hwmon/pmbus/adm1266.c-589-\tdata-\u003envmem_config.priv = data;\n--\ndrivers/hwmon/pmbus/adm1266.c-591-\tdata-\u003envmem_config.word_size = 1;\ndrivers/hwmon/pmbus/adm1266.c:592:\tdata-\u003envmem_config.size = adm1266_nvmem_cells[0].bytes;\ndrivers/hwmon/pmbus/adm1266.c-593-\n"
} |
| 69/2 | 2026/09/22 17:29 | llm | patch-evaluator-compressor |
0mModel:gemini-3.8-flash Args: null Results: null Reply: ### Summary of Investigation
#### 1. Applied Changes and Commit Context
- Commit `4da74d0352cad1ee0c07f09e61c60ef7b7d5c625`:
Modifies `nvmem_shift_read_buffer_in_place()` in `drivers/nvmem/core.c`:
```c
@@ -1598,12 +1598,14 @@ static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void
*p = *b++ >> bit_offset;
/* setup rest of the bytes if any */
- for (i = 1; i < cell->bytes; i++) {
+ for (i = 1; i < (cell->bytes - bytes_offset); i++) {
/* Get bits from next byte and shift them towards msb */
*p++ |= *b << (BITS_PER_BYTE - bit_offset);
*p = *b++ >> bit_offset;
}
+ /* point to end of the buffer unused bits will be cleared */
+ p = buf + cell->bytes - 1;
} else if (p != b) {
memmove(p, b, cell->bytes - bytes_offset);
p += cell->bytes - 1;
```
#### 2. Key Code Logic and Subsystem Mechanics
- `nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)`:
- Handles non-byte-aligned reads from an nvmem cell, shifting bits in-place inside `buf`.
- Prior code looped `i < cell->bytes`, reading from `*b` without considering `bytes_offset = bit_offset / BITS_PER_BYTE; b += bytes_offset;`, which causes an out-of-bounds read past the buffer if `bytes_offset > 0`.
- Fix updates loop bound to `i < (cell->bytes - bytes_offset)` and resets pointer `p = buf + cell->bytes - 1` before trailing bits are zeroed.
- Direct call chain:
- `nvmem_shift_read_buffer_in_place()` is static, called exclusively by `__nvmem_cell_read()`:
```c
if (cell->bit_offset || cell->nbits)
nvmem_shift_read_buffer_in_place(cell, buf);
```
- `__nvmem_cell_read()` is called only by:
1. `nvmem_cell_read(struct nvmem_cell *cell, size_t *len)` (core.c:1679)
2. `nvmem_device_cell_read(struct nvmem_device *nvmem, struct nvmem_cell_info *info, void *buf)` (core.c:2002)
#### 3. Reachability Analysis Across Layers
- User-space sysfs interface:
- `nvmem_populate_sysfs_cells(struct nvmem_device *nvmem)` registers a bin attribute group `"cells"` under `/sys/bus/nvmem/devices/<dev>/cells/<cell_name>@<offset>,<bit_offset>` (core.c:469-523).
- The read callback is `nvmem_cell_attr_read()`, which calls `nvmem_cell_read()`, leading directly to `__nvmem_cell_read()` and `nvmem_shift_read_buffer_in_place()`.
- Cell creation paths:
1. `nvmem_register()` with `config->cells` populated.
2. Device Tree (`OF`) via `nvmem_add_cells_from_dt()` / `nvmem_add_cells_from_legacy_of()`.
3. Dynamic layout parsers (`drivers/nvmem/layouts/` - `sl28vpd`, `onie-tlv`, `u-boot-env`).
4. Specific drivers registering static cell info (e.g. `adm1266`, `max1720x`, `brcm_nvram`, `tegra_fuse`).
- Target architecture: `amd64`:
- Investigated QEMU standard devices: `rtc-cmos` registers `cmos_nvram` via `devm_rtc_nvmem_register()`, but with `.cells = NULL` and no sub-cell definitions.
- Investigated MTD: `mtd_nvmem_add()` registers nvmem device with `add_legacy_fixed_of_cells = of_device_is_compatible(node, "nvmem-cells")`, dependent on OF.
- Investigated kernel config dependencies: `NVMEM` (bool), `NVMEM_SYSFS` (bool), `OF` (can be built on x86/amd64 if configured with `CONFIG_OF`), `I2C` EEPROMs (`EEPROM_AT24`).
- Need to verify whether cells with `bit_offset != 0` can be created or stimulated in standard virtualized amd64 QEMU environments (e.g., via mock drivers, I2C/SPI emulated devices, Device Tree overlays / OF unittest / configfs, or synthetic cell definitions).
#### 4. Active Theories and Next Steps
- Determine whether any amd64-reachable driver defines an nvmem cell with `bit_offset != 0` or `nbits != 0`, or if userspace (syzkaller) can register/instantiate one dynamically:
- Check if any driver compiled for x86/amd64 defines static `nvmem_cell_info` tables with `bit_offset` or `nbits`.
- Check if `drivers/i2c/busses/i2c-stub.c` or I2C EEPROMs can bind layouts or cells.
- Check whether `nvmem_cell_read()` is called by consumer drivers probing emulated devices.
- Assess reachability criteria: If no driver active in QEMU x86/amd64 creates nvmem cells with bit offsets, or if syzkaller cannot instantiate an nvmem cell, the function might be structurally unreachable in standard fuzzing runs, OR if mock/virtual drivers provide this path, determine appropriate configs (`CONFIG_NVMEM`, `CONFIG_NVMEM_SYSFS`, etc.) and symbols (`nvmem_cell_attr_read`, `__nvmem_cell_read`, `nvmem_cell_read`).
#### 5. Critical Files and Symbols
- `drivers/nvmem/core.c`: Contains `nvmem_shift_read_buffer_in_place`, `__nvmem_cell_read`, `nvmem_cell_read`, `nvmem_cell_attr_read`, `nvmem_populate_sysfs_cells`.
- `drivers/nvmem/Kconfig`: `CONFIG_NVMEM`, `CONFIG_NVMEM_SYSFS`.
- Note: Avoid looping through broad `grep` searches for generic terms like `cells` or `bytes`. Next checks should specifically target `bit_offset` in cell declarations (`struct nvmem_cell_info`).Tokens: input: 53799 output: 1646 thoughts: 0 |
| 70/2 | 2026/09/22 17:29 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 20350 output: 42 thoughts: 0 |
| 71/2 | 2026/09/22 17:29 | tool | read-file |
0mArgs:{
"File": "drivers/hwmon/pmbus/adm1266.c",
"FirstLine": 68,
"LineCount": 20
}Results: {
"Contents": " 68:\t\n 69:\tstatic const struct nvmem_cell_info adm1266_nvmem_cells[] = {\n 70:\t\t{\n 71:\t\t\t.name = \"blackbox\",\n 72:\t\t\t.offset = ADM1266_BLACKBOX_OFFSET,\n 73:\t\t\t.bytes = 2048,\n 74:\t\t},\n 75:\t};\n 76:\t\n 77:\tDECLARE_CRC8_TABLE(pmbus_crc_table);\n 78:\t\n 79:\t/*\n 80:\t * Different from Block Read as it sends data and waits for the slave to\n 81:\t * return a value dependent on that data. The protocol is simply a Write Block\n 82:\t * followed by a Read Block without the Read-Block command field and the\n 83:\t * Write-Block STOP bit.\n 84:\t */\n 85:\tstatic int adm1266_pmbus_block_xfer(struct adm1266_data *data, u8 cmd, u8 w_len, u8 *data_w,\n 86:\t\t\t\t\t u8 *data_r)\n 87:\t{\n"
} |
| 72/2 | 2026/09/22 17:29 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 20706 output: 44 thoughts: 0 |
| 73/2 | 2026/09/22 17:29 | tool | read-file |
0mArgs:{
"File": "drivers/power/supply/max1720x_battery.c",
"FirstLine": 100,
"LineCount": 40
}Results: {
"Contents": " 100:\t\n 101:\tstatic const struct regmap_access_table max1720x_readable_regs = {\n 102:\t\t.yes_ranges\t= max1720x_readable_allow,\n 103:\t\t.n_yes_ranges\t= ARRAY_SIZE(max1720x_readable_allow),\n 104:\t\t.no_ranges\t= max1720x_readable_deny,\n 105:\t\t.n_no_ranges\t= ARRAY_SIZE(max1720x_readable_deny),\n 106:\t};\n 107:\t\n 108:\tstatic const struct regmap_access_table max1720x_volatile_regs = {\n 109:\t\t.yes_ranges\t= max1720x_volatile_allow,\n 110:\t\t.n_yes_ranges\t= ARRAY_SIZE(max1720x_volatile_allow),\n 111:\t\t.no_ranges\t= max1720x_readable_deny,\n 112:\t\t.n_no_ranges\t= ARRAY_SIZE(max1720x_readable_deny),\n 113:\t};\n 114:\t\n 115:\tstatic const struct regmap_config max1720x_regmap_cfg = {\n 116:\t\t.reg_bits = 8,\n 117:\t\t.val_bits = 16,\n 118:\t\t.max_register = MAX172XX_ATAVCAP,\n 119:\t\t.val_format_endian = REGMAP_ENDIAN_LITTLE,\n 120:\t\t.rd_table = \u0026max1720x_readable_regs,\n 121:\t\t.volatile_table = \u0026max1720x_volatile_regs,\n 122:\t\t.cache_type = REGCACHE_MAPLE,\n 123:\t};\n 124:\t\n 125:\tstatic const struct regmap_range max1720x_nvmem_allow[] = {\n 126:\t\tregmap_reg_range(MAX172XX_TEMP1, MAX172XX_INT_TEMP),\n 127:\t\tregmap_reg_range(MAX172XX_TEMP2, MAX172XX_TEMP2),\n 128:\t\tregmap_reg_range(MAX1720X_NXTABLE0, MAX1720X_NDEVICE_NAME4),\n 129:\t};\n 130:\t\n 131:\tstatic const struct regmap_range max1720x_nvmem_deny[] = {\n 132:\t\tregmap_reg_range(0x00, 0x33),\n 133:\t\tregmap_reg_range(0x36, 0x3A),\n 134:\t\tregmap_reg_range(0x3C, 0x7F),\n 135:\t\tregmap_reg_range(0xE0, 0xFF),\n 136:\t};\n 137:\t\n 138:\tstatic const struct regmap_access_table max1720x_nvmem_regs = {\n 139:\t\t.yes_ranges\t= max1720x_nvmem_allow,\n"
} |
| 74/2 | 2026/09/22 17:29 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 21597 output: 37 thoughts: 0 |
| 75/2 | 2026/09/22 17:29 | tool | grepper |
0mArgs:{
"Expression": "max1720x_nvmem_cells",
"PathPrefix": "drivers/power/supply/"
}Results: {
"Output": "drivers/power/supply/max1720x_battery.c=145=static const struct regmap_config max1720x_nvmem_regmap_cfg = {\n--\ndrivers/power/supply/max1720x_battery.c-152-\ndrivers/power/supply/max1720x_battery.c:153:static const struct nvmem_cell_info max1720x_nvmem_cells[] = {\ndrivers/power/supply/max1720x_battery.c-154-\t{ .name = \"nXTable0\", .offset = 0, .bytes = 2, },\n--\ndrivers/power/supply/max1720x_battery.c=514=static int max1720x_probe_nvmem(struct i2c_client *client,\n--\ndrivers/power/supply/max1720x_battery.c-520-\t\t.name = \"max1720x_nvmem\",\ndrivers/power/supply/max1720x_battery.c:521:\t\t.cells = max1720x_nvmem_cells,\ndrivers/power/supply/max1720x_battery.c:522:\t\t.ncells = ARRAY_SIZE(max1720x_nvmem_cells),\ndrivers/power/supply/max1720x_battery.c-523-\t\t.read_only = true,\n--\ndrivers/power/supply/max1720x_battery.c-525-\t\t.reg_read = max1720x_nvmem_reg_read,\ndrivers/power/supply/max1720x_battery.c:526:\t\t.size = ARRAY_SIZE(max1720x_nvmem_cells) * 2,\ndrivers/power/supply/max1720x_battery.c-527-\t\t.word_size = 2,\n"
} |
| 76/2 | 2026/09/22 17:29 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 22125 output: 44 thoughts: 0 |
| 77/2 | 2026/09/22 17:29 | tool | read-file |
0mArgs:{
"File": "drivers/power/supply/max1720x_battery.c",
"FirstLine": 150,
"LineCount": 40
}Results: {
"Contents": " 150:\t\t.rd_table = \u0026max1720x_nvmem_regs,\n 151:\t};\n 152:\t\n 153:\tstatic const struct nvmem_cell_info max1720x_nvmem_cells[] = {\n 154:\t\t{ .name = \"nXTable0\", .offset = 0, .bytes = 2, },\n 155:\t\t{ .name = \"nXTable1\", .offset = 2, .bytes = 2, },\n 156:\t\t{ .name = \"nXTable2\", .offset = 4, .bytes = 2, },\n 157:\t\t{ .name = \"nXTable3\", .offset = 6, .bytes = 2, },\n 158:\t\t{ .name = \"nXTable4\", .offset = 8, .bytes = 2, },\n 159:\t\t{ .name = \"nXTable5\", .offset = 10, .bytes = 2, },\n 160:\t\t{ .name = \"nXTable6\", .offset = 12, .bytes = 2, },\n 161:\t\t{ .name = \"nXTable7\", .offset = 14, .bytes = 2, },\n 162:\t\t{ .name = \"nXTable8\", .offset = 16, .bytes = 2, },\n 163:\t\t{ .name = \"nXTable9\", .offset = 18, .bytes = 2, },\n 164:\t\t{ .name = \"nXTable10\", .offset = 20, .bytes = 2, },\n 165:\t\t{ .name = \"nXTable11\", .offset = 22, .bytes = 2, },\n 166:\t\t{ .name = \"nUser18C\", .offset = 24, .bytes = 2, },\n 167:\t\t{ .name = \"nUser18D\", .offset = 26, .bytes = 2, },\n 168:\t\t{ .name = \"nODSCTh\", .offset = 28, .bytes = 2, },\n 169:\t\t{ .name = \"nODSCCfg\", .offset = 30, .bytes = 2, },\n 170:\t\n 171:\t\t{ .name = \"nOCVTable0\", .offset = 32, .bytes = 2, },\n 172:\t\t{ .name = \"nOCVTable1\", .offset = 34, .bytes = 2, },\n 173:\t\t{ .name = \"nOCVTable2\", .offset = 36, .bytes = 2, },\n 174:\t\t{ .name = \"nOCVTable3\", .offset = 38, .bytes = 2, },\n 175:\t\t{ .name = \"nOCVTable4\", .offset = 40, .bytes = 2, },\n 176:\t\t{ .name = \"nOCVTable5\", .offset = 42, .bytes = 2, },\n 177:\t\t{ .name = \"nOCVTable6\", .offset = 44, .bytes = 2, },\n 178:\t\t{ .name = \"nOCVTable7\", .offset = 46, .bytes = 2, },\n 179:\t\t{ .name = \"nOCVTable8\", .offset = 48, .bytes = 2, },\n 180:\t\t{ .name = \"nOCVTable9\", .offset = 50, .bytes = 2, },\n 181:\t\t{ .name = \"nOCVTable10\", .offset = 52, .bytes = 2, },\n 182:\t\t{ .name = \"nOCVTable11\", .offset = 54, .bytes = 2, },\n 183:\t\t{ .name = \"nIChgTerm\", .offset = 56, .bytes = 2, },\n 184:\t\t{ .name = \"nFilterCfg\", .offset = 58, .bytes = 2, },\n 185:\t\t{ .name = \"nVEmpty\", .offset = 60, .bytes = 2, },\n 186:\t\t{ .name = \"nLearnCfg\", .offset = 62, .bytes = 2, },\n 187:\t\n 188:\t\t{ .name = \"nQRTable00\", .offset = 64, .bytes = 2, },\n 189:\t\t{ .name = \"nQRTable10\", .offset = 66, .bytes = 2, },\n"
} |
| 78/2 | 2026/09/22 17:29 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 23355 output: 21 thoughts: 78 Thoughts: Okay, let's break this down. **Investigating a Potential NVMEM Configuration Anomaly** Alright, so I'm looking at `max1720x_nvmem_cells` and something immediately jumps out. The `.bytes` field is set to `2`, which is what I'd expect for this type of configuration, but where are the `bit_offset` and `nbits` fields? This seems odd. The whole point of non-volatile memory (NVMEM) is often working at the bit or byte level. If there's no bit offset or number of bits specified, what configuration is there? My next thought is to investigate how these fields are *used* within the kernel, specifically when dealing with `nvmem_cell_info` or `nvmem_cell_entry`. I need to figure out how these values are typically handled. Is there a default behavior I'm missing? Are they optional in *some* configurations? Are they assumed to be zero in this specific driver? I need to search the code base thoroughly to see how these structures are employed. This could be a bug, or it could be a perfectly valid, if slightly unusual, design choice. I need to understand the intent. |
| 79/2 | 2026/09/22 17:29 | tool | grepper |
0mArgs:{
"Expression": "\\.bit_offset\\s*="
}Results: {
"Output": "arch/x86/kernel/tboot.c=258=static void tboot_copy_fadt(const struct acpi_table_fadt *fadt)\n--\narch/x86/kernel/tboot.c-262-\ttbg.bit_width = g.bit_width;\t\t\\\narch/x86/kernel/tboot.c:263:\ttbg.bit_offset = g.bit_offset;\t\\\narch/x86/kernel/tboot.c-264-\ttbg.access_width = g.access_width;\t\\\n--\ndrivers/cpufreq/pcc-cpufreq.c=390=static int __init pcc_cpufreq_evaluate(void)\n--\ndrivers/cpufreq/pcc-cpufreq.c-491-\tdoorbell.bit_width = reg_resource-\u003ebit_width;\ndrivers/cpufreq/pcc-cpufreq.c:492:\tdoorbell.bit_offset = reg_resource-\u003ebit_offset;\ndrivers/cpufreq/pcc-cpufreq.c-493-\tdoorbell.access_width = 4;\n--\ndrivers/md/dm-vdo/indexer/delta-index.c=986=static int restore_delta_list_data(struct delta_index *delta_index, unsigned int load_zone,\n--\ndrivers/md/dm-vdo/indexer/delta-index.c-1001-\t\t.tag = buffer[0],\ndrivers/md/dm-vdo/indexer/delta-index.c:1002:\t\t.bit_offset = buffer[1],\ndrivers/md/dm-vdo/indexer/delta-index.c-1003-\t\t.byte_count = get_unaligned_le16(\u0026buffer[2]),\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c=1762=int rt2800_config_shared_key(struct rt2x00_dev *rt2x00dev,\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-1792-\t */\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:1793:\tfield.bit_offset = 4 * (key-\u003ehw_key_idx % 8);\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-1794-\tfield.bit_mask = 0x7 \u003c\u003c field.bit_offset;\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c=12173=int rt2800_conf_tx(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-12205-\toffset = WMM_TXOP0_CFG + (sizeof(u32) * (!!(queue_idx \u0026 2)));\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:12206:\tfield.bit_offset = (queue_idx \u0026 1) * 16;\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-12207-\tfield.bit_mask = 0xffff \u003c\u003c field.bit_offset;\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-12213-\t/* Update WMM registers */\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:12214:\tfield.bit_offset = queue_idx * 4;\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-12215-\tfield.bit_mask = 0xf \u003c\u003c field.bit_offset;\n--\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c=2801=static int rt61pci_conf_tx(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c-2833-\toffset = AC_TXOP_CSR0 + (sizeof(u32) * (!!(queue_idx \u0026 2)));\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c:2834:\tfield.bit_offset = (queue_idx \u0026 1) * 16;\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c-2835-\tfield.bit_mask = 0xffff \u003c\u003c field.bit_offset;\n--\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c-2841-\t/* Update WMM registers */\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c:2842:\tfield.bit_offset = queue_idx * 4;\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c-2843-\tfield.bit_mask = 0xf \u003c\u003c field.bit_offset;\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c=256=static int rt73usb_config_shared_key(struct rt2x00_dev *rt2x00dev,\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-307-\t\tif (key-\u003ehw_key_idx \u003c 8) {\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:308:\t\t\tfield.bit_offset = (3 * key-\u003ehw_key_idx);\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-309-\t\t\tfield.bit_mask = 0x7 \u003c\u003c field.bit_offset;\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-314-\t\t} else {\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:315:\t\t\tfield.bit_offset = (3 * (key-\u003ehw_key_idx - 8));\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-316-\t\t\tfield.bit_mask = 0x7 \u003c\u003c field.bit_offset;\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c=2220=static int rt73usb_conf_tx(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-2252-\toffset = AC_TXOP_CSR0 + (sizeof(u32) * (!!(queue_idx \u0026 2)));\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:2253:\tfield.bit_offset = (queue_idx \u0026 1) * 16;\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-2254-\tfield.bit_mask = 0xffff \u003c\u003c field.bit_offset;\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-2260-\t/* Update WMM registers */\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:2261:\tfield.bit_offset = queue_idx * 4;\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-2262-\tfield.bit_mask = 0xf \u003c\u003c field.bit_offset;\n--\ndrivers/nvmem/core.c=792=int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)\n--\ndrivers/nvmem/core.c-814-\t\tif (addr \u0026\u0026 len == (2 * sizeof(u32))) {\ndrivers/nvmem/core.c:815:\t\t\tinfo.bit_offset = be32_to_cpup(addr++);\ndrivers/nvmem/core.c-816-\t\t\tinfo.nbits = be32_to_cpup(addr);\n--\ndrivers/pinctrl/sprd/pinctrl-sprd.h=10=struct platform_device;\n--\ndrivers/pinctrl/sprd/pinctrl-sprd.h-30-\t\t.type = (((a) \u003e\u003e TYPE_OFFSET) \u0026 0xf),\t\t\\\ndrivers/pinctrl/sprd/pinctrl-sprd.h:31:\t\t.bit_offset = (((a) \u003e\u003e BIT_OFFSET) \u0026 0xff),\t\\\ndrivers/pinctrl/sprd/pinctrl-sprd.h-32-\t\t.bit_width = ((a) \u003e\u003e WIDTH_OFFSET \u0026 0xf),\t\\\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=96=static const struct nvmem_cell_info tegra114_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-100-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:101:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-102-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-106-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:107:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-108-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-112-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:113:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-114-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-118-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:119:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-120-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-124-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:125:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-126-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-130-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:131:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-132-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-136-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:137:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-138-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-142-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:143:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-144-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-148-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:149:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-150-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-154-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:155:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-156-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=234=static const struct nvmem_cell_info tegra124_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-238-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:239:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-240-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-244-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:245:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-246-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-250-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:251:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-252-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-256-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:257:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-258-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-262-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:263:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-264-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-268-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:269:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-270-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-274-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:275:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-276-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-280-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:281:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-282-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-286-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:287:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-288-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-292-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:293:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-294-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-298-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:299:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-300-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-304-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:305:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-306-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=394=static const struct nvmem_cell_info tegra210_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-398-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:399:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-400-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-404-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:405:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-406-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-410-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:411:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-412-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-416-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:417:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-418-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-422-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:423:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-424-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-428-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:429:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-430-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-434-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:435:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-436-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-440-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:441:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-442-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-446-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:447:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-448-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-452-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:453:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-454-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-458-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:459:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-460-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-464-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:465:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-466-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-470-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:471:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-472-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=565=static const struct nvmem_cell_info tegra186_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-569-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:570:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-571-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-575-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:576:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-577-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=624=static const struct nvmem_cell_info tegra194_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-628-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:629:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-630-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-634-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:635:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-636-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-640-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:641:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-642-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-646-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:647:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-648-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-652-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:653:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-654-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=717=static const struct nvmem_cell_info tegra234_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-721-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:722:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-723-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-727-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:728:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-729-\t\t.nbits = 32,\n--\ndrivers/xen/xen-acpi-processor.c=51=static int push_cxx_to_hypervisor(struct acpi_processor *_pr)\n--\ndrivers/xen/xen-acpi-processor.c-77-\t\t\tdst_cx-\u003ereg.bit_width = 8;\ndrivers/xen/xen-acpi-processor.c:78:\t\t\tdst_cx-\u003ereg.bit_offset = 0;\ndrivers/xen/xen-acpi-processor.c-79-\t\t\tdst_cx-\u003ereg.access_size = 1;\n--\ndrivers/xen/xen-acpi-processor.c-83-\t\t\t\t/* NATIVE_CSTATE_BEYOND_HALT */\ndrivers/xen/xen-acpi-processor.c:84:\t\t\t\tdst_cx-\u003ereg.bit_offset = 2;\ndrivers/xen/xen-acpi-processor.c-85-\t\t\t\tdst_cx-\u003ereg.bit_width = 1; /* VENDOR_INTEL */\n--\nsound/soc/codecs/cs35l41-lib.c=699=static const struct cs35l41_otp_map_element_t cs35l41_otp_map_map[] = {\n--\nsound/soc/codecs/cs35l41-lib.c-703-\t\t.num_elements = ARRAY_SIZE(otp_map_1),\nsound/soc/codecs/cs35l41-lib.c:704:\t\t.bit_offset = 16,\nsound/soc/codecs/cs35l41-lib.c-705-\t\t.word_offset = 2,\n--\nsound/soc/codecs/cs35l41-lib.c-710-\t\t.num_elements = ARRAY_SIZE(otp_map_2),\nsound/soc/codecs/cs35l41-lib.c:711:\t\t.bit_offset = 16,\nsound/soc/codecs/cs35l41-lib.c-712-\t\t.word_offset = 2,\n--\nsound/soc/codecs/cs35l41-lib.c-717-\t\t.num_elements = ARRAY_SIZE(otp_map_2),\nsound/soc/codecs/cs35l41-lib.c:718:\t\t.bit_offset = 16,\nsound/soc/codecs/cs35l41-lib.c-719-\t\t.word_offset = 2,\n--\nsound/soc/codecs/cs35l41-lib.c-724-\t\t.num_elements = ARRAY_SIZE(otp_map_2),\nsound/soc/codecs/cs35l41-lib.c:725:\t\t.bit_offset = 16,\nsound/soc/codecs/cs35l41-lib.c-726-\t\t.word_offset = 2,\n--\nsound/soc/codecs/cs35l41-lib.c-731-\t\t.num_elements = ARRAY_SIZE(otp_map_1),\nsound/soc/codecs/cs35l41-lib.c:732:\t\t.bit_offset = 16,\nsound/soc/codecs/cs35l41-lib.c-733-\t\t.word_offset = 2,\n"
} |
| 80/2 | 2026/09/22 17:30 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 31328 output: 28 thoughts: 104 Thoughts: Here's my analysis of the provided code snippet, thinking out loud: **Diving into the nvmem Core** Hold on a second! Okay, focus. I'm looking at `drivers/nvmem/core.c` and specifically lines 815 and 816. There's something immediately interesting here: ```c drivers/nvmem/core.c:815: info.bit_offset = be32_to_cpup(addr++); drivers/nvmem/core.c-816- info.nbits = be32_to_cpup(addr); ``` Right, so we're extracting `bit_offset` and `nbits` from some memory region pointed to by `addr`. The use of `be32_to_cpup()` is important, it signifies a big-endian 32-bit integer conversion, which immediately raises questions about the platform this code targets, and the expected layout of the data structure being parsed. I should probably double-check how `addr` is initialized, but for now I want to understand how these values are utilized. My next step is to perform a cross-reference search, starting within the `drivers/nvmem/` directory. I need to understand how `bit_offset` is used. I'll search for every instance the variable `bit_offset` is used to get a picture of what this code is trying to achieve. Is it used for bit-level addressing within a larger memory region? Is it part of a configuration structure? Knowing the context of `bit_offset` and `nbits` is crucial to grasp the overall functionality. |
| 81/2 | 2026/09/22 17:30 | tool | grepper |
0mArgs:{
"Expression": "bit_offset",
"PathPrefix": "drivers/nvmem/"
}Results: {
"Output": "drivers/nvmem/core.c=29=struct nvmem_cell_entry {\n--\ndrivers/nvmem/core.c-33-\tint\t\t\tbytes;\ndrivers/nvmem/core.c:34:\tint\t\t\tbit_offset;\ndrivers/nvmem/core.c-35-\tint\t\t\tnbits;\n--\ndrivers/nvmem/core.c=469=static int nvmem_populate_sysfs_cells(struct nvmem_device *nvmem)\n--\ndrivers/nvmem/core.c-501-\t\t\t\t\t\t entry-\u003eoffset,\ndrivers/nvmem/core.c:502:\t\t\t\t\t\t entry-\u003ebit_offset);\ndrivers/nvmem/core.c-503-\t\tattrs[i].attr.mode = 0444 \u0026 nvmem_bin_attr_get_umode(nvmem);\n--\ndrivers/nvmem/core.c=581=static int nvmem_cell_info_to_nvmem_cell_entry_nodup(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-592-\ndrivers/nvmem/core.c:593:\tcell-\u003ebit_offset = info-\u003ebit_offset;\ndrivers/nvmem/core.c-594-\tcell-\u003enbits = info-\u003enbits;\n--\ndrivers/nvmem/core.c-597-\tif (cell-\u003enbits) {\ndrivers/nvmem/core.c:598:\t\tcell-\u003ebytes = DIV_ROUND_UP(cell-\u003enbits + cell-\u003ebit_offset,\ndrivers/nvmem/core.c-599-\t\t\t\t\t BITS_PER_BYTE);\n--\ndrivers/nvmem/core.c=792=int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)\n--\ndrivers/nvmem/core.c-814-\t\tif (addr \u0026\u0026 len == (2 * sizeof(u32))) {\ndrivers/nvmem/core.c:815:\t\t\tinfo.bit_offset = be32_to_cpup(addr++);\ndrivers/nvmem/core.c-816-\t\t\tinfo.nbits = be32_to_cpup(addr);\ndrivers/nvmem/core.c:817:\t\t\tif (info.bit_offset \u003e= BITS_PER_BYTE * info.bytes ||\ndrivers/nvmem/core.c-818-\t\t\t info.nbits \u003c 1 ||\ndrivers/nvmem/core.c:819:\t\t\t info.bit_offset + info.nbits \u003e BITS_PER_BYTE * info.bytes) {\ndrivers/nvmem/core.c-820-\t\t\t\tdev_err(dev, \"nvmem: invalid bits on %pOF\\n\", child);\n--\ndrivers/nvmem/core.c=1584=static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)\n--\ndrivers/nvmem/core.c-1587-\tint i, extra, bytes_offset;\ndrivers/nvmem/core.c:1588:\tint bit_offset = cell-\u003ebit_offset;\ndrivers/nvmem/core.c-1589-\n--\ndrivers/nvmem/core.c-1591-\ndrivers/nvmem/core.c:1592:\tbytes_offset = bit_offset / BITS_PER_BYTE;\ndrivers/nvmem/core.c-1593-\tb += bytes_offset;\ndrivers/nvmem/core.c:1594:\tbit_offset %= BITS_PER_BYTE;\ndrivers/nvmem/core.c-1595-\ndrivers/nvmem/core.c:1596:\tif (bit_offset % BITS_PER_BYTE) {\ndrivers/nvmem/core.c-1597-\t\t/* First shift */\ndrivers/nvmem/core.c:1598:\t\t*p = *b++ \u003e\u003e bit_offset;\ndrivers/nvmem/core.c-1599-\n--\ndrivers/nvmem/core.c-1602-\t\t\t/* Get bits from next byte and shift them towards msb */\ndrivers/nvmem/core.c:1603:\t\t\t*p++ |= *b \u003c\u003c (BITS_PER_BYTE - bit_offset);\ndrivers/nvmem/core.c-1604-\ndrivers/nvmem/core.c:1605:\t\t\t*p = *b++ \u003e\u003e bit_offset;\ndrivers/nvmem/core.c-1606-\t\t}\n--\ndrivers/nvmem/core.c=1627=static int __nvmem_cell_read(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-1638-\t/* shift bits in-place */\ndrivers/nvmem/core.c:1639:\tif (cell-\u003ebit_offset || cell-\u003enbits)\ndrivers/nvmem/core.c-1640-\t\tnvmem_shift_read_buffer_in_place(cell, buf);\n--\ndrivers/nvmem/core.c=1689=static void *nvmem_cell_prepare_write_buffer(struct nvmem_cell_entry *cell,\n--\ndrivers/nvmem/core.c-1692-\tstruct nvmem_device *nvmem = cell-\u003envmem;\ndrivers/nvmem/core.c:1693:\tint i, rc, nbits, bit_offset = cell-\u003ebit_offset;\ndrivers/nvmem/core.c-1694-\tu8 v, *p, *buf, *b, pbyte, pbits;\n--\ndrivers/nvmem/core.c-1703-\ndrivers/nvmem/core.c:1704:\tif (bit_offset) {\ndrivers/nvmem/core.c-1705-\t\tpbyte = *b;\ndrivers/nvmem/core.c:1706:\t\t*b \u003c\u003c= bit_offset;\ndrivers/nvmem/core.c-1707-\n--\ndrivers/nvmem/core.c-1711-\t\t\tgoto err;\ndrivers/nvmem/core.c:1712:\t\t*b++ |= GENMASK(bit_offset - 1, 0) \u0026 v;\ndrivers/nvmem/core.c-1713-\n--\ndrivers/nvmem/core.c-1716-\t\t\t/* Get last byte bits and shift them towards lsb */\ndrivers/nvmem/core.c:1717:\t\t\tpbits = pbyte \u003e\u003e (BITS_PER_BYTE - 1 - bit_offset);\ndrivers/nvmem/core.c-1718-\t\t\tpbyte = *b;\ndrivers/nvmem/core.c-1719-\t\t\tp = b;\ndrivers/nvmem/core.c:1720:\t\t\t*b \u003c\u003c= bit_offset;\ndrivers/nvmem/core.c-1721-\t\t\t*b++ |= pbits;\n--\ndrivers/nvmem/core.c-1725-\t/* if it's not end on byte boundary */\ndrivers/nvmem/core.c:1726:\tif ((nbits + bit_offset) % BITS_PER_BYTE) {\ndrivers/nvmem/core.c-1727-\t\t/* setup the last byte with msb bits from nvmem */\n--\ndrivers/nvmem/core.c-1731-\t\t\tgoto err;\ndrivers/nvmem/core.c:1732:\t\t*p |= GENMASK(7, (nbits + bit_offset) % BITS_PER_BYTE) \u0026 v;\ndrivers/nvmem/core.c-1733-\n--\ndrivers/nvmem/core.c=1742=static int __nvmem_cell_entry_write(struct nvmem_cell_entry *cell, void *buf, size_t len)\n--\ndrivers/nvmem/core.c-1747-\tif (!nvmem || nvmem-\u003eread_only ||\ndrivers/nvmem/core.c:1748:\t (cell-\u003ebit_offset == 0 \u0026\u0026 len != cell-\u003ebytes))\ndrivers/nvmem/core.c-1749-\t\treturn -EINVAL;\n--\ndrivers/nvmem/core.c-1758-\ndrivers/nvmem/core.c:1759:\tif (cell-\u003ebit_offset || cell-\u003enbits) {\ndrivers/nvmem/core.c-1760-\t\tif (len != BITS_TO_BYTES(cell-\u003enbits) \u0026\u0026 len != cell-\u003ebytes)\n--\ndrivers/nvmem/core.c-1769-\t/* free the tmp buffer */\ndrivers/nvmem/core.c:1770:\tif (cell-\u003ebit_offset || cell-\u003enbits)\ndrivers/nvmem/core.c-1771-\t\tkfree(buf);\n--\ndrivers/nvmem/qfprom.c=338=static void qfprom_fixup_dt_cell_info(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/qfprom.c-342-\ndrivers/nvmem/qfprom.c:343:\tcell-\u003ebit_offset += byte_offset * BITS_PER_BYTE;\ndrivers/nvmem/qfprom.c-344-\tcell-\u003eoffset -= byte_offset;\n"
} |
| 82/2 | 2026/09/22 17:30 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 34122 output: 33 thoughts: 27 Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience: **Investigating Potential NVMeM Layouts** Hold on a minute, there's something I need to check. My intuition is telling me that the answer might lie within the `drivers/nvmem/layouts/` directory. I should start there, and see what kind of patterns or existing structures we have within the NVMeM driver layout. |
| 83/2 | 2026/09/22 17:30 | tool | grepper |
0mError:no matches Args: {
"Expression": "bit_offset|nbits",
"PathPrefix": "drivers/nvmem/layouts/"
}Results: {
"error": "no matches"
} |
| 84/2 | 2026/09/22 17:30 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 34287 output: 20 thoughts: 661 Thoughts: **Analyzing the Use of `nbits` in the Kernel**
Okay, let's dive into this `nbits` field. I need to understand its behavior within the kernel's NVMEM framework. First thing I'm looking at is `__nvmem_cell_read()`. Ah, there it is: `if (cell->bit_offset || cell->nbits)`. Interesting. Even if there's no bit offset, if `nbits` is *not* zero, `nvmem_shift_read_buffer_in_place()` gets called. That's key.
Now, let's drill down into `nvmem_shift_read_buffer_in_place()`. Right, here's the code:
```c
static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)
{
u8 *p, *b;
int i, extra, bytes_offset;
int bit_offset = cell->bit_offset;
p = b = buf;
if (bit_offset) {
...
} else {
p += cell->bytes - 1;
}
/* clear extra bits in last byte */
extra = cell->nbits % BITS_PER_BYTE;
if (extra)
*p &= GENMASK(extra - 1, 0);
}
```
Okay, so if there *is* a bit offset, a shift operation is performed. If there's *no* bit offset, it jumps to the `else` block and then the code that uses `nbits` is triggered. The crucial part here is the final section. Regardless of the bit offset, the code calculates `extra` based on `nbits` (modulo `BITS_PER_BYTE`), and *then* clears the "extra" bits in the *last* byte of the buffer using the `GENMASK` macro if `extra` is not zero. This is exactly what I was looking for. Now, I have to figure out *where* `nbits` is actually populated. Time to scan the kernel for all instances of `nbits` to trace back its origin.
|
| 85/2 | 2026/09/22 17:30 | tool | grepper |
0mArgs:{
"Expression": "\\.nbits\\s*="
}Results: {
"Output": "arch/sparc/kernel/adi_64.c=38=void __init mdesc_adi_init(void)\n--\narch/sparc/kernel/adi_64.c-92-\t\tgoto adi_not_found;\narch/sparc/kernel/adi_64.c:93:\tadi_state.caps.nbits = *val;\narch/sparc/kernel/adi_64.c-94-\n--\narch/sparc/kernel/adi_64.c-118-\tadi_state.caps.blksz = 0;\narch/sparc/kernel/adi_64.c:119:\tadi_state.caps.nbits = 0;\narch/sparc/kernel/adi_64.c-120-\tif (hp)\n--\ncrypto/ecc_curve_defs.h=18=static struct ecc_curve nist_p192 = {\ncrypto/ecc_curve_defs.h-19-\t.name = \"nist_192\",\ncrypto/ecc_curve_defs.h:20:\t.nbits = 192,\ncrypto/ecc_curve_defs.h-21-\t.g = {\n--\ncrypto/ecc_curve_defs.h=45=static struct ecc_curve nist_p256 = {\ncrypto/ecc_curve_defs.h-46-\t.name = \"nist_256\",\ncrypto/ecc_curve_defs.h:47:\t.nbits = 256,\ncrypto/ecc_curve_defs.h-48-\t.g = {\n--\ncrypto/ecc_curve_defs.h=78=static struct ecc_curve nist_p384 = {\ncrypto/ecc_curve_defs.h-79-\t.name = \"nist_384\",\ncrypto/ecc_curve_defs.h:80:\t.nbits = 384,\ncrypto/ecc_curve_defs.h-81-\t.g = {\n--\ncrypto/ecc_curve_defs.h=123=static struct ecc_curve nist_p521 = {\ncrypto/ecc_curve_defs.h-124-\t.name = \"nist_521\",\ncrypto/ecc_curve_defs.h:125:\t.nbits = 521,\ncrypto/ecc_curve_defs.h-126-\t.g = {\n--\ncrypto/ecc_curve_defs.h=144=static const struct ecc_curve ecc_25519 = {\ncrypto/ecc_curve_defs.h-145-\t.name = \"curve25519\",\ncrypto/ecc_curve_defs.h:146:\t.nbits = 255,\ncrypto/ecc_curve_defs.h-147-\t.g = {\n--\ncrypto/ecrdsa_defs.h=48=static struct ecc_curve gost_cp256a = {\ncrypto/ecrdsa_defs.h-49-\t.name = \"cp256a\",\ncrypto/ecrdsa_defs.h:50:\t.nbits = 256,\ncrypto/ecrdsa_defs.h-51-\t.g = {\n--\ncrypto/ecrdsa_defs.h=82=static struct ecc_curve gost_cp256b = {\ncrypto/ecrdsa_defs.h-83-\t.name = \"cp256b\",\ncrypto/ecrdsa_defs.h:84:\t.nbits = 256,\ncrypto/ecrdsa_defs.h-85-\t.g = {\n--\ncrypto/ecrdsa_defs.h=120=static struct ecc_curve gost_cp256c = {\ncrypto/ecrdsa_defs.h-121-\t.name = \"cp256c\",\ncrypto/ecrdsa_defs.h:122:\t.nbits = 256,\ncrypto/ecrdsa_defs.h-123-\t.g = {\n--\ncrypto/ecrdsa_defs.h=170=static struct ecc_curve gost_tc512a = {\ncrypto/ecrdsa_defs.h-171-\t.name = \"tc512a\",\ncrypto/ecrdsa_defs.h:172:\t.nbits = 512,\ncrypto/ecrdsa_defs.h-173-\t.g = {\n--\ncrypto/ecrdsa_defs.h=216=static struct ecc_curve gost_tc512b = {\ncrypto/ecrdsa_defs.h-217-\t.name = \"tc512b\",\ncrypto/ecrdsa_defs.h:218:\t.nbits = 512,\ncrypto/ecrdsa_defs.h-219-\t.g = {\n--\ndrivers/nvmem/core.c=792=int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)\n--\ndrivers/nvmem/core.c-815-\t\t\tinfo.bit_offset = be32_to_cpup(addr++);\ndrivers/nvmem/core.c:816:\t\t\tinfo.nbits = be32_to_cpup(addr);\ndrivers/nvmem/core.c-817-\t\t\tif (info.bit_offset \u003e= BITS_PER_BYTE * info.bytes ||\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=96=static const struct nvmem_cell_info tegra114_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-101-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:102:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-103-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-107-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:108:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-109-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-113-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:114:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-115-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-119-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:120:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-121-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-125-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:126:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-127-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-131-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:132:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-133-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-137-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:138:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-139-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-143-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:144:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-145-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-149-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:150:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-151-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-155-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:156:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-157-\t},\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=234=static const struct nvmem_cell_info tegra124_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-239-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:240:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-241-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-245-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:246:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-247-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-251-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:252:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-253-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-257-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:258:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-259-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-263-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:264:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-265-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-269-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:270:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-271-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-275-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:276:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-277-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-281-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:282:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-283-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-287-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:288:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-289-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-293-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:294:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-295-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-299-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:300:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-301-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-305-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:306:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-307-\t},\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=394=static const struct nvmem_cell_info tegra210_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-399-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:400:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-401-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-405-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:406:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-407-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-411-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:412:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-413-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-417-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:418:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-419-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-423-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:424:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-425-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-429-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:430:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-431-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-435-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:436:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-437-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-441-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:442:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-443-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-447-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:448:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-449-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-453-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:454:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-455-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-459-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:460:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-461-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-465-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:466:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-467-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-471-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:472:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-473-\t},\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=565=static const struct nvmem_cell_info tegra186_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-570-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:571:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-572-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-576-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:577:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-578-\t},\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=624=static const struct nvmem_cell_info tegra194_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-629-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:630:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-631-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-635-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:636:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-637-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-641-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:642:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-643-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-647-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:648:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-649-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-653-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:654:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-655-\t},\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=717=static const struct nvmem_cell_info tegra234_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-722-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:723:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-724-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-728-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:729:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-730-\t},\n--\nfs/ntfs3/super.c=968=static int ntfs_init_from_boot(struct super_block *sb, u32 sector_size,\n--\nfs/ntfs3/super.c-1179-\nfs/ntfs3/super.c:1180:\tsbi-\u003eused.bitmap.nbits = clusters;\nfs/ntfs3/super.c-1181-\n--\ninclude/sound/soc.h=33=struct platform_device;\n--\ninclude/sound/soc.h-385-\t.private_value = (unsigned long)\u0026(struct soc_mreg_control) \\\ninclude/sound/soc.h:386:\t\t{.regbase = xregbase, .regcount = xregcount, .nbits = xnbits, \\\ninclude/sound/soc.h-387-\t\t.invert = xinvert, .min = xmin, .max = xmax} }\n--\nlib/bitmap-str.c=341=int bitmap_parselist(const char *buf, unsigned long *maskp, int nmaskbits)\n--\nlib/bitmap-str.c-345-\nlib/bitmap-str.c:346:\tr.nbits = nmaskbits;\nlib/bitmap-str.c-347-\tbitmap_zero(maskp, r.nbits);\n--\nsound/soc/fsl/fsl_easrc.c=126=static int fsl_easrc_set_reg(struct snd_kcontrol *kcontrol,\n--\nsound/soc/fsl/fsl_easrc.c-190-\t.private_value = (unsigned long)\u0026(struct soc_mreg_control) \\\nsound/soc/fsl/fsl_easrc.c:191:\t\t{ .regbase = xreg, .regcount = 1, .nbits = 32, \\\nsound/soc/fsl/fsl_easrc.c-192-\t\t .invert = 0, .min = 0, .max = 0xffffffff, } }\n--\nsound/soc/fsl/fsl_easrc.c-199-\t.private_value = (unsigned long)\u0026(struct soc_mreg_control) \\\nsound/soc/fsl/fsl_easrc.c:200:\t\t{ .regbase = xreg, .regcount = 1, .nbits = 32, \\\nsound/soc/fsl/fsl_easrc.c-201-\t\t .invert = 0, .min = 0, .max = 2, } }\n--\nsound/soc/fsl/fsl_utils.h=30=void fsl_asoc_constrain_rates(struct snd_pcm_hw_constraint_list *target_constr,\n--\nsound/soc/fsl/fsl_utils.h-42-\t.private_value = (unsigned long)\u0026(struct soc_mreg_control) \\\nsound/soc/fsl/fsl_utils.h:43:\t\t{.regbase = xregbase, .regcount = xregcount, .nbits = xnbits, \\\nsound/soc/fsl/fsl_utils.h-44-\t\t.invert = xinvert, .min = xmin, .max = xmax} }\n--\nsound/soc/tegra/tegra186_asrc.c=652=ASRC_SOURCE_DECL(src_select6, 5);\n--\nsound/soc/tegra/tegra186_asrc.c-665-\t\t.regcount\t= 1,\t\t\t\t\t\\\nsound/soc/tegra/tegra186_asrc.c:666:\t\t.nbits\t\t= 32,\t\t\t\t\t\\\nsound/soc/tegra/tegra186_asrc.c-667-\t\t.invert\t\t= 0,\t\t\t\t\t\\\n--\ntools/perf/util/mmap.c=238=void mmap__munmap(struct mmap *map)\n--\ntools/perf/util/mmap.c-241-\tmap-\u003eaffinity_mask.bits = NULL;\ntools/perf/util/mmap.c:242:\tmap-\u003eaffinity_mask.nbits = 0;\ntools/perf/util/mmap.c-243-\n--\ntools/perf/util/mmap.c=272=static int perf_mmap__setup_affinity_mask(struct mmap *map, struct mmap_params *mp)\ntools/perf/util/mmap.c-273-{\ntools/perf/util/mmap.c:274:\tmap-\u003eaffinity_mask.nbits = cpu__max_cpu().cpu;\ntools/perf/util/mmap.c-275-\tmap-\u003eaffinity_mask.bits = bitmap_zalloc(map-\u003eaffinity_mask.nbits);\n"
} |
| 86/2 | 2026/09/22 17:30 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 42318 output: 25 thoughts: 151 Thoughts: **Investigating the `nbits` Variable in the Nvmem Driver** Okay, hold on a second. Something's not quite right with these Nvmem results. I need to take a closer look at what's going on with this `nbits` variable. Specifically, I'm thinking about the implications of the results I'm seeing for `nbits =`. The code looks like it's pulling `info.nbits` from `be32_to_cpup(addr)` in `nvmem_add_cells_from_dt` within `drivers/nvmem/core.c` at line 816. But then I see that in the Tegra30 fuse driver (`drivers/soc/tegra/fuse/fuse-tegra30.c`), it's explicitly set to `.nbits = 32`. Now I'm starting to wonder, are there *any* other places in the entire codebase where `nvmem_cell_info` is populated, or where `nbits` or even `bit_offset` are set at all? I need to be absolutely certain I understand how this variable is being handled across the driver. Time to check the definition of `struct nvmem_cell_info` and trace its usage. |
| 87/2 | 2026/09/22 17:30 | tool | grepper |
0mArgs:{
"Expression": "struct nvmem_cell_info\\s*\\{"
}Results: {
"Output": "include/linux/nvmem-provider.h=46=struct nvmem_keepout {\n--\ninclude/linux/nvmem-provider.h-64- */\ninclude/linux/nvmem-provider.h:65:struct nvmem_cell_info {\ninclude/linux/nvmem-provider.h-66-\tconst char\t\t*name;\n"
} |
| 88/2 | 2026/09/22 17:30 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 42864 output: 37 thoughts: 22 Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience: **Diving into the NVMEM Provider Header** Okay, time to get my hands dirty. I'm focusing on `include/linux/nvmem-provider.h`, specifically around line 65. I'm guessing the area around that line holds a key definition or structure related to the NVMEM provider API. I need to refresh my understanding of how this subsystem is designed, particularly regarding the provider side, not just the consumer interface. My intuition is telling me there's something specific there I should investigate, maybe a core data structure, a crucial callback definition, or potentially an important macro that I keep overlooking in other code I review. Let's see what we can dig up. |
| 89/2 | 2026/09/22 17:30 | tool | read-file |
0mArgs:{
"File": "include/linux/nvmem-provider.h",
"FirstLine": 60,
"LineCount": 35
}Results: {
"Contents": " 60:\t * @np:\t\tOptional device_node pointer.\n 61:\t * @read_post_process:\tCallback for optional post processing of cell data\n 62:\t *\t\t\ton reads.\n 63:\t * @priv:\tOpaque data passed to the read_post_process hook.\n 64:\t */\n 65:\tstruct nvmem_cell_info {\n 66:\t\tconst char\t\t*name;\n 67:\t\tunsigned int\t\toffset;\n 68:\t\tsize_t\t\t\traw_len;\n 69:\t\tunsigned int\t\tbytes;\n 70:\t\tunsigned int\t\tbit_offset;\n 71:\t\tunsigned int\t\tnbits;\n 72:\t\tstruct device_node\t*np;\n 73:\t\tnvmem_cell_post_process_t read_post_process;\n 74:\t\tvoid\t\t\t*priv;\n 75:\t};\n 76:\t\n 77:\t/**\n 78:\t * struct nvmem_config - NVMEM device configuration\n 79:\t *\n 80:\t * @dev:\tParent device.\n 81:\t * @name:\tOptional name.\n 82:\t * @id:\t\tOptional device ID used in full name. Ignored if name is NULL.\n 83:\t * @owner:\tPointer to exporter module. Used for refcounting.\n 84:\t * @cells:\tOptional array of pre-defined NVMEM cells.\n 85:\t * @ncells:\tNumber of elements in cells.\n 86:\t * @add_legacy_fixed_of_cells:\tRead fixed NVMEM cells from old OF syntax.\n 87:\t * @fixup_dt_cell_info: Will be called before a cell is added. Can be\n 88:\t *\t\tused to modify the nvmem_cell_info.\n 89:\t * @keepout:\tOptional array of keepout ranges (sorted ascending by start).\n 90:\t * @nkeepout:\tNumber of elements in the keepout array.\n 91:\t * @type:\tType of the nvmem storage\n 92:\t * @read_only:\tDevice is read-only.\n 93:\t * @root_only:\tDevice is accessibly to root only.\n 94:\t * @of_node:\tIf given, this will be used instead of the parent's of_node.\n"
} |
| 90/2 | 2026/09/22 17:30 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 43686 output: 24 thoughts: 39 Thoughts: Okay, here's my summary, taking on the persona you described: **Investigating `nvmem_cell_info` Usage** Alright, time to get to the bottom of this. I need to understand the scope of `nvmem_cell_info`. My initial thought is, where exactly is this structure being used in the C code? To figure that out efficiently, I'll need to do some digging. Time to unleash the `grep`! I'll search all the relevant files for instances of `struct nvmem_cell_info`. That should give me a good overview of the calls and places where `nvmem_cell_info` is being used, so I can understand the context. |
| 91/2 | 2026/09/22 17:30 | tool | grepper |
0mArgs:{
"Expression": "struct nvmem_cell_info\\s+"
}Results: {
"Output": "Documentation/driver-api/nvmem.rst=63=struct::\nDocumentation/driver-api/nvmem.rst-64-\nDocumentation/driver-api/nvmem.rst:65: static const struct nvmem_cell_info foo_nvmem_cell = {\nDocumentation/driver-api/nvmem.rst-66-\t{\n--\nDocumentation/driver-api/nvmem.rst=117=To facilitate such consumers NVMEM framework provides below apis::\n--\nDocumentation/driver-api/nvmem.rst-129- int nvmem_device_cell_read(struct nvmem_device *nvmem,\nDocumentation/driver-api/nvmem.rst:130:\t\t\t struct nvmem_cell_info *info, void *buf);\nDocumentation/driver-api/nvmem.rst-131- int nvmem_device_cell_write(struct nvmem_device *nvmem,\nDocumentation/driver-api/nvmem.rst:132:\t\t\t struct nvmem_cell_info *info, void *buf);\nDocumentation/driver-api/nvmem.rst-133-\n--\ndrivers/hwmon/pmbus/adm1266.c=55=struct adm1266_data {\n--\ndrivers/hwmon/pmbus/adm1266.c-68-\ndrivers/hwmon/pmbus/adm1266.c:69:static const struct nvmem_cell_info adm1266_nvmem_cells[] = {\ndrivers/hwmon/pmbus/adm1266.c-70-\t{\n--\ndrivers/nvmem/brcm_nvram.c=31=struct brcm_nvram {\n--\ndrivers/nvmem/brcm_nvram.c-36-\tuint8_t padding_byte;\ndrivers/nvmem/brcm_nvram.c:37:\tstruct nvmem_cell_info *cells;\ndrivers/nvmem/brcm_nvram.c-38-\tint ncells;\n--\ndrivers/nvmem/core.c=581=static int nvmem_cell_info_to_nvmem_cell_entry_nodup(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c:582:\t\t\t\t\t\t const struct nvmem_cell_info *info,\ndrivers/nvmem/core.c-583-\t\t\t\t\t\t struct nvmem_cell_entry *cell)\n--\ndrivers/nvmem/core.c=625=static int nvmem_cell_info_to_nvmem_cell_entry(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c:626:\t\t\t\t\t const struct nvmem_cell_info *info,\ndrivers/nvmem/core.c-627-\t\t\t\t\t struct nvmem_cell_entry *cell)\n--\ndrivers/nvmem/core.c=650=int nvmem_add_one_cell(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c:651:\t\t const struct nvmem_cell_info *info)\ndrivers/nvmem/core.c-652-{\n--\ndrivers/nvmem/core.c=681=static int nvmem_add_cells(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c:682:\t\t const struct nvmem_cell_info *info,\ndrivers/nvmem/core.c-683-\t\t int ncells)\n--\ndrivers/nvmem/core.c=792=int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)\n--\ndrivers/nvmem/core.c-798-\tfor_each_child_of_node_scoped(np, child) {\ndrivers/nvmem/core.c:799:\t\tstruct nvmem_cell_info info = {0};\ndrivers/nvmem/core.c-800-\n--\ndrivers/nvmem/core.c=1988=ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c:1989:\t\t\t struct nvmem_cell_info *info, void *buf)\ndrivers/nvmem/core.c-1990-{\n--\ndrivers/nvmem/core.c=2019=int nvmem_device_cell_write(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c:2020:\t\t\t struct nvmem_cell_info *info, void *buf)\ndrivers/nvmem/core.c-2021-{\n--\ndrivers/nvmem/imx-ocotp-ele.c=131=static void imx_ocotp_fixup_dt_cell_info(struct nvmem_device *nvmem,\ndrivers/nvmem/imx-ocotp-ele.c:132:\t\t\t\t\t struct nvmem_cell_info *cell)\ndrivers/nvmem/imx-ocotp-ele.c-133-{\n--\ndrivers/nvmem/imx-ocotp.c=589=static void imx_ocotp_fixup_dt_cell_info(struct nvmem_device *nvmem,\ndrivers/nvmem/imx-ocotp.c:590:\t\t\t\t\t struct nvmem_cell_info *cell)\ndrivers/nvmem/imx-ocotp.c-591-{\n--\ndrivers/nvmem/internals.h=16=struct nvmem_device {\n--\ndrivers/nvmem/internals.h-31-\tvoid (*fixup_dt_cell_info)(struct nvmem_device *nvmem,\ndrivers/nvmem/internals.h:32:\t\t\t\t struct nvmem_cell_info *cell);\ndrivers/nvmem/internals.h-33-\tconst struct nvmem_keepout *keepout;\n--\ndrivers/nvmem/layouts/onie-tlv.c=98=static int onie_tlv_add_cells(struct device *dev, struct nvmem_device *nvmem,\n--\ndrivers/nvmem/layouts/onie-tlv.c-100-{\ndrivers/nvmem/layouts/onie-tlv.c:101:\tstruct nvmem_cell_info cell = {};\ndrivers/nvmem/layouts/onie-tlv.c-102-\tstruct device_node *layout;\n--\ndrivers/nvmem/layouts/sl28vpd.c=24=static int sl28vpd_mac_address_pp(void *priv, const char *id, int index,\n--\ndrivers/nvmem/layouts/sl28vpd.c-41-\ndrivers/nvmem/layouts/sl28vpd.c:42:static const struct nvmem_cell_info sl28vpd_v1_entries[] = {\ndrivers/nvmem/layouts/sl28vpd.c-43-\t{\n--\ndrivers/nvmem/layouts/sl28vpd.c=83=static int sl28vpd_add_cells(struct nvmem_layout *layout)\n--\ndrivers/nvmem/layouts/sl28vpd.c-86-\tstruct device *dev = \u0026layout-\u003edev;\ndrivers/nvmem/layouts/sl28vpd.c:87:\tconst struct nvmem_cell_info *pinfo;\ndrivers/nvmem/layouts/sl28vpd.c:88:\tstruct nvmem_cell_info info = {0};\ndrivers/nvmem/layouts/sl28vpd.c-89-\tstruct device_node *layout_np;\n--\ndrivers/nvmem/layouts/u-boot-env.c=52=static int u_boot_env_parse_cells(struct device *dev, struct nvmem_device *nvmem, uint8_t *buf,\n--\ndrivers/nvmem/layouts/u-boot-env.c-60-\t var = value + strlen(value) + 1) {\ndrivers/nvmem/layouts/u-boot-env.c:61:\t\tstruct nvmem_cell_info info = {};\ndrivers/nvmem/layouts/u-boot-env.c-62-\n--\ndrivers/nvmem/mtk-efuse.c=47=static void mtk_efuse_fixup_dt_cell_info(struct nvmem_device *nvmem,\ndrivers/nvmem/mtk-efuse.c:48:\t\t\t\t\t struct nvmem_cell_info *cell)\ndrivers/nvmem/mtk-efuse.c-49-{\n--\ndrivers/nvmem/qfprom.c=338=static void qfprom_fixup_dt_cell_info(struct nvmem_device *nvmem,\ndrivers/nvmem/qfprom.c:339:\t\t\t\t struct nvmem_cell_info *cell)\ndrivers/nvmem/qfprom.c-340-{\n--\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c=876=static int mtk_mfg_init_nvmem_provider(struct mtk_mfg *mfg)\n--\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c-878-\tstruct device *dev = \u0026mfg-\u003epdev-\u003edev;\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:879:\tstruct nvmem_cell_info cell = {};\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c-880-\tstruct nvmem_config config = {};\n--\ndrivers/power/supply/max1720x_battery.c=145=static const struct regmap_config max1720x_nvmem_regmap_cfg = {\n--\ndrivers/power/supply/max1720x_battery.c-152-\ndrivers/power/supply/max1720x_battery.c:153:static const struct nvmem_cell_info max1720x_nvmem_cells[] = {\ndrivers/power/supply/max1720x_battery.c-154-\t{ .name = \"nXTable0\", .offset = 0, .bytes = 2, },\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=86=const struct tegra_fuse_soc tegra30_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-95-#ifdef CONFIG_ARCH_TEGRA_114_SOC\ndrivers/soc/tegra/fuse/fuse-tegra30.c:96:static const struct nvmem_cell_info tegra114_fuse_cells[] = {\ndrivers/soc/tegra/fuse/fuse-tegra30.c-97-\t{\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=220=const struct tegra_fuse_soc tegra114_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-233-#if defined(CONFIG_ARCH_TEGRA_124_SOC) || defined(CONFIG_ARCH_TEGRA_132_SOC)\ndrivers/soc/tegra/fuse/fuse-tegra30.c:234:static const struct nvmem_cell_info tegra124_fuse_cells[] = {\ndrivers/soc/tegra/fuse/fuse-tegra30.c-235-\t{\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=380=const struct tegra_fuse_soc tegra124_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-393-#if defined(CONFIG_ARCH_TEGRA_210_SOC)\ndrivers/soc/tegra/fuse/fuse-tegra30.c:394:static const struct nvmem_cell_info tegra210_fuse_cells[] = {\ndrivers/soc/tegra/fuse/fuse-tegra30.c-395-\t{\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=551=const struct tegra_fuse_soc tegra210_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-564-#if defined(CONFIG_ARCH_TEGRA_186_SOC)\ndrivers/soc/tegra/fuse/fuse-tegra30.c:565:static const struct nvmem_cell_info tegra186_fuse_cells[] = {\ndrivers/soc/tegra/fuse/fuse-tegra30.c-566-\t{\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=609=const struct tegra_fuse_soc tegra186_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-623-#if defined(CONFIG_ARCH_TEGRA_194_SOC)\ndrivers/soc/tegra/fuse/fuse-tegra30.c:624:static const struct nvmem_cell_info tegra194_fuse_cells[] = {\ndrivers/soc/tegra/fuse/fuse-tegra30.c-625-\t{\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=702=const struct tegra_fuse_soc tegra194_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-716-#if defined(CONFIG_ARCH_TEGRA_234_SOC)\ndrivers/soc/tegra/fuse/fuse-tegra30.c:717:static const struct nvmem_cell_info tegra234_fuse_cells[] = {\ndrivers/soc/tegra/fuse/fuse-tegra30.c-718-\t{\n--\ndrivers/soc/tegra/fuse/fuse.h=26=struct tegra_fuse_soc {\n--\ndrivers/soc/tegra/fuse/fuse.h-34-\tunsigned int num_lookups;\ndrivers/soc/tegra/fuse/fuse.h:35:\tconst struct nvmem_cell_info *cells;\ndrivers/soc/tegra/fuse/fuse.h-36-\tunsigned int num_cells;\n--\ninclude/linux/nvmem-consumer.h=78=ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,\ninclude/linux/nvmem-consumer.h:79:\t\t\t struct nvmem_cell_info *info, void *buf);\ninclude/linux/nvmem-consumer.h-80-int nvmem_device_cell_write(struct nvmem_device *nvmem,\ninclude/linux/nvmem-consumer.h:81:\t\t\t struct nvmem_cell_info *info, void *buf);\ninclude/linux/nvmem-consumer.h-82-\n--\ninclude/linux/nvmem-consumer.h=190=static inline ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,\ninclude/linux/nvmem-consumer.h:191:\t\t\t\t\t struct nvmem_cell_info *info,\ninclude/linux/nvmem-consumer.h-192-\t\t\t\t\t void *buf)\n--\ninclude/linux/nvmem-consumer.h=197=static inline int nvmem_device_cell_write(struct nvmem_device *nvmem,\ninclude/linux/nvmem-consumer.h:198:\t\t\t\t\t struct nvmem_cell_info *info,\ninclude/linux/nvmem-consumer.h-199-\t\t\t\t\t void *buf)\n--\ninclude/linux/nvmem-provider.h=46=struct nvmem_keepout {\n--\ninclude/linux/nvmem-provider.h-52-/**\ninclude/linux/nvmem-provider.h:53: * struct nvmem_cell_info - NVMEM cell description\ninclude/linux/nvmem-provider.h-54- * @name:\tName.\n--\ninclude/linux/nvmem-provider.h-64- */\ninclude/linux/nvmem-provider.h:65:struct nvmem_cell_info {\ninclude/linux/nvmem-provider.h-66-\tconst char\t\t*name;\n--\ninclude/linux/nvmem-provider.h=111=struct nvmem_config {\n--\ninclude/linux/nvmem-provider.h-115-\tstruct module\t\t*owner;\ninclude/linux/nvmem-provider.h:116:\tconst struct nvmem_cell_info\t*cells;\ninclude/linux/nvmem-provider.h-117-\tint\t\t\tncells;\n--\ninclude/linux/nvmem-provider.h-119-\tvoid (*fixup_dt_cell_info)(struct nvmem_device *nvmem,\ninclude/linux/nvmem-provider.h:120:\t\t\t\t struct nvmem_cell_info *cell);\ninclude/linux/nvmem-provider.h-121-\tconst struct nvmem_keepout *keepout;\n--\ninclude/linux/nvmem-provider.h=174=int nvmem_add_one_cell(struct nvmem_device *nvmem,\ninclude/linux/nvmem-provider.h:175:\t\t const struct nvmem_cell_info *info);\ninclude/linux/nvmem-provider.h-176-\n--\ninclude/linux/nvmem-provider.h=204=static inline int nvmem_add_one_cell(struct nvmem_device *nvmem,\ninclude/linux/nvmem-provider.h:205:\t\t\t\t const struct nvmem_cell_info *info)\ninclude/linux/nvmem-provider.h-206-{\n"
} |
| 92/2 | 2026/09/22 17:30 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 48269 output: 35 thoughts: 284 Thoughts: **Analyzing the Usage of `struct nvmem_cell_info`** Okay, let's dive into this. My initial goal is to understand the scope of `struct nvmem_cell_info`'s application. I need to get a complete picture of where this structure is used within the codebase. First, I see the following: * `adm1266.c`: `.bit_offset = 0`, `.nbits = 0` which immediately raises a question, these default values are interesting, perhaps this driver is not fully implementing the structure correctly. * `brcm_nvram.c`: I need to look into this one more closely, so let's mark that down to check in the `drivers/nvmem` section. * `drivers/nvmem/core.c`: Aha, the core functionality, it's used within `nvmem_add_cells_from_dt`. This is definitely a critical point to review. * `drivers/nvmem/layouts/onie-tlv.c`, `drivers/nvmem/layouts/sl28vpd.c`, and `drivers/nvmem/layouts/u-boot-env.c`: these are all layout-specific implementations; the structure's likely used to describe the organization of data within these NVMEM layouts. * `drivers/pmdomain/mediatek/mtk-mfg-pmdomain.c`: Hmm, power management... I'll need to assess this in the context of power domains. * `drivers/power/supply/max1720x_battery.c`: `.bit_offset = 0`, `.nbits = 0` again, which looks like the adm1266.c, so it's probably using the structure, but perhaps not correctly. * `drivers/soc/tegra/fuse/fuse-tegra30.c`: ARM specific. This seems relevant, but platform-specific. Okay, let's focus on the more interesting ones: `brcm_nvram.c`, the layout drivers: `onie-tlv.c`, `sl28vpd.c`, and `u-boot-env.c`. I need to get into the details of how they utilize `struct nvmem_cell_info` to truly grasp its purpose and potential areas of concern. |
| 93/2 | 2026/09/22 17:31 | tool | grepper |
0mError:no matches Args: {
"Expression": "bit_offset",
"PathPrefix": "drivers/nvmem/brcm_nvram.c"
}Results: {
"error": "no matches"
} |
| 94/2 | 2026/09/22 17:31 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 49111 output: 28 thoughts: 714 Thoughts: **Investigating NVMEM Cell Bitfield Handling**
Okay, so I need to figure out how these bit offsets and number of bits are handled in the NVMEM framework. My initial thought was to check some common suspects like `drivers/nvmem/layouts/onie-tlv.c`, `sl28vpd.c`, and `u-boot-env.c` for `bit_offset` or `nbits`. However, a quick `grep` search earlier ruled out the `drivers/nvmem/layouts/` directory itself, which is odd.
The question then becomes, how are these NVMEM cells actually *created* in the Linux kernel? I need to trace this back. Let's see... Ah, `nvmem_add_cells_from_dt()` seems like the function to investigate.
Okay, let's look through the code:
```c
int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)
{
struct device *dev = &nvmem->dev;
struct device_node *child;
const __be32 *addr;
int len, ret;
for_each_child_of_node_scoped(np, child) {
struct nvmem_cell_info info = {0};
addr = of_get_property(child, "reg", &len);
if (!addr)
continue;
if (len < 2 * sizeof(u32)) {
dev_err(dev, "nvmem: invalid reg on %pOF\n", child);
continue;
}
info.offset = be32_to_cpup(addr++);
info.bytes = be32_to_cpup(addr++);
info.name = kasprintf(GFP_KERNEL, "%pOFn", child);
addr = of_get_property(child, "bits", &len);
if (addr && len == (2 * sizeof(u32))) {
info.bit_offset = be32_to_cpup(addr++);
info.nbits = be32_to_cpup(addr);
if (info.bit_offset >= BITS_PER_BYTE * info.bytes ||
info.nbits < 1 ||
info.bit_offset + info.nbits > BITS_PER_BYTE * info.bytes) {
dev_err(dev, "nvmem: invalid bits on %pOF\n", child);
kfree(info.name);
continue;
}
}
info.np = of_node_get(child);
if (nvmem->fixup_dt_cell_info)
nvmem->fixup_dt_cell_info(nvmem, &info);
ret = nvmem_add_one_cell(nvmem, &info);
...
```
Eureka! There it is! The Device Tree binding for an NVMEM cell *explicitly* checks for a `"bits"` property. This is what's setting `info.bit_offset` and `info.nbits`:
`info.bit_offset = be32_to_cpup(addr++);`
`info.nbits = be32_to_cpup(addr);`
So, the DT is the key. But wait, a crucial question arises: is Device Tree (`OF`) even used on x86/amd64? And if so, can it be present or created using overlays or even unittests? Can it be loaded dynamically at runtime, or is it baked into the boot process? I need to check `CONFIG_OF_OVERLAY` and `CONFIG_OF_CONFIGFS` to get the whole picture on that front.
|
| 95/2 | 2026/09/22 17:31 | tool | grepper |
0mArgs:{
"Expression": "CONFIG_OF",
"PathPrefix": "arch/x86"
}Results: {
"Output": "arch/x86/include/asm/prom.h-20-\narch/x86/include/asm/prom.h:21:#ifdef CONFIG_OF\narch/x86/include/asm/prom.h-22-extern int of_ioapic;\n--\narch/x86/kernel/Makefile=152=obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o\narch/x86/kernel/Makefile-153-\narch/x86/kernel/Makefile:154:obj-$(CONFIG_OF)\t\t\t+= devicetree.o\narch/x86/kernel/Makefile-155-obj-$(CONFIG_UPROBES)\t\t\t+= uprobes.o\n--\narch/x86/kernel/devicetree.c=339=void __init x86_flattree_get_config(void)\narch/x86/kernel/devicetree.c-340-{\narch/x86/kernel/devicetree.c:341:#ifdef CONFIG_OF_EARLY_FLATTREE\narch/x86/kernel/devicetree.c-342-\tu32 size, map_len;\n--\narch/x86/kernel/kexec-bzimage64.c=189=setup_efi_state(struct boot_params *params, unsigned long params_load_addr,\n--\narch/x86/kernel/kexec-bzimage64.c-224-\narch/x86/kernel/kexec-bzimage64.c:225:#ifdef CONFIG_OF_FLATTREE\narch/x86/kernel/kexec-bzimage64.c-226-static void setup_dtb(struct boot_params *params,\n--\narch/x86/kernel/kexec-bzimage64.c-244-}\narch/x86/kernel/kexec-bzimage64.c:245:#endif /* CONFIG_OF_FLATTREE */\narch/x86/kernel/kexec-bzimage64.c-246-\n--\narch/x86/kernel/kexec-bzimage64.c=301=setup_boot_parameters(struct kimage *image, struct boot_params *params,\n--\narch/x86/kernel/kexec-bzimage64.c-371-\narch/x86/kernel/kexec-bzimage64.c:372:#ifdef CONFIG_OF_FLATTREE\narch/x86/kernel/kexec-bzimage64.c-373-\tif (image-\u003eforce_dtb \u0026\u0026 initial_boot_params) {\n--\narch/x86/kernel/kexec-bzimage64.c=475=static void *bzImage64_load(struct kimage *image, char *kernel,\n--\narch/x86/kernel/kexec-bzimage64.c-571-\narch/x86/kernel/kexec-bzimage64.c:572:#ifdef CONFIG_OF_FLATTREE\narch/x86/kernel/kexec-bzimage64.c-573-\tif (image-\u003eforce_dtb \u0026\u0026 initial_boot_params)\n--\narch/x86/kernel/setup.c=401=static void __init add_early_ima_buffer(u64 phys_addr)\n--\narch/x86/kernel/setup.c-423-\narch/x86/kernel/setup.c:424:#if defined(CONFIG_HAVE_IMA_KEXEC) \u0026\u0026 !defined(CONFIG_OF_FLATTREE)\narch/x86/kernel/setup.c-425-int __init ima_free_kexec_buffer(void)\n--\narch/x86/kernel/x86_init.c=42=static __initconst const struct of_device_id of_cmos_match[] = {\n--\narch/x86/kernel/x86_init.c-49- * corresponding DT node's status property to disabled. Code is optimized\narch/x86/kernel/x86_init.c:50: * out for CONFIG_OF=n builds.\narch/x86/kernel/x86_init.c-51- */\n"
} |
| 96/2 | 2026/09/22 17:31 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 51775 output: 22 thoughts: 67 Thoughts: Here's my take on those thoughts: **Navigating the Configuration Conundrum** Okay, so I'm thinking about this x86 configuration...and it hits me: `CONFIG_OF` is definitely an option on x86, no question. But, hold on, the standard QEMU setup on x86 typically runs ACPI, right? Open Firmware (OF) isn't the go-to here. Something feels off... Aha! This jogs my memory... what about that `nvmem_device_cell_read()` function? Is that the key? Let me see who is using it. |
| 97/2 | 2026/09/22 17:31 | tool | grepper |
0mArgs:{
"Expression": "nvmem_device_cell_read"
}Results: {
"Output": "Documentation/driver-api/nvmem.rst=117=To facilitate such consumers NVMEM framework provides below apis::\n--\nDocumentation/driver-api/nvmem.rst-128-\t\t size_t bytes, void *buf);\nDocumentation/driver-api/nvmem.rst:129: int nvmem_device_cell_read(struct nvmem_device *nvmem,\nDocumentation/driver-api/nvmem.rst-130-\t\t\t struct nvmem_cell_info *info, void *buf);\n--\ndrivers/nvmem/core.c=1976=EXPORT_SYMBOL_GPL(nvmem_cell_read_variable_le_u64);\n--\ndrivers/nvmem/core.c-1978-/**\ndrivers/nvmem/core.c:1979: * nvmem_device_cell_read() - Read a given nvmem device and cell\ndrivers/nvmem/core.c-1980- *\n--\ndrivers/nvmem/core.c-1987- */\ndrivers/nvmem/core.c:1988:ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c-1989-\t\t\t struct nvmem_cell_info *info, void *buf)\n--\ndrivers/nvmem/core.c-2007-}\ndrivers/nvmem/core.c:2008:EXPORT_SYMBOL_GPL(nvmem_device_cell_read);\ndrivers/nvmem/core.c-2009-\n--\ninclude/linux/nvmem-consumer.h=76=int nvmem_device_write(struct nvmem_device *nvmem, unsigned int offset,\ninclude/linux/nvmem-consumer.h-77-\t\t size_t bytes, void *buf);\ninclude/linux/nvmem-consumer.h:78:ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,\ninclude/linux/nvmem-consumer.h-79-\t\t\t struct nvmem_cell_info *info, void *buf);\n--\ninclude/linux/nvmem-consumer.h=185=static inline void devm_nvmem_device_put(struct device *dev,\n--\ninclude/linux/nvmem-consumer.h-189-\ninclude/linux/nvmem-consumer.h:190:static inline ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,\ninclude/linux/nvmem-consumer.h-191-\t\t\t\t\t struct nvmem_cell_info *info,\n"
} |
| 98/2 | 2026/09/22 17:31 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 52644 output: 21 thoughts: 54 Thoughts: **Investigating the NVMEM Driver Call Chain** Okay, this is strange. I'm looking at the NVMEM driver code, and I've found an exported symbol, `nvmem_device_cell_read()`, that seems to be completely unused within the tree. That's highly unusual; exported symbols usually indicate intended external access. Makes me wonder, why is it there? Wait a second, let me check – is it just this function, or are there related read functions too? Aha, what about `nvmem_cell_read()`? Perhaps there's a different way to access the NVMEM cell functionality that is being used more. Let's dig into who *is* calling `nvmem_cell_read()` in the code. I need to understand the call graph to see what's actually happening here. This might be a clue as to a refactoring or design issue. |
| 99/2 | 2026/09/22 17:31 | tool | grepper |
0mArgs:{
"Expression": "nvmem_cell_read\\("
}Results: {
"Output": "Documentation/driver-api/nvmem.rst=97=The NVMEM framework provides 3 APIs to read/write NVMEM cells::\n--\nDocumentation/driver-api/nvmem.rst-104-\nDocumentation/driver-api/nvmem.rst:105: void *nvmem_cell_read(struct nvmem_cell *cell, ssize_t *len);\nDocumentation/driver-api/nvmem.rst-106- int nvmem_cell_write(struct nvmem_cell *cell, void *buf, ssize_t len);\n--\ndrivers/bluetooth/hci_ll.c=692=static int hci_ti_probe(struct serdev_device *serdev)\n--\ndrivers/bluetooth/hci_ll.c-750-\ndrivers/bluetooth/hci_ll.c:751:\t\tbdaddr = nvmem_cell_read(bdaddr_cell, \u0026len);\ndrivers/bluetooth/hci_ll.c-752-\t\tnvmem_cell_put(bdaddr_cell);\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c=72=static int qcom_cpufreq_simple_get_version(struct device *cpu_dev,\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-79-\t*pvs_name = NULL;\ndrivers/cpufreq/qcom-cpufreq-nvmem.c:80:\tspeedbin = nvmem_cell_read(speedbin_nvmem, NULL);\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-81-\tif (IS_ERR(speedbin))\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c=168=static int qcom_cpufreq_kryo_name_version(struct device *cpu_dev,\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-182-\ndrivers/cpufreq/qcom-cpufreq-nvmem.c:183:\tspeedbin = nvmem_cell_read(speedbin_nvmem, \u0026len);\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-184-\tif (IS_ERR(speedbin))\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c=227=static int qcom_cpufreq_krait_name_version(struct device *cpu_dev,\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-236-\ndrivers/cpufreq/qcom-cpufreq-nvmem.c:237:\tspeedbin = nvmem_cell_read(speedbin_nvmem, \u0026len);\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-238-\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c=276=static int qcom_cpufreq_ipq8064_name_version(struct device *cpu_dev,\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-285-\ndrivers/cpufreq/qcom-cpufreq-nvmem.c:286:\tspeedbin = nvmem_cell_read(speedbin_nvmem, \u0026len);\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-287-\tif (IS_ERR(speedbin))\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c=345=static int qcom_cpufreq_ipq6018_name_version(struct device *cpu_dev,\n--\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-358-\ndrivers/cpufreq/qcom-cpufreq-nvmem.c:359:\tspeedbin = nvmem_cell_read(speedbin_nvmem, NULL);\ndrivers/cpufreq/qcom-cpufreq-nvmem.c-360-\tif (IS_ERR(speedbin))\n--\ndrivers/cpufreq/sun50i-cpufreq-nvmem.c=191=static int sun50i_cpufreq_get_efuse(void)\n--\ndrivers/cpufreq/sun50i-cpufreq-nvmem.c-221-\ndrivers/cpufreq/sun50i-cpufreq-nvmem.c:222:\tspeedbin_ptr = nvmem_cell_read(speedbin_nvmem, \u0026len);\ndrivers/cpufreq/sun50i-cpufreq-nvmem.c-223-\tnvmem_cell_put(speedbin_nvmem);\n--\ndrivers/extcon/extcon-rtk-type-c.c=872=static int __updated_type_c_parameter_by_efuse(struct type_c_data *type_c)\n--\ndrivers/extcon/extcon-rtk-type-c.c-901-\ndrivers/extcon/extcon-rtk-type-c.c:902:\t\tbuf = nvmem_cell_read(cell, \u0026buf_size);\ndrivers/extcon/extcon-rtk-type-c.c-903-\t\tif (!IS_ERR(buf)) {\n--\ndrivers/extcon/extcon-rtk-type-c.c=956=static int __updated_type_c_parameter_by_efuse_v2(struct type_c_data *type_c)\n--\ndrivers/extcon/extcon-rtk-type-c.c-985-\ndrivers/extcon/extcon-rtk-type-c.c:986:\t\tbuf = nvmem_cell_read(cell, \u0026buf_size);\ndrivers/extcon/extcon-rtk-type-c.c-987-\t\tif (!IS_ERR(buf)) {\n--\ndrivers/gpu/drm/mediatek/mtk_dp.c=1164=static void mtk_dp_get_calibration_data(struct mtk_dp *mtk_dp)\n--\ndrivers/gpu/drm/mediatek/mtk_dp.c-1179-\ndrivers/gpu/drm/mediatek/mtk_dp.c:1180:\tbuf = (u32 *)nvmem_cell_read(cell, \u0026len);\ndrivers/gpu/drm/mediatek/mtk_dp.c-1181-\tnvmem_cell_put(cell);\n--\ndrivers/gpu/drm/msm/adreno/a5xx_gpu.c=1690=static void check_speed_bin(struct device *dev)\n--\ndrivers/gpu/drm/msm/adreno/a5xx_gpu.c-1706-\tif (!IS_ERR(cell)) {\ndrivers/gpu/drm/msm/adreno/a5xx_gpu.c:1707:\t\tvoid *buf = nvmem_cell_read(cell, NULL);\ndrivers/gpu/drm/msm/adreno/a5xx_gpu.c-1708-\n--\ndrivers/iio/adc/at91-sama5d2_adc.c=2248=static int at91_adc_temp_sensor_init(struct at91_adc_state *st,\n--\ndrivers/iio/adc/at91-sama5d2_adc.c-2268-\ndrivers/iio/adc/at91-sama5d2_adc.c:2269:\tbuf = nvmem_cell_read(temp_calib, \u0026len);\ndrivers/iio/adc/at91-sama5d2_adc.c-2270-\tnvmem_cell_put(temp_calib);\n--\ndrivers/iio/adc/meson_saradc.c=786=static int meson_sar_adc_temp_sensor_init(struct iio_dev *indio_dev)\n--\ndrivers/iio/adc/meson_saradc.c-809-\tread_len = MESON_SAR_ADC_EFUSE_BYTES;\ndrivers/iio/adc/meson_saradc.c:810:\tbuf = nvmem_cell_read(temperature_calib, \u0026read_len);\ndrivers/iio/adc/meson_saradc.c-811-\tnvmem_cell_put(temperature_calib);\n--\ndrivers/iio/adc/sc27xx_adc.c=165=static int adc_nvmem_cell_calib_data(struct sc27xx_adc_data *data, const char *cell_name)\n--\ndrivers/iio/adc/sc27xx_adc.c-178-\ndrivers/iio/adc/sc27xx_adc.c:179:\tbuf = nvmem_cell_read(cell, \u0026len);\ndrivers/iio/adc/sc27xx_adc.c-180-\tif (IS_ERR(buf)) {\n--\ndrivers/net/ethernet/ni/nixge.c=1234=static void *nixge_get_nvmem_address(struct device *dev)\n--\ndrivers/net/ethernet/ni/nixge.c-1243-\ndrivers/net/ethernet/ni/nixge.c:1244:\tmac = nvmem_cell_read(cell, \u0026cell_size);\ndrivers/net/ethernet/ni/nixge.c-1245-\tnvmem_cell_put(cell);\n--\ndrivers/net/ethernet/sunplus/spl2sw_driver.c=221=static int spl2sw_nvmem_get_mac_address(struct device *dev, struct device_node *np,\n--\ndrivers/net/ethernet/sunplus/spl2sw_driver.c-233-\t/* Read mac address from nvmem cell. */\ndrivers/net/ethernet/sunplus/spl2sw_driver.c:234:\tmac = nvmem_cell_read(cell, \u0026len);\ndrivers/net/ethernet/sunplus/spl2sw_driver.c-235-\tnvmem_cell_put(cell);\n--\ndrivers/net/phy/aquantia/aquantia_firmware.c=296=static int aqr_firmware_load_nvmem(struct phy_device *phydev)\n--\ndrivers/net/phy/aquantia/aquantia_firmware.c-306-\ndrivers/net/phy/aquantia/aquantia_firmware.c:307:\tbuf = nvmem_cell_read(cell, \u0026size);\ndrivers/net/phy/aquantia/aquantia_firmware.c-308-\tif (IS_ERR(buf)) {\n--\ndrivers/net/phy/dp83867.c=528=static int dp83867_of_init_io_impedance(struct phy_device *phydev)\n--\ndrivers/net/phy/dp83867.c-554-\ndrivers/net/phy/dp83867.c:555:\tbuf = nvmem_cell_read(cell, NULL);\ndrivers/net/phy/dp83867.c-556-\tnvmem_cell_put(cell);\n--\ndrivers/net/phy/mediatek/mtk-ge-soc.c=1164=static int mt798x_phy_calibration(struct phy_device *phydev)\n--\ndrivers/net/phy/mediatek/mtk-ge-soc.c-1177-\ndrivers/net/phy/mediatek/mtk-ge-soc.c:1178:\tbuf = (u32 *)nvmem_cell_read(cell, \u0026len);\ndrivers/net/phy/mediatek/mtk-ge-soc.c-1179-\tnvmem_cell_put(cell);\n--\ndrivers/net/wireless/ath/ath10k/core.c=1976=static int ath10k_download_cal_nvmem(struct ath10k *ar, const char *cell_name)\n--\ndrivers/net/wireless/ath/ath10k/core.c-1988-\ndrivers/net/wireless/ath/ath10k/core.c:1989:\tbuf = nvmem_cell_read(cell, \u0026len);\ndrivers/net/wireless/ath/ath10k/core.c-1990-\tif (IS_ERR(buf))\n--\ndrivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c=140=static void owl_nvmem_work(struct work_struct *work)\n--\ndrivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c-147-\ndrivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c:148:\tbuf = nvmem_cell_read(ctx-\u003ecell, \u0026len);\ndrivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c-149-\tif (!IS_ERR(buf)) {\n--\ndrivers/net/wireless/ath/ath9k/init.c=569=static int ath9k_nvmem_request_eeprom(struct ath_softc *sc)\n--\ndrivers/net/wireless/ath/ath9k/init.c-592-\ndrivers/net/wireless/ath/ath9k/init.c:593:\tbuf = nvmem_cell_read(cell, \u0026len);\ndrivers/net/wireless/ath/ath9k/init.c-594-\tnvmem_cell_put(cell);\n--\ndrivers/net/wireless/mediatek/mt76/eeprom.c=121=int mt76_get_of_data_from_nvmem(struct mt76_dev *dev, void *eep,\n--\ndrivers/net/wireless/mediatek/mt76/eeprom.c-133-\ndrivers/net/wireless/mediatek/mt76/eeprom.c:134:\tdata = nvmem_cell_read(cell, \u0026retlen);\ndrivers/net/wireless/mediatek/mt76/eeprom.c-135-\tnvmem_cell_put(cell);\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c=10966=int rt2800_read_eeprom_nvmem(struct rt2x00_dev *rt2x00dev)\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-10977-\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:10978:\tdata = nvmem_cell_read(cell, \u0026retlen);\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-10979-\tnvmem_cell_put(cell);\n--\ndrivers/nvmem/core.c=354=static ssize_t nvmem_cell_attr_read(struct file *filp, struct kobject *kobj,\n--\ndrivers/nvmem/core.c-370-\ndrivers/nvmem/core.c:371:\tcontent = nvmem_cell_read(cell, \u0026cell_sz);\ndrivers/nvmem/core.c-372-\tif (IS_ERR(content)) {\n--\ndrivers/nvmem/core.c=1584=static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)\n--\ndrivers/nvmem/core.c-1626-\ndrivers/nvmem/core.c:1627:static int __nvmem_cell_read(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c-1628-\t\t\t struct nvmem_cell_entry *cell,\n--\ndrivers/nvmem/core.c-1655-/**\ndrivers/nvmem/core.c:1656: * nvmem_cell_read() - Read a given nvmem cell\ndrivers/nvmem/core.c-1657- *\n--\ndrivers/nvmem/core.c-1664- */\ndrivers/nvmem/core.c:1665:void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)\ndrivers/nvmem/core.c-1666-{\n--\ndrivers/nvmem/core.c-1678-\ndrivers/nvmem/core.c:1679:\trc = __nvmem_cell_read(nvmem, cell-\u003eentry, buf, len, cell-\u003eid, cell-\u003eindex);\ndrivers/nvmem/core.c-1680-\tif (rc) {\n--\ndrivers/nvmem/core.c=1795=static int nvmem_cell_read_common(struct device *dev, const char *cell_id,\n--\ndrivers/nvmem/core.c-1805-\ndrivers/nvmem/core.c:1806:\tbuf = nvmem_cell_read(cell, \u0026len);\ndrivers/nvmem/core.c-1807-\tif (IS_ERR(buf)) {\n--\ndrivers/nvmem/core.c=1883=static const void *nvmem_cell_read_variable_common(struct device *dev,\n--\ndrivers/nvmem/core.c-1895-\tnbits = cell-\u003eentry-\u003enbits;\ndrivers/nvmem/core.c:1896:\tbuf = nvmem_cell_read(cell, len);\ndrivers/nvmem/core.c-1897-\tnvmem_cell_put(cell);\n--\ndrivers/nvmem/core.c-1901-\t/*\ndrivers/nvmem/core.c:1902:\t * If nbits is set then nvmem_cell_read() can significantly exaggerate\ndrivers/nvmem/core.c-1903-\t * the length of the real data. Throw away the extra junk.\n--\ndrivers/nvmem/core.c=1988=ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-2001-\ndrivers/nvmem/core.c:2002:\trc = __nvmem_cell_read(nvmem, \u0026cell, buf, \u0026len, NULL, 0);\ndrivers/nvmem/core.c-2003-\tif (rc)\n--\ndrivers/phy/mediatek/phy-mtk-mipi-dsi.c=67=static void mtk_mipi_tx_get_calibration_datal(struct mtk_mipi_tx *mipi_tx)\n--\ndrivers/phy/mediatek/phy-mtk-mipi-dsi.c-77-\t}\ndrivers/phy/mediatek/phy-mtk-mipi-dsi.c:78:\tbuf = (u32 *)nvmem_cell_read(cell, \u0026len);\ndrivers/phy/mediatek/phy-mtk-mipi-dsi.c-79-\tnvmem_cell_put(cell);\n--\ndrivers/phy/qualcomm/phy-qcom-qusb2.c=594=static void qusb2_phy_set_tune2_param(struct qusb2_phy *qphy)\n--\ndrivers/phy/qualcomm/phy-qcom-qusb2.c-610-\t */\ndrivers/phy/qualcomm/phy-qcom-qusb2.c:611:\tval = nvmem_cell_read(qphy-\u003ecell, NULL);\ndrivers/phy/qualcomm/phy-qcom-qusb2.c-612-\tif (IS_ERR(val)) {\n--\ndrivers/phy/realtek/phy-rtk-usb2.c=870=static int get_phy_data_by_efuse(struct rtk_phy *rtk_phy,\n--\ndrivers/phy/realtek/phy-rtk-usb2.c-891-\ndrivers/phy/realtek/phy-rtk-usb2.c:892:\t\tbuf = nvmem_cell_read(cell, \u0026buf_size);\ndrivers/phy/realtek/phy-rtk-usb2.c-893-\t\tif (!IS_ERR(buf)) {\n--\ndrivers/phy/realtek/phy-rtk-usb2.c-933-\ndrivers/phy/realtek/phy-rtk-usb2.c:934:\t\tbuf = nvmem_cell_read(cell, \u0026buf_size);\ndrivers/phy/realtek/phy-rtk-usb2.c-935-\t\tif (!IS_ERR(buf)) {\n--\ndrivers/phy/realtek/phy-rtk-usb3.c=433=static int get_phy_data_by_efuse(struct rtk_phy *rtk_phy,\n--\ndrivers/phy/realtek/phy-rtk-usb3.c-450-\ndrivers/phy/realtek/phy-rtk-usb3.c:451:\t\tbuf = nvmem_cell_read(cell, \u0026buf_size);\ndrivers/phy/realtek/phy-rtk-usb3.c-452-\t\tif (!IS_ERR(buf)) {\n--\ndrivers/phy/rockchip/phy-rockchip-inno-hdmi.c=1174=static int inno_hdmi_phy_rk3328_init(struct inno_hdmi_phy *inno)\n--\ndrivers/phy/rockchip/phy-rockchip-inno-hdmi.c-1203-\ndrivers/phy/rockchip/phy-rockchip-inno-hdmi.c:1204:\tefuse_buf = nvmem_cell_read(cell, \u0026len);\ndrivers/phy/rockchip/phy-rockchip-inno-hdmi.c-1205-\tnvmem_cell_put(cell);\n--\ndrivers/phy/socionext/phy-uniphier-usb3hs.c=101=static int uniphier_u3hsphy_get_nvparam(struct uniphier_u3hsphy_priv *priv,\n--\ndrivers/phy/socionext/phy-uniphier-usb3hs.c-110-\ndrivers/phy/socionext/phy-uniphier-usb3hs.c:111:\tbuf = nvmem_cell_read(cell, NULL);\ndrivers/phy/socionext/phy-uniphier-usb3hs.c-112-\tif (IS_ERR(buf))\n--\ndrivers/phy/sunplus/phy-sunplus-usb2.c=78=static int update_disc_vol(struct sp_usbphy *usbphy)\n--\ndrivers/phy/sunplus/phy-sunplus-usb2.c-91-\ndrivers/phy/sunplus/phy-sunplus-usb2.c:92:\totp_v = nvmem_cell_read(cell, \u0026otp_l);\ndrivers/phy/sunplus/phy-sunplus-usb2.c-93-\tnvmem_cell_put(cell);\n--\ndrivers/power/reset/macsmc-reboot.c=48=static int nvmem_cell_get_u8(struct nvmem_cell *cell)\n--\ndrivers/power/reset/macsmc-reboot.c-53-\ndrivers/power/reset/macsmc-reboot.c:54:\tbfr = nvmem_cell_read(cell, \u0026len);\ndrivers/power/reset/macsmc-reboot.c-55-\tif (IS_ERR(bfr))\n--\ndrivers/power/reset/nvmem-reboot-mode.c=20=static int nvmem_reboot_mode_write(struct reboot_mode_driver *reboot,\n--\ndrivers/power/reset/nvmem-reboot-mode.c-29-\ndrivers/power/reset/nvmem-reboot-mode.c:30:\tbuf = nvmem_cell_read(nvmem_rbm-\u003ecell, \u0026buf_len);\ndrivers/power/reset/nvmem-reboot-mode.c-31-\tif (IS_ERR(buf))\n--\ndrivers/power/supply/sc27xx_fuel_gauge.c=958=static int sc27xx_fgu_calibration(struct sc27xx_fgu_data *data)\n--\ndrivers/power/supply/sc27xx_fuel_gauge.c-968-\ndrivers/power/supply/sc27xx_fuel_gauge.c:969:\tbuf = nvmem_cell_read(cell, \u0026len);\ndrivers/power/supply/sc27xx_fuel_gauge.c-970-\tnvmem_cell_put(cell);\n--\ndrivers/rtc/rtc-macsmc.c=30=static int macsmc_rtc_get_time(struct device *dev, struct rtc_time *tm)\n--\ndrivers/rtc/rtc-macsmc.c-44-\ndrivers/rtc/rtc-macsmc.c:45:\tp_off = nvmem_cell_read(rtc-\u003ertc_offset, \u0026len);\ndrivers/rtc/rtc-macsmc.c-46-\tif (IS_ERR(p_off))\n--\ndrivers/rtc/rtc-pm8xxx.c=170=static int pm8xxx_rtc_read_nvmem_offset(struct pm8xxx_rtc *rtc_dd)\n--\ndrivers/rtc/rtc-pm8xxx.c-175-\ndrivers/rtc/rtc-pm8xxx.c:176:\tbuf = nvmem_cell_read(rtc_dd-\u003envmem_cell, \u0026len);\ndrivers/rtc/rtc-pm8xxx.c-177-\tif (IS_ERR(buf)) {\n--\ndrivers/soc/mediatek/mtk-svs.c=1859=static int svs_get_efuse_data(struct svs_platform *svsp,\n--\ndrivers/soc/mediatek/mtk-svs.c-1871-\ndrivers/soc/mediatek/mtk-svs.c:1872:\t*svsp_efuse = nvmem_cell_read(cell, svsp_efuse_max);\ndrivers/soc/mediatek/mtk-svs.c-1873-\tif (IS_ERR(*svsp_efuse)) {\n--\ndrivers/thermal/imx8mm_thermal.c=198=static int imx8mm_tmu_probe_set_calib_v2(struct platform_device *pdev,\n--\ndrivers/thermal/imx8mm_thermal.c-210-\ndrivers/thermal/imx8mm_thermal.c:211:\tbuf = nvmem_cell_read(cell, \u0026len);\ndrivers/thermal/imx8mm_thermal.c-212-\tnvmem_cell_put(cell);\n--\ndrivers/thermal/mediatek/auxadc_thermal.c=1073=static int mtk_thermal_get_calibration_data(struct device *dev,\n--\ndrivers/thermal/mediatek/auxadc_thermal.c-1095-\ndrivers/thermal/mediatek/auxadc_thermal.c:1096:\tbuf = (u32 *)nvmem_cell_read(cell, \u0026len);\ndrivers/thermal/mediatek/auxadc_thermal.c-1097-\n--\ndrivers/thermal/mediatek/lvts_thermal.c=876=static int lvts_calibration_read(struct device *dev, struct lvts_domain *lvts_td,\n--\ndrivers/thermal/mediatek/lvts_thermal.c-893-\ndrivers/thermal/mediatek/lvts_thermal.c:894:\t\tefuse = nvmem_cell_read(cell, \u0026len);\ndrivers/thermal/mediatek/lvts_thermal.c-895-\n--\ndrivers/thermal/qcom/tsens.c=58=char *qfprom_read(struct device *dev, const char *cname)\n--\ndrivers/thermal/qcom/tsens.c-67-\ndrivers/thermal/qcom/tsens.c:68:\tret = nvmem_cell_read(cell, \u0026data);\ndrivers/thermal/qcom/tsens.c-69-\tnvmem_cell_put(cell);\n--\ndrivers/thermal/rockchip_thermal.c=1470=static int rockchip_get_efuse_value(struct device_node *np, const char *cell_name,\n--\ndrivers/thermal/rockchip_thermal.c-1482-\ndrivers/thermal/rockchip_thermal.c:1483:\tbuf = nvmem_cell_read(cell, \u0026len);\ndrivers/thermal/rockchip_thermal.c-1484-\n--\ndrivers/thermal/sprd_thermal.c=121=static int sprd_thm_cal_read(struct device_node *np, const char *cell_id,\n--\ndrivers/thermal/sprd_thermal.c-131-\ndrivers/thermal/sprd_thermal.c:132:\tbuf = nvmem_cell_read(cell, \u0026len);\ndrivers/thermal/sprd_thermal.c-133-\tnvmem_cell_put(cell);\n--\ndrivers/thermal/sun8i_thermal.c=301=static int sun8i_ths_calibrate(struct ths_device *tmdev)\n--\ndrivers/thermal/sun8i_thermal.c-328-\ndrivers/thermal/sun8i_thermal.c:329:\tcaldata = nvmem_cell_read(calcell, \u0026callen);\ndrivers/thermal/sun8i_thermal.c-330-\tif (IS_ERR(caldata)) {\n--\ndrivers/ufs/host/ufs-renesas.c=448=static int ufs_renesas_init(struct ufs_hba *hba)\n--\ndrivers/ufs/host/ufs-renesas.c-480-\ndrivers/ufs/host/ufs-renesas.c:481:\tdata = nvmem_cell_read(cell, \u0026len);\ndrivers/ufs/host/ufs-renesas.c-482-\tif (IS_ERR(data)) {\n--\ndrivers/watchdog/rave-sp-wdt.c=253=static int rave_sp_wdt_probe(struct platform_device *pdev)\n--\ndrivers/watchdog/rave-sp-wdt.c-280-\t\tsize_t len;\ndrivers/watchdog/rave-sp-wdt.c:281:\t\tvoid *value = nvmem_cell_read(cell, \u0026len);\ndrivers/watchdog/rave-sp-wdt.c-282-\n--\ninclude/linux/nvmem-consumer.h=56=void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell);\ninclude/linux/nvmem-consumer.h:57:void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len);\ninclude/linux/nvmem-consumer.h-58-int nvmem_cell_write(struct nvmem_cell *cell, void *buf, size_t len);\n--\ninclude/linux/nvmem-consumer.h=116=static inline void nvmem_cell_put(struct nvmem_cell *cell)\n--\ninclude/linux/nvmem-consumer.h-119-\ninclude/linux/nvmem-consumer.h:120:static inline void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)\ninclude/linux/nvmem-consumer.h-121-{\n--\nnet/core/of_net.c=61=int of_get_mac_address_nvmem(struct device_node *np, u8 *addr)\n--\nnet/core/of_net.c-81-\nnet/core/of_net.c:82:\tmac = nvmem_cell_read(cell, \u0026len);\nnet/core/of_net.c-83-\tnvmem_cell_put(cell);\n--\nnet/ethernet/eth.c=532=int nvmem_get_mac_address(struct device *dev, void *addrbuf)\n--\nnet/ethernet/eth.c-541-\nnet/ethernet/eth.c:542:\tmac = nvmem_cell_read(cell, \u0026len);\nnet/ethernet/eth.c-543-\tnvmem_cell_put(cell);\n"
} |
| 100/2 | 2026/09/22 17:31 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 61003 output: 36 thoughts: 97 Thoughts: Here's my analysis of the situation: **Investigating the `nvmem_cell_read()` Function** Okay, so I need to trace the execution path of `nvmem_cell_read()`. The first thing I see is that it's called by `nvmem_cell_attr_read()`, which is defined in `drivers/nvmem/core.c`. Excellent, that gives me a concrete starting point. Now, I should probably also check where `nvmem_cell_attr_read()` itself is used, as well as considering `nvmem_populate_sysfs_cells()`, because that function's naming suggests it will interact with the file system cells as well. To get a better understanding of how these functions interact within the broader NVMEM framework, I'm going to focus my attention on `drivers/nvmem/core.c`, specifically around lines 350 to 530. That region should contain the relevant definitions and calls. Let's dig in. |
| 101/2 | 2026/09/22 17:31 | tool | read-file |
0mArgs:{
"File": "drivers/nvmem/core.c",
"FirstLine": 350,
"LineCount": 50
}Results: {
"Contents": " 350:\t\n 351:\tstatic struct nvmem_cell *nvmem_create_cell(struct nvmem_cell_entry *entry,\n 352:\t\t\t\t\t\t const char *id, int index);\n 353:\t\n 354:\tstatic ssize_t nvmem_cell_attr_read(struct file *filp, struct kobject *kobj,\n 355:\t\t\t\t\t const struct bin_attribute *attr, char *buf,\n 356:\t\t\t\t\t loff_t pos, size_t count)\n 357:\t{\n 358:\t\tstruct nvmem_cell_entry *entry;\n 359:\t\tstruct nvmem_cell *cell = NULL;\n 360:\t\tsize_t cell_sz, read_len;\n 361:\t\tvoid *content;\n 362:\t\n 363:\t\tentry = attr-\u003eprivate;\n 364:\t\tcell = nvmem_create_cell(entry, entry-\u003ename, 0);\n 365:\t\tif (IS_ERR(cell))\n 366:\t\t\treturn PTR_ERR(cell);\n 367:\t\n 368:\t\tif (!cell)\n 369:\t\t\treturn -EINVAL;\n 370:\t\n 371:\t\tcontent = nvmem_cell_read(cell, \u0026cell_sz);\n 372:\t\tif (IS_ERR(content)) {\n 373:\t\t\tread_len = PTR_ERR(content);\n 374:\t\t\tgoto destroy_cell;\n 375:\t\t}\n 376:\t\n 377:\t\tread_len = min_t(unsigned int, cell_sz - pos, count);\n 378:\t\tmemcpy(buf, content + pos, read_len);\n 379:\t\tkfree(content);\n 380:\t\n 381:\tdestroy_cell:\n 382:\t\tkfree_const(cell-\u003eid);\n 383:\t\tkfree(cell);\n 384:\t\n 385:\t\treturn read_len;\n 386:\t}\n 387:\t\n 388:\t/* default read/write permissions */\n 389:\tstatic const struct bin_attribute bin_attr_rw_nvmem = {\n 390:\t\t.attr\t= {\n 391:\t\t\t.name\t= \"nvmem\",\n 392:\t\t\t.mode\t= 0644,\n 393:\t\t},\n 394:\t\t.read\t= bin_attr_nvmem_read,\n 395:\t\t.write\t= bin_attr_nvmem_write,\n 396:\t};\n 397:\t\n 398:\tstatic const struct bin_attribute *const nvmem_bin_attributes[] = {\n 399:\t\t\u0026bin_attr_rw_nvmem,\n"
} |
| 102/2 | 2026/09/22 17:31 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 62083 output: 36 thoughts: 25 Thoughts: Okay, let's dive into this. I need to get a handle on the `drivers/nvmem/core.c` file and specifically lines 470-530. It's crucial to understand how this code is handling non-volatile memory access at a foundational level. I'm hoping to get a clearer picture of the core interactions, maybe identify where the critical locking or error handling mechanisms are implemented within the driver framework. I'm expecting this section to reveal either the heart of the addressing scheme, data transfer management, or possibly the registration and unregistration of the NVM devices with the system. Knowing the specifics in this area allows for a good foundation for analysis of any problems or for future improvements. Let me start the breakdown of the code. |
| 103/2 | 2026/09/22 17:31 | tool | read-file |
0mArgs:{
"File": "drivers/nvmem/core.c",
"FirstLine": 470,
"LineCount": 55
}Results: {
"Contents": " 470:\t{\n 471:\t\tstruct attribute_group group = {\n 472:\t\t\t.name\t= \"cells\",\n 473:\t\t};\n 474:\t\tstruct nvmem_cell_entry *entry;\n 475:\t\tconst struct bin_attribute **pattrs;\n 476:\t\tstruct bin_attribute *attrs;\n 477:\t\tunsigned int ncells = 0, i = 0;\n 478:\t\tint ret;\n 479:\t\n 480:\t\tguard(mutex)(\u0026nvmem_mutex);\n 481:\t\n 482:\t\tif (list_empty(\u0026nvmem-\u003ecells) || nvmem-\u003esysfs_cells_populated)\n 483:\t\t\treturn 0;\n 484:\t\n 485:\t\t/* Allocate an array of attributes with a sentinel */\n 486:\t\tncells = list_count_nodes(\u0026nvmem-\u003ecells);\n 487:\t\tpattrs = devm_kcalloc(\u0026nvmem-\u003edev, ncells + 1,\n 488:\t\t\t\t sizeof(struct bin_attribute *), GFP_KERNEL);\n 489:\t\tif (!pattrs)\n 490:\t\t\treturn -ENOMEM;\n 491:\t\n 492:\t\tattrs = devm_kcalloc(\u0026nvmem-\u003edev, ncells, sizeof(struct bin_attribute), GFP_KERNEL);\n 493:\t\tif (!attrs)\n 494:\t\t\treturn -ENOMEM;\n 495:\t\n 496:\t\t/* Initialize each attribute to take the name and size of the cell */\n 497:\t\tlist_for_each_entry(entry, \u0026nvmem-\u003ecells, node) {\n 498:\t\t\tsysfs_bin_attr_init(\u0026attrs[i]);\n 499:\t\t\tattrs[i].attr.name = devm_kasprintf(\u0026nvmem-\u003edev, GFP_KERNEL,\n 500:\t\t\t\t\t\t\t \"%s@%x,%x\", entry-\u003ename,\n 501:\t\t\t\t\t\t\t entry-\u003eoffset,\n 502:\t\t\t\t\t\t\t entry-\u003ebit_offset);\n 503:\t\t\tattrs[i].attr.mode = 0444 \u0026 nvmem_bin_attr_get_umode(nvmem);\n 504:\t\t\tattrs[i].size = entry-\u003ebytes;\n 505:\t\t\tattrs[i].read = \u0026nvmem_cell_attr_read;\n 506:\t\t\tattrs[i].private = entry;\n 507:\t\t\tif (!attrs[i].attr.name)\n 508:\t\t\t\treturn -ENOMEM;\n 509:\t\n 510:\t\t\tpattrs[i] = \u0026attrs[i];\n 511:\t\t\ti++;\n 512:\t\t}\n 513:\t\n 514:\t\tgroup.bin_attrs = pattrs;\n 515:\t\n 516:\t\tret = device_add_group(\u0026nvmem-\u003edev, \u0026group);\n 517:\t\tif (ret)\n 518:\t\t\treturn ret;\n 519:\t\n 520:\t\tnvmem-\u003esysfs_cells_populated = true;\n 521:\t\n 522:\t\treturn ret;\n 523:\t}\n 524:\t\n"
} |
| 104/2 | 2026/09/22 17:31 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 63136 output: 34 thoughts: 48 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Analyzing the nvmem Sysfs Population** Alright, so `nvmem_populate_sysfs_cells` is the key function here, tasked with generating those sysfs attributes we see when dealing with non-volatile memory devices, *but only* if the `nvmem->cells` pointer isn't NULL. This confirms my understanding: it's the mechanism that exposes the individual cells of the NVM to userspace. A quick mental check reinforces that: no cells, no sysfs attributes. Makes perfect sense. But the real question I need to answer, the one that's been nagging at the back of my mind, is *when* this function is actually invoked. I need to trace the call paths to understand the complete lifecycle. Is it during probe, attach, or some other phase of the driver's operation? I'll need to dig into the surrounding code to determine the exact triggering event and verify any preconditions for it's execution. Knowing that will give me a better understanding of how the attributes are created and updated. |
| 105/2 | 2026/09/22 17:31 | tool | grepper |
0mArgs:{
"Expression": "nvmem_populate_sysfs_cells",
"PathPrefix": "drivers/nvmem/"
}Results: {
"Output": "drivers/nvmem/core.c=463=static void nvmem_sysfs_remove_compat(struct nvmem_device *nvmem)\n--\ndrivers/nvmem/core.c-468-\ndrivers/nvmem/core.c:469:static int nvmem_populate_sysfs_cells(struct nvmem_device *nvmem)\ndrivers/nvmem/core.c-470-{\n--\ndrivers/nvmem/core.c=847=int nvmem_layout_register(struct nvmem_layout *layout)\n--\ndrivers/nvmem/core.c-859-#ifdef CONFIG_NVMEM_SYSFS\ndrivers/nvmem/core.c:860:\tret = nvmem_populate_sysfs_cells(layout-\u003envmem);\ndrivers/nvmem/core.c-861-\tif (ret) {\n--\ndrivers/nvmem/core.c=887=struct nvmem_device *nvmem_register(const struct nvmem_config *config)\n--\ndrivers/nvmem/core.c-1019-#ifdef CONFIG_NVMEM_SYSFS\ndrivers/nvmem/core.c:1020:\trval = nvmem_populate_sysfs_cells(nvmem);\ndrivers/nvmem/core.c-1021-\tif (rval)\n"
} |
| 106/2 | 2026/09/22 17:31 | llm | patch-evaluator-compressor |
0mModel:gemini-3.8-flash Args: null Results: null Reply: ### Summary of Investigation
#### 1. Applied Changes and Commit Context
- **Commit**: `4da74d0352cad1ee0c07f09e61c60ef7b7d5c625`
- **Location**: `drivers/nvmem/core.c:1598-1610`
- **Function**: `nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)`
- **Diff Details**:
```c
@@ -1598,12 +1598,14 @@ static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void
*p = *b++ >> bit_offset;
/* setup rest of the bytes if any */
- for (i = 1; i < cell->bytes; i++) {
+ for (i = 1; i < (cell->bytes - bytes_offset); i++) {
/* Get bits from next byte and shift them towards msb */
*p++ |= *b << (BITS_PER_BYTE - bit_offset);
*p = *b++ >> bit_offset;
}
+ /* point to end of the buffer unused bits will be cleared */
+ p = buf + cell->bytes - 1;
} else if (p != b) {
memmove(p, b, cell->bytes - bytes_offset);
p += cell->bytes - 1;
```
- **Bug Fixed**:
- In `nvmem_shift_read_buffer_in_place()`:
```c
bytes_offset = bit_offset / BITS_PER_BYTE;
b += bytes_offset;
bit_offset %= BITS_PER_BYTE;
```
When `bit_offset >= 8` (i.e. `bytes_offset > 0`), the original loop ran `cell->bytes - 1` times reading `*b++`. Because `b` started at `buf + bytes_offset`, reading `cell->bytes - 1` times over-read the buffer by `bytes_offset` bytes (OOB read). Furthermore, `p` advanced incorrectly.
The fix reduces the iteration count to `cell->bytes - bytes_offset` and explicitly points `p` to `buf + cell->bytes - 1` for clearing unused high bits.
#### 2. Call Paths and Entrypoints
- `nvmem_shift_read_buffer_in_place()` is a `static void` function called in exactly one place:
- `__nvmem_cell_read()` in `drivers/nvmem/core.c:1639`:
```c
if (cell->bit_offset || cell->nbits)
nvmem_shift_read_buffer_in_place(cell, buf);
```
- Direct callers of `__nvmem_cell_read()`:
1. `nvmem_cell_read(struct nvmem_cell *cell, size_t *len)` (`core.c:1679`)
2. `nvmem_device_cell_read(struct nvmem_device *nvmem, struct nvmem_cell_info *info, void *buf)` (`core.c:2002`)
- Sysfs exposure:
- `nvmem_populate_sysfs_cells()` exposes cells at `/sys/bus/nvmem/devices/<dev>/cells/<cell_name>@<offset>,<bit_offset>`.
- Reading these sysfs bin attributes triggers `nvmem_cell_attr_read()`, which invokes `nvmem_cell_read()`, directly calling `__nvmem_cell_read()` and reaching `nvmem_shift_read_buffer_in_place()`.
#### 3. Investigation of Cell Instantiation and Sources
To reach `nvmem_shift_read_buffer_in_place()`, a cell must satisfy `cell->bit_offset != 0` or `cell->nbits != 0`.
- **Search for static `.bit_offset` and `.nbits` definitions across kernel drivers**:
- `drivers/soc/tegra/fuse/fuse-tegra30.c`: Defines `tegra*_fuse_cells[]` with `.bit_offset = 0` and `.nbits = 32` (ARM/Tegra only).
- `drivers/hwmon/pmbus/adm1266.c`: Registers cells (`adm1266_nvmem_cells`), but has `offset = 0`, `bytes = 2048`, no `bit_offset` or `nbits`.
- `drivers/power/supply/max1720x_battery.c`: Registers cells (`max1720x_nvmem_cells`), but only defines `.offset` and `.bytes = 2` without `bit_offset` or `nbits`.
- `drivers/nvmem/layouts/`: No layouts define `bit_offset` or `nbits`.
- **Dynamic instantiation via Device Tree (`OF`)**:
- `drivers/nvmem/core.c:815-816` in `nvmem_add_cells_from_dt()`:
```c
if (addr && len == (2 * sizeof(u32))) {
info.bit_offset = be32_to_cpup(addr++);
info.nbits = be32_to_cpup(addr);
if (info.bit_offset >= BITS_PER_BYTE * info.bytes ||
info.nbits < 1 ||
info.bit_offset + info.nbits > BITS_PER_BYTE * info.bytes) {
dev_err(dev, "nvmem: invalid bits on %pOF\n", child);
```
DT parsing specifically reads `bits = <bit_offset nbits>` for cells defined in DT nodes under nvmem providers!
- `drivers/nvmem/qfprom.c:343`:
```c
cell->bit_offset += byte_offset * BITS_PER_BYTE;
```
Adjusts `bit_offset` based on byte offsets (Qualcomm platform only).
#### 4. Architecture and Virtualization Feasibility (`amd64`)
- Target architecture: `amd64`.
- On `amd64`, standard platforms use ACPI rather than Device Tree by default. However:
- `CONFIG_OF` can be enabled on x86 (`CONFIG_OF_DYNAMIC`, `CONFIG_OF_OVERLAY`, Device Tree unittests).
- Can userspace (syzkaller) create or load device tree overlays via configfs (`CONFIG_OF_CONFIGFS`) or apply DT overlays to create nvmem cells?
- Does any virtual/emulated bus or driver accessible on x86 instantiate nvmem cells with bit offsets or allow user-controlled cell definitions?
- If no virtual device reachable on standard amd64 QEMU instantiates an nvmem cell with `bit_offset != 0` or `nbits != 0`, the modified code may be structurally unreachable during standard fuzzing runs.
- Conversely, if DT overlay injection, mock device drivers, or specific drivers (e.g. MTD emulation via `nandsim` / `mtdram` with DT) allow cell creation, the function could be reachable.
#### 5. Identified Critical Files and Symbols
- `drivers/nvmem/core.c`: Contains `nvmem_shift_read_buffer_in_place`, `__nvmem_cell_read`, `nvmem_cell_read`, `nvmem_cell_attr_read`, `nvmem_add_cells_from_dt`, `nvmem_populate_sysfs_cells`.
- `include/linux/nvmem-provider.h`: `struct nvmem_cell_info`, `struct nvmem_config`.
- `drivers/nvmem/Kconfig`: `CONFIG_NVMEM`, `CONFIG_NVMEM_SYSFS`.
#### 6. Next Steps and Active Hypotheses
- Hypotheses:
1. **Unreachable on standard amd64**: In standard virtualized amd64 QEMU, nvmem devices present (like `cmos_nvram` via `rtc-cmos`) do not register cells with `bit_offset` or `nbits`, and DT parsing (`nvmem_add_cells_from_dt`) requires an OF device tree node which is typically absent or non-instantiable on standard amd64 unless OF unittest/overlay configfs is loaded.
2. **Reachable via userspace / OF dynamic overlay / synthetic driver**: Check if syzkaller or userspace can define nvmem cells via any syscall/ioctl/sysfs mechanism or whether any driver compiled under amd64 creates cells with non-zero bit offsets.
- Action items:
- Check whether `nvmem_add_one_cell()` or any userspace-exposed interface allows adding cells at runtime without OF.
- Check `CONFIG_OF_CONFIGFS` and whether OF overlays can bind to nvmem.
- Check whether any x86 driver or module sets `cell_info.bit_offset`.
- Decide if `WorthFuzzing` is `false` (due to structural unreachability on amd64 / lack of emulated devices with bit-offset cells) or `true` (if an emulated/virtual path exists).Tokens: input: 45471 output: 2166 thoughts: 0 |
| 107/2 | 2026/09/22 17:31 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 23944 output: 18 thoughts: 0 |
| 108/2 | 2026/09/22 17:31 | tool | grepper |
0mArgs:{
"Expression": "\\.bit_offset"
}Results: {
"Output": "arch/x86/kernel/tboot.c=258=static void tboot_copy_fadt(const struct acpi_table_fadt *fadt)\n--\narch/x86/kernel/tboot.c-262-\ttbg.bit_width = g.bit_width;\t\t\\\narch/x86/kernel/tboot.c:263:\ttbg.bit_offset = g.bit_offset;\t\\\narch/x86/kernel/tboot.c-264-\ttbg.access_width = g.access_width;\t\\\n--\ndrivers/acpi/acpi_lpit.c=25=static int lpit_read_residency_counter_us(u64 *counter, bool io_mem)\n--\ndrivers/acpi/acpi_lpit.c-43-\tif (!err) {\ndrivers/acpi/acpi_lpit.c:44:\t\tu64 mask = GENMASK_ULL(residency_info_ffh.gaddr.bit_offset +\ndrivers/acpi/acpi_lpit.c-45-\t\t\t\t residency_info_ffh.gaddr. bit_width - 1,\ndrivers/acpi/acpi_lpit.c:46:\t\t\t\t residency_info_ffh.gaddr.bit_offset);\ndrivers/acpi/acpi_lpit.c-47-\ndrivers/acpi/acpi_lpit.c-48-\t\t*counter \u0026= mask;\ndrivers/acpi/acpi_lpit.c:49:\t\t*counter \u003e\u003e= residency_info_ffh.gaddr.bit_offset;\ndrivers/acpi/acpi_lpit.c-50-\t\t*counter = div64_u64(*counter * 1000000ULL, residency_info_ffh.frequency);\n--\ndrivers/acpi/acpica/rsdumpinfo.c=235=struct acpi_rsdump_info acpi_rs_dump_generic_reg[6] = {\n--\ndrivers/acpi/acpica/rsdumpinfo.c-241-\t NULL},\ndrivers/acpi/acpica/rsdumpinfo.c:242:\t{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(generic_reg.bit_offset), \"Bit Offset\",\ndrivers/acpi/acpica/rsdumpinfo.c-243-\t NULL},\n--\ndrivers/acpi/apei/apei-base.c=57=int __apei_exec_read_register(struct acpi_whea_header *entry, u64 *val)\n--\ndrivers/acpi/apei/apei-base.c-63-\t\treturn rc;\ndrivers/acpi/apei/apei-base.c:64:\t*val \u003e\u003e= entry-\u003eregister_region.bit_offset;\ndrivers/acpi/apei/apei-base.c-65-\t*val \u0026= entry-\u003emask;\n--\ndrivers/acpi/apei/apei-base.c=99=int __apei_exec_write_register(struct acpi_whea_header *entry, u64 val)\n--\ndrivers/acpi/apei/apei-base.c-103-\tval \u0026= entry-\u003emask;\ndrivers/acpi/apei/apei-base.c:104:\tval \u003c\u003c= entry-\u003eregister_region.bit_offset;\ndrivers/acpi/apei/apei-base.c-105-\tif (entry-\u003eflags \u0026 APEI_EXEC_PRESERVE_REGISTER) {\n--\ndrivers/acpi/apei/apei-base.c-109-\t\t\treturn rc;\ndrivers/acpi/apei/apei-base.c:110:\t\tvalr \u0026= ~(entry-\u003emask \u003c\u003c entry-\u003eregister_region.bit_offset);\ndrivers/acpi/apei/apei-base.c-111-\t\tval |= valr;\n--\ndrivers/acpi/apei/ghes.c=254=static void ghes_ack_error(struct acpi_hest_generic_v2 *gv2)\n--\ndrivers/acpi/apei/ghes.c-262-\ndrivers/acpi/apei/ghes.c:263:\tval \u0026= gv2-\u003eread_ack_preserve \u003c\u003c gv2-\u003eread_ack_register.bit_offset;\ndrivers/acpi/apei/ghes.c:264:\tval |= gv2-\u003eread_ack_write \u003c\u003c gv2-\u003eread_ack_register.bit_offset;\ndrivers/acpi/apei/ghes.c-265-\n--\ndrivers/acpi/processor_throttling.c=402=static int acpi_processor_get_throttling_control(struct acpi_processor *pr)\n--\ndrivers/acpi/processor_throttling.c-462-\tif ((throttling-\u003econtrol_register.bit_width +\ndrivers/acpi/processor_throttling.c:463:\t\tthrottling-\u003econtrol_register.bit_offset) \u003e 32) {\ndrivers/acpi/processor_throttling.c-464-\t\tpr_err(\"Invalid _PTC control register\\n\");\n--\ndrivers/acpi/processor_throttling.c-469-\tif ((throttling-\u003estatus_register.bit_width +\ndrivers/acpi/processor_throttling.c:470:\t\tthrottling-\u003estatus_register.bit_offset) \u003e 32) {\ndrivers/acpi/processor_throttling.c-471-\t\tpr_err(\"Invalid _PTC status register\\n\");\n--\ndrivers/acpi/processor_throttling.c=740=static int acpi_read_throttling_status(struct acpi_processor *pr,\n--\ndrivers/acpi/processor_throttling.c-752-\t\tbit_width = throttling-\u003estatus_register.bit_width;\ndrivers/acpi/processor_throttling.c:753:\t\tbit_offset = throttling-\u003estatus_register.bit_offset;\ndrivers/acpi/processor_throttling.c-754-\n--\ndrivers/acpi/processor_throttling.c=772=static int acpi_write_throttling_state(struct acpi_processor *pr,\n--\ndrivers/acpi/processor_throttling.c-784-\t\tbit_width = throttling-\u003econtrol_register.bit_width;\ndrivers/acpi/processor_throttling.c:785:\t\tbit_offset = throttling-\u003econtrol_register.bit_offset;\ndrivers/acpi/processor_throttling.c-786-\t\tptc_mask = (1 \u003c\u003c bit_width) - 1;\n--\ndrivers/cpufreq/pcc-cpufreq.c=390=static int __init pcc_cpufreq_evaluate(void)\n--\ndrivers/cpufreq/pcc-cpufreq.c-491-\tdoorbell.bit_width = reg_resource-\u003ebit_width;\ndrivers/cpufreq/pcc-cpufreq.c:492:\tdoorbell.bit_offset = reg_resource-\u003ebit_offset;\ndrivers/cpufreq/pcc-cpufreq.c-493-\tdoorbell.access_width = 4;\n--\ndrivers/cpufreq/pcc-cpufreq.c-497-\t\t\"bit_offset is %d, access_width is %d, address is 0x%llx\\n\",\ndrivers/cpufreq/pcc-cpufreq.c:498:\t\tdoorbell.space_id, doorbell.bit_width, doorbell.bit_offset,\ndrivers/cpufreq/pcc-cpufreq.c-499-\t\tdoorbell.access_width, reg_resource-\u003eaddress);\n--\ndrivers/gpu/nova-core/vbios.rs=480= fn from_id(image: \u0026PciAtBiosImage, token_id: u8) -\u003e Result\u003cSelf\u003e {\n--\ndrivers/gpu/nova-core/vbios.rs-484- // Offset to the first token entry\ndrivers/gpu/nova-core/vbios.rs:485: let tokens_start = image.bit_offset + usize::from(header.header_size);\ndrivers/gpu/nova-core/vbios.rs-486-\n--\ndrivers/md/dm-vdo/indexer/delta-index.c=986=static int restore_delta_list_data(struct delta_index *delta_index, unsigned int load_zone,\n--\ndrivers/md/dm-vdo/indexer/delta-index.c-1001-\t\t.tag = buffer[0],\ndrivers/md/dm-vdo/indexer/delta-index.c:1002:\t\t.bit_offset = buffer[1],\ndrivers/md/dm-vdo/indexer/delta-index.c-1003-\t\t.byte_count = get_unaligned_le16(\u0026buffer[2]),\n--\ndrivers/md/dm-vdo/indexer/delta-index.c-1006-\ndrivers/md/dm-vdo/indexer/delta-index.c:1007:\tif ((save_info.bit_offset \u003e= BITS_PER_BYTE) ||\ndrivers/md/dm-vdo/indexer/delta-index.c-1008-\t (save_info.byte_count \u003e DELTA_LIST_MAX_BYTE_COUNT)) {\n--\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c=1849=int qlcnic_sriov_set_vf_tx_rate(struct net_device *netdev, int vf,\n--\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c-1894-\t\tnic_info.min_tx_bw = min_tx_rate / 100;\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c:1895:\t\tnic_info.bit_offsets = BIT_0;\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c-1896-\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c=1762=int rt2800_config_shared_key(struct rt2x00_dev *rt2x00dev,\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-1792-\t */\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:1793:\tfield.bit_offset = 4 * (key-\u003ehw_key_idx % 8);\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:1794:\tfield.bit_mask = 0x7 \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-1795-\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c=12173=int rt2800_conf_tx(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-12205-\toffset = WMM_TXOP0_CFG + (sizeof(u32) * (!!(queue_idx \u0026 2)));\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:12206:\tfield.bit_offset = (queue_idx \u0026 1) * 16;\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:12207:\tfield.bit_mask = 0xffff \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-12208-\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-12213-\t/* Update WMM registers */\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:12214:\tfield.bit_offset = queue_idx * 4;\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:12215:\tfield.bit_mask = 0xf \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-12216-\n--\ndrivers/net/wireless/ralink/rt2x00/rt2x00reg.h=157=struct rt2x00_field32 {\n--\ndrivers/net/wireless/ralink/rt2x00/rt2x00reg.h-239-\t*(__reg) |= ((__value) \u003c\u003c\t\t\\\ndrivers/net/wireless/ralink/rt2x00/rt2x00reg.h:240:\t ((__field).bit_offset)) \u0026\t\t\\\ndrivers/net/wireless/ralink/rt2x00/rt2x00reg.h-241-\t ((__field).bit_mask);\t\t\\\n--\ndrivers/net/wireless/ralink/rt2x00/rt2x00reg.h-247-\t((__reg) \u0026 ((__field).bit_mask)) \u003e\u003e\t\\\ndrivers/net/wireless/ralink/rt2x00/rt2x00reg.h:248:\t ((__field).bit_offset);\t\t\\\ndrivers/net/wireless/ralink/rt2x00/rt2x00reg.h-249-})\n--\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c=2801=static int rt61pci_conf_tx(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c-2833-\toffset = AC_TXOP_CSR0 + (sizeof(u32) * (!!(queue_idx \u0026 2)));\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c:2834:\tfield.bit_offset = (queue_idx \u0026 1) * 16;\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c:2835:\tfield.bit_mask = 0xffff \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c-2836-\n--\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c-2841-\t/* Update WMM registers */\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c:2842:\tfield.bit_offset = queue_idx * 4;\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c:2843:\tfield.bit_mask = 0xf \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c-2844-\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c=256=static int rt73usb_config_shared_key(struct rt2x00_dev *rt2x00dev,\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-307-\t\tif (key-\u003ehw_key_idx \u003c 8) {\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:308:\t\t\tfield.bit_offset = (3 * key-\u003ehw_key_idx);\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:309:\t\t\tfield.bit_mask = 0x7 \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-310-\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-314-\t\t} else {\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:315:\t\t\tfield.bit_offset = (3 * (key-\u003ehw_key_idx - 8));\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:316:\t\t\tfield.bit_mask = 0x7 \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-317-\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c=2220=static int rt73usb_conf_tx(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-2252-\toffset = AC_TXOP_CSR0 + (sizeof(u32) * (!!(queue_idx \u0026 2)));\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:2253:\tfield.bit_offset = (queue_idx \u0026 1) * 16;\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:2254:\tfield.bit_mask = 0xffff \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-2255-\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-2260-\t/* Update WMM registers */\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:2261:\tfield.bit_offset = queue_idx * 4;\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:2262:\tfield.bit_mask = 0xf \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-2263-\n--\ndrivers/nvmem/core.c=792=int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)\n--\ndrivers/nvmem/core.c-814-\t\tif (addr \u0026\u0026 len == (2 * sizeof(u32))) {\ndrivers/nvmem/core.c:815:\t\t\tinfo.bit_offset = be32_to_cpup(addr++);\ndrivers/nvmem/core.c-816-\t\t\tinfo.nbits = be32_to_cpup(addr);\ndrivers/nvmem/core.c:817:\t\t\tif (info.bit_offset \u003e= BITS_PER_BYTE * info.bytes ||\ndrivers/nvmem/core.c-818-\t\t\t info.nbits \u003c 1 ||\ndrivers/nvmem/core.c:819:\t\t\t info.bit_offset + info.nbits \u003e BITS_PER_BYTE * info.bytes) {\ndrivers/nvmem/core.c-820-\t\t\t\tdev_err(dev, \"nvmem: invalid bits on %pOF\\n\", child);\n--\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c=327=static int aml_calc_reg_and_bit(struct pinctrl_gpio_range *range,\n--\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c-334-\t*bit = (pin - range-\u003epin_base) * aml_bit_strides[reg_type]\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c:335:\t\t+ bank-\u003epc.bit_offset[reg_type];\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c-336-\t*reg = (bank-\u003epc.reg_offset[reg_type] + (*bit / 32)) * 4;\n--\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c=939=static inline int aml_gpio_calc_reg_and_bit(struct aml_gpio_bank *bank,\n--\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c-944-{\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c:945:\t*bit = gpio * aml_bit_strides[reg_type] + bank-\u003epc.bit_offset[reg_type];\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c-946-\t*reg = (bank-\u003epc.reg_offset[reg_type] + (*bit / 32)) * 4;\n--\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c=1028=static void init_bank_register_bit(struct aml_pinctrl *info,\n--\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c-1036-\t\tbank-\u003epc.reg_offset[i] = aml_def_regoffs[i];\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c:1037:\t\tbank-\u003epc.bit_offset[i] = 0;\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c-1038-\t}\n--\ndrivers/pinctrl/sprd/pinctrl-sprd.c=985=static int sprd_pinctrl_add_pins(struct sprd_pinctrl *sprd_pctl,\n--\ndrivers/pinctrl/sprd/pinctrl-sprd.c-1010-\t\t\t\tPINCTRL_REG_LEN * reg;\ndrivers/pinctrl/sprd/pinctrl-sprd.c:1011:\t\t\tpin-\u003ebit_offset = sprd_soc_pin_info[i].bit_offset;\ndrivers/pinctrl/sprd/pinctrl-sprd.c-1012-\t\t\tpin-\u003ebit_width = sprd_soc_pin_info[i].bit_width;\n--\ndrivers/pinctrl/sprd/pinctrl-sprd.h=10=struct platform_device;\n--\ndrivers/pinctrl/sprd/pinctrl-sprd.h-30-\t\t.type = (((a) \u003e\u003e TYPE_OFFSET) \u0026 0xf),\t\t\\\ndrivers/pinctrl/sprd/pinctrl-sprd.h:31:\t\t.bit_offset = (((a) \u003e\u003e BIT_OFFSET) \u0026 0xff),\t\\\ndrivers/pinctrl/sprd/pinctrl-sprd.h-32-\t\t.bit_width = ((a) \u003e\u003e WIDTH_OFFSET \u0026 0xf),\t\\\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=96=static const struct nvmem_cell_info tegra114_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-100-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:101:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-102-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-106-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:107:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-108-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-112-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:113:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-114-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-118-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:119:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-120-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-124-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:125:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-126-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-130-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:131:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-132-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-136-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:137:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-138-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-142-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:143:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-144-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-148-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:149:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-150-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-154-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:155:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-156-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=234=static const struct nvmem_cell_info tegra124_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-238-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:239:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-240-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-244-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:245:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-246-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-250-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:251:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-252-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-256-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:257:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-258-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-262-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:263:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-264-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-268-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:269:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-270-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-274-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:275:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-276-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-280-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:281:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-282-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-286-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:287:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-288-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-292-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:293:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-294-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-298-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:299:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-300-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-304-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:305:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-306-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=394=static const struct nvmem_cell_info tegra210_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-398-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:399:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-400-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-404-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:405:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-406-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-410-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:411:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-412-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-416-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:417:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-418-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-422-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:423:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-424-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-428-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:429:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-430-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-434-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:435:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-436-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-440-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:441:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-442-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-446-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:447:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-448-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-452-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:453:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-454-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-458-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:459:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-460-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-464-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:465:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-466-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-470-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:471:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-472-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=565=static const struct nvmem_cell_info tegra186_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-569-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:570:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-571-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-575-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:576:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-577-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=624=static const struct nvmem_cell_info tegra194_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-628-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:629:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-630-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-634-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:635:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-636-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-640-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:641:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-642-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-646-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:647:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-648-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-652-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:653:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-654-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=717=static const struct nvmem_cell_info tegra234_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-721-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:722:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-723-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-727-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:728:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-729-\t\t.nbits = 32,\n--\ndrivers/xen/xen-acpi-processor.c=51=static int push_cxx_to_hypervisor(struct acpi_processor *_pr)\n--\ndrivers/xen/xen-acpi-processor.c-77-\t\t\tdst_cx-\u003ereg.bit_width = 8;\ndrivers/xen/xen-acpi-processor.c:78:\t\t\tdst_cx-\u003ereg.bit_offset = 0;\ndrivers/xen/xen-acpi-processor.c-79-\t\t\tdst_cx-\u003ereg.access_size = 1;\n--\ndrivers/xen/xen-acpi-processor.c-83-\t\t\t\t/* NATIVE_CSTATE_BEYOND_HALT */\ndrivers/xen/xen-acpi-processor.c:84:\t\t\t\tdst_cx-\u003ereg.bit_offset = 2;\ndrivers/xen/xen-acpi-processor.c-85-\t\t\t\tdst_cx-\u003ereg.bit_width = 1; /* VENDOR_INTEL */\n--\nsound/soc/codecs/cs35l41-lib.c=699=static const struct cs35l41_otp_map_element_t cs35l41_otp_map_map[] = {\n--\nsound/soc/codecs/cs35l41-lib.c-703-\t\t.num_elements = ARRAY_SIZE(otp_map_1),\nsound/soc/codecs/cs35l41-lib.c:704:\t\t.bit_offset = 16,\nsound/soc/codecs/cs35l41-lib.c-705-\t\t.word_offset = 2,\n--\nsound/soc/codecs/cs35l41-lib.c-710-\t\t.num_elements = ARRAY_SIZE(otp_map_2),\nsound/soc/codecs/cs35l41-lib.c:711:\t\t.bit_offset = 16,\nsound/soc/codecs/cs35l41-lib.c-712-\t\t.word_offset = 2,\n--\nsound/soc/codecs/cs35l41-lib.c-717-\t\t.num_elements = ARRAY_SIZE(otp_map_2),\nsound/soc/codecs/cs35l41-lib.c:718:\t\t.bit_offset = 16,\nsound/soc/codecs/cs35l41-lib.c-719-\t\t.word_offset = 2,\n--\nsound/soc/codecs/cs35l41-lib.c-724-\t\t.num_elements = ARRAY_SIZE(otp_map_2),\nsound/soc/codecs/cs35l41-lib.c:725:\t\t.bit_offset = 16,\nsound/soc/codecs/cs35l41-lib.c-726-\t\t.word_offset = 2,\n--\nsound/soc/codecs/cs35l41-lib.c-731-\t\t.num_elements = ARRAY_SIZE(otp_map_1),\nsound/soc/codecs/cs35l41-lib.c:732:\t\t.bit_offset = 16,\nsound/soc/codecs/cs35l41-lib.c-733-\t\t.word_offset = 2,\n"
} |
| 109/2 | 2026/09/22 17:31 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 35080 output: 45 thoughts: 0 |
| 110/2 | 2026/09/22 17:32 | tool | read-file |
0mArgs:{
"File": "sound/soc/codecs/cs35l41-lib.c",
"FirstLine": 698,
"LineCount": 40
}Results: {
"Contents": " 698:\t\n 699:\tstatic const struct cs35l41_otp_map_element_t cs35l41_otp_map_map[] = {\n 700:\t\t{\n 701:\t\t\t.id = 0x01,\n 702:\t\t\t.map = otp_map_1,\n 703:\t\t\t.num_elements = ARRAY_SIZE(otp_map_1),\n 704:\t\t\t.bit_offset = 16,\n 705:\t\t\t.word_offset = 2,\n 706:\t\t},\n 707:\t\t{\n 708:\t\t\t.id = 0x02,\n 709:\t\t\t.map = otp_map_2,\n 710:\t\t\t.num_elements = ARRAY_SIZE(otp_map_2),\n 711:\t\t\t.bit_offset = 16,\n 712:\t\t\t.word_offset = 2,\n 713:\t\t},\n 714:\t\t{\n 715:\t\t\t.id = 0x03,\n 716:\t\t\t.map = otp_map_2,\n 717:\t\t\t.num_elements = ARRAY_SIZE(otp_map_2),\n 718:\t\t\t.bit_offset = 16,\n 719:\t\t\t.word_offset = 2,\n 720:\t\t},\n 721:\t\t{\n 722:\t\t\t.id = 0x06,\n 723:\t\t\t.map = otp_map_2,\n 724:\t\t\t.num_elements = ARRAY_SIZE(otp_map_2),\n 725:\t\t\t.bit_offset = 16,\n 726:\t\t\t.word_offset = 2,\n 727:\t\t},\n 728:\t\t{\n 729:\t\t\t.id = 0x08,\n 730:\t\t\t.map = otp_map_1,\n 731:\t\t\t.num_elements = ARRAY_SIZE(otp_map_1),\n 732:\t\t\t.bit_offset = 16,\n 733:\t\t\t.word_offset = 2,\n 734:\t\t},\n 735:\t};\n 736:\t\n 737:\tstruct regmap_config cs35l41_regmap_i2c = {\n"
} |
| 111/2 | 2026/09/22 17:32 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 35731 output: 17 thoughts: 0 |
| 112/2 | 2026/09/22 17:32 | tool | grepper |
0mArgs:{
"Expression": "\\.nbits"
}Results: {
"Output": "arch/sparc/include/asm/adi_64.h=39=static inline unsigned long adi_nbits(void)\narch/sparc/include/asm/adi_64.h-40-{\narch/sparc/include/asm/adi_64.h:41:\treturn adi_state.caps.nbits;\narch/sparc/include/asm/adi_64.h-42-}\n--\narch/sparc/include/asm/elf_64.h=218=do {\t\t\t\t\t\t\t\t\t\\\n--\narch/sparc/include/asm/elf_64.h-223-\tNEW_AUX_ENT(AT_ADI_BLKSZ, adi_state.caps.blksz);\t\t\\\narch/sparc/include/asm/elf_64.h:224:\tNEW_AUX_ENT(AT_ADI_NBITS, adi_state.caps.nbits);\t\t\\\narch/sparc/include/asm/elf_64.h-225-\tNEW_AUX_ENT(AT_ADI_UEONADI, adi_state.caps.ue_on_adi);\t\t\\\n--\narch/sparc/kernel/adi_64.c=38=void __init mdesc_adi_init(void)\n--\narch/sparc/kernel/adi_64.c-92-\t\tgoto adi_not_found;\narch/sparc/kernel/adi_64.c:93:\tadi_state.caps.nbits = *val;\narch/sparc/kernel/adi_64.c-94-\n--\narch/sparc/kernel/adi_64.c-107-\t */\narch/sparc/kernel/adi_64.c:108:\tif (adi_state.caps.nbits \u003e 4) {\narch/sparc/kernel/adi_64.c-109-\t\tpr_warn(\"WARNING: ADI tag size \u003e4 on this platform. Disabling AADI support\\n\");\n--\narch/sparc/kernel/adi_64.c-118-\tadi_state.caps.blksz = 0;\narch/sparc/kernel/adi_64.c:119:\tadi_state.caps.nbits = 0;\narch/sparc/kernel/adi_64.c-120-\tif (hp)\n--\ncrypto/ecc_curve_defs.h=18=static struct ecc_curve nist_p192 = {\ncrypto/ecc_curve_defs.h-19-\t.name = \"nist_192\",\ncrypto/ecc_curve_defs.h:20:\t.nbits = 192,\ncrypto/ecc_curve_defs.h-21-\t.g = {\n--\ncrypto/ecc_curve_defs.h=45=static struct ecc_curve nist_p256 = {\ncrypto/ecc_curve_defs.h-46-\t.name = \"nist_256\",\ncrypto/ecc_curve_defs.h:47:\t.nbits = 256,\ncrypto/ecc_curve_defs.h-48-\t.g = {\n--\ncrypto/ecc_curve_defs.h=78=static struct ecc_curve nist_p384 = {\ncrypto/ecc_curve_defs.h-79-\t.name = \"nist_384\",\ncrypto/ecc_curve_defs.h:80:\t.nbits = 384,\ncrypto/ecc_curve_defs.h-81-\t.g = {\n--\ncrypto/ecc_curve_defs.h=123=static struct ecc_curve nist_p521 = {\ncrypto/ecc_curve_defs.h-124-\t.name = \"nist_521\",\ncrypto/ecc_curve_defs.h:125:\t.nbits = 521,\ncrypto/ecc_curve_defs.h-126-\t.g = {\n--\ncrypto/ecc_curve_defs.h=144=static const struct ecc_curve ecc_25519 = {\ncrypto/ecc_curve_defs.h-145-\t.name = \"curve25519\",\ncrypto/ecc_curve_defs.h:146:\t.nbits = 255,\ncrypto/ecc_curve_defs.h-147-\t.g = {\n--\ncrypto/ecrdsa_defs.h=48=static struct ecc_curve gost_cp256a = {\ncrypto/ecrdsa_defs.h-49-\t.name = \"cp256a\",\ncrypto/ecrdsa_defs.h:50:\t.nbits = 256,\ncrypto/ecrdsa_defs.h-51-\t.g = {\n--\ncrypto/ecrdsa_defs.h=82=static struct ecc_curve gost_cp256b = {\ncrypto/ecrdsa_defs.h-83-\t.name = \"cp256b\",\ncrypto/ecrdsa_defs.h:84:\t.nbits = 256,\ncrypto/ecrdsa_defs.h-85-\t.g = {\n--\ncrypto/ecrdsa_defs.h=120=static struct ecc_curve gost_cp256c = {\ncrypto/ecrdsa_defs.h-121-\t.name = \"cp256c\",\ncrypto/ecrdsa_defs.h:122:\t.nbits = 256,\ncrypto/ecrdsa_defs.h-123-\t.g = {\n--\ncrypto/ecrdsa_defs.h=170=static struct ecc_curve gost_tc512a = {\ncrypto/ecrdsa_defs.h-171-\t.name = \"tc512a\",\ncrypto/ecrdsa_defs.h:172:\t.nbits = 512,\ncrypto/ecrdsa_defs.h-173-\t.g = {\n--\ncrypto/ecrdsa_defs.h=216=static struct ecc_curve gost_tc512b = {\ncrypto/ecrdsa_defs.h-217-\t.name = \"tc512b\",\ncrypto/ecrdsa_defs.h:218:\t.nbits = 512,\ncrypto/ecrdsa_defs.h-219-\t.g = {\n--\ndrivers/nvmem/core.c=792=int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)\n--\ndrivers/nvmem/core.c-815-\t\t\tinfo.bit_offset = be32_to_cpup(addr++);\ndrivers/nvmem/core.c:816:\t\t\tinfo.nbits = be32_to_cpup(addr);\ndrivers/nvmem/core.c-817-\t\t\tif (info.bit_offset \u003e= BITS_PER_BYTE * info.bytes ||\ndrivers/nvmem/core.c:818:\t\t\t info.nbits \u003c 1 ||\ndrivers/nvmem/core.c:819:\t\t\t info.bit_offset + info.nbits \u003e BITS_PER_BYTE * info.bytes) {\ndrivers/nvmem/core.c-820-\t\t\t\tdev_err(dev, \"nvmem: invalid bits on %pOF\\n\", child);\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=96=static const struct nvmem_cell_info tegra114_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-101-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:102:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-103-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-107-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:108:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-109-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-113-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:114:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-115-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-119-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:120:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-121-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-125-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:126:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-127-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-131-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:132:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-133-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-137-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:138:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-139-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-143-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:144:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-145-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-149-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:150:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-151-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-155-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:156:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-157-\t},\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=234=static const struct nvmem_cell_info tegra124_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-239-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:240:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-241-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-245-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:246:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-247-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-251-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:252:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-253-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-257-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:258:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-259-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-263-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:264:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-265-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-269-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:270:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-271-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-275-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:276:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-277-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-281-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:282:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-283-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-287-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:288:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-289-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-293-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:294:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-295-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-299-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:300:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-301-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-305-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:306:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-307-\t},\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=394=static const struct nvmem_cell_info tegra210_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-399-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:400:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-401-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-405-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:406:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-407-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-411-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:412:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-413-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-417-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:418:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-419-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-423-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:424:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-425-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-429-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:430:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-431-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-435-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:436:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-437-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-441-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:442:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-443-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-447-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:448:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-449-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-453-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:454:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-455-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-459-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:460:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-461-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-465-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:466:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-467-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-471-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:472:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-473-\t},\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=565=static const struct nvmem_cell_info tegra186_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-570-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:571:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-572-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-576-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:577:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-578-\t},\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=624=static const struct nvmem_cell_info tegra194_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-629-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:630:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-631-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-635-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:636:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-637-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-641-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:642:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-643-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-647-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:648:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-649-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-653-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:654:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-655-\t},\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=717=static const struct nvmem_cell_info tegra234_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-722-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:723:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-724-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-728-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:729:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-730-\t},\n--\nfs/ntfs3/fsntfs.c=585=int ntfs_look_free_mft(struct ntfs_sb_info *sbi, CLST *rno, bool mft,\n--\nfs/ntfs3/fsntfs.c-728-\t\tfor (;;) {\nfs/ntfs3/fsntfs.c:729:\t\t\tif (sbi-\u003emft.next_free \u003e= sbi-\u003emft.bitmap.nbits) {\nfs/ntfs3/fsntfs.c-730-\t\t\t} else if (!wnd_find(wnd, 1, MFT_REC_USER, 0, \u0026fr)) {\nfs/ntfs3/fsntfs.c:731:\t\t\t\tsbi-\u003emft.next_free = sbi-\u003emft.bitmap.nbits;\nfs/ntfs3/fsntfs.c-732-\t\t\t} else {\n--\nfs/ntfs3/fsntfs.c=842=int ntfs_refresh_zone(struct ntfs_sb_info *sbi)\n--\nfs/ntfs3/fsntfs.c-853-\tvcn = bytes_to_cluster(sbi,\nfs/ntfs3/fsntfs.c:854:\t\t\t (u64)sbi-\u003emft.bitmap.nbits \u003c\u003c sbi-\u003erecord_bits);\nfs/ntfs3/fsntfs.c-855-\n--\nfs/ntfs3/record.c=198=struct ATTRIB *mi_enum_attr(struct ntfs_inode *ni, struct mft_inode *mi,\n--\nfs/ntfs3/record.c-319-\t * For a non-empty attribute evcn is a cluster index and must lie\nfs/ntfs3/record.c:320:\t * within the volume (sbi-\u003eused.bitmap.nbits, set up in\nfs/ntfs3/record.c-321-\t * ntfs_init_from_boot() before any caller of mi_enum_attr() runs).\n--\nfs/ntfs3/record.c-340-\t\t/* Check out of volume for normal attribute. */\nfs/ntfs3/record.c:341:\t\tif (evcn != U64_MAX \u0026\u0026 evcn \u003e= mi-\u003esbi-\u003eused.bitmap.nbits)\nfs/ntfs3/record.c-342-\t\t\tgoto out;\n--\nfs/ntfs3/run.c=1026=int run_unpack(struct runs_tree *run, struct ntfs_sb_info *sbi, CLST ino,\n--\nfs/ntfs3/run.c-1132-\t\t\t\treturn -EINVAL;\nfs/ntfs3/run.c:1133:\t\t\tif (lcn_end \u003e sbi-\u003eused.bitmap.nbits) {\nfs/ntfs3/run.c-1134-\t\t\t\t/* LCN range is out of volume. */\n--\nfs/ntfs3/super.c=497=static int ntfs3_volinfo(struct seq_file *m, void *o)\n--\nfs/ntfs3/super.c-503-\t\t sbi-\u003evolume.major_ver, sbi-\u003evolume.minor_ver,\nfs/ntfs3/super.c:504:\t\t sbi-\u003ecluster_size, sbi-\u003eused.bitmap.nbits,\nfs/ntfs3/super.c:505:\t\t sbi-\u003emft.bitmap.nbits,\nfs/ntfs3/super.c:506:\t\t sbi-\u003emft.bitmap.nbits - wnd_zeroes(\u0026sbi-\u003emft.bitmap),\nfs/ntfs3/super.c-507-\t\t sbi-\u003evolume.real_dirty ? \"dirty\" : \"clean\",\n--\nfs/ntfs3/super.c=968=static int ntfs_init_from_boot(struct super_block *sb, u32 sector_size,\n--\nfs/ntfs3/super.c-1179-\nfs/ntfs3/super.c:1180:\tsbi-\u003eused.bitmap.nbits = clusters;\nfs/ntfs3/super.c-1181-\n--\nfs/ntfs3/super.c=1267=static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)\n--\nfs/ntfs3/super.c-1516-\t/* Check bitmap boundary. */\nfs/ntfs3/super.c:1517:\ttt = sbi-\u003eused.bitmap.nbits;\nfs/ntfs3/super.c-1518-\tif (inode-\u003ei_size \u003c ntfs3_bitmap_size(tt)) {\n--\ninclude/sound/soc.h=33=struct platform_device;\n--\ninclude/sound/soc.h-385-\t.private_value = (unsigned long)\u0026(struct soc_mreg_control) \\\ninclude/sound/soc.h:386:\t\t{.regbase = xregbase, .regcount = xregcount, .nbits = xnbits, \\\ninclude/sound/soc.h-387-\t\t.invert = xinvert, .min = xmin, .max = xmax} }\n--\nlib/bitmap-str.c=341=int bitmap_parselist(const char *buf, unsigned long *maskp, int nmaskbits)\n--\nlib/bitmap-str.c-345-\nlib/bitmap-str.c:346:\tr.nbits = nmaskbits;\nlib/bitmap-str.c:347:\tbitmap_zero(maskp, r.nbits);\nlib/bitmap-str.c-348-\n--\nlib/find_bit_benchmark_rust.rs=64=fn find_bit_test() {\n--\nlib/find_bit_benchmark_rust.rs-77- let nbits = BITMAP_LEN / SPARSENESS;\nlib/find_bit_benchmark_rust.rs:78: for _i in 0..nbits {\nlib/find_bit_benchmark_rust.rs-79- // SAFETY: __get_random_u32_below is safe to call with any u32 argument.\n--\nlib/test_bitmap.c=534=static void __init test_bitmap_parselist(void)\n--\nlib/test_bitmap.c-544-\t\ttime = ktime_get();\nlib/test_bitmap.c:545:\t\terr = bitmap_parselist(ptest.in, bmap, ptest.nbits);\nlib/test_bitmap.c-546-\t\ttime = ktime_get() - time;\n--\nlib/test_bitmap.c-555-\t\tif (!err \u0026\u0026 ptest.expected\nlib/test_bitmap.c:556:\t\t\t \u0026\u0026 !__bitmap_equal(bmap, ptest.expected, ptest.nbits)) {\nlib/test_bitmap.c-557-\t\t\tpr_err(\"parselist: %d: input is %s, result is 0x%lx, expected 0x%lx\\n\",\n--\nlib/test_bitmap.c=649=static void __init test_bitmap_parse(void)\n--\nlib/test_bitmap.c-660-\t\ttime = ktime_get();\nlib/test_bitmap.c:661:\t\terr = bitmap_parse(test.in, len, bmap, test.nbits);\nlib/test_bitmap.c-662-\t\ttime = ktime_get() - time;\n--\nlib/test_bitmap.c-671-\t\tif (!err \u0026\u0026 test.expected\nlib/test_bitmap.c:672:\t\t\t \u0026\u0026 !__bitmap_equal(bmap, test.expected, test.nbits)) {\nlib/test_bitmap.c-673-\t\t\tpr_err(\"parse: %d: input is %s, result is 0x%lx, expected 0x%lx\\n\",\n--\nrust/kernel/bitmap.rs=164= fn deref(\u0026self) -\u003e \u0026Bitmap {\nrust/kernel/bitmap.rs:165: let ptr = if self.nbits \u003c= BitmapVec::MAX_INLINE_LEN {\nrust/kernel/bitmap.rs-166- // SAFETY: Bitmap is represented inline.\n--\nrust/kernel/bitmap.rs-177- // An inline bitmap is treated like an array with single element.\nrust/kernel/bitmap.rs:178: unsafe { Bitmap::from_raw(ptr, self.nbits) }\nrust/kernel/bitmap.rs-179- }\n--\nrust/kernel/bitmap.rs=183= fn deref_mut(\u0026mut self) -\u003e \u0026mut Bitmap {\nrust/kernel/bitmap.rs:184: let ptr = if self.nbits \u003c= BitmapVec::MAX_INLINE_LEN {\nrust/kernel/bitmap.rs-185- // SAFETY: Bitmap is represented inline.\n--\nrust/kernel/bitmap.rs-196- // An inline bitmap is treated like an array with single element.\nrust/kernel/bitmap.rs:197: unsafe { Bitmap::from_raw_mut(ptr, self.nbits) }\nrust/kernel/bitmap.rs-198- }\n--\nrust/kernel/bitmap.rs=213= fn drop(\u0026mut self) {\nrust/kernel/bitmap.rs:214: if self.nbits \u003c= BitmapVec::MAX_INLINE_LEN {\nrust/kernel/bitmap.rs-215- return;\n--\nrust/kernel/bitmap.rs=272= pub fn len(\u0026self) -\u003e usize {\nrust/kernel/bitmap.rs:273: self.nbits\nrust/kernel/bitmap.rs-274- }\n--\nrust/kernel/bitmap.rs=278= pub fn fill_random(\u0026mut self) {\n--\nrust/kernel/bitmap.rs-283- self.as_mut_ptr().cast::\u003cffi::c_void\u003e(),\nrust/kernel/bitmap.rs:284: usize::div_ceil(self.nbits, bindings::BITS_PER_LONG as usize)\nrust/kernel/bitmap.rs-285- * bindings::BITS_PER_LONG as usize\n--\nrust/kernel/bitmap.rs=292=impl Bitmap {\n--\nrust/kernel/bitmap.rs-298- /// If CONFIG_RUST_BITMAP_HARDENED is not enabled and `index` is greater than\nrust/kernel/bitmap.rs:299: /// or equal to `self.nbits`, does nothing.\nrust/kernel/bitmap.rs-300- ///\n--\nrust/kernel/bitmap.rs-303- /// Panics if CONFIG_RUST_BITMAP_HARDENED is enabled and `index` is greater than\nrust/kernel/bitmap.rs:304: /// or equal to `self.nbits`.\nrust/kernel/bitmap.rs-305- #[inline]\n--\nrust/kernel/bitmap.rs=450= pub fn last_bit(\u0026self) -\u003e Option\u003cusize\u003e {\n--\nrust/kernel/bitmap.rs-461- ///\nrust/kernel/bitmap.rs:462: /// Returns `None` if `start` is greater or equal to `self.nbits`.\nrust/kernel/bitmap.rs-463- #[inline]\n--\nsound/soc/fsl/fsl_easrc.c=126=static int fsl_easrc_set_reg(struct snd_kcontrol *kcontrol,\n--\nsound/soc/fsl/fsl_easrc.c-190-\t.private_value = (unsigned long)\u0026(struct soc_mreg_control) \\\nsound/soc/fsl/fsl_easrc.c:191:\t\t{ .regbase = xreg, .regcount = 1, .nbits = 32, \\\nsound/soc/fsl/fsl_easrc.c-192-\t\t .invert = 0, .min = 0, .max = 0xffffffff, } }\n--\nsound/soc/fsl/fsl_easrc.c-199-\t.private_value = (unsigned long)\u0026(struct soc_mreg_control) \\\nsound/soc/fsl/fsl_easrc.c:200:\t\t{ .regbase = xreg, .regcount = 1, .nbits = 32, \\\nsound/soc/fsl/fsl_easrc.c-201-\t\t .invert = 0, .min = 0, .max = 2, } }\n--\nsound/soc/fsl/fsl_utils.h=30=void fsl_asoc_constrain_rates(struct snd_pcm_hw_constraint_list *target_constr,\n--\nsound/soc/fsl/fsl_utils.h-42-\t.private_value = (unsigned long)\u0026(struct soc_mreg_control) \\\nsound/soc/fsl/fsl_utils.h:43:\t\t{.regbase = xregbase, .regcount = xregcount, .nbits = xnbits, \\\nsound/soc/fsl/fsl_utils.h-44-\t\t.invert = xinvert, .min = xmin, .max = xmax} }\n--\nsound/soc/tegra/tegra186_asrc.c=652=ASRC_SOURCE_DECL(src_select6, 5);\n--\nsound/soc/tegra/tegra186_asrc.c-665-\t\t.regcount\t= 1,\t\t\t\t\t\\\nsound/soc/tegra/tegra186_asrc.c:666:\t\t.nbits\t\t= 32,\t\t\t\t\t\\\nsound/soc/tegra/tegra186_asrc.c-667-\t\t.invert\t\t= 0,\t\t\t\t\t\\\n--\ntools/perf/builtin-record.c=1049=static int record__thread_data_init_maps(struct record_thread *thread_data, struct evlist *evlist)\n--\ntools/perf/builtin-record.c-1060-\t\tthread_data-\u003enr_mmaps = bitmap_weight(thread_data-\u003emask-\u003emaps.bits,\ntools/perf/builtin-record.c:1061:\t\t\t\t\t\t thread_data-\u003emask-\u003emaps.nbits);\ntools/perf/builtin-record.c-1062-\tif (mmap) {\n--\ntools/perf/builtin-record.c=1566=static void record__adjust_affinity(struct record *rec, struct mmap *map)\n--\ntools/perf/builtin-record.c-1569-\t !bitmap_equal(thread-\u003emask-\u003eaffinity.bits, map-\u003eaffinity_mask.bits,\ntools/perf/builtin-record.c:1570:\t\t\t thread-\u003emask-\u003eaffinity.nbits)) {\ntools/perf/builtin-record.c:1571:\t\tbitmap_zero(thread-\u003emask-\u003eaffinity.bits, thread-\u003emask-\u003eaffinity.nbits);\ntools/perf/builtin-record.c-1572-\t\tbitmap_or(thread-\u003emask-\u003eaffinity.bits, thread-\u003emask-\u003eaffinity.bits,\ntools/perf/builtin-record.c:1573:\t\t\t map-\u003eaffinity_mask.bits, thread-\u003emask-\u003eaffinity.nbits);\ntools/perf/builtin-record.c-1574-\t\tsched_setaffinity(0, MMAP_CPU_MASK_BYTES(\u0026thread-\u003emask-\u003eaffinity),\n--\ntools/perf/builtin-record.c=3780=static int record__init_thread_masks_spec(struct record *rec, struct perf_cpu_map *cpus,\n--\ntools/perf/builtin-record.c-3826-\t\tif (!bitmap_and(thread_mask.maps.bits, thread_mask.maps.bits,\ntools/perf/builtin-record.c:3827:\t\t\t\tcpus_mask.bits, thread_mask.maps.nbits)) {\ntools/perf/builtin-record.c-3828-\t\t\tpr_err(\"Empty maps mask: %s\\n\", maps_spec[s]);\n--\ntools/perf/builtin-record.c-3832-\t\tif (!bitmap_and(thread_mask.affinity.bits, thread_mask.affinity.bits,\ntools/perf/builtin-record.c:3833:\t\t\t\tcpus_mask.bits, thread_mask.affinity.nbits)) {\ntools/perf/builtin-record.c-3834-\t\t\tpr_err(\"Empty affinity mask: %s\\n\", affinity_spec[s]);\n--\ntools/perf/builtin-record.c-3840-\t\tif (bitmap_intersects(thread_mask.maps.bits, full_mask.maps.bits,\ntools/perf/builtin-record.c:3841:\t\t\t\t thread_mask.maps.nbits)) {\ntools/perf/builtin-record.c-3842-\t\t\tpr_err(\"Intersecting maps mask: %s\\n\", maps_spec[s]);\n--\ntools/perf/builtin-record.c-3846-\t\tif (bitmap_intersects(thread_mask.affinity.bits, full_mask.affinity.bits,\ntools/perf/builtin-record.c:3847:\t\t\t\t thread_mask.affinity.nbits)) {\ntools/perf/builtin-record.c-3848-\t\t\tpr_err(\"Intersecting affinity mask: %s\\n\", affinity_spec[s]);\n--\ntools/perf/builtin-record.c-3853-\t\tbitmap_or(full_mask.maps.bits, full_mask.maps.bits,\ntools/perf/builtin-record.c:3854:\t\t\t thread_mask.maps.bits, full_mask.maps.nbits);\ntools/perf/builtin-record.c-3855-\t\tbitmap_or(full_mask.affinity.bits, full_mask.affinity.bits,\ntools/perf/builtin-record.c:3856:\t\t\t thread_mask.affinity.bits, full_mask.maps.nbits);\ntools/perf/builtin-record.c-3857-\n--\ntools/perf/util/mmap.c=238=void mmap__munmap(struct mmap *map)\n--\ntools/perf/util/mmap.c-241-\tmap-\u003eaffinity_mask.bits = NULL;\ntools/perf/util/mmap.c:242:\tmap-\u003eaffinity_mask.nbits = 0;\ntools/perf/util/mmap.c-243-\n--\ntools/perf/util/mmap.c=272=static int perf_mmap__setup_affinity_mask(struct mmap *map, struct mmap_params *mp)\ntools/perf/util/mmap.c-273-{\ntools/perf/util/mmap.c:274:\tmap-\u003eaffinity_mask.nbits = cpu__max_cpu().cpu;\ntools/perf/util/mmap.c:275:\tmap-\u003eaffinity_mask.bits = bitmap_zalloc(map-\u003eaffinity_mask.nbits);\ntools/perf/util/mmap.c-276-\tif (!map-\u003eaffinity_mask.bits)\n"
} |
| 113/2 | 2026/09/22 17:32 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 46616 output: 37 thoughts: 383 Thoughts: **Analyzing the `nvmem_shift_read_buffer_in_place` Function**
Okay, let's dissect this. I'm starting with `nvmem_shift_read_buffer_in_place()` located in `drivers/nvmem/core.c`. My immediate question is, how is this function reached? I need to trace its call path. I'm focusing on the implementation first:
```c
static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)
{
u8 *p, *b;
int i, extra_offset, bytes_offset;
u8 bit_offset = cell->bit_offset;
bytes_offset = bit_offset / BITS_PER_BYTE;
b = buf + bytes_offset;
bit_offset %= BITS_PER_BYTE;
if (bit_offset) {
...
```
Right, it takes a `nvmem_cell_entry` and a buffer as input. The core functionality seems to involve bit shifting within the buffer, adjusting for `bit_offset`. The key parameters here are `bit_offset` and `nbits` within the `cell` structure. It looks like it handles cases where the data isn't byte-aligned, which isn't unusual with NVM interfaces.
Now, let's find the callers. I'll check where `nvmem_shift_read_buffer_in_place` is actually invoked. Ah, it's called within `__nvmem_cell_read()`, in the same file. I see the condition:
```c
static int __nvmem_cell_read(struct nvmem_device *nvmem,
struct nvmem_cell_entry *cell,
void *buf, size_t *len, const char *id, int index)
{
...
if (cell->bit_offset || cell->nbits)
nvmem_shift_read_buffer_in_place(cell, buf);
```
Okay, so it's called *conditionally*. The function is invoked only when `cell->bit_offset` or `cell->nbits` is non-zero. That makes sense, because it is only necessary when you are dealing with a non-byte aligned access, or if the number of bits to read is less than a byte. So, if either the read starts at a bit offset *within* a byte, or if the read doesn't involve a whole number of bytes, the shift function is called. This is precisely to handle those non-byte-aligned reads. I can now understand the purpose of this function and the conditions that determine when it's needed. I'm ready to move on.
|
| 114/2 | 2026/09/22 17:32 | tool | read-file |
0mArgs:{
"File": "drivers/nvmem/core.c",
"FirstLine": 1584,
"LineCount": 50
}Results: {
"Contents": "1584:\tstatic void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)\n1585:\t{\n1586:\t\tu8 *p, *b;\n1587:\t\tint i, extra, bytes_offset;\n1588:\t\tint bit_offset = cell-\u003ebit_offset;\n1589:\t\n1590:\t\tp = b = buf;\n1591:\t\n1592:\t\tbytes_offset = bit_offset / BITS_PER_BYTE;\n1593:\t\tb += bytes_offset;\n1594:\t\tbit_offset %= BITS_PER_BYTE;\n1595:\t\n1596:\t\tif (bit_offset % BITS_PER_BYTE) {\n1597:\t\t\t/* First shift */\n1598:\t\t\t*p = *b++ \u003e\u003e bit_offset;\n1599:\t\n1600:\t\t\t/* setup rest of the bytes if any */\n1601:\t\t\tfor (i = 1; i \u003c (cell-\u003ebytes - bytes_offset); i++) {\n1602:\t\t\t\t/* Get bits from next byte and shift them towards msb */\n1603:\t\t\t\t*p++ |= *b \u003c\u003c (BITS_PER_BYTE - bit_offset);\n1604:\t\n1605:\t\t\t\t*p = *b++ \u003e\u003e bit_offset;\n1606:\t\t\t}\n1607:\t\t\t/* point to end of the buffer unused bits will be cleared */\n1608:\t\t\tp = buf + cell-\u003ebytes - 1;\n1609:\t\t} else if (p != b) {\n1610:\t\t\tmemmove(p, b, cell-\u003ebytes - bytes_offset);\n1611:\t\t\tp += cell-\u003ebytes - 1;\n1612:\t\t} else {\n1613:\t\t\t/* point to the msb */\n1614:\t\t\tp += cell-\u003ebytes - 1;\n1615:\t\t}\n1616:\t\n1617:\t\t/* result fits in less bytes */\n1618:\t\textra = cell-\u003ebytes - DIV_ROUND_UP(cell-\u003enbits, BITS_PER_BYTE);\n1619:\t\twhile (--extra \u003e= 0)\n1620:\t\t\t*p-- = 0;\n1621:\t\n1622:\t\t/* clear msb bits if any leftover in the last byte */\n1623:\t\tif (cell-\u003enbits % BITS_PER_BYTE)\n1624:\t\t\t*p \u0026= GENMASK((cell-\u003enbits % BITS_PER_BYTE) - 1, 0);\n1625:\t}\n1626:\t\n1627:\tstatic int __nvmem_cell_read(struct nvmem_device *nvmem,\n1628:\t\t\t\t struct nvmem_cell_entry *cell,\n1629:\t\t\t\t void *buf, size_t *len, const char *id, int index)\n1630:\t{\n1631:\t\tint rc;\n1632:\t\n1633:\t\trc = nvmem_reg_read(nvmem, cell-\u003eoffset, buf, cell-\u003eraw_len);\n"
} |
| 115/2 | 2026/09/22 17:32 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 48456 output: 21 thoughts: 60 Thoughts: Okay, let's break this down. As an expert in this area, I need to understand how `cell->bit_offset` or `cell->nbits` are being initialized within a kernel running on an `amd64` architecture. **Tracing the Initialization of Cell Bit Fields** My initial thought is to perform a code inspection, a thorough search. I need to identify all code paths where these specific fields, `cell->bit_offset` and `cell->nbits`, are *assigned* values. I'll need to meticulously examine the code to trace these assignments. I'll need to know which functions are involved and consider the data dependencies to understand the context. This will likely involve cross-referencing and understanding the control flow within this kernel environment. It's a fundamental step to understanding the system's behavior. |
| 116/2 | 2026/09/22 17:32 | tool | grepper |
0mArgs:{
"Expression": "-\u003ebit_offset\\s*="
}Results: {
"Output": "drivers/acpi/acpica/tbfadt.c=158=acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,\n--\ndrivers/acpi/acpica/tbfadt.c-196-\tgeneric_address-\u003ebit_width = bit_width;\ndrivers/acpi/acpica/tbfadt.c:197:\tgeneric_address-\u003ebit_offset = 0;\ndrivers/acpi/acpica/tbfadt.c-198-\tgeneric_address-\u003eaccess_width = 0;\t/* Access width ANY */\n--\ndrivers/acpi/cppc_acpi.c=94=static DEFINE_PER_CPU(struct cpc_desc *, cpc_desc_ptr);\n--\ndrivers/acpi/cppc_acpi.c-123-\t\t\t\t(reg)-\u003ebit_width == 0 \u0026\u0026\t\t\\\ndrivers/acpi/cppc_acpi.c:124:\t\t\t\t(reg)-\u003ebit_offset == 0 \u0026\u0026\t\t\\\ndrivers/acpi/cppc_acpi.c-125-\t\t\t\t(reg)-\u003eaccess_width == 0)\n--\ndrivers/block/drbd/drbd_main.c=1081=static int fill_bitmap_rle_bits(struct drbd_device *device,\n--\ndrivers/block/drbd/drbd_main.c-1153-\t\tplain_bits += rl;\ndrivers/block/drbd/drbd_main.c:1154:\t\tc-\u003ebit_offset = tmp;\ndrivers/block/drbd/drbd_main.c-1155-\t} while (c-\u003ebit_offset \u003c c-\u003ebm_bits);\n--\ndrivers/block/drbd/drbd_main.c-1163-\t\tbm_xfer_ctx_bit_to_word_offset(c);\ndrivers/block/drbd/drbd_main.c:1164:\t\tc-\u003ebit_offset = c-\u003eword_offset * BITS_PER_LONG;\ndrivers/block/drbd/drbd_main.c-1165-\t\treturn 0;\n--\ndrivers/block/drbd/drbd_main.c=1185=send_bitmap_rle_or_plain(struct drbd_peer_device *peer_device, struct bm_xfer_ctx *c)\n--\ndrivers/block/drbd/drbd_main.c-1223-\t\tc-\u003eword_offset += num_words;\ndrivers/block/drbd/drbd_main.c:1224:\t\tc-\u003ebit_offset = c-\u003eword_offset * BITS_PER_LONG;\ndrivers/block/drbd/drbd_main.c-1225-\n--\ndrivers/block/drbd/drbd_main.c-1229-\t\tif (c-\u003ebit_offset \u003e c-\u003ebm_bits)\ndrivers/block/drbd/drbd_main.c:1230:\t\t\tc-\u003ebit_offset = c-\u003ebm_bits;\ndrivers/block/drbd/drbd_main.c-1231-\t}\n--\ndrivers/block/drbd/drbd_receiver.c=4454=receive_bitmap_plain(struct drbd_peer_device *peer_device, unsigned int size,\n--\ndrivers/block/drbd/drbd_receiver.c-4476-\tc-\u003eword_offset += num_words;\ndrivers/block/drbd/drbd_receiver.c:4477:\tc-\u003ebit_offset = c-\u003eword_offset * BITS_PER_LONG;\ndrivers/block/drbd/drbd_receiver.c-4478-\tif (c-\u003ebit_offset \u003e c-\u003ebm_bits)\ndrivers/block/drbd/drbd_receiver.c:4479:\t\tc-\u003ebit_offset = c-\u003ebm_bits;\ndrivers/block/drbd/drbd_receiver.c-4480-\n--\ndrivers/block/drbd/drbd_receiver.c=4506=recv_bm_rle_bits(struct drbd_peer_device *peer_device,\n--\ndrivers/block/drbd/drbd_receiver.c-4561-\ndrivers/block/drbd/drbd_receiver.c:4562:\tc-\u003ebit_offset = s;\ndrivers/block/drbd/drbd_receiver.c-4563-\tbm_xfer_ctx_bit_to_word_offset(c);\n--\ndrivers/clk/ti/clkctrl.c=224=static struct clk_hw *_ti_omap4_clkctrl_xlate(struct of_phandle_args *clkspec,\n--\ndrivers/clk/ti/clkctrl.c-237-\t\tif (iter-\u003ereg_offset == clkspec-\u003eargs[0] \u0026\u0026\ndrivers/clk/ti/clkctrl.c:238:\t\t iter-\u003ebit_offset == clkspec-\u003eargs[1]) {\ndrivers/clk/ti/clkctrl.c-239-\t\t\tentry = iter;\n--\ndrivers/clk/ti/clkctrl.c=285=_ti_clkctrl_clk_register(struct omap_clkctrl_provider *provider,\n--\ndrivers/clk/ti/clkctrl.c-318-\tclkctrl_clk-\u003ereg_offset = offset;\ndrivers/clk/ti/clkctrl.c:319:\tclkctrl_clk-\u003ebit_offset = bit;\ndrivers/clk/ti/clkctrl.c-320-\tclkctrl_clk-\u003eclk = clk_hw;\n--\ndrivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c=151=nvkm_bios_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,\n--\ndrivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c-188-\ndrivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c:189:\tbios-\u003ebit_offset = nvbios_findstr(bios-\u003edata, bios-\u003esize,\ndrivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c-190-\t\t\t\t\t \"\\xff\\xb8\"\"BIT\", 5);\n--\ndrivers/nvmem/core.c=581=static int nvmem_cell_info_to_nvmem_cell_entry_nodup(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-592-\ndrivers/nvmem/core.c:593:\tcell-\u003ebit_offset = info-\u003ebit_offset;\ndrivers/nvmem/core.c-594-\tcell-\u003enbits = info-\u003enbits;\n--\ndrivers/nvmem/core.c=1742=static int __nvmem_cell_entry_write(struct nvmem_cell_entry *cell, void *buf, size_t len)\n--\ndrivers/nvmem/core.c-1747-\tif (!nvmem || nvmem-\u003eread_only ||\ndrivers/nvmem/core.c:1748:\t (cell-\u003ebit_offset == 0 \u0026\u0026 len != cell-\u003ebytes))\ndrivers/nvmem/core.c-1749-\t\treturn -EINVAL;\n--\ndrivers/pinctrl/sprd/pinctrl-sprd.c=985=static int sprd_pinctrl_add_pins(struct sprd_pinctrl *sprd_pctl,\n--\ndrivers/pinctrl/sprd/pinctrl-sprd.c-1010-\t\t\t\tPINCTRL_REG_LEN * reg;\ndrivers/pinctrl/sprd/pinctrl-sprd.c:1011:\t\t\tpin-\u003ebit_offset = sprd_soc_pin_info[i].bit_offset;\ndrivers/pinctrl/sprd/pinctrl-sprd.c-1012-\t\t\tpin-\u003ebit_width = sprd_soc_pin_info[i].bit_width;\n--\ndrivers/xen/xen-acpi-processor.c=187=static int xen_copy_pct_data(struct acpi_pct_register *pct,\n--\ndrivers/xen/xen-acpi-processor.c-197-\tdst_pct-\u003ebit_width = pct-\u003ebit_width;\ndrivers/xen/xen-acpi-processor.c:198:\tdst_pct-\u003ebit_offset = pct-\u003ebit_offset;\ndrivers/xen/xen-acpi-processor.c-199-\tdst_pct-\u003ereserved = pct-\u003ereserved;\n--\ntools/lib/bpf/relo_core.c=262=int bpf_core_parse_spec(const char *prog_name, const struct btf *btf,\n--\ntools/lib/bpf/relo_core.c-332-\t\treturn sz;\ntools/lib/bpf/relo_core.c:333:\tspec-\u003ebit_offset = access_idx * sz * 8;\ntools/lib/bpf/relo_core.c-334-\n"
} |
| 117/2 | 2026/09/22 17:32 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 50946 output: 28 thoughts: 69 Thoughts: Here's my thought process, as requested: **Debugging NVMem Bit Offset Assignment** Okay, so I'm looking at this `nvmem_cell_info_to_nvmem_cell_entry_nodup()` function, and I see this line: `cell->bit_offset = info->bit_offset;`. My immediate concern is where that `info->bit_offset` value is *actually* set. I need to trace the origin of that value. It's critical for understanding how the offset is calculated and ultimately, whether the NVMem cell is being positioned correctly. So, I'm thinking, the most direct approach is a grep. I'll need to look across all the NVMem drivers, so that means I'm targeting `drivers/nvmem/`. I'll grep for `bit_offset` and see where it appears in assignments, particularly to the `info` structure or anything closely related. Hopefully, the results of the grep will reveal how and where this important offset is being initialized. I'm anticipating that I will find the source for this crucial piece of information. |
| 118/2 | 2026/09/22 17:32 | tool | grepper |
0mArgs:{
"Expression": "bit_offset",
"PathPrefix": "drivers/nvmem/"
}Results: {
"Output": "drivers/nvmem/core.c=29=struct nvmem_cell_entry {\n--\ndrivers/nvmem/core.c-33-\tint\t\t\tbytes;\ndrivers/nvmem/core.c:34:\tint\t\t\tbit_offset;\ndrivers/nvmem/core.c-35-\tint\t\t\tnbits;\n--\ndrivers/nvmem/core.c=469=static int nvmem_populate_sysfs_cells(struct nvmem_device *nvmem)\n--\ndrivers/nvmem/core.c-501-\t\t\t\t\t\t entry-\u003eoffset,\ndrivers/nvmem/core.c:502:\t\t\t\t\t\t entry-\u003ebit_offset);\ndrivers/nvmem/core.c-503-\t\tattrs[i].attr.mode = 0444 \u0026 nvmem_bin_attr_get_umode(nvmem);\n--\ndrivers/nvmem/core.c=581=static int nvmem_cell_info_to_nvmem_cell_entry_nodup(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-592-\ndrivers/nvmem/core.c:593:\tcell-\u003ebit_offset = info-\u003ebit_offset;\ndrivers/nvmem/core.c-594-\tcell-\u003enbits = info-\u003enbits;\n--\ndrivers/nvmem/core.c-597-\tif (cell-\u003enbits) {\ndrivers/nvmem/core.c:598:\t\tcell-\u003ebytes = DIV_ROUND_UP(cell-\u003enbits + cell-\u003ebit_offset,\ndrivers/nvmem/core.c-599-\t\t\t\t\t BITS_PER_BYTE);\n--\ndrivers/nvmem/core.c=792=int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)\n--\ndrivers/nvmem/core.c-814-\t\tif (addr \u0026\u0026 len == (2 * sizeof(u32))) {\ndrivers/nvmem/core.c:815:\t\t\tinfo.bit_offset = be32_to_cpup(addr++);\ndrivers/nvmem/core.c-816-\t\t\tinfo.nbits = be32_to_cpup(addr);\ndrivers/nvmem/core.c:817:\t\t\tif (info.bit_offset \u003e= BITS_PER_BYTE * info.bytes ||\ndrivers/nvmem/core.c-818-\t\t\t info.nbits \u003c 1 ||\ndrivers/nvmem/core.c:819:\t\t\t info.bit_offset + info.nbits \u003e BITS_PER_BYTE * info.bytes) {\ndrivers/nvmem/core.c-820-\t\t\t\tdev_err(dev, \"nvmem: invalid bits on %pOF\\n\", child);\n--\ndrivers/nvmem/core.c=1584=static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)\n--\ndrivers/nvmem/core.c-1587-\tint i, extra, bytes_offset;\ndrivers/nvmem/core.c:1588:\tint bit_offset = cell-\u003ebit_offset;\ndrivers/nvmem/core.c-1589-\n--\ndrivers/nvmem/core.c-1591-\ndrivers/nvmem/core.c:1592:\tbytes_offset = bit_offset / BITS_PER_BYTE;\ndrivers/nvmem/core.c-1593-\tb += bytes_offset;\ndrivers/nvmem/core.c:1594:\tbit_offset %= BITS_PER_BYTE;\ndrivers/nvmem/core.c-1595-\ndrivers/nvmem/core.c:1596:\tif (bit_offset % BITS_PER_BYTE) {\ndrivers/nvmem/core.c-1597-\t\t/* First shift */\ndrivers/nvmem/core.c:1598:\t\t*p = *b++ \u003e\u003e bit_offset;\ndrivers/nvmem/core.c-1599-\n--\ndrivers/nvmem/core.c-1602-\t\t\t/* Get bits from next byte and shift them towards msb */\ndrivers/nvmem/core.c:1603:\t\t\t*p++ |= *b \u003c\u003c (BITS_PER_BYTE - bit_offset);\ndrivers/nvmem/core.c-1604-\ndrivers/nvmem/core.c:1605:\t\t\t*p = *b++ \u003e\u003e bit_offset;\ndrivers/nvmem/core.c-1606-\t\t}\n--\ndrivers/nvmem/core.c=1627=static int __nvmem_cell_read(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-1638-\t/* shift bits in-place */\ndrivers/nvmem/core.c:1639:\tif (cell-\u003ebit_offset || cell-\u003enbits)\ndrivers/nvmem/core.c-1640-\t\tnvmem_shift_read_buffer_in_place(cell, buf);\n--\ndrivers/nvmem/core.c=1689=static void *nvmem_cell_prepare_write_buffer(struct nvmem_cell_entry *cell,\n--\ndrivers/nvmem/core.c-1692-\tstruct nvmem_device *nvmem = cell-\u003envmem;\ndrivers/nvmem/core.c:1693:\tint i, rc, nbits, bit_offset = cell-\u003ebit_offset;\ndrivers/nvmem/core.c-1694-\tu8 v, *p, *buf, *b, pbyte, pbits;\n--\ndrivers/nvmem/core.c-1703-\ndrivers/nvmem/core.c:1704:\tif (bit_offset) {\ndrivers/nvmem/core.c-1705-\t\tpbyte = *b;\ndrivers/nvmem/core.c:1706:\t\t*b \u003c\u003c= bit_offset;\ndrivers/nvmem/core.c-1707-\n--\ndrivers/nvmem/core.c-1711-\t\t\tgoto err;\ndrivers/nvmem/core.c:1712:\t\t*b++ |= GENMASK(bit_offset - 1, 0) \u0026 v;\ndrivers/nvmem/core.c-1713-\n--\ndrivers/nvmem/core.c-1716-\t\t\t/* Get last byte bits and shift them towards lsb */\ndrivers/nvmem/core.c:1717:\t\t\tpbits = pbyte \u003e\u003e (BITS_PER_BYTE - 1 - bit_offset);\ndrivers/nvmem/core.c-1718-\t\t\tpbyte = *b;\ndrivers/nvmem/core.c-1719-\t\t\tp = b;\ndrivers/nvmem/core.c:1720:\t\t\t*b \u003c\u003c= bit_offset;\ndrivers/nvmem/core.c-1721-\t\t\t*b++ |= pbits;\n--\ndrivers/nvmem/core.c-1725-\t/* if it's not end on byte boundary */\ndrivers/nvmem/core.c:1726:\tif ((nbits + bit_offset) % BITS_PER_BYTE) {\ndrivers/nvmem/core.c-1727-\t\t/* setup the last byte with msb bits from nvmem */\n--\ndrivers/nvmem/core.c-1731-\t\t\tgoto err;\ndrivers/nvmem/core.c:1732:\t\t*p |= GENMASK(7, (nbits + bit_offset) % BITS_PER_BYTE) \u0026 v;\ndrivers/nvmem/core.c-1733-\n--\ndrivers/nvmem/core.c=1742=static int __nvmem_cell_entry_write(struct nvmem_cell_entry *cell, void *buf, size_t len)\n--\ndrivers/nvmem/core.c-1747-\tif (!nvmem || nvmem-\u003eread_only ||\ndrivers/nvmem/core.c:1748:\t (cell-\u003ebit_offset == 0 \u0026\u0026 len != cell-\u003ebytes))\ndrivers/nvmem/core.c-1749-\t\treturn -EINVAL;\n--\ndrivers/nvmem/core.c-1758-\ndrivers/nvmem/core.c:1759:\tif (cell-\u003ebit_offset || cell-\u003enbits) {\ndrivers/nvmem/core.c-1760-\t\tif (len != BITS_TO_BYTES(cell-\u003enbits) \u0026\u0026 len != cell-\u003ebytes)\n--\ndrivers/nvmem/core.c-1769-\t/* free the tmp buffer */\ndrivers/nvmem/core.c:1770:\tif (cell-\u003ebit_offset || cell-\u003enbits)\ndrivers/nvmem/core.c-1771-\t\tkfree(buf);\n--\ndrivers/nvmem/qfprom.c=338=static void qfprom_fixup_dt_cell_info(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/qfprom.c-342-\ndrivers/nvmem/qfprom.c:343:\tcell-\u003ebit_offset += byte_offset * BITS_PER_BYTE;\ndrivers/nvmem/qfprom.c-344-\tcell-\u003eoffset -= byte_offset;\n"
} |
| 119/2 | 2026/09/22 17:32 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 53588 output: 38 thoughts: 84 Thoughts: Okay, here's my take on those lines of code – let me break down what I'm seeing: **Understanding the Bit Offset Calculation** Alright, let's dive in. I'm looking at `qfprom.c`, specifically around line 343. That line, `cell->bit_offset += byte_offset * BITS_PER_BYTE;`, immediately clicked for me. It's the key to understanding why `bit_offset` might end up being greater than or equal to `BITS_PER_BYTE`. It’s essentially incrementing the `bit_offset` by multiples of bytes, which makes perfect sense in this context. We're dealing with bit-level addressing, but working with byte offsets introduces this potential overflow. To get the full picture, I should probably inspect lines 330 to 360, since this likely sets the context. That range will definitely spell out what's really going on with that `byte_offset` value. I'm guessing it handles some kind of conversion between byte-based addressing and bit-level manipulations. Seeing that section should clear up how the `byte_offset` is calculated, and what the overall goal is for calculating the `bit_offset`. |
| 120/2 | 2026/09/22 17:32 | tool | read-file |
0mArgs:{
"File": "drivers/nvmem/qfprom.c",
"FirstLine": 330,
"LineCount": 40
}Results: {
"Contents": " 330:\t\n 331:\t\tfor (i = 0; i \u003c words; i++)\n 332:\t\t\t*val++ = readl(base + reg + i * sizeof(u32));\n 333:\t\n 334:\t\treturn 0;\n 335:\t}\n 336:\t\n 337:\t/* Align reads to word boundary */\n 338:\tstatic void qfprom_fixup_dt_cell_info(struct nvmem_device *nvmem,\n 339:\t\t\t\t\t struct nvmem_cell_info *cell)\n 340:\t{\n 341:\t\tunsigned int byte_offset = cell-\u003eoffset % sizeof(u32);\n 342:\t\n 343:\t\tcell-\u003ebit_offset += byte_offset * BITS_PER_BYTE;\n 344:\t\tcell-\u003eoffset -= byte_offset;\n 345:\t\tif (byte_offset \u0026\u0026 !cell-\u003enbits)\n 346:\t\t\tcell-\u003enbits = cell-\u003ebytes * BITS_PER_BYTE;\n 347:\t}\n 348:\t\n 349:\tstatic void qfprom_runtime_disable(void *data)\n 350:\t{\n 351:\t\tpm_runtime_disable(data);\n 352:\t}\n 353:\t\n 354:\tstatic const struct qfprom_soc_data qfprom_7_8_data = {\n 355:\t\t.accel_value = 0xD10,\n 356:\t\t.qfprom_blow_timer_value = 25,\n 357:\t\t.qfprom_blow_set_freq = 4800000,\n 358:\t\t.qfprom_blow_uV = 1800000,\n 359:\t};\n 360:\t\n 361:\tstatic const struct qfprom_soc_data qfprom_7_15_data = {\n 362:\t\t.accel_value = 0xD08,\n 363:\t\t.qfprom_blow_timer_value = 24,\n 364:\t\t.qfprom_blow_set_freq = 4800000,\n 365:\t\t.qfprom_blow_uV = 1900000,\n 366:\t};\n 367:\t\n 368:\tstatic int qfprom_probe(struct platform_device *pdev)\n 369:\t{\n"
} |
| 121/2 | 2026/09/22 17:32 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 54634 output: 39 thoughts: 68 Thoughts: **Analyzing the `qfprom_fixup_dt_cell_info` Function** Okay, let's dive into this `qfprom_fixup_dt_cell_info` function. Right, so `qfprom` is the Qualcomm SoC eFuse driver, found in `drivers/nvmem/qfprom.c`. It's a platform driver, so specific to Qualcomm hardware. Now, I need to understand the context of this function call. The best way to do that is to check the Git history. Let's trace this back to the originating commit. What commit introduced this patch? Knowing that will provide the surrounding changes and hopefully, the problem it was designed to fix. That's where I need to start. |
| 122/2 | 2026/09/22 17:32 | tool | grepper |
0mArgs:{
"Expression": "point to end of the buffer unused bits will be cleared",
"PathPrefix": "drivers/nvmem/core.c"
}Results: {
"Output": "drivers/nvmem/core.c=1584=static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)\n--\ndrivers/nvmem/core.c-1606-\t\t}\ndrivers/nvmem/core.c:1607:\t\t/* point to end of the buffer unused bits will be cleared */\ndrivers/nvmem/core.c-1608-\t\tp = buf + cell-\u003ebytes - 1;\n"
} |
| 123/2 | 2026/09/22 17:32 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 55030 output: 26 thoughts: 1438 Thoughts: **Analyzing Potential Fuzzing Reachability of `nvmem_shift_read_buffer_in_place` on `amd64`** Okay, let's break this down. My initial thought is to figure out if `nvmem_shift_read_buffer_in_place(cell, buf)` is even called. It's called in `__nvmem_cell_read()`. The important thing here is: is it *always* called, or only under specific conditions? Line 1639 shows an `if` statement: `if (cell->bit_offset || cell->nbits) nvmem_shift_read_buffer_in_place(cell, buf);`. So, it's called *only* if either `cell->bit_offset` or `cell->nbits` is non-zero. That's the key. Now, I need to understand the function itself. `nvmem_shift_read_buffer_in_place()` shifts bits within a buffer. The critical part is the changed loop within the `if (bit_offset % BITS_PER_BYTE)` block. It seems like the original loop condition had an issue. Specifically, `bytes_offset` is calculated as `bit_offset / BITS_PER_BYTE`. This means when `bit_offset % 8 != 0` (non-multiple of 8), but `bytes_offset > 0`, the loop likely had an off-by-one error. The original loop ran `cell->bytes - 1` times and the corrected loop runs `cell->bytes - bytes_offset` times. Moreover, `p` now gets set to `buf + cell->bytes - 1`. The crucial question is: Can this buggy code be reached during syzkaller fuzzing on `amd64`? We need to evaluate the reachability. According to the guidelines, the fuzzing needs to be able to execute in standard virtualized environments. This means the key question is whether or not there are device drivers compiled and active on the `amd64` platform that use the NVMEM framework. First, I need to determine if the `nvmem` subsystem is even active on `amd64`. If there aren't any drivers compiled in that environment, then the code is unreachable for fuzzing. I will investigate which `nvmem` drivers are compiled or actively used on `amd64` or emulated devices. I need to specifically look for cases where `cell->bit_offset` or `cell->nbits` could be non-zero on `amd64` - this would be a likely place that this bug shows up. Only when the nvmem system is used can we see the error. Only then would the code be reachable. |
| 124/2 | 2026/09/22 17:32 | tool | grepper |
0mArgs:{
"Expression": "nvmem_register",
"PathPrefix": "drivers/"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 694 lines.\nUse more precise expression if possible.\n\ndrivers/hwmon/pmbus/adm1266.c=579=static int adm1266_config_nvmem(struct adm1266_data *data)\n--\ndrivers/hwmon/pmbus/adm1266.c-597-\ndrivers/hwmon/pmbus/adm1266.c:598:\tdata-\u003envmem = devm_nvmem_register(\u0026data-\u003eclient-\u003edev, \u0026data-\u003envmem_config);\ndrivers/hwmon/pmbus/adm1266.c-599-\tif (IS_ERR(data-\u003envmem)) {\n--\ndrivers/hwmon/pmbus/mpq8646.c=877=static int mpq8646_probe(struct i2c_client *client)\n--\ndrivers/hwmon/pmbus/mpq8646.c-941-\t\t};\ndrivers/hwmon/pmbus/mpq8646.c:942:\t\tstruct nvmem_device *nv = devm_nvmem_register(\u0026client-\u003edev, \u0026cfg);\ndrivers/hwmon/pmbus/mpq8646.c-943-\n--\ndrivers/hwmon/spd5118.c=384=static int spd5118_nvmem_init(struct device *dev, struct spd5118_data *data)\n--\ndrivers/hwmon/spd5118.c-403-\ndrivers/hwmon/spd5118.c:404:\tnvmem = devm_nvmem_register(dev, \u0026nvmem_config);\ndrivers/hwmon/spd5118.c-405-\treturn PTR_ERR_OR_ZERO(nvmem);\n--\ndrivers/iio/pressure/bmp280-core.c=2350=static int bmp580_preinit(struct bmp280_data *data)\n--\ndrivers/iio/pressure/bmp280-core.c-2393-\t/* Register nvmem device */\ndrivers/iio/pressure/bmp280-core.c:2394:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(config.dev, \u0026config));\ndrivers/iio/pressure/bmp280-core.c-2395-}\n--\ndrivers/media/i2c/ov2740.c=1250=static int ov2740_register_nvmem(struct i2c_client *client,\n--\ndrivers/media/i2c/ov2740.c-1280-\ndrivers/media/i2c/ov2740.c:1281:\tnvm-\u003envmem = devm_nvmem_register(dev, \u0026nvmem_config);\ndrivers/media/i2c/ov2740.c-1282-\tif (IS_ERR(nvm-\u003envmem))\n--\ndrivers/media/i2c/video-i2c.c=750=static int video_i2c_probe(struct i2c_client *client)\n--\ndrivers/media/i2c/video-i2c.c-844-\ndrivers/media/i2c/video-i2c.c:845:\t\tdevice = devm_nvmem_register(\u0026client-\u003edev, config);\ndrivers/media/i2c/video-i2c.c-846-\n--\ndrivers/misc/ds1682.c=226=static int ds1682_probe(struct i2c_client *client)\n--\ndrivers/misc/ds1682.c-246-\ndrivers/misc/ds1682.c:247:\tnvmem = devm_nvmem_register(\u0026client-\u003edev, \u0026config);\ndrivers/misc/ds1682.c-248-\tif (IS_ENABLED(CONFIG_NVMEM) \u0026\u0026 IS_ERR(nvmem))\n--\ndrivers/misc/keba/cp500.c=593=static int cp500_nvmem_write(void *priv, unsigned int offset, void *val,\n--\ndrivers/misc/keba/cp500.c-606-\ndrivers/misc/keba/cp500.c:607:static int cp500_nvmem_register(struct cp500 *cp500,\ndrivers/misc/keba/cp500.c-608-\t\t\t\tstruct nvmem_device *base_nvmem)\n--\ndrivers/misc/keba/cp500.c-634-\tnvmem_config.priv = \u0026cp500-\u003envmem_cpu;\ndrivers/misc/keba/cp500.c:635:\ttmp = nvmem_register(\u0026nvmem_config);\ndrivers/misc/keba/cp500.c-636-\tif (IS_ERR(tmp))\n--\ndrivers/misc/keba/cp500.c-644-\tnvmem_config.priv = \u0026cp500-\u003envmem_user;\ndrivers/misc/keba/cp500.c:645:\ttmp = nvmem_register(\u0026nvmem_config);\ndrivers/misc/keba/cp500.c-646-\tif (IS_ERR(tmp)) {\n--\ndrivers/misc/keba/cp500.c=693=static int cp500_nvmem(struct notifier_block *nb, unsigned long action,\n--\ndrivers/misc/keba/cp500.c-720-\ndrivers/misc/keba/cp500.c:721:\tret = cp500_nvmem_register(cp500, nvmem);\ndrivers/misc/keba/cp500.c-722-\tif (ret)\n--\ndrivers/misc/keba/cp500.c=863=static int cp500_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)\n--\ndrivers/misc/keba/cp500.c-920-\tcp500-\u003envmem_notifier.notifier_call = cp500_nvmem;\ndrivers/misc/keba/cp500.c:921:\tret = nvmem_register_notifier(\u0026cp500-\u003envmem_notifier);\ndrivers/misc/keba/cp500.c-922-\tif (ret != 0)\n--\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c=320=static int pci1xxxx_otp_eeprom_probe(struct auxiliary_device *aux_dev,\n--\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c-376-\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:377:\t\tpriv-\u003envmem_eeprom = devm_nvmem_register(\u0026aux_dev-\u003edev,\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c-378-\t\t\t\t\t\t\t \u0026priv-\u003envmem_config_eeprom);\n--\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c-396-\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c:397:\tpriv-\u003envmem_otp = devm_nvmem_register(\u0026aux_dev-\u003edev,\ndrivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c-398-\t\t\t\t\t \u0026priv-\u003envmem_config_otp);\n--\ndrivers/mtd/mtdcore.c=607=static int mtd_nvmem_add(struct mtd_info *mtd)\n--\ndrivers/mtd/mtdcore.c-625-\ndrivers/mtd/mtdcore.c:626:\tmtd-\u003envmem = nvmem_register(\u0026config);\ndrivers/mtd/mtdcore.c-627-\tif (IS_ERR(mtd-\u003envmem)) {\n--\ndrivers/mtd/mtdcore.c=923=static ssize_t mtd_otp_size(struct mtd_info *mtd, bool is_user)\n--\ndrivers/mtd/mtdcore.c-954-\ndrivers/mtd/mtdcore.c:955:static struct nvmem_device *mtd_otp_nvmem_register(struct mtd_info *mtd,\ndrivers/mtd/mtdcore.c-956-\t\t\t\t\t\t const char *compatible,\n--\ndrivers/mtd/mtdcore.c-980-\ndrivers/mtd/mtdcore.c:981:\tnvmem = nvmem_register(\u0026config);\ndrivers/mtd/mtdcore.c-982-\t/* Just ignore if there is no NVMEM support in the kernel */\n--\ndrivers/mtd/mtdcore.c=1019=static int mtd_otp_nvmem_add(struct mtd_info *mtd)\n--\ndrivers/mtd/mtdcore.c-1033-\t\tif (size \u003e 0) {\ndrivers/mtd/mtdcore.c:1034:\t\t\tnvmem = mtd_otp_nvmem_register(mtd, \"user-otp\", size,\ndrivers/mtd/mtdcore.c-1035-\t\t\t\t\t\t mtd_nvmem_user_otp_reg_read);\n--\ndrivers/mtd/mtdcore.c-1071-\ndrivers/mtd/mtdcore.c:1072:\t\t\tnvmem = mtd_otp_nvmem_register(mtd, \"factory-otp\", size,\ndrivers/mtd/mtdcore.c-1073-\t\t\t\t\t\t mtd_nvmem_fact_otp_reg_read);\n--\ndrivers/mtd/ubi/nvmem.c=61=static int ubi_nvmem_add(struct ubi_volume_info *vi)\n--\ndrivers/mtd/ubi/nvmem.c-98-\tunv-\u003eusable_leb_size = vi-\u003eusable_leb_size;\ndrivers/mtd/ubi/nvmem.c:99:\tunv-\u003envmem = nvmem_register(\u0026config);\ndrivers/mtd/ubi/nvmem.c-100-\tif (IS_ERR(unv-\u003envmem)) {\n--\ndrivers/nvmem/airoha-smc-efuses.c=50=static int airoha_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/airoha-smc-efuses.c-99-\t\tnvmem_config.of_node = child;\ndrivers/nvmem/airoha-smc-efuses.c:100:\t\tnvmem = devm_nvmem_register(dev, \u0026nvmem_config);\ndrivers/nvmem/airoha-smc-efuses.c-101-\t\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/an8855-efuse.c=25=static int an8855_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/an8855-efuse.c-44-\tan8855_nvmem_config.dev = dev;\ndrivers/nvmem/an8855-efuse.c:45:\tnvmem = devm_nvmem_register(dev, \u0026an8855_nvmem_config);\ndrivers/nvmem/an8855-efuse.c-46-\n--\ndrivers/nvmem/apple-efuses.c=32=static int apple_efuses_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/apple-efuses.c-58-\ndrivers/nvmem/apple-efuses.c:59:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(config.dev, \u0026config));\ndrivers/nvmem/apple-efuses.c-60-}\n--\ndrivers/nvmem/apple-spmi-nvmem.c=37=static int apple_spmi_nvmem_probe(struct spmi_device *sdev)\n--\ndrivers/nvmem/apple-spmi-nvmem.c-56-\ndrivers/nvmem/apple-spmi-nvmem.c:57:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(\u0026sdev-\u003edev, \u0026nvmem_cfg));\ndrivers/nvmem/apple-spmi-nvmem.c-58-}\n--\ndrivers/nvmem/at24.c=595=static int at24_probe(struct i2c_client *client)\n--\ndrivers/nvmem/at24.c-778-\ndrivers/nvmem/at24.c:779:\tat24-\u003envmem = devm_nvmem_register(dev, \u0026nvmem_config);\ndrivers/nvmem/at24.c-780-\tif (IS_ERR(at24-\u003envmem)) {\n--\ndrivers/nvmem/at25.c=482=static int at25_probe(struct spi_mem *mem)\n--\ndrivers/nvmem/at25.c-552-\ndrivers/nvmem/at25.c:553:\tat25-\u003envmem = devm_nvmem_register(\u0026spi-\u003edev, \u0026at25-\u003envmem_config);\ndrivers/nvmem/at25.c-554-\tif (IS_ERR(at25-\u003envmem))\n--\ndrivers/nvmem/bcm-ocotp.c=243=static int bcm_otpc_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/bcm-ocotp.c-292-\ndrivers/nvmem/bcm-ocotp.c:293:\tnvmem = devm_nvmem_register(dev, \u0026bcm_otpc_nvmem_config);\ndrivers/nvmem/bcm-ocotp.c-294-\tif (IS_ERR(nvmem)) {\n--\ndrivers/nvmem/brcm_nvram.c=212=static int brcm_nvram_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/brcm_nvram.c-240-\ndrivers/nvmem/brcm_nvram.c:241:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(dev, \u0026config));\ndrivers/nvmem/brcm_nvram.c-242-}\n--\ndrivers/nvmem/core.c=681=static int nvmem_add_cells(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-696-/**\ndrivers/nvmem/core.c:697: * nvmem_register_notifier() - Register a notifier block for nvmem events.\ndrivers/nvmem/core.c-698- *\n--\ndrivers/nvmem/core.c-702- */\ndrivers/nvmem/core.c:703:int nvmem_register_notifier(struct notifier_block *nb)\ndrivers/nvmem/core.c-704-{\n--\ndrivers/nvmem/core.c-706-}\ndrivers/nvmem/core.c:707:EXPORT_SYMBOL_GPL(nvmem_register_notifier);\ndrivers/nvmem/core.c-708-\n--\ndrivers/nvmem/core.c=875=EXPORT_SYMBOL_GPL(nvmem_layout_unregister);\n--\ndrivers/nvmem/core.c-877-/**\ndrivers/nvmem/core.c:878: * nvmem_register() - Register a nvmem device for given nvmem_config.\ndrivers/nvmem/core.c-879- * Also creates a binary entry in /sys/bus/nvmem/devices/dev-name/nvmem\n--\ndrivers/nvmem/core.c-886-\ndrivers/nvmem/core.c:887:struct nvmem_device *nvmem_register(const struct nvmem_config *config)\ndrivers/nvmem/core.c-888-{\n--\ndrivers/nvmem/core.c-1042-}\ndrivers/nvmem/core.c:1043:EXPORT_SYMBOL_GPL(nvmem_register);\ndrivers/nvmem/core.c-1044-\n--\ndrivers/nvmem/core.c=1072=static void devm_nvmem_unregister(void *nvmem)\n--\ndrivers/nvmem/core.c-1077-/**\ndrivers/nvmem/core.c:1078: * devm_nvmem_register() - Register a managed nvmem device for given\ndrivers/nvmem/core.c-1079- * nvmem_config.\n--\ndrivers/nvmem/core.c-1087- */\ndrivers/nvmem/core.c:1088:struct nvmem_device *devm_nvmem_register(struct device *dev,\ndrivers/nvmem/core.c-1089-\t\t\t\t\t const struct nvmem_config *config)\n--\ndrivers/nvmem/core.c-1093-\ndrivers/nvmem/core.c:1094:\tnvmem = nvmem_register(config);\ndrivers/nvmem/core.c-1095-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/core.c-1103-}\ndrivers/nvmem/core.c:1104:EXPORT_SYMBOL_GPL(devm_nvmem_register);\ndrivers/nvmem/core.c-1105-\n--\ndrivers/nvmem/ee1004.c=278=static int ee1004_probe(struct i2c_client *client)\n--\ndrivers/nvmem/ee1004.c-326-\ndrivers/nvmem/ee1004.c:327:\tndev = devm_nvmem_register(\u0026client-\u003edev, \u0026config);\ndrivers/nvmem/ee1004.c-328-\tif (IS_ERR(ndev))\n--\ndrivers/nvmem/eeprom_93xx46.c=458=static int eeprom_93xx46_probe(struct spi_device *spi)\n--\ndrivers/nvmem/eeprom_93xx46.c-518-\ndrivers/nvmem/eeprom_93xx46.c:519:\tedev-\u003envmem = devm_nvmem_register(\u0026spi-\u003edev, \u0026edev-\u003envmem_config);\ndrivers/nvmem/eeprom_93xx46.c-520-\tif (IS_ERR(edev-\u003envmem))\n--\ndrivers/nvmem/imx-iim.c=96=static int imx_iim_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/imx-iim.c-126-\ndrivers/nvmem/imx-iim.c:127:\tnvmem = devm_nvmem_register(dev, \u0026cfg);\ndrivers/nvmem/imx-iim.c-128-\n--\ndrivers/nvmem/imx-ocotp-ele.c=138=static int imx_ele_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/imx-ocotp-ele.c-167-\ndrivers/nvmem/imx-ocotp-ele.c:168:\tnvmem = devm_nvmem_register(dev, \u0026priv-\u003econfig);\ndrivers/nvmem/imx-ocotp-ele.c-169-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/imx-ocotp-scu.c=239=static int imx_scu_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/imx-ocotp-scu.c-258-\timx_scu_ocotp_nvmem_config.priv = priv;\ndrivers/nvmem/imx-ocotp-scu.c:259:\tnvmem = devm_nvmem_register(dev, \u0026imx_scu_ocotp_nvmem_config);\ndrivers/nvmem/imx-ocotp-scu.c-260-\n--\ndrivers/nvmem/imx-ocotp.c=596=static int imx_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/imx-ocotp.c-628-\ndrivers/nvmem/imx-ocotp.c:629:\tnvmem = devm_nvmem_register(dev, \u0026imx_ocotp_nvmem_config);\ndrivers/nvmem/imx-ocotp.c-630-\n--\ndrivers/nvmem/jz4780-efuse.c=139=static int jz4780_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/jz4780-efuse.c-212-\ndrivers/nvmem/jz4780-efuse.c:213:\tnvmem = devm_nvmem_register(dev, \u0026cfg);\ndrivers/nvmem/jz4780-efuse.c-214-\n--\ndrivers/nvmem/lan9662-otpc.c=180=static int lan9662_otp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/lan9662-otpc.c-198-\ndrivers/nvmem/lan9662-otpc.c:199:\tnvmem = devm_nvmem_register(dev, \u0026otp_config);\ndrivers/nvmem/lan9662-otpc.c-200-\n--\ndrivers/nvmem/layerscape-sfp.c=45=static int layerscape_sfp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/layerscape-sfp.c-74-\ndrivers/nvmem/layerscape-sfp.c:75:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026layerscape_sfp_nvmem_config);\ndrivers/nvmem/layerscape-sfp.c-76-\n--\ndrivers/nvmem/lpc18xx_eeprom.c=161=static int lpc18xx_eeprom_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/lpc18xx_eeprom.c-234-\ndrivers/nvmem/lpc18xx_eeprom.c:235:\teeprom-\u003envmem = devm_nvmem_register(dev, \u0026lpc18xx_nvmem_config);\ndrivers/nvmem/lpc18xx_eeprom.c-236-\tif (IS_ERR(eeprom-\u003envmem)) {\n--\ndrivers/nvmem/lpc18xx_otp.c=66=static int lpc18xx_otp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/lpc18xx_otp.c-82-\ndrivers/nvmem/lpc18xx_otp.c:83:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026lpc18xx_otp_nvmem_config);\ndrivers/nvmem/lpc18xx_otp.c-84-\n--\ndrivers/nvmem/m24lr.c=488=static int m24lr_probe(struct i2c_client *client)\n--\ndrivers/nvmem/m24lr.c-556-\ndrivers/nvmem/m24lr.c:557:\tnvmem = devm_nvmem_register(dev, \u0026nvmem_conf);\ndrivers/nvmem/m24lr.c-558-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/max77759-nvmem.c=90=static int max77759_nvmem_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/max77759-nvmem.c-114-\ndrivers/nvmem/max77759-nvmem.c:115:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(config.dev, \u0026config));\ndrivers/nvmem/max77759-nvmem.c-116-}\n--\ndrivers/nvmem/meson-efuse.c=47=static int meson_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/meson-efuse.c-89-\ndrivers/nvmem/meson-efuse.c:90:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, econfig);\ndrivers/nvmem/meson-efuse.c-91-\n--\ndrivers/nvmem/meson-mx-efuse.c=191=static int meson_mx_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/meson-mx-efuse.c-225-\ndrivers/nvmem/meson-mx-efuse.c:226:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026efuse-\u003econfig);\ndrivers/nvmem/meson-mx-efuse.c-227-\n--\ndrivers/nvmem/microchip-otpc.c=243=static int mchp_otpc_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/microchip-otpc.c-266-\tmchp_nvmem_config.priv = otpc;\ndrivers/nvmem/microchip-otpc.c:267:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026mchp_nvmem_config);\ndrivers/nvmem/microchip-otpc.c-268-\n--\ndrivers/nvmem/mtk-efuse.c=62=static int mtk_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/mtk-efuse.c-89-\t\teconfig.fixup_dt_cell_info = \u0026mtk_efuse_fixup_dt_cell_info;\ndrivers/nvmem/mtk-efuse.c:90:\tnvmem = devm_nvmem_register(dev, \u0026econfig);\ndrivers/nvmem/mtk-efuse.c-91-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/mxs-ocotp.c=139=static int mxs_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/mxs-ocotp.c-174-\tocotp_config.dev = dev;\ndrivers/nvmem/mxs-ocotp.c:175:\totp-\u003envmem = devm_nvmem_register(dev, \u0026ocotp_config);\ndrivers/nvmem/mxs-ocotp.c-176-\tif (IS_ERR(otp-\u003envmem))\n--\ndrivers/nvmem/nintendo-otp.c=73=static int nintendo_otp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/nintendo-otp.c-104-\ndrivers/nvmem/nintendo-otp.c:105:\tnvmem = devm_nvmem_register(dev, \u0026config);\ndrivers/nvmem/nintendo-otp.c-106-\n--\ndrivers/nvmem/qcom-spmi-sdam.c=111=static int sdam_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/qcom-spmi-sdam.c-152-\ndrivers/nvmem/qcom-spmi-sdam.c:153:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026sdam-\u003esdam_config);\ndrivers/nvmem/qcom-spmi-sdam.c-154-\tif (IS_ERR(nvmem)) {\n--\ndrivers/nvmem/qfprom.c=368=static int qfprom_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/qfprom.c-453-\ndrivers/nvmem/qfprom.c:454:\tnvmem = devm_nvmem_register(dev, \u0026econfig);\ndrivers/nvmem/qfprom.c-455-\n--\ndrivers/nvmem/qnap-mcu-eeprom.c=74=static int qnap_mcu_eeprom_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/qnap-mcu-eeprom.c-93-\ndrivers/nvmem/qnap-mcu-eeprom.c:94:\tndev = devm_nvmem_register(\u0026pdev-\u003edev, \u0026nvcfg);\ndrivers/nvmem/qnap-mcu-eeprom.c-95-\tif (IS_ERR(ndev))\n--\ndrivers/nvmem/qoriq-efuse.c=29=static int qoriq_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/qoriq-efuse.c-54-\tconfig.priv = priv;\ndrivers/nvmem/qoriq-efuse.c:55:\tnvmem = devm_nvmem_register(config.dev, \u0026config);\ndrivers/nvmem/qoriq-efuse.c-56-\n--\ndrivers/nvmem/rave-sp-eeprom.c=287=static int rave_sp_eeprom_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/rave-sp-eeprom.c-337-\ndrivers/nvmem/rave-sp-eeprom.c:338:\tnvmem = devm_nvmem_register(dev, \u0026config);\ndrivers/nvmem/rave-sp-eeprom.c-339-\n--\ndrivers/nvmem/rcar-efuse.c=46=static int rcar_fuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/rcar-efuse.c-89-\ndrivers/nvmem/rcar-efuse.c:90:\tfuse-\u003envmem = devm_nvmem_register(dev, \u0026config);\ndrivers/nvmem/rcar-efuse.c-91-\tif (IS_ERR(fuse-\u003envmem))\n--\ndrivers/nvmem/rmem.c=119=static int rmem_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/rmem.c-152-\ndrivers/nvmem/rmem.c:153:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(dev, \u0026config));\ndrivers/nvmem/rmem.c-154-}\n--\ndrivers/nvmem/rockchip-efuse.c=253=static int rockchip_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/rockchip-efuse.c-286-\teconfig.dev = efuse-\u003edev;\ndrivers/nvmem/rockchip-efuse.c:287:\tnvmem = devm_nvmem_register(dev, \u0026econfig);\ndrivers/nvmem/rockchip-efuse.c-288-\n--\ndrivers/nvmem/rockchip-otp.c=415=static int rockchip_otp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/rockchip-otp.c-454-\ndrivers/nvmem/rockchip-otp.c:455:\tnvmem = devm_nvmem_register(dev, \u0026otp_config);\ndrivers/nvmem/rockchip-otp.c-456-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/s32g-ocotp-nvmem.c=64=static int s32g_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/s32g-ocotp-nvmem.c-84-\ndrivers/nvmem/s32g-ocotp-nvmem.c:85:\tnvmem = devm_nvmem_register(dev, \u0026s32g_ocotp_nvmem_config);\ndrivers/nvmem/s32g-ocotp-nvmem.c-86-\n--\ndrivers/nvmem/sc27xx-efuse.c=202=static int sc27xx_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/sc27xx-efuse.c-250-\teconfig.add_legacy_fixed_of_cells = true;\ndrivers/nvmem/sc27xx-efuse.c:251:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026econfig);\ndrivers/nvmem/sc27xx-efuse.c-252-\tif (IS_ERR(nvmem)) {\n--\ndrivers/nvmem/sec-qfprom.c=45=static int sec_qfprom_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/sec-qfprom.c-75-\ndrivers/nvmem/sec-qfprom.c:76:\tnvmem = devm_nvmem_register(dev, \u0026econfig);\ndrivers/nvmem/sec-qfprom.c-77-\n--\ndrivers/nvmem/snvs_lpgpr.c=89=static int snvs_lpgpr_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/snvs_lpgpr.c-131-\ndrivers/nvmem/snvs_lpgpr.c:132:\tnvmem = devm_nvmem_register(dev, cfg);\ndrivers/nvmem/snvs_lpgpr.c-133-\n--\ndrivers/nvmem/sprd-efuse.c=361=static int sprd_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/sprd-efuse.c-415-\teconfig.dev = \u0026pdev-\u003edev;\ndrivers/nvmem/sprd-efuse.c:416:\tnvmem = devm_nvmem_register(\u0026pdev-\u003edev, \u0026econfig);\ndrivers/nvmem/sprd-efuse.c-417-\tif (IS_ERR(nvmem)) {\n--\ndrivers/nvmem/stm32-romem.c=189=static int stm32_romem_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/stm32-romem.c-248-\ndrivers/nvmem/stm32-romem.c:249:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(dev, \u0026priv-\u003ecfg));\ndrivers/nvmem/stm32-romem.c-250-}\n--\ndrivers/nvmem/sunplus-ocotp.c=156=static int sp_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/sunplus-ocotp.c-190-\ndrivers/nvmem/sunplus-ocotp.c:191:\tnvmem = devm_nvmem_register(dev, \u0026sp_ocotp_nvmem_config);\ndrivers/nvmem/sunplus-ocotp.c-192-\tif (IS_ERR(nvmem)) {\n--\ndrivers/nvmem/sunxi_sid.c=124=static int sunxi_sid_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/sunxi_sid.c-166-\ndrivers/nvmem/sunxi_sid.c:167:\tnvmem = devm_nvmem_register(dev, nvmem_cfg);\ndrivers/nvmem/sunxi_sid.c-168-\tif (IS_ERR(nvmem))\n--\ndrivers/nvmem/u-boot-env.c=45=static int u_boot_env_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/u-boot-env.c-71-\ndrivers/nvmem/u-boot-env.c:72:\tpriv-\u003envmem = devm_nvmem_register(dev, \u0026config);\ndrivers/nvmem/u-boot-env.c-73-\tif (IS_ERR(priv-\u003envmem))\n--\ndrivers/nvmem/uniphier-efuse.c=31=static int uniphier_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/uniphier-efuse.c-54-\teconfig.add_legacy_fixed_of_cells = true;\ndrivers/nvmem/uniphier-efuse.c:55:\tnvmem = devm_nvmem_register(dev, \u0026econfig);\ndrivers/nvmem/uniphier-efuse.c-56-\n--\ndrivers/nvmem/vf610-ocotp.c=212=static int vf610_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/vf610-ocotp.c-238-\ndrivers/nvmem/vf610-ocotp.c:239:\tocotp_dev-\u003envmem = devm_nvmem_register(dev, \u0026ocotp_config);\ndrivers/nvmem/vf610-ocotp.c-240-\n--\ndrivers/nvmem/zynqmp_nvmem.c=206=static int zynqmp_nvmem_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/zynqmp_nvmem.c-220-\ndrivers/nvmem/zynqmp_nvmem.c:221:\treturn PTR_ERR_OR_ZERO(devm_nvmem_register(dev, \u0026econfig));\ndrivers/nvmem/zynqmp_nvmem.c-222-}\n--\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c=876=static int mtk_mfg_init_nvmem_provider(struct mtk_mfg *mfg)\n--\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c-890-\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:891:\tnvdev = devm_nvmem_register(dev, \u0026config);\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c-892-\tif (IS_ERR(nvdev))\n--\ndrivers/power/supply/max1720x_battery.c=514=static int max1720x_probe_nvmem(struct i2c_client *client,\n--\ndrivers/power/supply/max1720x_battery.c-565-\ndrivers/power/supply/max1720x_battery.c:566:\tnvmem = devm_nvmem_register(dev, \u0026nvmem_config);\ndrivers/power/supply/max1720x_battery.c-567-\tif (IS_ERR(nvmem)) {\n--\ndrivers/rtc/nvmem.c-12-\ndrivers/rtc/nvmem.c:13:int devm_rtc_nvmem_register(struct rtc_device *rtc,\ndrivers/rtc/nvmem.c-14-\t\t struct nvmem_config *nvmem_config)\n--\ndrivers/rtc/nvmem.c-24-\tnvmem_config-\u003eadd_legacy_fixed_of_cells = true;\ndrivers/rtc/nvmem.c:25:\tnvmem = devm_nvmem_register(dev, nvmem_config);\ndrivers/rtc/nvmem.c-26-\tif (IS_ERR(nvmem))\n--\ndrivers/rtc/nvmem.c-30-}\ndrivers/rtc/nvmem.c:31:EXPORT_SYMBOL_GPL(devm_rtc_nvmem_register);\n--\ndrivers/rtc/rtc-abx80x.c=742=static int abx80x_setup_nvmem(struct abx80x_priv *priv)\n--\ndrivers/rtc/rtc-abx80x.c-751-\ndrivers/rtc/rtc-abx80x.c:752:\treturn devm_rtc_nvmem_register(priv-\u003ertc, \u0026config);\ndrivers/rtc/rtc-abx80x.c-753-}\n--\ndrivers/rtc/rtc-cmos.c=930=cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)\n--\ndrivers/rtc/rtc-cmos.c-1120-\tnvmem_cfg.size = address_space - NVRAM_OFFSET;\ndrivers/rtc/rtc-cmos.c:1121:\tdevm_rtc_nvmem_register(cmos_rtc.rtc, \u0026nvmem_cfg);\ndrivers/rtc/rtc-cmos.c-1122-\n--\ndrivers/rtc/rtc-ds1305.c=543=static int ds1305_probe(struct spi_device *spi)\n--\ndrivers/rtc/rtc-ds1305.c-700-\ndrivers/rtc/rtc-ds1305.c:701:\tdevm_rtc_nvmem_register(ds1305-\u003ertc, \u0026ds1305_nvmem_cfg);\ndrivers/rtc/rtc-ds1305.c-702-\n--\ndrivers/rtc/rtc-ds1307.c=1876=static int ds1307_probe(struct i2c_client *client)\n--\ndrivers/rtc/rtc-ds1307.c-2152-\ndrivers/rtc/rtc-ds1307.c:2153:\t\tdevm_rtc_nvmem_register(ds1307-\u003ertc, \u0026nvmem_cfg);\ndrivers/rtc/rtc-ds1307.c-2154-\t}\n--\ndrivers/rtc/rtc-ds1343.c=344=static int ds1343_probe(struct spi_device *spi)\n--\ndrivers/rtc/rtc-ds1343.c-415-\tnvmem_cfg.priv = priv;\ndrivers/rtc/rtc-ds1343.c:416:\tdevm_rtc_nvmem_register(priv-\u003ertc, \u0026nvmem_cfg);\ndrivers/rtc/rtc-ds1343.c-417-\n--\ndrivers/rtc/rtc-ds1511.c=272=static int ds1511_rtc_probe(struct platform_device *pdev)\n--\ndrivers/rtc/rtc-ds1511.c-348-\n\n"
} |
| 125/2 | 2026/09/22 17:32 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 67784 output: 39 thoughts: 38 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Analyzing the `rtc-cmos` Configuration** Right, that list is staring me in the face, isn't it? Let's break this down. My immediate concern, as always, is the specifics. I see `rtc-cmos` handling nvmem, which is expected, but I need to know the configuration details. What specific registers are we talking about? What's the address map? The timing? I need clarity. My next step is clearly to go right to the source. Let's dig into `rtc-cmos.c`. I need to see how the driver actually interacts with the hardware. I'm looking for the register definitions, the initialization routines, the read/write sequences – the whole shebang. I'm going to quickly parse through the code, looking for any immediate red flags or gotchas in the implementation. Ultimately, I'm expecting to confirm the assumptions I have, and identify the areas that need further investigation. |
| 126/2 | 2026/09/22 17:32 | tool | read-file |
0mArgs:{
"File": "drivers/rtc/rtc-cmos.c",
"FirstLine": 1115,
"LineCount": 15
}Results: {
"Contents": "1115:\t\n1116:\t\t/* Set the sync offset for the periodic 11min update correct */\n1117:\t\tcmos_rtc.rtc-\u003eset_offset_nsec = NSEC_PER_SEC / 2;\n1118:\t\n1119:\t\t/* export at least the first block of NVRAM */\n1120:\t\tnvmem_cfg.size = address_space - NVRAM_OFFSET;\n1121:\t\tdevm_rtc_nvmem_register(cmos_rtc.rtc, \u0026nvmem_cfg);\n1122:\t\n1123:\t\t/*\n1124:\t\t * Everything has gone well so far, so by default register a handler for\n1125:\t\t * the ACPI RTC fixed event.\n1126:\t\t */\n1127:\t\tif (!info)\n1128:\t\t\tacpi_rtc_event_setup(dev);\n1129:\t\n"
} |
| 127/2 | 2026/09/22 17:32 | llm | patch-evaluator-compressor |
0mModel:gemini-3.8-flash Args: null Results: null Reply: ### Summary of Workspace State & Investigation
#### 1. Applied Changes and Commit Details
- **Commit**: `4da74d0352cad1ee0c07f09e61c60ef7b7d5c625`
- **File**: `drivers/nvmem/core.c`
- **Function**: `nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)`
- **Full Context of Modified Function (`core.c:1584-1625`)**:
```c
static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)
{
u8 *p, *b;
int i, extra, bytes_offset;
int bit_offset = cell->bit_offset;
p = b = buf;
bytes_offset = bit_offset / BITS_PER_BYTE;
b += bytes_offset;
bit_offset %= BITS_PER_BYTE;
if (bit_offset % BITS_PER_BYTE) {
/* First shift */
*p = *b++ >> bit_offset;
/* setup rest of the bytes if any */
for (i = 1; i < (cell->bytes - bytes_offset); i++) {
/* Get bits from next byte and shift them towards msb */
*p++ |= *b << (BITS_PER_BYTE - bit_offset);
*p = *b++ >> bit_offset;
}
/* point to end of the buffer unused bits will be cleared */
p = buf + cell->bytes - 1;
} else if (p != b) {
memmove(p, b, cell->bytes - bytes_offset);
p += cell->bytes - 1;
} else {
/* point to the msb */
p += cell->bytes - 1;
}
/* result fits in less bytes */
extra = cell->bytes - DIV_ROUND_UP(cell->nbits, BITS_PER_BYTE);
while (--extra >= 0)
*p-- = 0;
/* clear msb bits if any leftover in the last byte */
if (cell->nbits % BITS_PER_BYTE)
*p &= GENMASK((cell->nbits % BITS_PER_BYTE) - 1, 0);
}
```
- **Nature of the Patch**:
- Fixes an out-of-bounds read and index corruption bug when `bit_offset >= 8` (`bytes_offset > 0`).
- Previously, loop bound was `cell->bytes`, reading past buffer end because `b` started offset by `bytes_offset`. Fixed bound to `cell->bytes - bytes_offset`.
- Fixes `p` positioning for high-bit zeroing (`p = buf + cell->bytes - 1`).
---
#### 2. Call Graph & Execution Paths
1. `nvmem_shift_read_buffer_in_place()` is `static void` called exclusively from `__nvmem_cell_read()` (`core.c:1639`):
```c
if (cell->bit_offset || cell->nbits)
nvmem_shift_read_buffer_in_place(cell, buf);
```
2. `__nvmem_cell_read()` is called by:
- `nvmem_cell_read()` (`core.c:1679`)
- `nvmem_device_cell_read()` (`core.c:2002`, exported but has zero in-tree callers outside nvmem core)
3. Direct callers of `nvmem_cell_read()`:
- Userspace sysfs interface: `nvmem_cell_attr_read()` (`core.c:354-386`), attached to sysfs binary attributes under `/sys/bus/nvmem/devices/<dev>/cells/<cell_name>@<offset>,<bit_offset>`.
- Kernel consumers: various platform drivers (e.g. `qcom-cpufreq-nvmem`, `at91-sama5d2_adc`, `meson_saradc`, `ath10k`, network MAC retrieval via `of_net.c`, `eth.c`).
---
#### 3. Investigation of Cell Instantiation Sources
To enter `nvmem_shift_read_buffer_in_place()`, a cell must have `cell->bit_offset != 0 || cell->nbits != 0`.
- **Search for static definitions (`.bit_offset`, `.nbits`)**:
- Static definitions of `.bit_offset` and `.nbits` in the kernel:
- `drivers/soc/tegra/fuse/fuse-tegra30.c`: `.bit_offset = 0`, `.nbits = 32` (ARM/Tegra only; does not set `bit_offset != 0`).
- No other drivers or nvmem layouts statically register `bit_offset` or `nbits`.
- **Dynamic instantiation via Device Tree (`OF`)**:
- `nvmem_add_cells_from_dt()` (`core.c:792-840`) parses OF child nodes:
```c
addr = of_get_property(child, "bits", &len);
if (addr && len == (2 * sizeof(u32))) {
info.bit_offset = be32_to_cpup(addr++);
info.nbits = be32_to_cpup(addr);
```
- This is the primary and standard mechanism designed to set `bit_offset` and `nbits`.
---
#### 4. Architecture & Reachability Evaluation (`amd64`)
- **Target architecture**: `amd64`.
- **Hardware/Platform analysis**:
- NVMEM on amd64: primarily ACPI/RTC CMOS (`rtc-cmos`), EEPROM over I2C/SMBus, or Intel/AMD platform drivers.
- On standard amd64 QEMU/KVM images running ACPI, Device Tree is not present at boot (`initial_boot_params == NULL`).
- While `CONFIG_OF` can be compiled on x86 (`devicetree.c`, `CONFIG_OF_FLATTREE`), standard x86 systems run ACPI, not OF.
- Neither sysfs nor any syscall provides an arbitrary user API to register new `nvmem_cell_info` with bit offsets on arbitrary nvmem devices.
- Even if `CONFIG_OF_OVERLAY` / `CONFIG_OF_CONFIGFS` were enabled, standard virtualized amd64 fuzzers (syzkaller running on QEMU) do not boot with Open Firmware Device Trees or attach DT overlays to nvmem nodes with `bits` properties.
- Tegra fuse and Qualcomm QFPROM drivers are strictly ARM/ARM64 and unreachable on amd64.
---
#### 5. Hypotheses and Assessment
- **Hypothesis 1 (Unreachable on standard amd64)**:
- Triggering `nvmem_shift_read_buffer_in_place` requires either:
1. A registered nvmem device with cells where `bit_offset != 0` or `nbits != 0`.
2. Parsing an OF device tree node with a `"bits"` property under an nvmem provider.
- On `amd64`, no driver or emulated hardware registers bit-offset nvmem cells, and no OF nodes exist for nvmem providers in standard amd64 virtual machines.
- Therefore, `nvmem_shift_read_buffer_in_place` cannot be reached or executed by syzkaller in an amd64 QEMU fuzzing setup.
- Under Section 2 ("Structurally unreachable hardware" / "Unreachable execution paths: Code paths exclusive to architectures other than the target architecture"), this warrants `WorthFuzzing=false`.
- **Hypothesis 2 (Alternative / Edge Reachability)**:
- If considered reachable through theoretical synthetic DT loading on x86, the target symbols would be `nvmem_shift_read_buffer_in_place` and `__nvmem_cell_read`, with configs `NVMEM` and `NVMEM_SYSFS`.
- However, in practice on `amd64`, without physical Tegra/Qualcomm hardware or OF boot firmware, execution is impossible.
---
#### 6. Watch Out for Loops / Next Steps
- Avoid repeated grep searches for `bit_offset` or `nbits` across the tree (all callers and definitions have been exhaustively found).
- Finalize reachability decision (`WorthFuzzing=false` due to target architecture `amd64` lacking any bit-offset nvmem provider/device or DT backing in QEMU virtualization, or `WorthFuzzing=true` if defensive criteria strictly apply to all core drivers regardless of board configuration).
- Call `set-results` tool with definitive evaluation.Tokens: input: 51307 output: 2090 thoughts: 0 |
| 128/2 | 2026/09/22 17:33 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 23208 output: 34 thoughts: 0 |
| 129/2 | 2026/09/22 17:33 | tool | grepper |
0mArgs:{
"Expression": "nvmem_cfg",
"PathPrefix": "drivers/rtc/rtc-cmos.c"
}Results: {
"Output": "drivers/rtc/rtc-cmos.c=930=cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)\n--\ndrivers/rtc/rtc-cmos.c-937-\tbool\t\t\t\thpet_registered = false;\ndrivers/rtc/rtc-cmos.c:938:\tstruct nvmem_config nvmem_cfg = {\ndrivers/rtc/rtc-cmos.c-939-\t\t.name = \"cmos_nvram\",\n--\ndrivers/rtc/rtc-cmos.c-1119-\t/* export at least the first block of NVRAM */\ndrivers/rtc/rtc-cmos.c:1120:\tnvmem_cfg.size = address_space - NVRAM_OFFSET;\ndrivers/rtc/rtc-cmos.c:1121:\tdevm_rtc_nvmem_register(cmos_rtc.rtc, \u0026nvmem_cfg);\ndrivers/rtc/rtc-cmos.c-1122-\n--\ndrivers/rtc/rtc-cmos.c-1135-\t\t cmos_rtc.century ? \", y3k\" : \"\",\ndrivers/rtc/rtc-cmos.c:1136:\t\t nvmem_cfg.size,\ndrivers/rtc/rtc-cmos.c-1137-\t\t use_hpet_alarm() ? \", hpet irqs\" : \"\");\n"
} |
| 130/2 | 2026/09/22 17:33 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 23593 output: 19 thoughts: 0 |
| 131/2 | 2026/09/22 17:33 | tool | grepper |
0mArgs:{
"Expression": "\\.cells\\s*="
}Results: {
"Output": "drivers/hwmon/pmbus/adm1266.c=579=static int adm1266_config_nvmem(struct adm1266_data *data)\n--\ndrivers/hwmon/pmbus/adm1266.c-586-\tdata-\u003envmem_config.reg_read = adm1266_nvmem_read;\ndrivers/hwmon/pmbus/adm1266.c:587:\tdata-\u003envmem_config.cells = adm1266_nvmem_cells;\ndrivers/hwmon/pmbus/adm1266.c-588-\tdata-\u003envmem_config.ncells = ARRAY_SIZE(adm1266_nvmem_cells);\n--\ndrivers/mfd/intel-m10-bmc-pmci.c=376=static const struct intel_m10bmc_platform_info m10bmc_pmci_n6000 = {\ndrivers/mfd/intel-m10-bmc-pmci.c:377:\t.cells = m10bmc_pmci_n6000_bmc_subdevs,\ndrivers/mfd/intel-m10-bmc-pmci.c-378-\t.n_cells = ARRAY_SIZE(m10bmc_pmci_n6000_bmc_subdevs),\n--\ndrivers/mfd/intel-m10-bmc-spi.c=138=static const struct intel_m10bmc_platform_info m10bmc_spi_n3000 = {\ndrivers/mfd/intel-m10-bmc-spi.c:139:\t.cells = m10bmc_pacn3000_subdevs,\ndrivers/mfd/intel-m10-bmc-spi.c-140-\t.n_cells = ARRAY_SIZE(m10bmc_pacn3000_subdevs),\n--\ndrivers/mfd/intel-m10-bmc-spi.c=146=static const struct intel_m10bmc_platform_info m10bmc_spi_d5005 = {\ndrivers/mfd/intel-m10-bmc-spi.c:147:\t.cells = m10bmc_d5005_subdevs,\ndrivers/mfd/intel-m10-bmc-spi.c-148-\t.n_cells = ARRAY_SIZE(m10bmc_d5005_subdevs),\n--\ndrivers/mfd/intel-m10-bmc-spi.c=154=static const struct intel_m10bmc_platform_info m10bmc_spi_n5010 = {\ndrivers/mfd/intel-m10-bmc-spi.c:155:\t.cells = m10bmc_n5010_subdevs,\ndrivers/mfd/intel-m10-bmc-spi.c-156-\t.n_cells = ARRAY_SIZE(m10bmc_n5010_subdevs),\n--\ndrivers/mfd/mt6397-core.c=296=static const struct chip_data mt6323_core = {\n--\ndrivers/mfd/mt6397-core.c-298-\t.cid_shift = 0,\ndrivers/mfd/mt6397-core.c:299:\t.cells = mt6323_devs,\ndrivers/mfd/mt6397-core.c-300-\t.cell_size = ARRAY_SIZE(mt6323_devs),\n--\ndrivers/mfd/mt6397-core.c=304=static const struct chip_data mt6328_core = {\n--\ndrivers/mfd/mt6397-core.c-306-\t.cid_shift = 8,\ndrivers/mfd/mt6397-core.c:307:\t.cells = mt6328_devs,\ndrivers/mfd/mt6397-core.c-308-\t.cell_size = ARRAY_SIZE(mt6328_devs),\n--\ndrivers/mfd/mt6397-core.c=312=static const struct chip_data mt6357_core = {\n--\ndrivers/mfd/mt6397-core.c-314-\t.cid_shift = 8,\ndrivers/mfd/mt6397-core.c:315:\t.cells = mt6357_devs,\ndrivers/mfd/mt6397-core.c-316-\t.cell_size = ARRAY_SIZE(mt6357_devs),\n--\ndrivers/mfd/mt6397-core.c=320=static const struct chip_data mt6331_mt6332_core = {\n--\ndrivers/mfd/mt6397-core.c-322-\t.cid_shift = 8,\ndrivers/mfd/mt6397-core.c:323:\t.cells = mt6331_mt6332_devs,\ndrivers/mfd/mt6397-core.c-324-\t.cell_size = ARRAY_SIZE(mt6331_mt6332_devs),\n--\ndrivers/mfd/mt6397-core.c=328=static const struct chip_data mt6358_core = {\n--\ndrivers/mfd/mt6397-core.c-330-\t.cid_shift = 8,\ndrivers/mfd/mt6397-core.c:331:\t.cells = mt6358_devs,\ndrivers/mfd/mt6397-core.c-332-\t.cell_size = ARRAY_SIZE(mt6358_devs),\n--\ndrivers/mfd/mt6397-core.c=336=static const struct chip_data mt6359_core = {\n--\ndrivers/mfd/mt6397-core.c-338-\t.cid_shift = 8,\ndrivers/mfd/mt6397-core.c:339:\t.cells = mt6359_devs,\ndrivers/mfd/mt6397-core.c-340-\t.cell_size = ARRAY_SIZE(mt6359_devs),\n--\ndrivers/mfd/mt6397-core.c=344=static const struct chip_data mt6397_core = {\n--\ndrivers/mfd/mt6397-core.c-346-\t.cid_shift = 0,\ndrivers/mfd/mt6397-core.c:347:\t.cells = mt6397_devs,\ndrivers/mfd/mt6397-core.c-348-\t.cell_size = ARRAY_SIZE(mt6397_devs),\n--\ndrivers/mfd/rohm-bd96801.c=583=static const struct bd968xx bd96801_data = {\n--\ndrivers/mfd/rohm-bd96801.c-590-\t.regmap_config = \u0026bd96801_regmap_config,\ndrivers/mfd/rohm-bd96801.c:591:\t.cells = bd96801_cells,\ndrivers/mfd/rohm-bd96801.c-592-\t.num_cells = ARRAY_SIZE(bd96801_cells),\n--\ndrivers/mfd/rohm-bd96801.c=597=static const struct bd968xx bd96802_data = {\n--\ndrivers/mfd/rohm-bd96801.c-604-\t.regmap_config = \u0026bd96802_regmap_config,\ndrivers/mfd/rohm-bd96801.c:605:\t.cells = bd96802_cells,\ndrivers/mfd/rohm-bd96801.c-606-\t.num_cells = ARRAY_SIZE(bd96802_cells),\n--\ndrivers/mfd/rohm-bd96801.c=611=static const struct bd968xx bd96805_data = {\n--\ndrivers/mfd/rohm-bd96801.c-618-\t.regmap_config = \u0026bd96801_regmap_config,\ndrivers/mfd/rohm-bd96801.c:619:\t.cells = bd96805_cells,\ndrivers/mfd/rohm-bd96801.c-620-\t.num_cells = ARRAY_SIZE(bd96805_cells),\n--\ndrivers/mfd/rohm-bd96801.c=625=static struct bd968xx bd96806_data = {\n--\ndrivers/mfd/rohm-bd96801.c-632-\t.regmap_config = \u0026bd96802_regmap_config,\ndrivers/mfd/rohm-bd96801.c:633:\t.cells = bd96806_cells,\ndrivers/mfd/rohm-bd96801.c-634-\t.num_cells = ARRAY_SIZE(bd96806_cells),\n--\ndrivers/mfd/ti-lmu.c=122=static const struct ti_lmu_data chip##_data =\t\\\ndrivers/mfd/ti-lmu.c-123-{\t\t\t\t\t\t\\\ndrivers/mfd/ti-lmu.c:124:\t.cells = chip##_devices,\t\t\\\ndrivers/mfd/ti-lmu.c-125-\t.num_cells = ARRAY_SIZE(chip##_devices),\\\n--\ndrivers/mfd/tps65219.c=458=static const struct tps65219_chip_data chip_info_table[] = {\n--\ndrivers/mfd/tps65219.c-460-\t\t.irq_chip = \u0026tps65214_irq_chip,\ndrivers/mfd/tps65219.c:461:\t\t.cells = tps65214_cells,\ndrivers/mfd/tps65219.c-462-\t\t.n_cells = ARRAY_SIZE(tps65214_cells),\n--\ndrivers/mfd/tps65219.c-465-\t\t.irq_chip = \u0026tps65215_irq_chip,\ndrivers/mfd/tps65219.c:466:\t\t.cells = tps65215_cells,\ndrivers/mfd/tps65219.c-467-\t\t.n_cells = ARRAY_SIZE(tps65215_cells),\n--\ndrivers/mfd/tps65219.c-470-\t\t.irq_chip = \u0026tps65219_irq_chip,\ndrivers/mfd/tps65219.c:471:\t\t.cells = tps65219_cells,\ndrivers/mfd/tps65219.c-472-\t\t.n_cells = ARRAY_SIZE(tps65219_cells),\n--\ndrivers/nvmem/brcm_nvram.c=212=static int brcm_nvram_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/brcm_nvram.c-235-\tconfig.dev = dev;\ndrivers/nvmem/brcm_nvram.c:236:\tconfig.cells = priv-\u003ecells;\ndrivers/nvmem/brcm_nvram.c-237-\tconfig.ncells = priv-\u003encells;\n--\ndrivers/power/supply/max1720x_battery.c=514=static int max1720x_probe_nvmem(struct i2c_client *client,\n--\ndrivers/power/supply/max1720x_battery.c-520-\t\t.name = \"max1720x_nvmem\",\ndrivers/power/supply/max1720x_battery.c:521:\t\t.cells = max1720x_nvmem_cells,\ndrivers/power/supply/max1720x_battery.c-522-\t\t.ncells = ARRAY_SIZE(max1720x_nvmem_cells),\n--\ndrivers/s390/char/con3270.c=891=static struct tty3270_line *tty3270_alloc_screen(struct tty3270 *tp, unsigned int rows,\n--\ndrivers/s390/char/con3270.c-901-\tfor (lines = 0; lines \u003c allocated; lines++) {\ndrivers/s390/char/con3270.c:902:\t\tscreen[lines].cells = kzalloc_objs(struct tty3270_cell, cols);\ndrivers/s390/char/con3270.c-903-\t\tif (!screen[lines].cells)\n--\ndrivers/soc/tegra/fuse/fuse-tegra.c=139=static int tegra_fuse_probe(struct platform_device *pdev)\n--\ndrivers/soc/tegra/fuse/fuse-tegra.c-207-\tnvmem.owner = THIS_MODULE;\ndrivers/soc/tegra/fuse/fuse-tegra.c:208:\tnvmem.cells = fuse-\u003esoc-\u003ecells;\ndrivers/soc/tegra/fuse/fuse-tegra.c-209-\tnvmem.ncells = fuse-\u003esoc-\u003enum_cells;\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=220=const struct tegra_fuse_soc tegra114_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-225-\t.num_lookups = ARRAY_SIZE(tegra114_fuse_lookups),\ndrivers/soc/tegra/fuse/fuse-tegra30.c:226:\t.cells = tegra114_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-227-\t.num_cells = ARRAY_SIZE(tegra114_fuse_cells),\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=380=const struct tegra_fuse_soc tegra124_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-385-\t.num_lookups = ARRAY_SIZE(tegra124_fuse_lookups),\ndrivers/soc/tegra/fuse/fuse-tegra30.c:386:\t.cells = tegra124_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-387-\t.num_cells = ARRAY_SIZE(tegra124_fuse_cells),\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=551=const struct tegra_fuse_soc tegra210_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-555-\t.lookups = tegra210_fuse_lookups,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:556:\t.cells = tegra210_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-557-\t.num_cells = ARRAY_SIZE(tegra210_fuse_cells),\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=609=const struct tegra_fuse_soc tegra186_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-613-\t.num_lookups = ARRAY_SIZE(tegra186_fuse_lookups),\ndrivers/soc/tegra/fuse/fuse-tegra30.c:614:\t.cells = tegra186_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-615-\t.num_cells = ARRAY_SIZE(tegra186_fuse_cells),\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=702=const struct tegra_fuse_soc tegra194_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-706-\t.num_lookups = ARRAY_SIZE(tegra194_fuse_lookups),\ndrivers/soc/tegra/fuse/fuse-tegra30.c:707:\t.cells = tegra194_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-708-\t.num_cells = ARRAY_SIZE(tegra194_fuse_cells),\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=772=const struct tegra_fuse_soc tegra234_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-776-\t.num_lookups = ARRAY_SIZE(tegra234_fuse_lookups),\ndrivers/soc/tegra/fuse/fuse-tegra30.c:777:\t.cells = tegra234_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-778-\t.num_cells = ARRAY_SIZE(tegra234_fuse_cells),\n--\nnet/xfrm/xfrm_input.c=848=void __init xfrm_input_init(void)\n--\nnet/xfrm/xfrm_input.c-858-\tif (err)\nnet/xfrm/xfrm_input.c:859:\t\tgro_cells.cells = NULL;\nnet/xfrm/xfrm_input.c-860-\n"
} |
| 132/2 | 2026/09/22 17:33 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 28253 output: 44 thoughts: 0 |
| 133/2 | 2026/09/22 17:33 | tool | read-file |
0mArgs:{
"File": "drivers/power/supply/max1720x_battery.c",
"FirstLine": 500,
"LineCount": 40
}Results: {
"Contents": " 500:\t{\n 501:\t\tstruct max1720x_device_info *info = priv;\n 502:\t\tunsigned int reg = MAX1720X_NXTABLE0 + (off / 2);\n 503:\t\n 504:\t\treturn regmap_bulk_read(info-\u003eregmap_nv, reg, val, len / 2);\n 505:\t}\n 506:\t\n 507:\tstatic void max1720x_unregister_ancillary(void *data)\n 508:\t{\n 509:\t\tstruct max1720x_device_info *info = data;\n 510:\t\n 511:\t\ti2c_unregister_device(info-\u003eancillary);\n 512:\t}\n 513:\t\n 514:\tstatic int max1720x_probe_nvmem(struct i2c_client *client,\n 515:\t\t\t\t\tstruct max1720x_device_info *info)\n 516:\t{\n 517:\t\tstruct device *dev = \u0026client-\u003edev;\n 518:\t\tstruct nvmem_config nvmem_config = {\n 519:\t\t\t.dev = dev,\n 520:\t\t\t.name = \"max1720x_nvmem\",\n 521:\t\t\t.cells = max1720x_nvmem_cells,\n 522:\t\t\t.ncells = ARRAY_SIZE(max1720x_nvmem_cells),\n 523:\t\t\t.read_only = true,\n 524:\t\t\t.root_only = true,\n 525:\t\t\t.reg_read = max1720x_nvmem_reg_read,\n 526:\t\t\t.size = ARRAY_SIZE(max1720x_nvmem_cells) * 2,\n 527:\t\t\t.word_size = 2,\n 528:\t\t\t.stride = 2,\n 529:\t\t\t.priv = info,\n 530:\t\t};\n 531:\t\tstruct nvmem_device *nvmem;\n 532:\t\tunsigned int val;\n 533:\t\tint ret;\n 534:\t\n 535:\t\tinfo-\u003eancillary = i2c_new_ancillary_device(client, \"nvmem\", 0xb);\n 536:\t\tif (IS_ERR(info-\u003eancillary)) {\n 537:\t\t\tdev_err(dev, \"Failed to initialize ancillary i2c device\\n\");\n 538:\t\t\treturn PTR_ERR(info-\u003eancillary);\n 539:\t\t}\n"
} |
| 134/2 | 2026/09/22 17:33 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 28974 output: 44 thoughts: 0 |
| 135/2 | 2026/09/22 17:33 | tool | read-file |
0mArgs:{
"File": "drivers/power/supply/max1720x_battery.c",
"FirstLine": 460,
"LineCount": 40
}Results: {
"Contents": " 460:\t\n 461:\t\t/*\n 462:\t\t * Temperature in degrees Celsius starting at absolute zero, -273C or\n 463:\t\t * 0K with an LSb of 0.1C\n 464:\t\t */\n 465:\t\treturn sysfs_emit(buf, \"%d\\n\", val - 2730);\n 466:\t}\n 467:\t\n 468:\tstatic ssize_t temp_ain1_show(struct device *dev, struct device_attribute *attr,\n 469:\t\t\t\t char *buf)\n 470:\t{\n 471:\t\treturn max1720x_read_temp(dev, MAX172XX_TEMP1, buf);\n 472:\t}\n 473:\t\n 474:\tstatic ssize_t temp_ain2_show(struct device *dev, struct device_attribute *attr,\n 475:\t\t\t\t char *buf)\n 476:\t{\n 477:\t\treturn max1720x_read_temp(dev, MAX172XX_TEMP2, buf);\n 478:\t}\n 479:\t\n 480:\tstatic ssize_t temp_int_show(struct device *dev, struct device_attribute *attr,\n 481:\t\t\t\t char *buf)\n 482:\t{\n 483:\t\treturn max1720x_read_temp(dev, MAX172XX_INT_TEMP, buf);\n 484:\t}\n 485:\t\n 486:\tstatic DEVICE_ATTR_RO(temp_ain1);\n 487:\tstatic DEVICE_ATTR_RO(temp_ain2);\n 488:\tstatic DEVICE_ATTR_RO(temp_int);\n 489:\t\n 490:\tstatic struct attribute *max1720x_attrs[] = {\n 491:\t\t\u0026dev_attr_temp_ain1.attr,\n 492:\t\t\u0026dev_attr_temp_ain2.attr,\n 493:\t\t\u0026dev_attr_temp_int.attr,\n 494:\t\tNULL\n 495:\t};\n 496:\tATTRIBUTE_GROUPS(max1720x);\n 497:\t\n 498:\tstatic\n 499:\tint max1720x_nvmem_reg_read(void *priv, unsigned int off, void *val, size_t len)\n"
} |
| 136/2 | 2026/09/22 17:33 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 29662 output: 37 thoughts: 0 |
| 137/2 | 2026/09/22 17:33 | tool | grepper |
0mArgs:{
"Expression": "max1720x_nvmem_cells",
"PathPrefix": "drivers/power/supply/"
}Results: {
"Output": "drivers/power/supply/max1720x_battery.c=145=static const struct regmap_config max1720x_nvmem_regmap_cfg = {\n--\ndrivers/power/supply/max1720x_battery.c-152-\ndrivers/power/supply/max1720x_battery.c:153:static const struct nvmem_cell_info max1720x_nvmem_cells[] = {\ndrivers/power/supply/max1720x_battery.c-154-\t{ .name = \"nXTable0\", .offset = 0, .bytes = 2, },\n--\ndrivers/power/supply/max1720x_battery.c=514=static int max1720x_probe_nvmem(struct i2c_client *client,\n--\ndrivers/power/supply/max1720x_battery.c-520-\t\t.name = \"max1720x_nvmem\",\ndrivers/power/supply/max1720x_battery.c:521:\t\t.cells = max1720x_nvmem_cells,\ndrivers/power/supply/max1720x_battery.c:522:\t\t.ncells = ARRAY_SIZE(max1720x_nvmem_cells),\ndrivers/power/supply/max1720x_battery.c-523-\t\t.read_only = true,\n--\ndrivers/power/supply/max1720x_battery.c-525-\t\t.reg_read = max1720x_nvmem_reg_read,\ndrivers/power/supply/max1720x_battery.c:526:\t\t.size = ARRAY_SIZE(max1720x_nvmem_cells) * 2,\ndrivers/power/supply/max1720x_battery.c-527-\t\t.word_size = 2,\n"
} |
| 138/2 | 2026/09/22 17:33 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 30190 output: 44 thoughts: 0 |
| 139/2 | 2026/09/22 17:33 | tool | read-file |
0mArgs:{
"File": "drivers/power/supply/max1720x_battery.c",
"FirstLine": 150,
"LineCount": 40
}Results: {
"Contents": " 150:\t\t.rd_table = \u0026max1720x_nvmem_regs,\n 151:\t};\n 152:\t\n 153:\tstatic const struct nvmem_cell_info max1720x_nvmem_cells[] = {\n 154:\t\t{ .name = \"nXTable0\", .offset = 0, .bytes = 2, },\n 155:\t\t{ .name = \"nXTable1\", .offset = 2, .bytes = 2, },\n 156:\t\t{ .name = \"nXTable2\", .offset = 4, .bytes = 2, },\n 157:\t\t{ .name = \"nXTable3\", .offset = 6, .bytes = 2, },\n 158:\t\t{ .name = \"nXTable4\", .offset = 8, .bytes = 2, },\n 159:\t\t{ .name = \"nXTable5\", .offset = 10, .bytes = 2, },\n 160:\t\t{ .name = \"nXTable6\", .offset = 12, .bytes = 2, },\n 161:\t\t{ .name = \"nXTable7\", .offset = 14, .bytes = 2, },\n 162:\t\t{ .name = \"nXTable8\", .offset = 16, .bytes = 2, },\n 163:\t\t{ .name = \"nXTable9\", .offset = 18, .bytes = 2, },\n 164:\t\t{ .name = \"nXTable10\", .offset = 20, .bytes = 2, },\n 165:\t\t{ .name = \"nXTable11\", .offset = 22, .bytes = 2, },\n 166:\t\t{ .name = \"nUser18C\", .offset = 24, .bytes = 2, },\n 167:\t\t{ .name = \"nUser18D\", .offset = 26, .bytes = 2, },\n 168:\t\t{ .name = \"nODSCTh\", .offset = 28, .bytes = 2, },\n 169:\t\t{ .name = \"nODSCCfg\", .offset = 30, .bytes = 2, },\n 170:\t\n 171:\t\t{ .name = \"nOCVTable0\", .offset = 32, .bytes = 2, },\n 172:\t\t{ .name = \"nOCVTable1\", .offset = 34, .bytes = 2, },\n 173:\t\t{ .name = \"nOCVTable2\", .offset = 36, .bytes = 2, },\n 174:\t\t{ .name = \"nOCVTable3\", .offset = 38, .bytes = 2, },\n 175:\t\t{ .name = \"nOCVTable4\", .offset = 40, .bytes = 2, },\n 176:\t\t{ .name = \"nOCVTable5\", .offset = 42, .bytes = 2, },\n 177:\t\t{ .name = \"nOCVTable6\", .offset = 44, .bytes = 2, },\n 178:\t\t{ .name = \"nOCVTable7\", .offset = 46, .bytes = 2, },\n 179:\t\t{ .name = \"nOCVTable8\", .offset = 48, .bytes = 2, },\n 180:\t\t{ .name = \"nOCVTable9\", .offset = 50, .bytes = 2, },\n 181:\t\t{ .name = \"nOCVTable10\", .offset = 52, .bytes = 2, },\n 182:\t\t{ .name = \"nOCVTable11\", .offset = 54, .bytes = 2, },\n 183:\t\t{ .name = \"nIChgTerm\", .offset = 56, .bytes = 2, },\n 184:\t\t{ .name = \"nFilterCfg\", .offset = 58, .bytes = 2, },\n 185:\t\t{ .name = \"nVEmpty\", .offset = 60, .bytes = 2, },\n 186:\t\t{ .name = \"nLearnCfg\", .offset = 62, .bytes = 2, },\n 187:\t\n 188:\t\t{ .name = \"nQRTable00\", .offset = 64, .bytes = 2, },\n 189:\t\t{ .name = \"nQRTable10\", .offset = 66, .bytes = 2, },\n"
} |
| 140/2 | 2026/09/22 17:33 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 31420 output: 18 thoughts: 0 |
| 141/2 | 2026/09/22 17:33 | tool | grepper |
0mArgs:{
"Expression": "\\.bit_offset"
}Results: {
"Output": "arch/x86/kernel/tboot.c=258=static void tboot_copy_fadt(const struct acpi_table_fadt *fadt)\n--\narch/x86/kernel/tboot.c-262-\ttbg.bit_width = g.bit_width;\t\t\\\narch/x86/kernel/tboot.c:263:\ttbg.bit_offset = g.bit_offset;\t\\\narch/x86/kernel/tboot.c-264-\ttbg.access_width = g.access_width;\t\\\n--\ndrivers/acpi/acpi_lpit.c=25=static int lpit_read_residency_counter_us(u64 *counter, bool io_mem)\n--\ndrivers/acpi/acpi_lpit.c-43-\tif (!err) {\ndrivers/acpi/acpi_lpit.c:44:\t\tu64 mask = GENMASK_ULL(residency_info_ffh.gaddr.bit_offset +\ndrivers/acpi/acpi_lpit.c-45-\t\t\t\t residency_info_ffh.gaddr. bit_width - 1,\ndrivers/acpi/acpi_lpit.c:46:\t\t\t\t residency_info_ffh.gaddr.bit_offset);\ndrivers/acpi/acpi_lpit.c-47-\ndrivers/acpi/acpi_lpit.c-48-\t\t*counter \u0026= mask;\ndrivers/acpi/acpi_lpit.c:49:\t\t*counter \u003e\u003e= residency_info_ffh.gaddr.bit_offset;\ndrivers/acpi/acpi_lpit.c-50-\t\t*counter = div64_u64(*counter * 1000000ULL, residency_info_ffh.frequency);\n--\ndrivers/acpi/acpica/rsdumpinfo.c=235=struct acpi_rsdump_info acpi_rs_dump_generic_reg[6] = {\n--\ndrivers/acpi/acpica/rsdumpinfo.c-241-\t NULL},\ndrivers/acpi/acpica/rsdumpinfo.c:242:\t{ACPI_RSD_UINT8, ACPI_RSD_OFFSET(generic_reg.bit_offset), \"Bit Offset\",\ndrivers/acpi/acpica/rsdumpinfo.c-243-\t NULL},\n--\ndrivers/acpi/apei/apei-base.c=57=int __apei_exec_read_register(struct acpi_whea_header *entry, u64 *val)\n--\ndrivers/acpi/apei/apei-base.c-63-\t\treturn rc;\ndrivers/acpi/apei/apei-base.c:64:\t*val \u003e\u003e= entry-\u003eregister_region.bit_offset;\ndrivers/acpi/apei/apei-base.c-65-\t*val \u0026= entry-\u003emask;\n--\ndrivers/acpi/apei/apei-base.c=99=int __apei_exec_write_register(struct acpi_whea_header *entry, u64 val)\n--\ndrivers/acpi/apei/apei-base.c-103-\tval \u0026= entry-\u003emask;\ndrivers/acpi/apei/apei-base.c:104:\tval \u003c\u003c= entry-\u003eregister_region.bit_offset;\ndrivers/acpi/apei/apei-base.c-105-\tif (entry-\u003eflags \u0026 APEI_EXEC_PRESERVE_REGISTER) {\n--\ndrivers/acpi/apei/apei-base.c-109-\t\t\treturn rc;\ndrivers/acpi/apei/apei-base.c:110:\t\tvalr \u0026= ~(entry-\u003emask \u003c\u003c entry-\u003eregister_region.bit_offset);\ndrivers/acpi/apei/apei-base.c-111-\t\tval |= valr;\n--\ndrivers/acpi/apei/ghes.c=254=static void ghes_ack_error(struct acpi_hest_generic_v2 *gv2)\n--\ndrivers/acpi/apei/ghes.c-262-\ndrivers/acpi/apei/ghes.c:263:\tval \u0026= gv2-\u003eread_ack_preserve \u003c\u003c gv2-\u003eread_ack_register.bit_offset;\ndrivers/acpi/apei/ghes.c:264:\tval |= gv2-\u003eread_ack_write \u003c\u003c gv2-\u003eread_ack_register.bit_offset;\ndrivers/acpi/apei/ghes.c-265-\n--\ndrivers/acpi/processor_throttling.c=402=static int acpi_processor_get_throttling_control(struct acpi_processor *pr)\n--\ndrivers/acpi/processor_throttling.c-462-\tif ((throttling-\u003econtrol_register.bit_width +\ndrivers/acpi/processor_throttling.c:463:\t\tthrottling-\u003econtrol_register.bit_offset) \u003e 32) {\ndrivers/acpi/processor_throttling.c-464-\t\tpr_err(\"Invalid _PTC control register\\n\");\n--\ndrivers/acpi/processor_throttling.c-469-\tif ((throttling-\u003estatus_register.bit_width +\ndrivers/acpi/processor_throttling.c:470:\t\tthrottling-\u003estatus_register.bit_offset) \u003e 32) {\ndrivers/acpi/processor_throttling.c-471-\t\tpr_err(\"Invalid _PTC status register\\n\");\n--\ndrivers/acpi/processor_throttling.c=740=static int acpi_read_throttling_status(struct acpi_processor *pr,\n--\ndrivers/acpi/processor_throttling.c-752-\t\tbit_width = throttling-\u003estatus_register.bit_width;\ndrivers/acpi/processor_throttling.c:753:\t\tbit_offset = throttling-\u003estatus_register.bit_offset;\ndrivers/acpi/processor_throttling.c-754-\n--\ndrivers/acpi/processor_throttling.c=772=static int acpi_write_throttling_state(struct acpi_processor *pr,\n--\ndrivers/acpi/processor_throttling.c-784-\t\tbit_width = throttling-\u003econtrol_register.bit_width;\ndrivers/acpi/processor_throttling.c:785:\t\tbit_offset = throttling-\u003econtrol_register.bit_offset;\ndrivers/acpi/processor_throttling.c-786-\t\tptc_mask = (1 \u003c\u003c bit_width) - 1;\n--\ndrivers/cpufreq/pcc-cpufreq.c=390=static int __init pcc_cpufreq_evaluate(void)\n--\ndrivers/cpufreq/pcc-cpufreq.c-491-\tdoorbell.bit_width = reg_resource-\u003ebit_width;\ndrivers/cpufreq/pcc-cpufreq.c:492:\tdoorbell.bit_offset = reg_resource-\u003ebit_offset;\ndrivers/cpufreq/pcc-cpufreq.c-493-\tdoorbell.access_width = 4;\n--\ndrivers/cpufreq/pcc-cpufreq.c-497-\t\t\"bit_offset is %d, access_width is %d, address is 0x%llx\\n\",\ndrivers/cpufreq/pcc-cpufreq.c:498:\t\tdoorbell.space_id, doorbell.bit_width, doorbell.bit_offset,\ndrivers/cpufreq/pcc-cpufreq.c-499-\t\tdoorbell.access_width, reg_resource-\u003eaddress);\n--\ndrivers/gpu/nova-core/vbios.rs=480= fn from_id(image: \u0026PciAtBiosImage, token_id: u8) -\u003e Result\u003cSelf\u003e {\n--\ndrivers/gpu/nova-core/vbios.rs-484- // Offset to the first token entry\ndrivers/gpu/nova-core/vbios.rs:485: let tokens_start = image.bit_offset + usize::from(header.header_size);\ndrivers/gpu/nova-core/vbios.rs-486-\n--\ndrivers/md/dm-vdo/indexer/delta-index.c=986=static int restore_delta_list_data(struct delta_index *delta_index, unsigned int load_zone,\n--\ndrivers/md/dm-vdo/indexer/delta-index.c-1001-\t\t.tag = buffer[0],\ndrivers/md/dm-vdo/indexer/delta-index.c:1002:\t\t.bit_offset = buffer[1],\ndrivers/md/dm-vdo/indexer/delta-index.c-1003-\t\t.byte_count = get_unaligned_le16(\u0026buffer[2]),\n--\ndrivers/md/dm-vdo/indexer/delta-index.c-1006-\ndrivers/md/dm-vdo/indexer/delta-index.c:1007:\tif ((save_info.bit_offset \u003e= BITS_PER_BYTE) ||\ndrivers/md/dm-vdo/indexer/delta-index.c-1008-\t (save_info.byte_count \u003e DELTA_LIST_MAX_BYTE_COUNT)) {\n--\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c=1849=int qlcnic_sriov_set_vf_tx_rate(struct net_device *netdev, int vf,\n--\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c-1894-\t\tnic_info.min_tx_bw = min_tx_rate / 100;\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c:1895:\t\tnic_info.bit_offsets = BIT_0;\ndrivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c-1896-\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c=1762=int rt2800_config_shared_key(struct rt2x00_dev *rt2x00dev,\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-1792-\t */\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:1793:\tfield.bit_offset = 4 * (key-\u003ehw_key_idx % 8);\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:1794:\tfield.bit_mask = 0x7 \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-1795-\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c=12173=int rt2800_conf_tx(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-12205-\toffset = WMM_TXOP0_CFG + (sizeof(u32) * (!!(queue_idx \u0026 2)));\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:12206:\tfield.bit_offset = (queue_idx \u0026 1) * 16;\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:12207:\tfield.bit_mask = 0xffff \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-12208-\n--\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-12213-\t/* Update WMM registers */\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:12214:\tfield.bit_offset = queue_idx * 4;\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c:12215:\tfield.bit_mask = 0xf \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt2800lib.c-12216-\n--\ndrivers/net/wireless/ralink/rt2x00/rt2x00reg.h=157=struct rt2x00_field32 {\n--\ndrivers/net/wireless/ralink/rt2x00/rt2x00reg.h-239-\t*(__reg) |= ((__value) \u003c\u003c\t\t\\\ndrivers/net/wireless/ralink/rt2x00/rt2x00reg.h:240:\t ((__field).bit_offset)) \u0026\t\t\\\ndrivers/net/wireless/ralink/rt2x00/rt2x00reg.h-241-\t ((__field).bit_mask);\t\t\\\n--\ndrivers/net/wireless/ralink/rt2x00/rt2x00reg.h-247-\t((__reg) \u0026 ((__field).bit_mask)) \u003e\u003e\t\\\ndrivers/net/wireless/ralink/rt2x00/rt2x00reg.h:248:\t ((__field).bit_offset);\t\t\\\ndrivers/net/wireless/ralink/rt2x00/rt2x00reg.h-249-})\n--\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c=2801=static int rt61pci_conf_tx(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c-2833-\toffset = AC_TXOP_CSR0 + (sizeof(u32) * (!!(queue_idx \u0026 2)));\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c:2834:\tfield.bit_offset = (queue_idx \u0026 1) * 16;\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c:2835:\tfield.bit_mask = 0xffff \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c-2836-\n--\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c-2841-\t/* Update WMM registers */\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c:2842:\tfield.bit_offset = queue_idx * 4;\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c:2843:\tfield.bit_mask = 0xf \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt61pci.c-2844-\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c=256=static int rt73usb_config_shared_key(struct rt2x00_dev *rt2x00dev,\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-307-\t\tif (key-\u003ehw_key_idx \u003c 8) {\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:308:\t\t\tfield.bit_offset = (3 * key-\u003ehw_key_idx);\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:309:\t\t\tfield.bit_mask = 0x7 \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-310-\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-314-\t\t} else {\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:315:\t\t\tfield.bit_offset = (3 * (key-\u003ehw_key_idx - 8));\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:316:\t\t\tfield.bit_mask = 0x7 \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-317-\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c=2220=static int rt73usb_conf_tx(struct ieee80211_hw *hw,\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-2252-\toffset = AC_TXOP_CSR0 + (sizeof(u32) * (!!(queue_idx \u0026 2)));\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:2253:\tfield.bit_offset = (queue_idx \u0026 1) * 16;\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:2254:\tfield.bit_mask = 0xffff \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-2255-\n--\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-2260-\t/* Update WMM registers */\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:2261:\tfield.bit_offset = queue_idx * 4;\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c:2262:\tfield.bit_mask = 0xf \u003c\u003c field.bit_offset;\ndrivers/net/wireless/ralink/rt2x00/rt73usb.c-2263-\n--\ndrivers/nvmem/core.c=792=int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)\n--\ndrivers/nvmem/core.c-814-\t\tif (addr \u0026\u0026 len == (2 * sizeof(u32))) {\ndrivers/nvmem/core.c:815:\t\t\tinfo.bit_offset = be32_to_cpup(addr++);\ndrivers/nvmem/core.c-816-\t\t\tinfo.nbits = be32_to_cpup(addr);\ndrivers/nvmem/core.c:817:\t\t\tif (info.bit_offset \u003e= BITS_PER_BYTE * info.bytes ||\ndrivers/nvmem/core.c-818-\t\t\t info.nbits \u003c 1 ||\ndrivers/nvmem/core.c:819:\t\t\t info.bit_offset + info.nbits \u003e BITS_PER_BYTE * info.bytes) {\ndrivers/nvmem/core.c-820-\t\t\t\tdev_err(dev, \"nvmem: invalid bits on %pOF\\n\", child);\n--\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c=327=static int aml_calc_reg_and_bit(struct pinctrl_gpio_range *range,\n--\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c-334-\t*bit = (pin - range-\u003epin_base) * aml_bit_strides[reg_type]\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c:335:\t\t+ bank-\u003epc.bit_offset[reg_type];\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c-336-\t*reg = (bank-\u003epc.reg_offset[reg_type] + (*bit / 32)) * 4;\n--\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c=939=static inline int aml_gpio_calc_reg_and_bit(struct aml_gpio_bank *bank,\n--\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c-944-{\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c:945:\t*bit = gpio * aml_bit_strides[reg_type] + bank-\u003epc.bit_offset[reg_type];\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c-946-\t*reg = (bank-\u003epc.reg_offset[reg_type] + (*bit / 32)) * 4;\n--\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c=1028=static void init_bank_register_bit(struct aml_pinctrl *info,\n--\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c-1036-\t\tbank-\u003epc.reg_offset[i] = aml_def_regoffs[i];\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c:1037:\t\tbank-\u003epc.bit_offset[i] = 0;\ndrivers/pinctrl/meson/pinctrl-amlogic-a4.c-1038-\t}\n--\ndrivers/pinctrl/sprd/pinctrl-sprd.c=985=static int sprd_pinctrl_add_pins(struct sprd_pinctrl *sprd_pctl,\n--\ndrivers/pinctrl/sprd/pinctrl-sprd.c-1010-\t\t\t\tPINCTRL_REG_LEN * reg;\ndrivers/pinctrl/sprd/pinctrl-sprd.c:1011:\t\t\tpin-\u003ebit_offset = sprd_soc_pin_info[i].bit_offset;\ndrivers/pinctrl/sprd/pinctrl-sprd.c-1012-\t\t\tpin-\u003ebit_width = sprd_soc_pin_info[i].bit_width;\n--\ndrivers/pinctrl/sprd/pinctrl-sprd.h=10=struct platform_device;\n--\ndrivers/pinctrl/sprd/pinctrl-sprd.h-30-\t\t.type = (((a) \u003e\u003e TYPE_OFFSET) \u0026 0xf),\t\t\\\ndrivers/pinctrl/sprd/pinctrl-sprd.h:31:\t\t.bit_offset = (((a) \u003e\u003e BIT_OFFSET) \u0026 0xff),\t\\\ndrivers/pinctrl/sprd/pinctrl-sprd.h-32-\t\t.bit_width = ((a) \u003e\u003e WIDTH_OFFSET \u0026 0xf),\t\\\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=96=static const struct nvmem_cell_info tegra114_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-100-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:101:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-102-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-106-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:107:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-108-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-112-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:113:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-114-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-118-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:119:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-120-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-124-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:125:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-126-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-130-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:131:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-132-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-136-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:137:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-138-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-142-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:143:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-144-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-148-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:149:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-150-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-154-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:155:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-156-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=234=static const struct nvmem_cell_info tegra124_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-238-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:239:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-240-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-244-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:245:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-246-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-250-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:251:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-252-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-256-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:257:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-258-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-262-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:263:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-264-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-268-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:269:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-270-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-274-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:275:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-276-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-280-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:281:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-282-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-286-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:287:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-288-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-292-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:293:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-294-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-298-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:299:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-300-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-304-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:305:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-306-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=394=static const struct nvmem_cell_info tegra210_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-398-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:399:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-400-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-404-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:405:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-406-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-410-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:411:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-412-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-416-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:417:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-418-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-422-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:423:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-424-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-428-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:429:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-430-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-434-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:435:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-436-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-440-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:441:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-442-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-446-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:447:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-448-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-452-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:453:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-454-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-458-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:459:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-460-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-464-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:465:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-466-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-470-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:471:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-472-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=565=static const struct nvmem_cell_info tegra186_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-569-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:570:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-571-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-575-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:576:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-577-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=624=static const struct nvmem_cell_info tegra194_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-628-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:629:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-630-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-634-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:635:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-636-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-640-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:641:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-642-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-646-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:647:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-648-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-652-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:653:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-654-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=717=static const struct nvmem_cell_info tegra234_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-721-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:722:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-723-\t\t.nbits = 32,\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-727-\t\t.bytes = 4,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:728:\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-729-\t\t.nbits = 32,\n--\ndrivers/xen/xen-acpi-processor.c=51=static int push_cxx_to_hypervisor(struct acpi_processor *_pr)\n--\ndrivers/xen/xen-acpi-processor.c-77-\t\t\tdst_cx-\u003ereg.bit_width = 8;\ndrivers/xen/xen-acpi-processor.c:78:\t\t\tdst_cx-\u003ereg.bit_offset = 0;\ndrivers/xen/xen-acpi-processor.c-79-\t\t\tdst_cx-\u003ereg.access_size = 1;\n--\ndrivers/xen/xen-acpi-processor.c-83-\t\t\t\t/* NATIVE_CSTATE_BEYOND_HALT */\ndrivers/xen/xen-acpi-processor.c:84:\t\t\t\tdst_cx-\u003ereg.bit_offset = 2;\ndrivers/xen/xen-acpi-processor.c-85-\t\t\t\tdst_cx-\u003ereg.bit_width = 1; /* VENDOR_INTEL */\n--\nsound/soc/codecs/cs35l41-lib.c=699=static const struct cs35l41_otp_map_element_t cs35l41_otp_map_map[] = {\n--\nsound/soc/codecs/cs35l41-lib.c-703-\t\t.num_elements = ARRAY_SIZE(otp_map_1),\nsound/soc/codecs/cs35l41-lib.c:704:\t\t.bit_offset = 16,\nsound/soc/codecs/cs35l41-lib.c-705-\t\t.word_offset = 2,\n--\nsound/soc/codecs/cs35l41-lib.c-710-\t\t.num_elements = ARRAY_SIZE(otp_map_2),\nsound/soc/codecs/cs35l41-lib.c:711:\t\t.bit_offset = 16,\nsound/soc/codecs/cs35l41-lib.c-712-\t\t.word_offset = 2,\n--\nsound/soc/codecs/cs35l41-lib.c-717-\t\t.num_elements = ARRAY_SIZE(otp_map_2),\nsound/soc/codecs/cs35l41-lib.c:718:\t\t.bit_offset = 16,\nsound/soc/codecs/cs35l41-lib.c-719-\t\t.word_offset = 2,\n--\nsound/soc/codecs/cs35l41-lib.c-724-\t\t.num_elements = ARRAY_SIZE(otp_map_2),\nsound/soc/codecs/cs35l41-lib.c:725:\t\t.bit_offset = 16,\nsound/soc/codecs/cs35l41-lib.c-726-\t\t.word_offset = 2,\n--\nsound/soc/codecs/cs35l41-lib.c-731-\t\t.num_elements = ARRAY_SIZE(otp_map_1),\nsound/soc/codecs/cs35l41-lib.c:732:\t\t.bit_offset = 16,\nsound/soc/codecs/cs35l41-lib.c-733-\t\t.word_offset = 2,\n"
} |
| 142/2 | 2026/09/22 17:33 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 42556 output: 24 thoughts: 53 Thoughts: Okay, let's dive into this. Here's how I'd approach this task, thinking as an embedded systems expert: **Investigating Potential for Dynamic NVMEM Cell Creation** Alright, I need to get to the bottom of this dynamic cell creation question within the `nvmem` framework. First things first, let's take a look at the `nvmem_layout` structure. I'm wondering if there's any mechanism, perhaps through the layout definition itself, that allows for the creation of cells on the fly, maybe something using `bit_offset` in a clever way. Could we describe cell arrangements that aren't fixed at compile time? To understand this better, I need to expand my search. I'll search the codebase for that `struct nvmem_layout` definition. While I am at it, the `nvmem_layout_register` function will come up in any implementation and usage of `nvmem_layout`. That would be the best entry point for how these layouts are used, as well as where. I should also check the `drivers/nvmem/layouts/` directory, in case there are some examples of different layouts or potential templates. I'm looking for any indication of how these layouts are instantiated, configured, and how they relate to the underlying NVMEM hardware. Understanding the registration and use is key here! |
| 143/2 | 2026/09/22 17:33 | tool | codesearch-dir-index |
0mArgs:{
"Dir": "drivers/nvmem/layouts"
}Results: {
"Files": [
"fixed-layout.c",
"onie-tlv.c",
"sl28vpd.c",
"u-boot-env.c",
"u-boot-env.h"
],
"Subdirs": null
} |
| 144/2 | 2026/09/22 17:33 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 42979 output: 38 thoughts: 18 Thoughts: Okay, let's dive in. Here's my thought process regarding that specific file: **Checking `drivers/nvmem/layouts/fixed-layout.c`** Alright, so the task at hand seems to be related to the `fixed-layout.c` file within the `nvmem` driver layout. My immediate thought is, "Okay, this is about handling NVRAM/non-volatile memory that has a fixed memory layout." That means the important thing here is probably the structure definition that sets up this fixed layout. I want to check how the layout is organized because the most likely reason I need to read this is that there's a problem, or I need to understand how some data is stored in the nvmem. I'll need to look for things like the offsets, sizes, and any access mechanisms defined within the fixed layout. I expect to see structures defining regions, and possibly, functions for reading and writing to those regions. I'll be looking for how the driver handles address translation, error handling, and any special considerations for this *fixed* configuration. Given the context, I want to confirm how this specific fixed layout is implemented in the NVMe system. Let's see what's in there. |
| 145/2 | 2026/09/22 17:33 | tool | read-file |
0mArgs:{
"File": "drivers/nvmem/layouts/fixed-layout.c",
"FirstLine": 1,
"LineCount": 80
}Results: {
"Contents": " 1:\t// SPDX-License-Identifier: GPL-2.0-only\n 2:\t/*\n 3:\t * Copyright 2026 Bootlin\n 4:\t *\n 5:\t * Authors: Mathieu Dubois-Briand \u003cmathieu.dubois-briand@bootlin.com\u003e\n 6:\t */\n 7:\t\n 8:\t#include \u003clinux/nvmem-provider.h\u003e\n 9:\t#include \u003clinux/of.h\u003e\n 10:\t\n 11:\t#include \"../internals.h\"\n 12:\t\n 13:\tstatic int fixed_layout_add_cells(struct nvmem_layout *layout)\n 14:\t{\n 15:\t\tstruct device_node *np;\n 16:\t\tint ret;\n 17:\t\n 18:\t\tnp = of_nvmem_layout_get_container(layout-\u003envmem);\n 19:\t\tif (!np)\n 20:\t\t\treturn -ENOENT;\n 21:\t\n 22:\t\tret = nvmem_add_cells_from_dt(layout-\u003envmem, np);\n 23:\t\tof_node_put(np);\n 24:\t\n 25:\t\treturn ret;\n 26:\t}\n 27:\t\n 28:\tstatic int fixed_layout_probe(struct nvmem_layout *layout)\n 29:\t{\n 30:\t\tlayout-\u003eadd_cells = fixed_layout_add_cells;\n 31:\t\n 32:\t\treturn nvmem_layout_register(layout);\n 33:\t}\n 34:\t\n 35:\tstatic void fixed_layout_remove(struct nvmem_layout *layout)\n 36:\t{\n 37:\t\tnvmem_layout_unregister(layout);\n 38:\t}\n 39:\t\n 40:\tstatic const struct of_device_id fixed_layout_of_match_table[] = {\n 41:\t\t{ .compatible = \"fixed-layout\", },\n 42:\t\t{},\n 43:\t};\n 44:\t\n 45:\tstatic struct nvmem_layout_driver fixed_layout_layout = {\n 46:\t\t.driver = {\n 47:\t\t\t.name = \"fixed-layout\",\n 48:\t\t\t.of_match_table = fixed_layout_of_match_table,\n 49:\t\t},\n 50:\t\t.probe = fixed_layout_probe,\n 51:\t\t.remove = fixed_layout_remove,\n 52:\t};\n 53:\tmodule_nvmem_layout_driver(fixed_layout_layout);\n 54:\t\n 55:\tMODULE_AUTHOR(\"Mathieu Dubois-Briand\");\n 56:\tMODULE_LICENSE(\"GPL\");\n 57:\tMODULE_DEVICE_TABLE(of, fixed_layout_of_match_table);\n 58:\tMODULE_DESCRIPTION(\"NVMEM fixed-layout driver\");\n"
} |
| 146/2 | 2026/09/22 17:33 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 44038 output: 30 thoughts: 51 Thoughts: Here's my summary, as though I'm thinking through this process: **Diving into `nvmem_add_cells_from_dt` and its Implications** Okay, so I see `fixed_layout_add_cells` calls `nvmem_add_cells_from_dt(layout->nvmem, np)`. That makes sense; it's the core function for loading NVMEM cells from a fixed layout. But this raises some immediate questions in my mind. We're using the Device Tree, which is a common approach, but what about other methods used to define NVMEM cells? Specifically, I need to consider how this interacts with things like ONIE TLV (Tag-Length-Value), SL28 VPD (Vital Product Data), and the U-Boot environment. These are all other, quite common, mechanisms for storing non-volatile memory data, depending on the system and the bootloader. Are we covering those bases? Is `nvmem_add_cells_from_dt` the *only* entry point, and if so, how do we integrate with these alternative approaches? Do we have fallbacks, wrappers, or other mechanisms to handle these different sources of NVMEM configuration? I have to ensure that all common cases are supported correctly! |
| 147/2 | 2026/09/22 17:33 | tool | grepper |
0mError:no matches Args: {
"Expression": "bit_offset",
"PathPrefix": "drivers/nvmem/layouts/"
}Results: {
"error": "no matches"
} |
| 148/2 | 2026/09/22 17:33 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 44404 output: 31 thoughts: 40 Thoughts: Here's my summary, as the expert: **Investigating Call Sites of Specific Functions** Okay, so I need to track down all the places in this codebase, or project, where these two functions, `nvmem_add_cells` and `nvmem_cell_info_to_nvmem_cell_entry_nodup`, are actually being *called*. It's a fairly basic debugging task, but understanding where these functions are being used is crucial for understanding the overall data flow and identifying potential issues, optimizations, or even unintended consequences of changes I might be considering. I'm going to start by just doing a quick scan to make sure I haven't missed anything obvious. I need to make sure I haven't accidentally overlooked any call sites during previous investigations. This is the first step in creating a complete picture of the dependencies surrounding these functions. |
| 149/2 | 2026/09/22 17:33 | tool | grepper |
0mArgs:{
"Expression": "nvmem_add_cells",
"PathPrefix": "drivers/nvmem/"
}Results: {
"Output": "drivers/nvmem/core.c=670=EXPORT_SYMBOL_GPL(nvmem_add_one_cell);\n--\ndrivers/nvmem/core.c-672-/**\ndrivers/nvmem/core.c:673: * nvmem_add_cells() - Add cell information to an nvmem device\ndrivers/nvmem/core.c-674- *\n--\ndrivers/nvmem/core.c-680- */\ndrivers/nvmem/core.c:681:static int nvmem_add_cells(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c-682-\t\t const struct nvmem_cell_info *info,\n--\ndrivers/nvmem/core.c=739=static int nvmem_validate_keepouts(struct nvmem_device *nvmem)\n--\ndrivers/nvmem/core.c-791-\ndrivers/nvmem/core.c:792:int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)\ndrivers/nvmem/core.c-793-{\n--\ndrivers/nvmem/core.c-839-}\ndrivers/nvmem/core.c:840:EXPORT_SYMBOL_GPL(nvmem_add_cells_from_dt);\ndrivers/nvmem/core.c-841-\ndrivers/nvmem/core.c:842:static int nvmem_add_cells_from_legacy_of(struct nvmem_device *nvmem)\ndrivers/nvmem/core.c-843-{\ndrivers/nvmem/core.c:844:\treturn nvmem_add_cells_from_dt(nvmem, nvmem-\u003edev.of_node);\ndrivers/nvmem/core.c-845-}\n--\ndrivers/nvmem/core.c=887=struct nvmem_device *nvmem_register(const struct nvmem_config *config)\n--\ndrivers/nvmem/core.c-993-\tif (config-\u003ecells) {\ndrivers/nvmem/core.c:994:\t\trval = nvmem_add_cells(nvmem, config-\u003ecells, config-\u003encells);\ndrivers/nvmem/core.c-995-\t\tif (rval)\n--\ndrivers/nvmem/core.c-999-\tif (config-\u003eadd_legacy_fixed_of_cells) {\ndrivers/nvmem/core.c:1000:\t\trval = nvmem_add_cells_from_legacy_of(nvmem);\ndrivers/nvmem/core.c-1001-\t\tif (rval)\n--\ndrivers/nvmem/internals.h=16=struct nvmem_device {\n--\ndrivers/nvmem/internals.h-41-\ndrivers/nvmem/internals.h:42:int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np);\ndrivers/nvmem/internals.h-43-\n--\ndrivers/nvmem/layouts/fixed-layout.c=13=static int fixed_layout_add_cells(struct nvmem_layout *layout)\n--\ndrivers/nvmem/layouts/fixed-layout.c-21-\ndrivers/nvmem/layouts/fixed-layout.c:22:\tret = nvmem_add_cells_from_dt(layout-\u003envmem, np);\ndrivers/nvmem/layouts/fixed-layout.c-23-\tof_node_put(np);\n"
} |
| 150/2 | 2026/09/22 17:33 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 45530 output: 22 thoughts: 19 Thoughts: Here's my thought process, as if I were considering this function: **Digging into `nvmem_add_one_cell`** Okay, so I need to understand this `nvmem_add_one_cell` function better. My first instinct, as always, is to trace its usage. I need to figure out the calling context to understand what it's doing within the broader `nvmem` framework. So, my immediate thought is: where is this function actually *called*? Time to fire up the tools and start searching for its invocations. Knowing the call sites is key to understanding its purpose and potential impact. Let's see what the code has to tell us. |
| 151/2 | 2026/09/22 17:33 | tool | grepper |
0mArgs:{
"Expression": "nvmem_add_one_cell"
}Results: {
"Output": "Documentation/driver-api/nvmem.rst=63=struct::\n--\nDocumentation/driver-api/nvmem.rst-72-\nDocumentation/driver-api/nvmem.rst:73: int nvmem_add_one_cell(nvmem, \u0026foo_nvmem_cell);\nDocumentation/driver-api/nvmem.rst-74-\n--\ndrivers/nvmem/core.c=625=static int nvmem_cell_info_to_nvmem_cell_entry(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-642-/**\ndrivers/nvmem/core.c:643: * nvmem_add_one_cell() - Add one cell information to an nvmem device\ndrivers/nvmem/core.c-644- *\n--\ndrivers/nvmem/core.c-649- */\ndrivers/nvmem/core.c:650:int nvmem_add_one_cell(struct nvmem_device *nvmem,\ndrivers/nvmem/core.c-651-\t\t const struct nvmem_cell_info *info)\n--\ndrivers/nvmem/core.c-669-}\ndrivers/nvmem/core.c:670:EXPORT_SYMBOL_GPL(nvmem_add_one_cell);\ndrivers/nvmem/core.c-671-\n--\ndrivers/nvmem/core.c=681=static int nvmem_add_cells(struct nvmem_device *nvmem,\n--\ndrivers/nvmem/core.c-687-\tfor (i = 0; i \u003c ncells; i++) {\ndrivers/nvmem/core.c:688:\t\trval = nvmem_add_one_cell(nvmem, \u0026info[i]);\ndrivers/nvmem/core.c-689-\t\tif (rval)\n--\ndrivers/nvmem/core.c=792=int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)\n--\ndrivers/nvmem/core.c-829-\ndrivers/nvmem/core.c:830:\t\tret = nvmem_add_one_cell(nvmem, \u0026info);\ndrivers/nvmem/core.c-831-\t\tkfree(info.name);\n--\ndrivers/nvmem/layouts/onie-tlv.c=98=static int onie_tlv_add_cells(struct device *dev, struct nvmem_device *nvmem,\n--\ndrivers/nvmem/layouts/onie-tlv.c-128-\ndrivers/nvmem/layouts/onie-tlv.c:129:\t\tret = nvmem_add_one_cell(nvmem, \u0026cell);\ndrivers/nvmem/layouts/onie-tlv.c-130-\t\tif (ret) {\n--\ndrivers/nvmem/layouts/sl28vpd.c=83=static int sl28vpd_add_cells(struct nvmem_layout *layout)\n--\ndrivers/nvmem/layouts/sl28vpd.c-126-\ndrivers/nvmem/layouts/sl28vpd.c:127:\t\tret = nvmem_add_one_cell(nvmem, \u0026info);\ndrivers/nvmem/layouts/sl28vpd.c-128-\t\tif (ret) {\n--\ndrivers/nvmem/layouts/u-boot-env.c=52=static int u_boot_env_parse_cells(struct device *dev, struct nvmem_device *nvmem, uint8_t *buf,\n--\ndrivers/nvmem/layouts/u-boot-env.c-80-\ndrivers/nvmem/layouts/u-boot-env.c:81:\t\tnvmem_add_one_cell(nvmem, \u0026info);\ndrivers/nvmem/layouts/u-boot-env.c-82-\t}\n--\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c=876=static int mtk_mfg_init_nvmem_provider(struct mtk_mfg *mfg)\n--\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c-899-\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:900:\tret = nvmem_add_one_cell(nvdev, \u0026cell);\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c-901-\tif (ret) {\n--\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c-905-\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c:906:\t/* cell.np purposefully not put as nvmem_add_one_cell does not increase refcount */\ndrivers/pmdomain/mediatek/mtk-mfg-pmdomain.c-907-\n--\ninclude/linux/nvmem-provider.h=111=struct nvmem_config {\n--\ninclude/linux/nvmem-provider.h-146- *\t\t\thas this layout. The function will add layout\ninclude/linux/nvmem-provider.h:147: *\t\t\tspecific cells with nvmem_add_one_cell().\ninclude/linux/nvmem-provider.h-148- *\n--\ninclude/linux/nvmem-provider.h=171=struct nvmem_device *devm_nvmem_register(struct device *dev,\n--\ninclude/linux/nvmem-provider.h-173-\ninclude/linux/nvmem-provider.h:174:int nvmem_add_one_cell(struct nvmem_device *nvmem,\ninclude/linux/nvmem-provider.h-175-\t\t const struct nvmem_cell_info *info);\n--\ninclude/linux/nvmem-provider.h=199=devm_nvmem_register(struct device *dev, const struct nvmem_config *c)\n--\ninclude/linux/nvmem-provider.h-203-\ninclude/linux/nvmem-provider.h:204:static inline int nvmem_add_one_cell(struct nvmem_device *nvmem,\ninclude/linux/nvmem-provider.h-205-\t\t\t\t const struct nvmem_cell_info *info)\n"
} |
| 152/2 | 2026/09/22 17:33 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 47268 output: 22 thoughts: 32 Thoughts: Okay, here's my interpretation of those thoughts, presented as a first-person expert summary: **Digging into nvmem and `fixup_dt_cell_info`** Alright, time to dive in. My immediate thought is to check out `fixup_dt_cell_info`. That function name has a familiar ring, implying it's involved in, well, fixing up something related to Device Tree cell information. Probably related to the way nvmem interacts with DT data. I wonder, is this something that needs to be checked more deeply? It is most likely used within the nvmem framework. So, the next obvious question I need to answer is: where exactly *is* `fixup_dt_cell_info` used within the nvmem codebase? I need to trace its callers. Knowing its call sites will give me a better understanding of its role and potential impact. Let's see if I can use my favorite tools to figure that out. |
| 153/2 | 2026/09/22 17:33 | tool | grepper |
0mArgs:{
"Expression": "fixup_dt_cell_info"
}Results: {
"Output": "drivers/nvmem/core.c=792=int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)\n--\ndrivers/nvmem/core.c-826-\ndrivers/nvmem/core.c:827:\t\tif (nvmem-\u003efixup_dt_cell_info)\ndrivers/nvmem/core.c:828:\t\t\tnvmem-\u003efixup_dt_cell_info(nvmem, \u0026info);\ndrivers/nvmem/core.c-829-\n--\ndrivers/nvmem/core.c=887=struct nvmem_device *nvmem_register(const struct nvmem_config *config)\n--\ndrivers/nvmem/core.c-935-\tINIT_LIST_HEAD(\u0026nvmem-\u003ecells);\ndrivers/nvmem/core.c:936:\tnvmem-\u003efixup_dt_cell_info = config-\u003efixup_dt_cell_info;\ndrivers/nvmem/core.c-937-\n--\ndrivers/nvmem/imx-ocotp-ele.c=115=static int imx_ocotp_cell_pp(void *context, const char *id, int index,\n--\ndrivers/nvmem/imx-ocotp-ele.c-130-\ndrivers/nvmem/imx-ocotp-ele.c:131:static void imx_ocotp_fixup_dt_cell_info(struct nvmem_device *nvmem,\ndrivers/nvmem/imx-ocotp-ele.c-132-\t\t\t\t\t struct nvmem_cell_info *cell)\n--\ndrivers/nvmem/imx-ocotp-ele.c=138=static int imx_ele_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/imx-ocotp-ele.c-164-\tpriv-\u003econfig.add_legacy_fixed_of_cells = true;\ndrivers/nvmem/imx-ocotp-ele.c:165:\tpriv-\u003econfig.fixup_dt_cell_info = imx_ocotp_fixup_dt_cell_info;\ndrivers/nvmem/imx-ocotp-ele.c-166-\tmutex_init(\u0026priv-\u003elock);\n--\ndrivers/nvmem/imx-ocotp.c=587=MODULE_DEVICE_TABLE(of, imx_ocotp_dt_ids);\ndrivers/nvmem/imx-ocotp.c-588-\ndrivers/nvmem/imx-ocotp.c:589:static void imx_ocotp_fixup_dt_cell_info(struct nvmem_device *nvmem,\ndrivers/nvmem/imx-ocotp.c-590-\t\t\t\t\t struct nvmem_cell_info *cell)\n--\ndrivers/nvmem/imx-ocotp.c=596=static int imx_ocotp_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/imx-ocotp.c-620-\timx_ocotp_nvmem_config.priv = priv;\ndrivers/nvmem/imx-ocotp.c:621:\timx_ocotp_nvmem_config.fixup_dt_cell_info = \u0026imx_ocotp_fixup_dt_cell_info;\ndrivers/nvmem/imx-ocotp.c-622-\n--\ndrivers/nvmem/internals.h=16=struct nvmem_device {\n--\ndrivers/nvmem/internals.h-30-\tstruct list_head\tcells;\ndrivers/nvmem/internals.h:31:\tvoid (*fixup_dt_cell_info)(struct nvmem_device *nvmem,\ndrivers/nvmem/internals.h-32-\t\t\t\t struct nvmem_cell_info *cell);\n--\ndrivers/nvmem/mtk-efuse.c=36=static int mtk_efuse_gpu_speedbin_pp(void *context, const char *id, int index,\n--\ndrivers/nvmem/mtk-efuse.c-46-\ndrivers/nvmem/mtk-efuse.c:47:static void mtk_efuse_fixup_dt_cell_info(struct nvmem_device *nvmem,\ndrivers/nvmem/mtk-efuse.c-48-\t\t\t\t\t struct nvmem_cell_info *cell)\n--\ndrivers/nvmem/mtk-efuse.c=62=static int mtk_efuse_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/mtk-efuse.c-88-\tif (pdata-\u003euses_post_processing)\ndrivers/nvmem/mtk-efuse.c:89:\t\teconfig.fixup_dt_cell_info = \u0026mtk_efuse_fixup_dt_cell_info;\ndrivers/nvmem/mtk-efuse.c-90-\tnvmem = devm_nvmem_register(dev, \u0026econfig);\n--\ndrivers/nvmem/qfprom.c=319=static int qfprom_reg_read(void *context,\n--\ndrivers/nvmem/qfprom.c-337-/* Align reads to word boundary */\ndrivers/nvmem/qfprom.c:338:static void qfprom_fixup_dt_cell_info(struct nvmem_device *nvmem,\ndrivers/nvmem/qfprom.c-339-\t\t\t\t struct nvmem_cell_info *cell)\n--\ndrivers/nvmem/qfprom.c=368=static int qfprom_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/qfprom.c-376-\t\t.reg_read = qfprom_reg_read,\ndrivers/nvmem/qfprom.c:377:\t\t.fixup_dt_cell_info = qfprom_fixup_dt_cell_info,\ndrivers/nvmem/qfprom.c-378-\t};\n--\ninclude/linux/nvmem-provider.h=65=struct nvmem_cell_info {\n--\ninclude/linux/nvmem-provider.h-86- * @add_legacy_fixed_of_cells:\tRead fixed NVMEM cells from old OF syntax.\ninclude/linux/nvmem-provider.h:87: * @fixup_dt_cell_info: Will be called before a cell is added. Can be\ninclude/linux/nvmem-provider.h-88- *\t\tused to modify the nvmem_cell_info.\n--\ninclude/linux/nvmem-provider.h=111=struct nvmem_config {\n--\ninclude/linux/nvmem-provider.h-118-\tbool\t\t\tadd_legacy_fixed_of_cells;\ninclude/linux/nvmem-provider.h:119:\tvoid (*fixup_dt_cell_info)(struct nvmem_device *nvmem,\ninclude/linux/nvmem-provider.h-120-\t\t\t\t struct nvmem_cell_info *cell);\n"
} |
| 154/2 | 2026/09/22 17:34 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 49260 output: 31 thoughts: 1319 Thoughts: **Analyzing `nvmem_shift_read_buffer_in_place` Reachability on amd64** Okay, let's break this down systematically. I see `qfprom_fixup_dt_cell_info` and immediately recognize it's specific to the Qualcomm Fuse QFPROM driver (`drivers/nvmem/qfprom.c`). This is a dead end for `amd64` because that platform is based on ARM/ARM64 and therefore not relevant. The core question is whether `nvmem_shift_read_buffer_in_place` can *ever* be reached on an `amd64` system. This function is called when `cell->bit_offset || cell->nbits` is non-zero, which suggests a bit-level shift within an NVMEM cell. The key here is to figure out how such cells are *registered* on an x86 architecture. I'm thinking, Device Tree (DT). Can that be used on `amd64` in any practical scenario? Let me check: `nvmem_add_cells_from_dt`, this function relies on either an `np` or `of_node`. So I dig into the code, and what I see in that function is a check on the 'bits' property of a Device Tree node. If the `bit_offset` or `nbits` properties are set, the code is trying to parse them. However, on a standard `amd64` system, we boot with ACPI or BIOS/UEFI, not Device Tree. So, by default, the conditions for DT registration won't exist (`of_root == NULL`, `of_have_populated_dt() == false`). I need to cover all bases here: Are there any unusual circumstances where DT might be present, even on an x86 platform? Could `CONFIG_OF` be enabled? Even if enabled, at runtime, it's unlikely a DT would be present. What about `CONFIG_OF_UNITTEST`? Nope, that is for unit testing, not real device creation. `CONFIG_OF_CONFIGFS`? Could user space create DT nodes? That is an interesting question. Syzkaller might create DT overlays through configfs, but can they *attach* those nodes to an ACPI or platform NVMEM device? That seems unlikely. I recall `rtc-cmos.c`. On `amd64` that's typically ACPI or PnP, so it wouldn't have an `of_node`. Now I need to see what other NVMEM devices are present on amd64. I'll quickly check the calls to `devm_nvmem_register` and `nvmem_register`. I know `rtc-cmos.c` has no cells defined. `ee1004.c` (DDR4 SPD EEPROM) has no cells and `at24.c` (I2C EEPROM) is present. Could this be created via i2c/sysfs `new_device`? That is what I need to investigate next: `at24.c` and specifically, how cells are configured. |
| 155/2 | 2026/09/22 17:34 | tool | grepper |
0mError:no matches Args: {
"Expression": "cells",
"PathPrefix": "drivers/nvmem/at24.c"
}Results: {
"error": "no matches"
} |
| 156/2 | 2026/09/22 17:34 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 51301 output: 27 thoughts: 61 Thoughts: Okay, here's the summary, tailored for an expert audience, in the first person: **Investigating Potential Data Corruption in `at24.c` and Related NVMEM Configurations** Right, so, I've got this nagging suspicion about `at24.c` and data corruption, and the first thing that jumps out is the lack of static cells in that file. That's unusual. It makes me question how the EEPROM data is being managed, especially if it’s potentially shared with other subsystems. My immediate next step is a deep dive into the `drivers/nvmem/` directory. I need to scrutinize every single file in there that even *mentions* `.cells`, `.bit_offset`, or `.nbits`. Those are red flags for potential data structure collisions or incorrect addressing, particularly in non-volatile memory scenarios. The kernel's configuration options are another area to consider. And, of course, a broader search across the *entire* kernel source base is necessary. I'll need to use something like `grep` to hunt for any instances of `.cells` being used within any NVMEM configuration. I want to uncover every place where those structures are defined, used, and, crucially, *misused*, even indirectly. This needs to be a very thorough and exhaustive search. I want to be *certain* there aren't any potential concurrency issues or memory access conflicts. This is going to be crucial to determining the scope and nature of this issue. |
| 157/2 | 2026/09/22 17:34 | tool | grepper |
0mArgs:{
"Expression": "\\.cells\\s*=",
"PathPrefix": "drivers/"
}Results: {
"Output": "drivers/hwmon/pmbus/adm1266.c=579=static int adm1266_config_nvmem(struct adm1266_data *data)\n--\ndrivers/hwmon/pmbus/adm1266.c-586-\tdata-\u003envmem_config.reg_read = adm1266_nvmem_read;\ndrivers/hwmon/pmbus/adm1266.c:587:\tdata-\u003envmem_config.cells = adm1266_nvmem_cells;\ndrivers/hwmon/pmbus/adm1266.c-588-\tdata-\u003envmem_config.ncells = ARRAY_SIZE(adm1266_nvmem_cells);\n--\ndrivers/mfd/intel-m10-bmc-pmci.c=376=static const struct intel_m10bmc_platform_info m10bmc_pmci_n6000 = {\ndrivers/mfd/intel-m10-bmc-pmci.c:377:\t.cells = m10bmc_pmci_n6000_bmc_subdevs,\ndrivers/mfd/intel-m10-bmc-pmci.c-378-\t.n_cells = ARRAY_SIZE(m10bmc_pmci_n6000_bmc_subdevs),\n--\ndrivers/mfd/intel-m10-bmc-spi.c=138=static const struct intel_m10bmc_platform_info m10bmc_spi_n3000 = {\ndrivers/mfd/intel-m10-bmc-spi.c:139:\t.cells = m10bmc_pacn3000_subdevs,\ndrivers/mfd/intel-m10-bmc-spi.c-140-\t.n_cells = ARRAY_SIZE(m10bmc_pacn3000_subdevs),\n--\ndrivers/mfd/intel-m10-bmc-spi.c=146=static const struct intel_m10bmc_platform_info m10bmc_spi_d5005 = {\ndrivers/mfd/intel-m10-bmc-spi.c:147:\t.cells = m10bmc_d5005_subdevs,\ndrivers/mfd/intel-m10-bmc-spi.c-148-\t.n_cells = ARRAY_SIZE(m10bmc_d5005_subdevs),\n--\ndrivers/mfd/intel-m10-bmc-spi.c=154=static const struct intel_m10bmc_platform_info m10bmc_spi_n5010 = {\ndrivers/mfd/intel-m10-bmc-spi.c:155:\t.cells = m10bmc_n5010_subdevs,\ndrivers/mfd/intel-m10-bmc-spi.c-156-\t.n_cells = ARRAY_SIZE(m10bmc_n5010_subdevs),\n--\ndrivers/mfd/mt6397-core.c=296=static const struct chip_data mt6323_core = {\n--\ndrivers/mfd/mt6397-core.c-298-\t.cid_shift = 0,\ndrivers/mfd/mt6397-core.c:299:\t.cells = mt6323_devs,\ndrivers/mfd/mt6397-core.c-300-\t.cell_size = ARRAY_SIZE(mt6323_devs),\n--\ndrivers/mfd/mt6397-core.c=304=static const struct chip_data mt6328_core = {\n--\ndrivers/mfd/mt6397-core.c-306-\t.cid_shift = 8,\ndrivers/mfd/mt6397-core.c:307:\t.cells = mt6328_devs,\ndrivers/mfd/mt6397-core.c-308-\t.cell_size = ARRAY_SIZE(mt6328_devs),\n--\ndrivers/mfd/mt6397-core.c=312=static const struct chip_data mt6357_core = {\n--\ndrivers/mfd/mt6397-core.c-314-\t.cid_shift = 8,\ndrivers/mfd/mt6397-core.c:315:\t.cells = mt6357_devs,\ndrivers/mfd/mt6397-core.c-316-\t.cell_size = ARRAY_SIZE(mt6357_devs),\n--\ndrivers/mfd/mt6397-core.c=320=static const struct chip_data mt6331_mt6332_core = {\n--\ndrivers/mfd/mt6397-core.c-322-\t.cid_shift = 8,\ndrivers/mfd/mt6397-core.c:323:\t.cells = mt6331_mt6332_devs,\ndrivers/mfd/mt6397-core.c-324-\t.cell_size = ARRAY_SIZE(mt6331_mt6332_devs),\n--\ndrivers/mfd/mt6397-core.c=328=static const struct chip_data mt6358_core = {\n--\ndrivers/mfd/mt6397-core.c-330-\t.cid_shift = 8,\ndrivers/mfd/mt6397-core.c:331:\t.cells = mt6358_devs,\ndrivers/mfd/mt6397-core.c-332-\t.cell_size = ARRAY_SIZE(mt6358_devs),\n--\ndrivers/mfd/mt6397-core.c=336=static const struct chip_data mt6359_core = {\n--\ndrivers/mfd/mt6397-core.c-338-\t.cid_shift = 8,\ndrivers/mfd/mt6397-core.c:339:\t.cells = mt6359_devs,\ndrivers/mfd/mt6397-core.c-340-\t.cell_size = ARRAY_SIZE(mt6359_devs),\n--\ndrivers/mfd/mt6397-core.c=344=static const struct chip_data mt6397_core = {\n--\ndrivers/mfd/mt6397-core.c-346-\t.cid_shift = 0,\ndrivers/mfd/mt6397-core.c:347:\t.cells = mt6397_devs,\ndrivers/mfd/mt6397-core.c-348-\t.cell_size = ARRAY_SIZE(mt6397_devs),\n--\ndrivers/mfd/rohm-bd96801.c=583=static const struct bd968xx bd96801_data = {\n--\ndrivers/mfd/rohm-bd96801.c-590-\t.regmap_config = \u0026bd96801_regmap_config,\ndrivers/mfd/rohm-bd96801.c:591:\t.cells = bd96801_cells,\ndrivers/mfd/rohm-bd96801.c-592-\t.num_cells = ARRAY_SIZE(bd96801_cells),\n--\ndrivers/mfd/rohm-bd96801.c=597=static const struct bd968xx bd96802_data = {\n--\ndrivers/mfd/rohm-bd96801.c-604-\t.regmap_config = \u0026bd96802_regmap_config,\ndrivers/mfd/rohm-bd96801.c:605:\t.cells = bd96802_cells,\ndrivers/mfd/rohm-bd96801.c-606-\t.num_cells = ARRAY_SIZE(bd96802_cells),\n--\ndrivers/mfd/rohm-bd96801.c=611=static const struct bd968xx bd96805_data = {\n--\ndrivers/mfd/rohm-bd96801.c-618-\t.regmap_config = \u0026bd96801_regmap_config,\ndrivers/mfd/rohm-bd96801.c:619:\t.cells = bd96805_cells,\ndrivers/mfd/rohm-bd96801.c-620-\t.num_cells = ARRAY_SIZE(bd96805_cells),\n--\ndrivers/mfd/rohm-bd96801.c=625=static struct bd968xx bd96806_data = {\n--\ndrivers/mfd/rohm-bd96801.c-632-\t.regmap_config = \u0026bd96802_regmap_config,\ndrivers/mfd/rohm-bd96801.c:633:\t.cells = bd96806_cells,\ndrivers/mfd/rohm-bd96801.c-634-\t.num_cells = ARRAY_SIZE(bd96806_cells),\n--\ndrivers/mfd/ti-lmu.c=122=static const struct ti_lmu_data chip##_data =\t\\\ndrivers/mfd/ti-lmu.c-123-{\t\t\t\t\t\t\\\ndrivers/mfd/ti-lmu.c:124:\t.cells = chip##_devices,\t\t\\\ndrivers/mfd/ti-lmu.c-125-\t.num_cells = ARRAY_SIZE(chip##_devices),\\\n--\ndrivers/mfd/tps65219.c=458=static const struct tps65219_chip_data chip_info_table[] = {\n--\ndrivers/mfd/tps65219.c-460-\t\t.irq_chip = \u0026tps65214_irq_chip,\ndrivers/mfd/tps65219.c:461:\t\t.cells = tps65214_cells,\ndrivers/mfd/tps65219.c-462-\t\t.n_cells = ARRAY_SIZE(tps65214_cells),\n--\ndrivers/mfd/tps65219.c-465-\t\t.irq_chip = \u0026tps65215_irq_chip,\ndrivers/mfd/tps65219.c:466:\t\t.cells = tps65215_cells,\ndrivers/mfd/tps65219.c-467-\t\t.n_cells = ARRAY_SIZE(tps65215_cells),\n--\ndrivers/mfd/tps65219.c-470-\t\t.irq_chip = \u0026tps65219_irq_chip,\ndrivers/mfd/tps65219.c:471:\t\t.cells = tps65219_cells,\ndrivers/mfd/tps65219.c-472-\t\t.n_cells = ARRAY_SIZE(tps65219_cells),\n--\ndrivers/nvmem/brcm_nvram.c=212=static int brcm_nvram_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/brcm_nvram.c-235-\tconfig.dev = dev;\ndrivers/nvmem/brcm_nvram.c:236:\tconfig.cells = priv-\u003ecells;\ndrivers/nvmem/brcm_nvram.c-237-\tconfig.ncells = priv-\u003encells;\n--\ndrivers/power/supply/max1720x_battery.c=514=static int max1720x_probe_nvmem(struct i2c_client *client,\n--\ndrivers/power/supply/max1720x_battery.c-520-\t\t.name = \"max1720x_nvmem\",\ndrivers/power/supply/max1720x_battery.c:521:\t\t.cells = max1720x_nvmem_cells,\ndrivers/power/supply/max1720x_battery.c-522-\t\t.ncells = ARRAY_SIZE(max1720x_nvmem_cells),\n--\ndrivers/s390/char/con3270.c=891=static struct tty3270_line *tty3270_alloc_screen(struct tty3270 *tp, unsigned int rows,\n--\ndrivers/s390/char/con3270.c-901-\tfor (lines = 0; lines \u003c allocated; lines++) {\ndrivers/s390/char/con3270.c:902:\t\tscreen[lines].cells = kzalloc_objs(struct tty3270_cell, cols);\ndrivers/s390/char/con3270.c-903-\t\tif (!screen[lines].cells)\n--\ndrivers/soc/tegra/fuse/fuse-tegra.c=139=static int tegra_fuse_probe(struct platform_device *pdev)\n--\ndrivers/soc/tegra/fuse/fuse-tegra.c-207-\tnvmem.owner = THIS_MODULE;\ndrivers/soc/tegra/fuse/fuse-tegra.c:208:\tnvmem.cells = fuse-\u003esoc-\u003ecells;\ndrivers/soc/tegra/fuse/fuse-tegra.c-209-\tnvmem.ncells = fuse-\u003esoc-\u003enum_cells;\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=220=const struct tegra_fuse_soc tegra114_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-225-\t.num_lookups = ARRAY_SIZE(tegra114_fuse_lookups),\ndrivers/soc/tegra/fuse/fuse-tegra30.c:226:\t.cells = tegra114_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-227-\t.num_cells = ARRAY_SIZE(tegra114_fuse_cells),\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=380=const struct tegra_fuse_soc tegra124_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-385-\t.num_lookups = ARRAY_SIZE(tegra124_fuse_lookups),\ndrivers/soc/tegra/fuse/fuse-tegra30.c:386:\t.cells = tegra124_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-387-\t.num_cells = ARRAY_SIZE(tegra124_fuse_cells),\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=551=const struct tegra_fuse_soc tegra210_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-555-\t.lookups = tegra210_fuse_lookups,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:556:\t.cells = tegra210_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-557-\t.num_cells = ARRAY_SIZE(tegra210_fuse_cells),\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=609=const struct tegra_fuse_soc tegra186_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-613-\t.num_lookups = ARRAY_SIZE(tegra186_fuse_lookups),\ndrivers/soc/tegra/fuse/fuse-tegra30.c:614:\t.cells = tegra186_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-615-\t.num_cells = ARRAY_SIZE(tegra186_fuse_cells),\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=702=const struct tegra_fuse_soc tegra194_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-706-\t.num_lookups = ARRAY_SIZE(tegra194_fuse_lookups),\ndrivers/soc/tegra/fuse/fuse-tegra30.c:707:\t.cells = tegra194_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-708-\t.num_cells = ARRAY_SIZE(tegra194_fuse_cells),\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=772=const struct tegra_fuse_soc tegra234_fuse_soc = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-776-\t.num_lookups = ARRAY_SIZE(tegra234_fuse_lookups),\ndrivers/soc/tegra/fuse/fuse-tegra30.c:777:\t.cells = tegra234_fuse_cells,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-778-\t.num_cells = ARRAY_SIZE(tegra234_fuse_cells),\n"
} |
| 158/2 | 2026/09/22 17:34 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 56247 output: 38 thoughts: 73 Thoughts: Here's my take on those thoughts: **Analyzing NVMem Cell Assignments in the Linux Kernel** Right, okay, let's dive into this NVMem configuration landscape. That list is a bit intimidating, but no problem, we'll break it down systematically. My immediate thought is, let's focus on any driver that's directly assigning `.cells` within the `nvmem` configuration. That's a good starting point to understand the interactions. Alright, first entry, `drivers/hwmon/pmbus/adm1266.c`. And that references `adm1266_nvmem_cells`. Time to scrutinize `adm1266_nvmem_cells` itself and see how that's being handled. This could be interesting. Let's see what's being configured with these cells. |
| 159/2 | 2026/09/22 17:34 | tool | grepper |
0mArgs:{
"Expression": "adm1266_nvmem_cells",
"PathPrefix": "drivers/hwmon/pmbus/"
}Results: {
"Output": "drivers/hwmon/pmbus/adm1266.c=55=struct adm1266_data {\n--\ndrivers/hwmon/pmbus/adm1266.c-68-\ndrivers/hwmon/pmbus/adm1266.c:69:static const struct nvmem_cell_info adm1266_nvmem_cells[] = {\ndrivers/hwmon/pmbus/adm1266.c-70-\t{\n--\ndrivers/hwmon/pmbus/adm1266.c=579=static int adm1266_config_nvmem(struct adm1266_data *data)\n--\ndrivers/hwmon/pmbus/adm1266.c-586-\tdata-\u003envmem_config.reg_read = adm1266_nvmem_read;\ndrivers/hwmon/pmbus/adm1266.c:587:\tdata-\u003envmem_config.cells = adm1266_nvmem_cells;\ndrivers/hwmon/pmbus/adm1266.c:588:\tdata-\u003envmem_config.ncells = ARRAY_SIZE(adm1266_nvmem_cells);\ndrivers/hwmon/pmbus/adm1266.c-589-\tdata-\u003envmem_config.priv = data;\n--\ndrivers/hwmon/pmbus/adm1266.c-591-\tdata-\u003envmem_config.word_size = 1;\ndrivers/hwmon/pmbus/adm1266.c:592:\tdata-\u003envmem_config.size = adm1266_nvmem_cells[0].bytes;\ndrivers/hwmon/pmbus/adm1266.c-593-\n"
} |
| 160/2 | 2026/09/22 17:34 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 56983 output: 42 thoughts: 16 Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and rendered in the first person: **Analyzing the `adm1266_nvmem_cells` Structure** Alright, let's dive into this `adm1266_nvmem_cells` thing. My immediate thought is, what exactly are we talking about here? Based on the naming convention, I'm betting this is related to the non-volatile memory cell definitions for an ADM1266, probably a power management IC, right? I'm already mentally sketching out the architecture – thinking about flash memory, perhaps OTP (One-Time Programmable) cells, or maybe even eFuse configurations. I need to understand if this is a low-level definition, a configuration struct, or perhaps even a software abstraction layer. Is this related to calibration data, device-specific settings, or some kind of fault logging? The "nvmem" part is key. That tells me these cells are persistent across power cycles, meaning they hold critical data. I need to quickly ascertain what the structure actually *does* with these cells. What are the read/write access methods? How is it integrated with the rest of the driver or firmware? Are there any security considerations I should immediately be aware of like data integrity, access permissions, or potential vulnerabilities? I'm going to want to examine the surrounding code to determine how this interacts with the rest of the system; are there error checking procedures and recovery methods, or is there the potential for data corruption? This needs a thorough investigation. |
| 161/2 | 2026/09/22 17:34 | tool | read-file |
0mArgs:{
"File": "drivers/hwmon/pmbus/adm1266.c",
"FirstLine": 68,
"LineCount": 15
}Results: {
"Contents": " 68:\t\n 69:\tstatic const struct nvmem_cell_info adm1266_nvmem_cells[] = {\n 70:\t\t{\n 71:\t\t\t.name = \"blackbox\",\n 72:\t\t\t.offset = ADM1266_BLACKBOX_OFFSET,\n 73:\t\t\t.bytes = 2048,\n 74:\t\t},\n 75:\t};\n 76:\t\n 77:\tDECLARE_CRC8_TABLE(pmbus_crc_table);\n 78:\t\n 79:\t/*\n 80:\t * Different from Block Read as it sends data and waits for the slave to\n 81:\t * return a value dependent on that data. The protocol is simply a Write Block\n 82:\t * followed by a Read Block without the Read-Block command field and the\n"
} |
| 162/2 | 2026/09/22 17:34 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 57592 output: 33 thoughts: 29 Thoughts: Here's my attempt at summarizing the thought process, tailored for an expert audience: **Initial Assessment: Bitwise Confusion** Okay, `.bit_offset = 0`, `.nbits = 0`... that's a red flag. This signals a potential problem with how bitfields are being handled. Zero values for both offset and number of bits is highly suspect, and raises a few immediate questions. Is this an uninitialized structure, or a deliberate but ineffective configuration? Are there subsequent modifications that are supposed to happen? My gut tells me this needs deeper investigation, as it suggests a fundamental misunderstanding of the data structure, or an oversight. My primary concern stems from the practical implications. Improper bitfield configuration can lead to a number of potential errors in a system: data corruption, alignment issues, or improper memory access to name a few. My next step would be to figure out what context I'm in. Immediately, I need to know where these fields are defined and used. That means I need to think about which source file this relates to, and `brcm_nvram.c` just jumped into my mind. I've worked with Broadcom-based systems before, and the NVRAM routines are notorious for their reliance on bitwise manipulation. It's a prime suspect for an area where these sorts of issues could manifest. Time to dive into the `brcm_nvram.c` code and see if I can find the data structure in question and related operations, and figure out the impact of these values. |
| 163/2 | 2026/09/22 17:34 | tool | grepper |
0mArgs:{
"Expression": "cells",
"PathPrefix": "drivers/nvmem/brcm_nvram.c"
}Results: {
"Output": "drivers/nvmem/brcm_nvram.c-27- * @padding_byte:\tPadding value used to fill remaining space\ndrivers/nvmem/brcm_nvram.c:28: * @cells:\t\tArray of discovered NVMEM cells\ndrivers/nvmem/brcm_nvram.c:29: * @ncells:\t\tNumber of elements in cells\ndrivers/nvmem/brcm_nvram.c-30- */\ndrivers/nvmem/brcm_nvram.c=31=struct brcm_nvram {\n--\ndrivers/nvmem/brcm_nvram.c-36-\tuint8_t padding_byte;\ndrivers/nvmem/brcm_nvram.c:37:\tstruct nvmem_cell_info *cells;\ndrivers/nvmem/brcm_nvram.c:38:\tint ncells;\ndrivers/nvmem/brcm_nvram.c-39-};\n--\ndrivers/nvmem/brcm_nvram.c=103=static int brcm_nvram_read_post_process_macaddr(void *context, const char *id, int index,\n--\ndrivers/nvmem/brcm_nvram.c-121-\ndrivers/nvmem/brcm_nvram.c:122:static int brcm_nvram_add_cells(struct brcm_nvram *priv, uint8_t *data,\ndrivers/nvmem/brcm_nvram.c-123-\t\t\t\tsize_t len)\n--\ndrivers/nvmem/brcm_nvram.c-133-\ndrivers/nvmem/brcm_nvram.c:134:\tpriv-\u003encells = 0;\ndrivers/nvmem/brcm_nvram.c-135-\tfor (var = data + sizeof(struct brcm_nvram_header);\n--\ndrivers/nvmem/brcm_nvram.c-137-\t var += strlen(var) + 1) {\ndrivers/nvmem/brcm_nvram.c:138:\t\tpriv-\u003encells++;\ndrivers/nvmem/brcm_nvram.c-139-\t}\ndrivers/nvmem/brcm_nvram.c-140-\ndrivers/nvmem/brcm_nvram.c:141:\tpriv-\u003ecells = devm_kcalloc(dev, priv-\u003encells, sizeof(*priv-\u003ecells), GFP_KERNEL);\ndrivers/nvmem/brcm_nvram.c:142:\tif (!priv-\u003ecells) {\ndrivers/nvmem/brcm_nvram.c-143-\t\terr = -ENOMEM;\n--\ndrivers/nvmem/brcm_nvram.c-163-\ndrivers/nvmem/brcm_nvram.c:164:\t\tpriv-\u003ecells[idx].name = name;\ndrivers/nvmem/brcm_nvram.c:165:\t\tpriv-\u003ecells[idx].offset = value - (char *)data;\ndrivers/nvmem/brcm_nvram.c:166:\t\tpriv-\u003ecells[idx].bytes = strlen(value);\ndrivers/nvmem/brcm_nvram.c:167:\t\tpriv-\u003ecells[idx].np = of_get_child_by_name(dev-\u003eof_node, priv-\u003ecells[idx].name);\ndrivers/nvmem/brcm_nvram.c-168-\t\tif (!strcmp(name, \"et0macaddr\") ||\n--\ndrivers/nvmem/brcm_nvram.c-170-\t\t !strcmp(name, \"et2macaddr\")) {\ndrivers/nvmem/brcm_nvram.c:171:\t\t\tpriv-\u003ecells[idx].raw_len = strlen(value);\ndrivers/nvmem/brcm_nvram.c:172:\t\t\tpriv-\u003ecells[idx].bytes = ETH_ALEN;\ndrivers/nvmem/brcm_nvram.c:173:\t\t\tpriv-\u003ecells[idx].read_post_process = brcm_nvram_read_post_process_macaddr;\ndrivers/nvmem/brcm_nvram.c-174-\t\t}\n--\ndrivers/nvmem/brcm_nvram.c=182=static int brcm_nvram_parse(struct brcm_nvram *priv)\n--\ndrivers/nvmem/brcm_nvram.c-204-\ndrivers/nvmem/brcm_nvram.c:205:\terr = brcm_nvram_add_cells(priv, priv-\u003edata, len);\ndrivers/nvmem/brcm_nvram.c-206-\tif (err)\ndrivers/nvmem/brcm_nvram.c:207:\t\tdev_err(dev, \"Failed to add cells: %d\\n\", err);\ndrivers/nvmem/brcm_nvram.c-208-\n--\ndrivers/nvmem/brcm_nvram.c=212=static int brcm_nvram_probe(struct platform_device *pdev)\n--\ndrivers/nvmem/brcm_nvram.c-235-\tconfig.dev = dev;\ndrivers/nvmem/brcm_nvram.c:236:\tconfig.cells = priv-\u003ecells;\ndrivers/nvmem/brcm_nvram.c:237:\tconfig.ncells = priv-\u003encells;\ndrivers/nvmem/brcm_nvram.c-238-\tconfig.priv = priv;\n"
} |
| 164/2 | 2026/09/22 17:34 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 59312 output: 20 thoughts: 396 Thoughts: **Investigating Potential Compatibility Issues** Okay, so I'm looking at this `brcm_nvram.c` code, and the `.bit_offset` and `.nbits` are both zero. That seems straightforward enough, but then my brain jumps to the Tegra fuse implementation. Now, in `tegra114_fuse_cells`, I see `.bit_offset` is 0, but `.nbits` is 32. Hmm, if `.bit_offset` is 0 and `.nbits` is 32, does that trigger the `nvmem_shift_read_buffer_in_place` function? Let's quickly check the `__nvmem_cell_read` function: ```c /* shift bits in-place */ if (cell->bit_offset || cell->nbits) nvmem_shift_read_buffer_in_place(cell, buf); ``` Yep, since `cell->nbits` is 32, the `if` condition *is* true! But wait a second... Tegra is an Nvidia Tegra ARM/ARM64 SoC! And *not* amd64! This is where things start to get interesting. Now, I start to think about the broader picture. What about `qfprom.c`? That's Qualcomm Snapdragon SoC - also ARM/ARM64. And `mtk-efuse.c`? MediaTek SoC - again, ARM/ARM64. Same story with `imx-ocotp.c` and `imx-ocotp-ele.c` - NXP i.MX SoC, ARM/ARM64. Okay, so the underlying issue is becoming clearer. Are there *any* drivers that utilize `bit_offset` or `nbits` that are actually intended to run on an `amd64` architecture? It seems highly improbable. I need to do a thorough sweep of the kernel source to be absolutely sure. Time to search the entire codebase for occurrences of `\.nbits\s*=`, and maybe `\.bit_offset\s*=`, to confirm. |
| 165/2 | 2026/09/22 17:34 | tool | grepper |
0mArgs:{
"Expression": "\\.nbits\\s*="
}Results: {
"Output": "arch/sparc/kernel/adi_64.c=38=void __init mdesc_adi_init(void)\n--\narch/sparc/kernel/adi_64.c-92-\t\tgoto adi_not_found;\narch/sparc/kernel/adi_64.c:93:\tadi_state.caps.nbits = *val;\narch/sparc/kernel/adi_64.c-94-\n--\narch/sparc/kernel/adi_64.c-118-\tadi_state.caps.blksz = 0;\narch/sparc/kernel/adi_64.c:119:\tadi_state.caps.nbits = 0;\narch/sparc/kernel/adi_64.c-120-\tif (hp)\n--\ncrypto/ecc_curve_defs.h=18=static struct ecc_curve nist_p192 = {\ncrypto/ecc_curve_defs.h-19-\t.name = \"nist_192\",\ncrypto/ecc_curve_defs.h:20:\t.nbits = 192,\ncrypto/ecc_curve_defs.h-21-\t.g = {\n--\ncrypto/ecc_curve_defs.h=45=static struct ecc_curve nist_p256 = {\ncrypto/ecc_curve_defs.h-46-\t.name = \"nist_256\",\ncrypto/ecc_curve_defs.h:47:\t.nbits = 256,\ncrypto/ecc_curve_defs.h-48-\t.g = {\n--\ncrypto/ecc_curve_defs.h=78=static struct ecc_curve nist_p384 = {\ncrypto/ecc_curve_defs.h-79-\t.name = \"nist_384\",\ncrypto/ecc_curve_defs.h:80:\t.nbits = 384,\ncrypto/ecc_curve_defs.h-81-\t.g = {\n--\ncrypto/ecc_curve_defs.h=123=static struct ecc_curve nist_p521 = {\ncrypto/ecc_curve_defs.h-124-\t.name = \"nist_521\",\ncrypto/ecc_curve_defs.h:125:\t.nbits = 521,\ncrypto/ecc_curve_defs.h-126-\t.g = {\n--\ncrypto/ecc_curve_defs.h=144=static const struct ecc_curve ecc_25519 = {\ncrypto/ecc_curve_defs.h-145-\t.name = \"curve25519\",\ncrypto/ecc_curve_defs.h:146:\t.nbits = 255,\ncrypto/ecc_curve_defs.h-147-\t.g = {\n--\ncrypto/ecrdsa_defs.h=48=static struct ecc_curve gost_cp256a = {\ncrypto/ecrdsa_defs.h-49-\t.name = \"cp256a\",\ncrypto/ecrdsa_defs.h:50:\t.nbits = 256,\ncrypto/ecrdsa_defs.h-51-\t.g = {\n--\ncrypto/ecrdsa_defs.h=82=static struct ecc_curve gost_cp256b = {\ncrypto/ecrdsa_defs.h-83-\t.name = \"cp256b\",\ncrypto/ecrdsa_defs.h:84:\t.nbits = 256,\ncrypto/ecrdsa_defs.h-85-\t.g = {\n--\ncrypto/ecrdsa_defs.h=120=static struct ecc_curve gost_cp256c = {\ncrypto/ecrdsa_defs.h-121-\t.name = \"cp256c\",\ncrypto/ecrdsa_defs.h:122:\t.nbits = 256,\ncrypto/ecrdsa_defs.h-123-\t.g = {\n--\ncrypto/ecrdsa_defs.h=170=static struct ecc_curve gost_tc512a = {\ncrypto/ecrdsa_defs.h-171-\t.name = \"tc512a\",\ncrypto/ecrdsa_defs.h:172:\t.nbits = 512,\ncrypto/ecrdsa_defs.h-173-\t.g = {\n--\ncrypto/ecrdsa_defs.h=216=static struct ecc_curve gost_tc512b = {\ncrypto/ecrdsa_defs.h-217-\t.name = \"tc512b\",\ncrypto/ecrdsa_defs.h:218:\t.nbits = 512,\ncrypto/ecrdsa_defs.h-219-\t.g = {\n--\ndrivers/nvmem/core.c=792=int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)\n--\ndrivers/nvmem/core.c-815-\t\t\tinfo.bit_offset = be32_to_cpup(addr++);\ndrivers/nvmem/core.c:816:\t\t\tinfo.nbits = be32_to_cpup(addr);\ndrivers/nvmem/core.c-817-\t\t\tif (info.bit_offset \u003e= BITS_PER_BYTE * info.bytes ||\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=96=static const struct nvmem_cell_info tegra114_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-101-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:102:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-103-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-107-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:108:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-109-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-113-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:114:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-115-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-119-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:120:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-121-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-125-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:126:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-127-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-131-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:132:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-133-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-137-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:138:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-139-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-143-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:144:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-145-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-149-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:150:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-151-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-155-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:156:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-157-\t},\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=234=static const struct nvmem_cell_info tegra124_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-239-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:240:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-241-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-245-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:246:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-247-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-251-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:252:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-253-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-257-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:258:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-259-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-263-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:264:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-265-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-269-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:270:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-271-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-275-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:276:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-277-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-281-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:282:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-283-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-287-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:288:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-289-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-293-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:294:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-295-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-299-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:300:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-301-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-305-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:306:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-307-\t},\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=394=static const struct nvmem_cell_info tegra210_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-399-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:400:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-401-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-405-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:406:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-407-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-411-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:412:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-413-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-417-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:418:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-419-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-423-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:424:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-425-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-429-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:430:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-431-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-435-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:436:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-437-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-441-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:442:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-443-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-447-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:448:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-449-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-453-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:454:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-455-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-459-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:460:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-461-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-465-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:466:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-467-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-471-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:472:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-473-\t},\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=565=static const struct nvmem_cell_info tegra186_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-570-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:571:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-572-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-576-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:577:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-578-\t},\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=624=static const struct nvmem_cell_info tegra194_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-629-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:630:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-631-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-635-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:636:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-637-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-641-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:642:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-643-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-647-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:648:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-649-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-653-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:654:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-655-\t},\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c=717=static const struct nvmem_cell_info tegra234_fuse_cells[] = {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-722-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:723:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-724-\t}, {\n--\ndrivers/soc/tegra/fuse/fuse-tegra30.c-728-\t\t.bit_offset = 0,\ndrivers/soc/tegra/fuse/fuse-tegra30.c:729:\t\t.nbits = 32,\ndrivers/soc/tegra/fuse/fuse-tegra30.c-730-\t},\n--\nfs/ntfs3/super.c=968=static int ntfs_init_from_boot(struct super_block *sb, u32 sector_size,\n--\nfs/ntfs3/super.c-1179-\nfs/ntfs3/super.c:1180:\tsbi-\u003eused.bitmap.nbits = clusters;\nfs/ntfs3/super.c-1181-\n--\ninclude/sound/soc.h=33=struct platform_device;\n--\ninclude/sound/soc.h-385-\t.private_value = (unsigned long)\u0026(struct soc_mreg_control) \\\ninclude/sound/soc.h:386:\t\t{.regbase = xregbase, .regcount = xregcount, .nbits = xnbits, \\\ninclude/sound/soc.h-387-\t\t.invert = xinvert, .min = xmin, .max = xmax} }\n--\nlib/bitmap-str.c=341=int bitmap_parselist(const char *buf, unsigned long *maskp, int nmaskbits)\n--\nlib/bitmap-str.c-345-\nlib/bitmap-str.c:346:\tr.nbits = nmaskbits;\nlib/bitmap-str.c-347-\tbitmap_zero(maskp, r.nbits);\n--\nsound/soc/fsl/fsl_easrc.c=126=static int fsl_easrc_set_reg(struct snd_kcontrol *kcontrol,\n--\nsound/soc/fsl/fsl_easrc.c-190-\t.private_value = (unsigned long)\u0026(struct soc_mreg_control) \\\nsound/soc/fsl/fsl_easrc.c:191:\t\t{ .regbase = xreg, .regcount = 1, .nbits = 32, \\\nsound/soc/fsl/fsl_easrc.c-192-\t\t .invert = 0, .min = 0, .max = 0xffffffff, } }\n--\nsound/soc/fsl/fsl_easrc.c-199-\t.private_value = (unsigned long)\u0026(struct soc_mreg_control) \\\nsound/soc/fsl/fsl_easrc.c:200:\t\t{ .regbase = xreg, .regcount = 1, .nbits = 32, \\\nsound/soc/fsl/fsl_easrc.c-201-\t\t .invert = 0, .min = 0, .max = 2, } }\n--\nsound/soc/fsl/fsl_utils.h=30=void fsl_asoc_constrain_rates(struct snd_pcm_hw_constraint_list *target_constr,\n--\nsound/soc/fsl/fsl_utils.h-42-\t.private_value = (unsigned long)\u0026(struct soc_mreg_control) \\\nsound/soc/fsl/fsl_utils.h:43:\t\t{.regbase = xregbase, .regcount = xregcount, .nbits = xnbits, \\\nsound/soc/fsl/fsl_utils.h-44-\t\t.invert = xinvert, .min = xmin, .max = xmax} }\n--\nsound/soc/tegra/tegra186_asrc.c=652=ASRC_SOURCE_DECL(src_select6, 5);\n--\nsound/soc/tegra/tegra186_asrc.c-665-\t\t.regcount\t= 1,\t\t\t\t\t\\\nsound/soc/tegra/tegra186_asrc.c:666:\t\t.nbits\t\t= 32,\t\t\t\t\t\\\nsound/soc/tegra/tegra186_asrc.c-667-\t\t.invert\t\t= 0,\t\t\t\t\t\\\n--\ntools/perf/util/mmap.c=238=void mmap__munmap(struct mmap *map)\n--\ntools/perf/util/mmap.c-241-\tmap-\u003eaffinity_mask.bits = NULL;\ntools/perf/util/mmap.c:242:\tmap-\u003eaffinity_mask.nbits = 0;\ntools/perf/util/mmap.c-243-\n--\ntools/perf/util/mmap.c=272=static int perf_mmap__setup_affinity_mask(struct mmap *map, struct mmap_params *mp)\ntools/perf/util/mmap.c-273-{\ntools/perf/util/mmap.c:274:\tmap-\u003eaffinity_mask.nbits = cpu__max_cpu().cpu;\ntools/perf/util/mmap.c-275-\tmap-\u003eaffinity_mask.bits = bitmap_zalloc(map-\u003eaffinity_mask.nbits);\n"
} |
| 166/2 | 2026/09/22 17:34 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 67045 output: 29 thoughts: 1084 Thoughts: **Analysis of `nvmem_shift_read_buffer_in_place` Applicability to amd64** Okay, let's break this down systematically. I'm focusing on whether `nvmem_shift_read_buffer_in_place` can ever be hit on an amd64 system, because if it *can't*, then it's not worth fuzzing. The logic seems clear enough, but let's be sure. First, I identified that the crucial condition triggering the call to `nvmem_shift_read_buffer_in_place` within `__nvmem_cell_read` is `cell->bit_offset || cell->nbits`. My initial investigation showed that both `bit_offset` and `nbits` are assigned in `nvmem_add_cells_from_dt`, which is used in several SoC-specific drivers (like Tegra, Qualcomm, MediaTek, i.MX) and within static definition `.nbits=32` of `fuse-tegra30.c`. So my first thought was it probably can't. Now, I double-checked everywhere where `bit_offset` or `nbits` is assigned. The key assignments are: * In `nvmem_add_cells_from_dt` (which reads from device tree) * In `fuse-tegra30.c` * In `nvmem/qfprom.c` And by carefully reviewing the code, I confirmed that there are no other places. The really crucial question is: Can those assignments *happen* on `amd64`? We're concerned because the fuzzing guidelines say we should skip paths that are *exclusive* to other architectures. Let's address the device tree part. Can `amd64` systems use Device Tree? Yes, of course. x86 has support for Device Tree. Let's confirm by searching the kernel for `arch/x86/` for `devicetree` or `of_` or `CONFIG_OF`. So, it's possible for `nvmem_add_cells_from_dt` to run on `amd64`. So the key question is whether or not we're using those Device Tree defined nodes, or static definitions on AMD64. Thus, based on the documented negative criteria for fuzzing, I *think* this is NOT a candidate for skipping. We can't say that this code is *exclusively* unreachable on amd64. Therefore, it is *WorthFuzzing=true*. |
| 167/2 | 2026/09/22 17:35 | tool | grepper |
0mArgs:{
"Expression": "CONFIG_OF",
"PathPrefix": "arch/x86/"
}Results: {
"Output": "arch/x86/include/asm/prom.h-20-\narch/x86/include/asm/prom.h:21:#ifdef CONFIG_OF\narch/x86/include/asm/prom.h-22-extern int of_ioapic;\n--\narch/x86/kernel/Makefile=152=obj-$(CONFIG_X86_CHECK_BIOS_CORRUPTION) += check.o\narch/x86/kernel/Makefile-153-\narch/x86/kernel/Makefile:154:obj-$(CONFIG_OF)\t\t\t+= devicetree.o\narch/x86/kernel/Makefile-155-obj-$(CONFIG_UPROBES)\t\t\t+= uprobes.o\n--\narch/x86/kernel/devicetree.c=339=void __init x86_flattree_get_config(void)\narch/x86/kernel/devicetree.c-340-{\narch/x86/kernel/devicetree.c:341:#ifdef CONFIG_OF_EARLY_FLATTREE\narch/x86/kernel/devicetree.c-342-\tu32 size, map_len;\n--\narch/x86/kernel/kexec-bzimage64.c=189=setup_efi_state(struct boot_params *params, unsigned long params_load_addr,\n--\narch/x86/kernel/kexec-bzimage64.c-224-\narch/x86/kernel/kexec-bzimage64.c:225:#ifdef CONFIG_OF_FLATTREE\narch/x86/kernel/kexec-bzimage64.c-226-static void setup_dtb(struct boot_params *params,\n--\narch/x86/kernel/kexec-bzimage64.c-244-}\narch/x86/kernel/kexec-bzimage64.c:245:#endif /* CONFIG_OF_FLATTREE */\narch/x86/kernel/kexec-bzimage64.c-246-\n--\narch/x86/kernel/kexec-bzimage64.c=301=setup_boot_parameters(struct kimage *image, struct boot_params *params,\n--\narch/x86/kernel/kexec-bzimage64.c-371-\narch/x86/kernel/kexec-bzimage64.c:372:#ifdef CONFIG_OF_FLATTREE\narch/x86/kernel/kexec-bzimage64.c-373-\tif (image-\u003eforce_dtb \u0026\u0026 initial_boot_params) {\n--\narch/x86/kernel/kexec-bzimage64.c=475=static void *bzImage64_load(struct kimage *image, char *kernel,\n--\narch/x86/kernel/kexec-bzimage64.c-571-\narch/x86/kernel/kexec-bzimage64.c:572:#ifdef CONFIG_OF_FLATTREE\narch/x86/kernel/kexec-bzimage64.c-573-\tif (image-\u003eforce_dtb \u0026\u0026 initial_boot_params)\n--\narch/x86/kernel/setup.c=401=static void __init add_early_ima_buffer(u64 phys_addr)\n--\narch/x86/kernel/setup.c-423-\narch/x86/kernel/setup.c:424:#if defined(CONFIG_HAVE_IMA_KEXEC) \u0026\u0026 !defined(CONFIG_OF_FLATTREE)\narch/x86/kernel/setup.c-425-int __init ima_free_kexec_buffer(void)\n--\narch/x86/kernel/x86_init.c=42=static __initconst const struct of_device_id of_cmos_match[] = {\n--\narch/x86/kernel/x86_init.c-49- * corresponding DT node's status property to disabled. Code is optimized\narch/x86/kernel/x86_init.c:50: * out for CONFIG_OF=n builds.\narch/x86/kernel/x86_init.c-51- */\n"
} |
| 168/2 | 2026/09/22 17:35 | llm | patch-evaluator-compressor |
0mModel:gemini-3.8-flash Args: null Results: null Reply: ### Comprehensive Summary of Workspace and Investigation
#### 1. Applied Changes and Commit Details
- **Commit**: `4da74d0352cad1ee0c07f09e61c60ef7b7d5c625`
- **File**: `drivers/nvmem/core.c`
- **Function**: `nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void *buf)`
- **Patch Diff Context**:
```c
@@ -1598,12 +1598,14 @@ static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void
*p = *b++ >> bit_offset;
/* setup rest of the bytes if any */
- for (i = 1; i < cell->bytes; i++) {
+ for (i = 1; i < (cell->bytes - bytes_offset); i++) {
/* Get bits from next byte and shift them towards msb */
*p++ |= *b << (BITS_PER_BYTE - bit_offset);
*p = *b++ >> bit_offset;
}
+ /* point to end of the buffer unused bits will be cleared */
+ p = buf + cell->bytes - 1;
} else if (p != b) {
memmove(p, b, cell->bytes - bytes_offset);
p += cell->bytes - 1;
```
- **Code Functionality**:
- `nvmem_shift_read_buffer_in_place()` handles bit-level extraction and right-alignment for sub-byte or non-byte-aligned nvmem cells where `cell->bit_offset != 0` or `cell->nbits != 0`.
- When `bit_offset >= 8` (`bytes_offset = bit_offset / BITS_PER_BYTE > 0`) and `bit_offset % 8 != 0`, `b` is shifted by `bytes_offset`. The prior loop bound (`cell->bytes`) caused out-of-bounds reading past the allocated buffer.
- The patch bounds loop iterations to `cell->bytes - bytes_offset` and corrects `p` to point to `buf + cell->bytes - 1` for clearing unused high bits.
---
#### 2. Call Graph & Entry Points
1. `nvmem_shift_read_buffer_in_place()` is `static void` with a single direct caller:
- `__nvmem_cell_read()` (`drivers/nvmem/core.c:1639`):
```c
if (cell->bit_offset || cell->nbits)
nvmem_shift_read_buffer_in_place(cell, buf);
```
2. Direct callers of `__nvmem_cell_read()`:
- `nvmem_cell_read()` (`drivers/nvmem/core.c:1679`)
- `nvmem_device_cell_read()` (`drivers/nvmem/core.c:2002`)
3. Callers of `nvmem_cell_read()`:
- Userspace sysfs interface: `nvmem_cell_attr_read()` (`drivers/nvmem/core.c:354-386`), exposed at `/sys/bus/nvmem/devices/<dev>/cells/<cell_name>@<offset>,<bit_offset>` (read-only binary attribute).
- Platform consumer drivers (network MAC address readers, ADC calibration consumers, CPU freq drivers, etc.).
---
#### 3. Investigation of Cell Instantiation Sources
To reach `nvmem_shift_read_buffer_in_place()`, a cell must exist with `cell->bit_offset != 0` or `cell->nbits != 0`.
An exhaustive search across the entire kernel tree for how `bit_offset` and `nbits` are populated revealed:
- **`drivers/nvmem/core.c` internal assignment**:
- `cell->bit_offset = info->bit_offset;`
- `cell->nbits = info->nbits;`
inside `nvmem_cell_info_to_nvmem_cell_entry_nodup()` (`core.c:593-594`).
- **Device Tree (`OF`) Parsing**:
- `nvmem_add_cells_from_dt()` (`core.c:792-840`):
```c
addr = of_get_property(child, "bits", &len);
if (addr && len == (2 * sizeof(u32))) {
info.bit_offset = be32_to_cpup(addr++);
info.nbits = be32_to_cpup(addr);
```
This is standard Device Tree binding (`bits = <offset_in_bits length_in_bits>;`) used on ARM/RISC-V/MIPS/PowerPC DT platforms.
- Device Tree layouts (`drivers/nvmem/layouts/fixed-layout.c`) call `nvmem_add_cells_from_dt()`.
- Non-DT layouts (`onie-tlv.c`, `sl28vpd.c`, `u-boot-env.c`) register cells using `nvmem_add_one_cell()`, but set only byte-aligned `.offset` and `.bytes` (none set `.bit_offset` or `.nbits`).
- **Static C arrays (`struct nvmem_cell_info`)**:
- `drivers/power/supply/max1720x_battery.c`: Sets `.offset` and `.bytes`, but does not set `.bit_offset` or `.nbits`.
- `drivers/soc/tegra/fuse/fuse-tegra30.c`: Statically sets `.bit_offset = 0, .nbits = 32` (ARM/Tegra SoC only).
- No other in-tree drivers define static cells with non-zero `bit_offset` or `nbits`.
- **Dynamic Fixups**:
- `drivers/nvmem/qfprom.c:343` (`qfprom_fixup_dt_cell_info`): Qualcomm SoC eFuse driver adjusts `cell->bit_offset += byte_offset * BITS_PER_BYTE` to force 32-bit word alignment on DT cells. This is strictly Qualcomm ARM/ARM64 platform hardware.
---
#### 4. Architecture & Reachability Evaluation (`amd64`)
- **Target architecture**: `amd64`.
- **Subsystem presence on x86/amd64**:
- `rtc-cmos` registers an nvmem device (`cmos_nvram`) without any cells (`config->cells == NULL`, `config->ncells == 0`).
- No x86 driver registers nvmem cells with bit offsets or non-zero `nbits`.
- **Device Tree absence on standard amd64 QEMU/virtualization**:
- Standard amd64 QEMU/KVM virtual machines boot with ACPI firmware (SeaBIOS/OVMF), not Open Firmware Device Trees. `initial_boot_params == NULL`.
- There is no userspace syscall, ioctl, or sysfs attribute to dynamically add nvmem cells or construct synthetic nvmem devices with custom bit offsets.
- Hardware drivers that use bit offsets (`qcom,qfprom`, `tegra-fuse`, various SoC eFuses) require non-x86 physical SoC hardware or DT bindings that are structurally unreachable on amd64 QEMU.
- **Syzkaller fuzzability**:
- The modified function `nvmem_shift_read_buffer_in_place()` cannot be executed on amd64 in QEMU because no registered cell has `bit_offset != 0` or `nbits != 0`.
---
#### 5. Hypotheses and Conclusions
- **Current Assessment**:
- All modified code is inside `nvmem_shift_read_buffer_in_place()`.
- Reaching this code requires cells with sub-byte bit offsets/lengths.
- Sub-byte cells are exclusively created via OF Device Tree nodes (`bits = <...>`) or ARM-specific SoC drivers (`qfprom`, `tegra-fuse`).
- Under Section 2 ("Structurally unreachable hardware" and "Unreachable execution paths: Code paths exclusive to architectures other than the target architecture"), this change is unreachable on amd64.
- Evaluation warrants `WorthFuzzing=false`.
---
#### 6. Watch Out for Reasoning Loops
- Do not repeat search queries for `bit_offset`, `nbits`, `nvmem_add_cells`, or `nvmem_register`; the kernel codebase has been completely searched across all drivers and layouts.
- Investigation is complete. Next step is executing `set-results` with `WorthFuzzing=false` and submitting the final response.Tokens: input: 50480 output: 2050 thoughts: 0 |
| 169/2 | 2026/09/22 17:35 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 24555 output: 20 thoughts: 59 Thoughts: **Investigating Device Tree Instantiation on x86** Okay, so I need to clarify something in my mind. Can we actually leverage Device Tree overlays or configfs to instantiate an OF (Open Firmware) node on an x86 system? It seems a bit unconventional, but I've got to be sure. I'm wondering about the feasibility of dynamic device tree configuration using configfs. Hmm, wait a second... there's a kernel configuration option I vaguely recall – `CONFIG_OF_CONFIGFS`. I should probably double-check the details on `CONFIG_OF_CONFIGFS` itself. That seems like the right place to begin this line of inquiry. |
| 170/2 | 2026/09/22 17:35 | tool | grepper |
0mError:no matches Args: {
"Expression": "CONFIG_OF_CONFIGFS"
}Results: {
"error": "no matches"
} |
| 171/2 | 2026/09/22 17:35 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 24789 output: 17 thoughts: 9 Thoughts: Okay, here's my interpretation of that thought process, assuming I'm already deep in the weeds of this technical problem and familiar with the term `of_overlay`: **Checking `of_overlay`** Alright, let's get down to brass tacks. I've been chasing this bug for a while, and it's time to zero in on a specific area. "Let's check `of_overlay`." This isn't just a casual suggestion; it's a focused directive. I've likely identified `of_overlay` as a potential culprit based on previous analysis, debugging, or code review. My intuition, experience, and the data I've already gathered have pointed me in this direction. Now, it's time to meticulously inspect the relevant code, data structures, or configuration surrounding `of_overlay`. I'll be looking for potential errors in logic, incorrect assumptions, memory leaks, concurrency issues, or anything else that could be causing the observed anomalous behavior. I'm prepared to dive into the specifics of *why* `of_overlay` might be the problem, armed with a clear hypothesis and ready to either confirm or refute it based on the evidence I find. This is where the rubber meets the road. It's time to rigorously examine this critical piece of the puzzle. |
| 172/2 | 2026/09/22 17:35 | tool | grepper |
0mArgs:{
"Expression": "of_overlay"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 614 lines.\nUse more precise expression if possible.\n\nDocumentation/devicetree/overlay-notes.rst=109=The API is quite easy to use.\nDocumentation/devicetree/overlay-notes.rst-110-\nDocumentation/devicetree/overlay-notes.rst:111:1) Call of_overlay_fdt_apply() to create and apply an overlay changeset. The\nDocumentation/devicetree/overlay-notes.rst-112- return value is an error or a cookie identifying this overlay.\nDocumentation/devicetree/overlay-notes.rst-113-\nDocumentation/devicetree/overlay-notes.rst:114:2) Call of_overlay_remove() to remove and clean up the overlay changeset\nDocumentation/devicetree/overlay-notes.rst:115: previously created via the call to of_overlay_fdt_apply(). Removal of an\nDocumentation/devicetree/overlay-notes.rst-116- overlay changeset that is stacked by another will not be permitted.\n--\nDocumentation/devicetree/overlay-notes.rst=118=Finally, if you need to remove all overlays in one-go, just call\nDocumentation/devicetree/overlay-notes.rst:119:of_overlay_remove_all() which will remove every single one in the correct\nDocumentation/devicetree/overlay-notes.rst-120-order.\n--\nDocumentation/devicetree/overlay-notes.rst=122=There is the option to register notifiers that get called on\nDocumentation/devicetree/overlay-notes.rst:123:overlay operations. See of_overlay_notifier_register/unregister and\nDocumentation/devicetree/overlay-notes.rst:124:enum of_overlay_notify_action for details.\nDocumentation/devicetree/overlay-notes.rst-125-\n--\nDocumentation/translations/zh_CN/devicetree/overlay-notes.rst=90=DT中的适当位置。在这种情况下,可以提供目标路径。通过标签的目标位置的语法是比\n--\nDocumentation/translations/zh_CN/devicetree/overlay-notes.rst-112-\nDocumentation/translations/zh_CN/devicetree/overlay-notes.rst:113:1) 调用of_overlay_fdt_apply()来创建和应用一个覆盖的变更集。返回值是一个\nDocumentation/translations/zh_CN/devicetree/overlay-notes.rst-114- 错误或一个识别这个覆盖的cookie。\nDocumentation/translations/zh_CN/devicetree/overlay-notes.rst-115-\nDocumentation/translations/zh_CN/devicetree/overlay-notes.rst:116:2) 调用of_overlay_remove()来删除和清理先前通过调用of_overlay_fdt_apply()\nDocumentation/translations/zh_CN/devicetree/overlay-notes.rst-117- 而创建的覆盖变更集。不允许删除一个被另一个覆盖的覆盖变化集。\nDocumentation/translations/zh_CN/devicetree/overlay-notes.rst-118-\nDocumentation/translations/zh_CN/devicetree/overlay-notes.rst:119:最后,如果你需要一次性删除所有的覆盖,只需调用of_overlay_remove_all(),\nDocumentation/translations/zh_CN/devicetree/overlay-notes.rst-120-它将以正确的顺序删除每一个覆盖。\n--\nDocumentation/translations/zh_CN/devicetree/overlay-notes.rst-122-你可以选择注册在覆盖操作中被调用的通知器。详见\nDocumentation/translations/zh_CN/devicetree/overlay-notes.rst:123:of_overlay_notifier_register/unregister和enum of_overlay_notify_action。\nDocumentation/translations/zh_CN/devicetree/overlay-notes.rst-124-\n--\nMAINTAINERS=20462=F:\ttools/testing/selftests/dt/\nMAINTAINERS:20463:K:\tof_overlay_notifier_\nMAINTAINERS:20464:K:\tof_overlay_fdt_apply\nMAINTAINERS:20465:K:\tof_overlay_remove\nMAINTAINERS-20466-\n--\ndrivers/clk/clk-fixed-rate_test.c=342=static int clk_fixed_rate_of_init(struct kunit *test)\n--\ndrivers/clk/clk-fixed-rate_test.c-349-\ndrivers/clk/clk-fixed-rate_test.c:350:\tKUNIT_ASSERT_EQ(test, 0, of_overlay_apply_kunit(test, kunit_clk_fixed_rate_test));\ndrivers/clk/clk-fixed-rate_test.c-351-\n--\ndrivers/clk/clk_test.c=2741=static int clk_register_clk_parent_data_of_test_init(struct kunit *test)\n--\ndrivers/clk/clk_test.c-2745-\tKUNIT_ASSERT_EQ(test, 0,\ndrivers/clk/clk_test.c:2746:\t\t\tof_overlay_apply_kunit(test, kunit_clk_parent_data_test));\ndrivers/clk/clk_test.c-2747-\n--\ndrivers/clk/clk_test.c=3086=static int clk_register_clk_parent_data_device_init(struct kunit *test)\n--\ndrivers/clk/clk_test.c-3088-\tKUNIT_ASSERT_EQ(test, 0,\ndrivers/clk/clk_test.c:3089:\t\t\tof_overlay_apply_kunit(test, kunit_clk_parent_data_test));\ndrivers/clk/clk_test.c-3090-\n--\ndrivers/clk/clk_test.c=3119=struct clk_assigned_rates_test_param {\n--\ndrivers/clk/clk_test.c-3129-#define TEST_PARAM_OVERLAY(overlay_name)\t\t\t\t\\\ndrivers/clk/clk_test.c:3130:\t.overlay_begin = of_overlay_begin(overlay_name),\t\t\\\ndrivers/clk/clk_test.c:3131:\t.overlay_end = of_overlay_end(overlay_name)\ndrivers/clk/clk_test.c-3132-\n--\ndrivers/clk/clk_test.c=3162=static int clk_assigned_rates_test_init(struct kunit *test)\n--\ndrivers/clk/clk_test.c-3171-\ndrivers/clk/clk_test.c:3172:\tKUNIT_ASSERT_EQ(test, 0, __of_overlay_apply_kunit(test,\ndrivers/clk/clk_test.c-3173-\t\t\t\t\t\t\t test_param-\u003eoverlay_begin,\n--\ndrivers/clk/clk_test.c=3612=static void clk_hw_register_dev_get_dev_returns_dev(struct kunit *test)\n--\ndrivers/clk/clk_test.c-3620-\ndrivers/clk/clk_test.c:3621:\tKUNIT_ASSERT_EQ(test, 0, of_overlay_apply_kunit(test, kunit_clk_hw_get_dev_of_node));\ndrivers/clk/clk_test.c-3622-\n--\ndrivers/clk/clk_test.c=3684=static void of_clk_hw_register_node_get_of_node_returns_node(struct kunit *test)\n--\ndrivers/clk/clk_test.c-3691-\ndrivers/clk/clk_test.c:3692:\tKUNIT_ASSERT_EQ(test, 0, of_overlay_apply_kunit(test, kunit_clk_hw_get_dev_of_node));\ndrivers/clk/clk_test.c-3693-\n--\ndrivers/fpga/of-fpga-region.c=285=static int of_fpga_region_notify_pre_apply(struct fpga_region *region,\ndrivers/fpga/of-fpga-region.c:286:\t\t\t\t\t struct of_overlay_notify_data *nd)\ndrivers/fpga/of-fpga-region.c-287-{\n--\ndrivers/fpga/of-fpga-region.c=325=static void of_fpga_region_notify_post_remove(struct fpga_region *region,\ndrivers/fpga/of-fpga-region.c:326:\t\t\t\t\t struct of_overlay_notify_data *nd)\ndrivers/fpga/of-fpga-region.c-327-{\n--\ndrivers/fpga/of-fpga-region.c=345=static int of_fpga_region_notify(struct notifier_block *nb,\n--\ndrivers/fpga/of-fpga-region.c-347-{\ndrivers/fpga/of-fpga-region.c:348:\tstruct of_overlay_notify_data *nd = arg;\ndrivers/fpga/of-fpga-region.c-349-\tstruct fpga_region *region;\n--\ndrivers/fpga/of-fpga-region.c=451=static int __init of_fpga_region_init(void)\n--\ndrivers/fpga/of-fpga-region.c-454-\ndrivers/fpga/of-fpga-region.c:455:\tret = of_overlay_notifier_register(\u0026fpga_region_of_nb);\ndrivers/fpga/of-fpga-region.c-456-\tif (ret)\n--\ndrivers/fpga/of-fpga-region.c-465-err_plat:\ndrivers/fpga/of-fpga-region.c:466:\tof_overlay_notifier_unregister(\u0026fpga_region_of_nb);\ndrivers/fpga/of-fpga-region.c-467-\treturn ret;\n--\ndrivers/fpga/of-fpga-region.c=470=static void __exit of_fpga_region_exit(void)\n--\ndrivers/fpga/of-fpga-region.c-472-\tplatform_driver_unregister(\u0026of_fpga_region_driver);\ndrivers/fpga/of-fpga-region.c:473:\tof_overlay_notifier_unregister(\u0026fpga_region_of_nb);\ndrivers/fpga/of-fpga-region.c-474-}\n--\ndrivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c=20=static int __init imx8mp_hdmi_tx_connector_fixup_init(void)\n--\ndrivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c-67-\ndrivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c:68:\terr = of_overlay_fdt_apply(dtbo_start, dtbo_size, \u0026ovcs_id, NULL);\ndrivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c-69-\tif (err)\ndrivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c:70:\t\terr = of_overlay_remove(\u0026ovcs_id);\ndrivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c-71-\n--\ndrivers/gpu/drm/tilcdc/tilcdc_panel_legacy.c=143=static int __init tilcdc_panel_legacy_init(void)\n--\ndrivers/gpu/drm/tilcdc/tilcdc_panel_legacy.c-163-\ndrivers/gpu/drm/tilcdc/tilcdc_panel_legacy.c:164:\tret = of_overlay_fdt_apply(dtbo_start, dtbo_size, \u0026ovcs_id, NULL);\ndrivers/gpu/drm/tilcdc/tilcdc_panel_legacy.c-165-\tif (ret)\n--\ndrivers/gpu/drm/tilcdc/tilcdc_panel_legacy.c-180-overlay_remove:\ndrivers/gpu/drm/tilcdc/tilcdc_panel_legacy.c:181:\tof_overlay_remove(\u0026ovcs_id);\ndrivers/gpu/drm/tilcdc/tilcdc_panel_legacy.c-182-\treturn ret;\n--\ndrivers/misc/lan966x_pci.c=126=static int lan966x_pci_load_overlay(struct lan966x_pci *data)\n--\ndrivers/misc/lan966x_pci.c-130-\ndrivers/misc/lan966x_pci.c:131:\treturn of_overlay_fdt_apply(dtbo_start, dtbo_size, \u0026data-\u003eovcs_id, dev_of_node(data-\u003edev));\ndrivers/misc/lan966x_pci.c-132-}\n--\ndrivers/misc/lan966x_pci.c=134=static void lan966x_pci_unload_overlay(struct lan966x_pci *data)\ndrivers/misc/lan966x_pci.c-135-{\ndrivers/misc/lan966x_pci.c:136:\tof_overlay_remove(\u0026data-\u003eovcs_id);\ndrivers/misc/lan966x_pci.c-137-}\n--\ndrivers/of/of_kunit_helpers.c=25=EXPORT_SYMBOL_GPL(of_root_kunit_skip);\n--\ndrivers/of/of_kunit_helpers.c-28-\ndrivers/of/of_kunit_helpers.c:29:static void of_overlay_fdt_apply_kunit_exit(void *ovcs_id)\ndrivers/of/of_kunit_helpers.c-30-{\ndrivers/of/of_kunit_helpers.c:31:\tof_overlay_remove(ovcs_id);\ndrivers/of/of_kunit_helpers.c-32-}\n--\ndrivers/of/of_kunit_helpers.c-34-/**\ndrivers/of/of_kunit_helpers.c:35: * of_overlay_fdt_apply_kunit() - Test managed of_overlay_fdt_apply()\ndrivers/of/of_kunit_helpers.c-36- * @test: test context\n--\ndrivers/of/of_kunit_helpers.c-40- *\ndrivers/of/of_kunit_helpers.c:41: * Just like of_overlay_fdt_apply(), except the overlay is managed by the test\ndrivers/of/of_kunit_helpers.c:42: * case and is automatically removed with of_overlay_remove() after the test\ndrivers/of/of_kunit_helpers.c-43- * case concludes.\n--\ndrivers/of/of_kunit_helpers.c-46- */\ndrivers/of/of_kunit_helpers.c:47:int of_overlay_fdt_apply_kunit(struct kunit *test, void *overlay_fdt,\ndrivers/of/of_kunit_helpers.c-48-\t\t\t u32 overlay_fdt_size, int *ovcs_id)\n--\ndrivers/of/of_kunit_helpers.c-58-\ndrivers/of/of_kunit_helpers.c:59:\tret = of_overlay_fdt_apply(overlay_fdt, overlay_fdt_size,\ndrivers/of/of_kunit_helpers.c-60-\t\t\t\t ovcs_id, NULL);\n--\ndrivers/of/of_kunit_helpers.c-65-\ndrivers/of/of_kunit_helpers.c:66:\treturn kunit_add_action_or_reset(test, of_overlay_fdt_apply_kunit_exit,\ndrivers/of/of_kunit_helpers.c-67-\t\t\t\t\t copy_id);\ndrivers/of/of_kunit_helpers.c-68-}\ndrivers/of/of_kunit_helpers.c:69:EXPORT_SYMBOL_GPL(of_overlay_fdt_apply_kunit);\ndrivers/of/of_kunit_helpers.c-70-\n--\ndrivers/of/of_private.h=100=void __of_phandle_cache_inv_entry(phandle handle);\n--\ndrivers/of/of_private.h-102-#if defined(CONFIG_OF_OVERLAY)\ndrivers/of/of_private.h:103:void of_overlay_mutex_lock(void);\ndrivers/of/of_private.h:104:void of_overlay_mutex_unlock(void);\ndrivers/of/of_private.h-105-#else\ndrivers/of/of_private.h:106:static inline void of_overlay_mutex_lock(void) {};\ndrivers/of/of_private.h:107:static inline void of_overlay_mutex_unlock(void) {};\ndrivers/of/of_private.h-108-#endif\n--\ndrivers/of/overlay.c=69=struct overlay_changeset {\n--\ndrivers/of/overlay.c-74-\tstruct device_node *overlay_root;\ndrivers/of/overlay.c:75:\tenum of_overlay_notify_action notify_state;\ndrivers/of/overlay.c-76-\tint count;\n--\ndrivers/of/overlay.c=104=static int build_changeset_next_level(struct overlay_changeset *ovcs,\n--\ndrivers/of/overlay.c-108- * of_resolve_phandles() finds the largest phandle in the live tree.\ndrivers/of/overlay.c:109: * of_overlay_apply() may add a larger phandle to the live tree.\ndrivers/of/overlay.c-110- * Do not allow race between two overlays being applied simultaneously:\ndrivers/of/overlay.c:111: * mutex_lock(\u0026of_overlay_phandle_mutex)\ndrivers/of/overlay.c-112- * of_resolve_phandles()\ndrivers/of/overlay.c:113: * of_overlay_apply()\ndrivers/of/overlay.c:114: * mutex_unlock(\u0026of_overlay_phandle_mutex)\ndrivers/of/overlay.c-115- */\ndrivers/of/overlay.c:116:static DEFINE_MUTEX(of_overlay_phandle_mutex);\ndrivers/of/overlay.c-117-\ndrivers/of/overlay.c:118:void of_overlay_mutex_lock(void)\ndrivers/of/overlay.c-119-{\ndrivers/of/overlay.c:120:\tmutex_lock(\u0026of_overlay_phandle_mutex);\ndrivers/of/overlay.c-121-}\ndrivers/of/overlay.c-122-\ndrivers/of/overlay.c:123:void of_overlay_mutex_unlock(void)\ndrivers/of/overlay.c-124-{\ndrivers/of/overlay.c:125:\tmutex_unlock(\u0026of_overlay_phandle_mutex);\ndrivers/of/overlay.c-126-}\n--\ndrivers/of/overlay.c=131=static BLOCKING_NOTIFIER_HEAD(overlay_notify_chain);\n--\ndrivers/of/overlay.c-133-/**\ndrivers/of/overlay.c:134: * of_overlay_notifier_register() - Register notifier for overlay operations\ndrivers/of/overlay.c-135- * @nb:\t\tNotifier block to register\n--\ndrivers/of/overlay.c-144- */\ndrivers/of/overlay.c:145:int of_overlay_notifier_register(struct notifier_block *nb)\ndrivers/of/overlay.c-146-{\n--\ndrivers/of/overlay.c-148-}\ndrivers/of/overlay.c:149:EXPORT_SYMBOL_GPL(of_overlay_notifier_register);\ndrivers/of/overlay.c-150-\ndrivers/of/overlay.c-151-/**\ndrivers/of/overlay.c:152: * of_overlay_notifier_unregister() - Unregister notifier for overlay operations\ndrivers/of/overlay.c-153- * @nb:\t\tNotifier block to unregister\ndrivers/of/overlay.c-154- */\ndrivers/of/overlay.c:155:int of_overlay_notifier_unregister(struct notifier_block *nb)\ndrivers/of/overlay.c-156-{\n--\ndrivers/of/overlay.c-158-}\ndrivers/of/overlay.c:159:EXPORT_SYMBOL_GPL(of_overlay_notifier_unregister);\ndrivers/of/overlay.c-160-\ndrivers/of/overlay.c=161=static int overlay_notify(struct overlay_changeset *ovcs,\ndrivers/of/overlay.c:162:\t\tenum of_overlay_notify_action action)\ndrivers/of/overlay.c-163-{\ndrivers/of/overlay.c:164:\tstruct of_overlay_notify_data nd;\ndrivers/of/overlay.c-165-\tint i, ret;\n--\ndrivers/of/overlay.c-179-\t\t\tpr_err(\"overlay changeset %s notifier error %d, target: %pOF\\n\",\ndrivers/of/overlay.c:180:\t\t\t of_overlay_action_name(action), ret, nd.target);\ndrivers/of/overlay.c-181-\t\t\treturn ret;\n--\ndrivers/of/overlay.c=859=static void free_overlay_changeset(struct overlay_changeset *ovcs)\n--\ndrivers/of/overlay.c-899- *\ndrivers/of/overlay.c:900: * of_overlay_apply() - Create and apply an overlay changeset\ndrivers/of/overlay.c-901- * @ovcs:\toverlay changeset\n--\ndrivers/of/overlay.c-922- * Returns 0 on success, or a negative error number. On error return,\ndrivers/of/overlay.c:923: * the caller of of_overlay_apply() must call free_overlay_changeset().\ndrivers/of/overlay.c-924- */\ndrivers/of/overlay.c-925-\ndrivers/of/overlay.c:926:static int of_overlay_apply(struct overlay_changeset *ovcs,\ndrivers/of/overlay.c-927-\t\t\t const struct device_node *base)\n--\ndrivers/of/overlay.c-980-/**\ndrivers/of/overlay.c:981: * of_overlay_fdt_apply() - Create and apply an overlay changeset\ndrivers/of/overlay.c-982- * @overlay_fdt:\tpointer to overlay FDT\n--\ndrivers/of/overlay.c-988- *\ndrivers/of/overlay.c:989: * See of_overlay_apply() for important behavior information.\ndrivers/of/overlay.c-990- *\ndrivers/of/overlay.c-991- * Return: 0 on success, or a negative error number. *@ret_ovcs_id is set to\ndrivers/of/overlay.c:992: * the value of overlay changeset id, which can be passed to of_overlay_remove()\ndrivers/of/overlay.c-993- * to remove the overlay.\n--\ndrivers/of/overlay.c-996- * likely if an OF_OVERLAY_POST_APPLY notifier returns an error. In this case\ndrivers/of/overlay.c:997: * the caller should call of_overlay_remove() with the value in *@ret_ovcs_id.\ndrivers/of/overlay.c-998- */\ndrivers/of/overlay.c-999-\ndrivers/of/overlay.c:1000:int of_overlay_fdt_apply(const void *overlay_fdt, u32 overlay_fdt_size,\ndrivers/of/overlay.c-1001-\t\t\t int *ret_ovcs_id, const struct device_node *base)\n--\ndrivers/of/overlay.c-1030-\ndrivers/of/overlay.c:1031:\tof_overlay_mutex_lock();\ndrivers/of/overlay.c-1032-\tmutex_lock(\u0026of_mutex);\n--\ndrivers/of/overlay.c-1071-\ndrivers/of/overlay.c:1072:\tret = of_overlay_apply(ovcs, base);\ndrivers/of/overlay.c-1073-\t/*\ndrivers/of/overlay.c:1074:\t * If of_overlay_apply() error, calling free_overlay_changeset() may\ndrivers/of/overlay.c-1075-\t * result in a memory leak if the apply partly succeeded, so do NOT\ndrivers/of/overlay.c:1076:\t * goto err_free_ovcs. Instead, the caller of of_overlay_fdt_apply()\ndrivers/of/overlay.c:1077:\t * can call of_overlay_remove();\ndrivers/of/overlay.c-1078-\t */\n--\ndrivers/of/overlay.c-1086-\tmutex_unlock(\u0026of_mutex);\ndrivers/of/overlay.c:1087:\tof_overlay_mutex_unlock();\ndrivers/of/overlay.c-1088-\treturn ret;\ndrivers/of/overlay.c-1089-}\ndrivers/of/overlay.c:1090:EXPORT_SYMBOL_GPL(of_overlay_fdt_apply);\ndrivers/of/overlay.c-1091-\n--\ndrivers/of/overlay.c=1155=static int overlay_removal_is_ok(struct overlay_changeset *remove_ovcs)\n--\ndrivers/of/overlay.c-1169-/**\ndrivers/of/overlay.c:1170: * of_overlay_remove() - Revert and free an overlay changeset\ndrivers/of/overlay.c-1171- * @ovcs_id:\tPointer to overlay changeset id\n--\ndrivers/of/overlay.c-1173- * Removes an overlay if it is permissible. @ovcs_id was previously returned\ndrivers/of/overlay.c:1174: * by of_overlay_fdt_apply().\ndrivers/of/overlay.c-1175- *\n--\ndrivers/of/overlay.c-1202- */\ndrivers/of/overlay.c:1203:int of_overlay_remove(int *ovcs_id)\ndrivers/of/overlay.c-1204-{\n--\ndrivers/of/overlay.c-1265-\t * overlay related memory. This is a memory leak unless a subsequent\ndrivers/of/overlay.c:1266:\t * of_overlay_remove() of this overlay is successful.\ndrivers/of/overlay.c-1267-\t */\n--\ndrivers/of/overlay.c-1274-}\ndrivers/of/overlay.c:1275:EXPORT_SYMBOL_GPL(of_overlay_remove);\ndrivers/of/overlay.c-1276-\ndrivers/of/overlay.c-1277-/**\ndrivers/of/overlay.c:1278: * of_overlay_remove_all() - Reverts and frees all overlay changesets\ndrivers/of/overlay.c-1279- *\n--\ndrivers/of/overlay.c-1283- */\ndrivers/of/overlay.c:1284:int of_overlay_remove_all(void)\ndrivers/of/overlay.c-1285-{\n--\ndrivers/of/overlay.c-1290-\tlist_for_each_entry_safe_reverse(ovcs, ovcs_n, \u0026ovcs_list, ovcs_list) {\ndrivers/of/overlay.c:1291:\t\tret = of_overlay_remove(\u0026ovcs-\u003eid);\ndrivers/of/overlay.c-1292-\t\tif (ret)\n--\ndrivers/of/overlay.c-1297-}\ndrivers/of/overlay.c:1298:EXPORT_SYMBOL_GPL(of_overlay_remove_all);\n--\ndrivers/of/overlay_test.c=17=static const char * const kunit_compatible = \"test,empty\";\ndrivers/of/overlay_test.c-18-\ndrivers/of/overlay_test.c:19:/* Test that of_overlay_apply_kunit() adds a node to the live tree */\ndrivers/of/overlay_test.c:20:static void of_overlay_apply_kunit_apply(struct kunit *test)\ndrivers/of/overlay_test.c-21-{\n--\ndrivers/of/overlay_test.c-24-\tKUNIT_ASSERT_EQ(test, 0,\ndrivers/of/overlay_test.c:25:\t\t\tof_overlay_apply_kunit(test, kunit_overlay_test));\ndrivers/of/overlay_test.c-26-\n--\ndrivers/of/overlay_test.c-32-/*\ndrivers/of/overlay_test.c:33: * Test that of_overlay_apply_kunit() creates platform devices with the\ndrivers/of/overlay_test.c-34- * expected device_node\ndrivers/of/overlay_test.c-35- */\ndrivers/of/overlay_test.c:36:static void of_overlay_apply_kunit_platform_device(struct kunit *test)\ndrivers/of/overlay_test.c-37-{\n--\ndrivers/of/overlay_test.c-41-\tKUNIT_ASSERT_EQ(test, 0,\ndrivers/of/overlay_test.c:42:\t\t\tof_overlay_apply_kunit(test, kunit_overlay_test));\ndrivers/of/overlay_test.c-43-\n--\ndrivers/of/overlay_test.c-53-\ndrivers/of/overlay_test.c:54:static int of_overlay_bus_match_compatible(struct device *dev, const void *data)\ndrivers/of/overlay_test.c-55-{\n--\ndrivers/of/overlay_test.c-58-\ndrivers/of/overlay_test.c:59:/* Test that of_overlay_apply_kunit() cleans up after the test is finished */\ndrivers/of/overlay_test.c:60:static void of_overlay_apply_kunit_cleanup(struct kunit *test)\ndrivers/of/overlay_test.c-61-{\n--\ndrivers/of/overlay_test.c-76-\tKUNIT_ASSERT_EQ(test, 0,\ndrivers/of/overlay_test.c:77:\t\t\tof_overlay_apply_kunit(\u0026fake, kunit_overlay_test));\ndrivers/of/overlay_test.c-78-\n--\ndrivers/of/overlay_test.c-95-\tdev = bus_find_device(\u0026platform_bus_type, NULL, kunit_compatible,\ndrivers/of/overlay_test.c:96:\t\t\t of_overlay_bus_match_compatible);\ndrivers/of/overlay_test.c-97-\tKUNIT_EXPECT_PTR_EQ(test, NULL, dev);\n--\ndrivers/of/overlay_test.c-100-\ndrivers/of/overlay_test.c:101:static struct kunit_case of_overlay_apply_kunit_test_cases[] = {\ndrivers/of/overlay_test.c:102:\tKUNIT_CASE(of_overlay_apply_kunit_apply),\ndrivers/of/overlay_test.c:103:\tKUNIT_CASE(of_overlay_apply_kunit_platform_device),\ndrivers/of/overlay_test.c:104:\tKUNIT_CASE(of_overlay_apply_kunit_cleanup),\ndrivers/of/overlay_test.c-105-\t{}\n--\ndrivers/of/overlay_test.c-110- */\ndrivers/of/overlay_test.c:111:static struct kunit_suite of_overlay_apply_kunit_suite = {\ndrivers/of/overlay_test.c:112:\t.name = \"of_overlay_apply_kunit\",\ndrivers/of/overlay_test.c:113:\t.test_cases = of_overlay_apply_kunit_test_cases,\ndrivers/of/overlay_test.c-114-};\n--\ndrivers/of/overlay_test.c=116=kunit_test_suites(\ndrivers/of/overlay_test.c:117:\t\u0026of_overlay_apply_kunit_suite,\ndrivers/of/overlay_test.c-118-);\n--\ndrivers/of/unittest.c=2134=static int __init unittest_data_add(void)\n--\ndrivers/of/unittest.c-2173-\t */\ndrivers/of/unittest.c:2174:\tof_overlay_mutex_lock();\ndrivers/of/unittest.c-2175-\n--\ndrivers/of/unittest.c-2208-unlock:\ndrivers/of/unittest.c:2209:\tof_overlay_mutex_unlock();\ndrivers/of/unittest.c-2210-\n--\ndrivers/of/unittest.c=2619=static void of_unittest_remove_tracked_overlays(void)\n--\ndrivers/of/unittest.c-2628-\t\tsave_ovcs_id = ovcs_id;\ndrivers/of/unittest.c:2629:\t\tret = of_overlay_remove(\u0026ovcs_id);\ndrivers/of/unittest.c-2630-\t\tif (ret == -ENODEV) {\ndrivers/of/unittest.c-2631-\t\t\toverlay_name = overlay_name_from_nr(overlay_nr);\ndrivers/of/unittest.c:2632:\t\t\tpr_warn(\"%s: of_overlay_remove() for overlay \\\"%s\\\" failed, ret = %d\\n\",\ndrivers/of/unittest.c-2633-\t\t\t\t__func__, overlay_name, ret);\n--\ndrivers/of/unittest.c=2709=static int __init of_unittest_apply_revert_overlay_check(int overlay_nr,\n--\ndrivers/of/unittest.c-2721-\tsave_ovcs_id = ovcs_id;\ndrivers/of/unittest.c:2722:\tret = of_overlay_remove(\u0026ovcs_id);\ndrivers/of/unittest.c-2723-\tif (ret != 0) {\n--\ndrivers/of/unittest.c=2854=static void __init of_unittest_overlay_6(void)\n--\ndrivers/of/unittest.c-2927-\t\tovcs_id = save_ovcs_id[i];\ndrivers/of/unittest.c:2928:\t\tif (of_overlay_remove(\u0026ovcs_id)) {\ndrivers/of/unittest.c-2929-\t\t\tunittest(0, \"%s failed destroy @\\\"%s\\\"\\n\",\n--\ndrivers/of/unittest.c=2956=static void __init of_unittest_overlay_8(void)\n--\ndrivers/of/unittest.c-3010-\ndrivers/of/unittest.c:3011:\tret = of_overlay_remove(\u0026ovcs_id);\ndrivers/of/unittest.c-3012-\n--\ndrivers/of/unittest.c-3033-\t\tovcs_id = save_ovcs_id[i];\ndrivers/of/unittest.c:3034:\t\tif (of_overlay_remove(\u0026ovcs_id)) {\ndrivers/of/unittest.c-3035-\t\t\tunittest(0, \"%s not destroyed @\\\"%s\\\"\\n\",\n--\ndrivers/of/unittest.c=3406=static int of_notify(struct notifier_block *nb, unsigned long action,\n--\ndrivers/of/unittest.c-3408-{\ndrivers/of/unittest.c:3409:\tstruct of_overlay_notify_data *nd = arg;\ndrivers/of/unittest.c-3410-\tstruct device_node *found;\n--\ndrivers/of/unittest.c=3478=static void __init of_unittest_overlay_notify(void)\n--\ndrivers/of/unittest.c-3482-\ndrivers/of/unittest.c:3483:\tret = of_overlay_notifier_register(\u0026of_nb);\ndrivers/of/unittest.c-3484-\tunittest(!ret,\ndrivers/of/unittest.c:3485:\t\t \"of_overlay_notifier_register() failed, ret = %d\\n\", ret);\ndrivers/of/unittest.c-3486-\tif (ret)\n--\ndrivers/of/unittest.c-3532-\ndrivers/of/unittest.c:3533:\t\tret = of_overlay_remove(\u0026ovcs_id);\ndrivers/of/unittest.c-3534-\t\tEXPECT_END(KERN_INFO, \"OF: overlay: overlay changeset pre-remove notifier error -18, target: /testcase-data/overlay-node/test-bus\");\n--\ndrivers/of/unittest.c-3538-\t\t\t */\ndrivers/of/unittest.c:3539:\t\t\tunittest(1, \"overlay_18 of_overlay_remove() injected error for OF_OVERLAY_PRE_REMOVE\\n\");\ndrivers/of/unittest.c-3540-\t\t} else {\ndrivers/of/unittest.c:3541:\t\t\tunittest(0, \"overlay_18 of_overlay_remove() injected error for OF_OVERLAY_PRE_REMOVE not returned\\n\");\ndrivers/of/unittest.c-3542-\t\t}\n--\ndrivers/of/unittest.c-3557-\t\tEXPECT_BEGIN(KERN_INFO, \"OF: overlay: overlay changeset post-remove notifier error -19, target: /testcase-data/overlay-node/test-bus\");\ndrivers/of/unittest.c:3558:\t\tret = of_overlay_remove(\u0026ovcs_id);\ndrivers/of/unittest.c-3559-\t\tEXPECT_END(KERN_INFO, \"OF: overlay: overlay changeset post-remove notifier error -19, target: /testcase-data/overlay-node/test-bus\");\ndrivers/of/unittest.c-3560-\t\tif (ret == -ENODEV)\ndrivers/of/unittest.c:3561:\t\t\tunittest(1, \"overlay_19 of_overlay_remove() injected error for OF_OVERLAY_POST_REMOVE\\n\");\ndrivers/of/unittest.c-3562-\t\telse\ndrivers/of/unittest.c:3563:\t\t\tunittest(0, \"overlay_19 of_overlay_remove() injected error for OF_OVERLAY_POST_REMOVE not returned\\n\");\ndrivers/of/unittest.c-3564-\t} else {\n--\ndrivers/of/unittest.c-3576-\tif (ovcs_id) {\ndrivers/of/unittest.c:3577:\t\tret = of_overlay_remove(\u0026ovcs_id);\ndrivers/of/unittest.c-3578-\t\tif (ret)\n--\ndrivers/of/unittest.c-3584-\ndrivers/of/unittest.c:3585:\tunittest(!of_overlay_notifier_unregister(\u0026of_nb),\ndrivers/of/unittest.c:3586:\t\t \"of_overlay_notifier_unregister() failed, ret = %d\\n\", ret);\ndrivers/of/unittest.c-3587-}\n--\ndrivers/of/unittest.c=3987=static int __init overlay_data_apply(const char *overlay_name, int *ovcs_id)\n--\ndrivers/of/unittest.c-4009-\ndrivers/of/unittest.c:4010:\tret = of_overlay_fdt_apply(info-\u003edtbo_begin, size, \u0026info-\u003eovcs_id,\ndrivers/of/unittest.c-4011-\t\t\t\t NULL);\n--\ndrivers/of/unittest.c-4020-\tif (ret != info-\u003eexpected_result) {\ndrivers/of/unittest.c:4021:\t\tpr_err(\"of_overlay_fdt_apply() expected %d, ret=%d, %s\\n\",\ndrivers/of/unittest.c-4022-\t\t info-\u003eexpected_result, ret, overlay_name);\n--\ndrivers/of/unittest.c-4027-\t\t/* changeset may be partially applied */\ndrivers/of/unittest.c:4028:\t\tret2 = of_overlay_remove(\u0026info-\u003eovcs_id);\ndrivers/of/unittest.c-4029-\t\tif (ret2 != info-\u003eexpected_result_remove) {\ndrivers/of/unittest.c:4030:\t\t\tpr_err(\"of_overlay_remove() expected %d, ret=%d, %s\\n\",\ndrivers/of/unittest.c-4031-\t\t\t info-\u003eexpected_result_remove, ret2,\n--\ndrivers/of/unittest.c=4048=static __init void of_unittest_overlay_high_level(void)\n--\ndrivers/of/unittest.c-4066-\t */\ndrivers/of/unittest.c:4067:\tof_overlay_mutex_lock();\ndrivers/of/unittest.c-4068-\tof_resolve_phandles(overlay_base_root);\ndrivers/of/unittest.c:4069:\tof_overlay_mutex_unlock();\ndrivers/of/unittest.c-4070-\n--\ndrivers/of/unittest.c=4328=static int testdrv_probe(struct pci_dev *pdev, const struct pci_device_id *id)\n--\ndrivers/of/unittest.c-4350-\tsize = info-\u003edtbo_end - info-\u003edtbo_begin;\ndrivers/of/unittest.c:4351:\tret = of_overlay_fdt_apply(info-\u003edtbo_begin, size, \u0026ovcs_id, dn);\ndrivers/of/unittest.c-4352-\tif (ret)\n--\n\n"
} |
| 173/2 | 2026/09/22 17:35 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 35631 output: 220 thoughts: 1041 Thoughts: **Analysis of Fuzzing Worthiness for nvmem_shift_read_buffer_in_place() on amd64** Okay, so here's the breakdown. My job here is to determine if fuzzing the `nvmem_shift_read_buffer_in_place()` function on amd64 is worth the effort, and, based on my analysis, it's not. First, let's consider the call graph of `of_overlay_fdt_apply()`. It's called by kunit tests, specific GPU drivers, and some relatively obscure drivers. None of these pathways are directly exposed to userspace via syscalls, ioctls, or sysfs. There's no mainline Linux facility to load arbitrary Device Tree overlays. That's an important point. Now, focusing on x86 specifically, where my target architecture is `amd64`, I see that Open Firmware (OF) is rarely enabled unless `CONFIG_OF` is explicitly set. Even when it is enabled, QEMU on x86 doesn't seem to generate a live OF devicetree with the `nvmem` nodes and cells that have this `bits` property. We know that `nvmem_shift_read_buffer_in_place()` is only called by `__nvmem_cell_read()` when either `cell->bit_offset` or `cell->nbits` is set. Now, the crucial part: where do these bit offsets and non-standard bit widths come from? They are only set within the kernel in a few places: * The `drivers/nvmem/core.c` via the Device Tree property `bits = <...>` in `nvmem_add_cells_from_dt`. * Specific ARM SoC drivers like `tegra_fuse_soc`, `qfprom_fixup_dt_cell_info`, `imx_ocotp_fixup_dt_cell_info`, and `mtk_efuse_fixup_dt_cell_info`. Notice, these are ARM-specific, and all use Device Tree. Crucially, **nothing** on amd64 registers an nvmem cell with either `bit_offset` or `nbits`. Therefore, on `amd64`, `nvmem_shift_read_buffer_in_place()` can *never* be called. This falls squarely under Section 2 of my criteria: "Code paths exclusive to architectures other than the target architecture." This also relates to "Structurally unreachable hardware." Let's go back and review section 2. I only return `WorthFuzzing=false` if all modified code is *strictly* in one of these categories: * Unreachable execution paths (like driver teardown callbacks only used during hot-unplug or manual unbinding). * Code paths that are exclusive to different architectures. Given all of this, the `nvmem_shift_read_buffer_in_place()` function is essentially a dead end on `amd64`. It's only activated by these bit-level properties within drivers that rely heavily on Open Firmware Device Trees, something not typically used on amd64 machines. The standard amd64 virtualization uses ACPI, not Device Trees, and there's no userspace interface that provides a mechanism to add these `nvmem` cells. Therefore the code path is structurally unreachable. Therefore: * `WorthFuzzing: false` * `FocusSymbols: []` (Because the function is unreachable) * `EnableConfigs: []` (Not relevant) * `Reasoning: The patch modifies `nvmem_shift_read_buffer_in_place()` in `drivers/nvmem/core.c`, which handles bit-level shifting and alignment when reading non-byte-aligned nvmem cells (`cell->bit_offset != 0` or `cell->nbits != 0`). In the Linux kernel, nvmem cells with bit offsets or custom bit widths are exclusively instantiated via Open Firmware Device Tree properties (`bits = <...>`) or vendor-specific ARM SoC fuse/OTP drivers (e.g., Qualcomm QFPROM, NVIDIA Tegra fuse, NXP i.MX OCOTP, MediaTek eFuse). On the target architecture `amd64`, systems boot with ACPI rather than Device Trees, no amd64 driver registers nvmem cells with bit offsets, and there is no userspace mechanism to construct or register arbitrary nvmem cells. As such, this code path is exclusive to other architectures and structurally unreachable on amd64.` Time to use that `set-results` tool and move on. |
| 174/2 | 2026/09/22 17:35 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch modifies `nvmem_shift_read_buffer_in_place()` in `drivers/nvmem/core.c`, which is only invoked when reading nvmem cells with sub-byte alignment or width (`cell-\u003ebit_offset != 0` or `cell-\u003enbits != 0`). In the kernel, such cells are defined exclusively via Device Tree bindings (\"bits\" property) or vendor-specific ARM/SoC eFuse/OTP drivers (e.g., Qualcomm QFPROM, Tegra fuse, i.MX OCOTP, MediaTek eFuse). On the target architecture amd64, standard virtualized environments boot via ACPI rather than Device Trees, no amd64 driver defines nvmem cells with bit offsets or custom bit widths, and no userspace interface exists to register nvmem cells or inject Device Tree nodes. Consequently, the modified code is structurally unreachable on amd64.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies `nvmem_shift_read_buffer_in_place()` in `drivers/nvmem/core.c`, which is only invoked when reading nvmem cells with sub-byte alignment or width (`cell-\u003ebit_offset != 0` or `cell-\u003enbits != 0`). In the kernel, such cells are defined exclusively via Device Tree bindings (\"bits\" property) or vendor-specific ARM/SoC eFuse/OTP drivers (e.g., Qualcomm QFPROM, Tegra fuse, i.MX OCOTP, MediaTek eFuse). On the target architecture amd64, standard virtualized environments boot via ACPI rather than Device Trees, no amd64 driver defines nvmem cells with bit offsets or custom bit widths, and no userspace interface exists to register nvmem cells or inject Device Tree nodes. Consequently, the modified code is structurally unreachable on amd64.",
"WorthFuzzing": false
} |
| 175/1 | 2026/09/22 17:35 | action | If |
0mArgs:{
"WorthFuzzing": false
}Results: null |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|