summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
11 daystools/build: selftests: Remove some duplicate toolchain definitionsJames Clark
Try to remove some, but not all duplicate toolchain definitions. In these instances, their makefiles already include tools/scripts/Makefile.include which defines these in a consistent way. STRIP is the only one that was set with an '=', but I don't think it was significant so that difference can be dropped. Signed-off-by: James Clark <james.clark@linaro.org> Reviewed-by: Ian Rogers <irogers@google.com> Acked-by: Ihor Solodrai <ihor.solodrai@linux.dev> Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
11 daystools/build: Allow versioning LLVM readelfJames Clark
Documentation/kbuild/llvm.rst mentions that readelf is included in the LLVM toolchain, but it's not currently included in this block. Add it so that LLVM=... options also apply to readelf. Users in tools/ were Perf which was hardcoding it, and another was the BPF makefile. Both already include Makefile.include so convert them to use the new variables. Where readelf wasn't doing anything arch specific, use HOSTREADELF because it's more likely to be installed. Reviewed-by: Ian Rogers <irogers@google.com> Signed-off-by: James Clark <james.clark@linaro.org> Acked-by: Ihor Solodrai <ihor.solodrai@linux.dev> Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
11 daystools/build: Indent if else blocksJames Clark
These blocks are quite big and unreadable without indentation. Indent them. No functional changes intended. Signed-off-by: James Clark <james.clark@linaro.org> Reviewed-by: Ian Rogers <irogers@google.com> Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
11 daystools/build: Allow versioning of all LLVM tools defined in Makefile.includeJames Clark
The version of LLVM tools can be given on the build command with LLVM=-15, but this isn't applied to all tools. For example $(CC) gets versioned, but $(CLANG) doesn't. This causes a Perf build with LTO=1 to fail with an error about mixed clang versions: ld.lld: error: libperf/core.o: Unknown attribute kind (86) (Producer: 'LLVM18.1.8' Reader: 'LLVM 15.0.7') This file has two "ifneq ($(LLVM),)" blocks adjacent to each other, so merge these blocks making it obvious that all tools should be versioned consistently and there is nothing special about each block. This also reveals that ?= and "allow-override" are used inconsistently between the blocks. "allow-override" is technically only required for builtin variables, but isn't only used on them, and doesn't do any harm if used on a non-builtin. Make them all "allow-override" for consistency. The only functional difference this will cause is if there is a file level definition of one of the variables followed by an "#include of Makefile.include" which will now overwrite. But this isn't done and in a later commit some of the duplicate definitions will be removed for good measure. There are also some other LLVM tools that are not defined here and will be moved in a later commit. Signed-off-by: James Clark <james.clark@linaro.org> Reviewed-by: Ian Rogers <irogers@google.com> Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Fixes: e9c281928c24 ("kbuild: Make $(LLVM) more flexible") Signed-off-by: Namhyung Kim <namhyung@kernel.org>
12 daysInput: inexio - replace printk with dev_dbg and fix missing spaceBivash Kumar Singh
Replace printk(KERN_DEBUG) with dev_dbg() using the serio device, which is the correct logging style for driver code. Also fix missing space after comma in the function argument, and remove the redundant 'inexio.c:' filename prefix from the message. Signed-off-by: Bivash Kumar Singh <bivashraj750@gmail.com> Link: https://patch.msgid.link/20260725130803.6763-1-bivashraj750@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 daysInput: elo - fix coding style issues in elo_setup_10()Bivash Kumar Singh
Fix two checkpatch warnings in elo_setup_10(): - Add missing space around '-' operator in array index expression - Add missing 'const' qualifier to elo_types pointer array, since the array is never modified after initialization Signed-off-by: Bivash Kumar Singh <bivashraj750@gmail.com> Link: https://patch.msgid.link/20260725113638.5147-1-bivashraj750@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
12 dayshsi: omap_ssi_core: fix missing DMA mask setup for SSI controller deviceIvaylo Dimitrov
The OMAP SSI driver uses a synthetic HSI controller device allocated via hsi_alloc_controller(), which does not go through the normal OF/platform device initialization path. As a result, the embedded struct device does not have a DMA mask initialized by default. After recent DMA API hardening changes, dma_map_sg() and related helpers now require a valid dma_mask to be present, otherwise the driver may crash or trigger warnings when attempting DMA mapping operations. Fix this by explicitly initializing the DMA mask for the SSI controller device and setting a 32-bit DMA mask, which matches the hardware capabilities. Cc: stable@vger.kernel.org Fixes: f959dcd6ddfd ("dma-direct: Fix potential NULL pointer dereference") Reported-by: Merlijn Wajer <merlijn@wizzup.org> Closes: https://lore.kernel.org/linux-omap/4ed95c71-2066-6b4c-ad1b-53ef02d79d53@wizzup.org/ Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> Link: https://patch.msgid.link/20260724130522.706480-1-ivo.g.dimitrov.75@gmail.com Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
12 daysHSI: omap_ssi: Remove redundant dev_err()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() and devm_request_threaded_irq() automatically log detailed error messages on failure. Remove the now-redundant driver-specific dev_err() calls. Signed-off-by: Pan Chuang <panchuang@vivo.com> Link: https://patch.msgid.link/20260713132747.394970-3-panchuang@vivo.com Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
12 daysHSI: nokia-modem: Remove redundant dev_err()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() automatically logs detailed error messages on failure. Remove the now-redundant driver-specific dev_err() calls. Signed-off-by: Pan Chuang <panchuang@vivo.com> Link: https://patch.msgid.link/20260713132747.394970-2-panchuang@vivo.com Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
12 dayshsi: omap_ssi: remove debugfs on port creation failurePengpeng Hou
ssi_probe() creates the controller debugfs tree before creating the SSI port child devices. If a port device cannot be created, the error path removes any children and tears down the controller, but leaves the debugfs tree behind. Remove the controller debugfs tree on the port creation failure path, matching the normal remove path. Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn> Link: https://patch.msgid.link/20260616004348.97684-1-pengpeng@iscas.ac.cn Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
12 daysMerge tag 'ib-psy-array-helpers-for-v7.3-signed' into psy-nextSebastian Reichel
Immutable branch for battery array helpers to be used by the USB-C state machine. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
12 dayspower: supply: Add helpers to get and put arrays of power supply handlesAmit Sunil Dhamne
Add power_supply_get_system_batteries() to allow drivers to obtain a list of registered battery type power supply references in the system. Also add power_supply_put_system_batteries() to perform cleanup after the former function is called. Signed-off-by: Amit Sunil Dhamne <amitsd@google.com> Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com> Link: https://patch.msgid.link/20260714-batt-status-v5-1-9de4aa900b69@google.com Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
12 daysfs/resctrl: Use accurate and symmetric exit flowsReinette Chatre
During schemata file write handling there is one error exit path labeled "out" that handles all cleanup and unlocking needed on exit. The staged configs cleared during an error exit may not have been used at the time of exit making the clearing of the staged configs unnecessary. Access the exit code using two labels and only clear the staged configuration if it was in use at the time of exit. Doing so makes the code flow obvious and simplifies upcoming changes that improve the handling of failures during early input parsing. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Tony Luck <tony.luck@intel.com> Tested-by: Babu Moger <babu.moger@amd.com> Link: https://patch.msgid.link/4cdd79d612dc6d62ccd490e1c31298025d66d385.1782857711.git.reinette.chatre@intel.com
12 daysMerge branch 'for-7.3' into for-nextTejun Heo
12 dayssched_ext: Use rcu_access_pointer() for the first_task comparisonTejun Heo
dsq->first_task is __rcu for the lockless scx_bpf_dsq_peek(). The task removal path compares it against the departing task with a plain load, which sparse flags. The comparison runs under the dsq lock and only tests identity, so rcu_access_pointer() is the fit. Signed-off-by: Tejun Heo <tj@kernel.org>
12 dayssched_ext: Resolve most remaining scx_root accessesTejun Heo
scx_root is __rcu and naked accesses were left as transitional markers for the multi-scheduler transition, to be converted to accesses through the associated scheduler instances. Most accesses have since been converted to resolve the sched from the program or task at hand. The remaining naked sites divide into ones that semantically always want the root sched, which this patch resolves, and one that is left to a later patch. The resolved sites: - The SCX_OPS_TID_TO_TASK validation and the ecaps sync kick already hold a sched whose ancestors[] pins the root as entry 0 with plain pointers stable for the sched's lifetime. Reach the root through the sched at hand. - The dispatch entry, class switch, idle notification and fork init paths only execute while the scheduler is live and scx_root never changes inside the live window, so no update can race them. Add scx_root_protected_live() which documents that invariant and resolves with a plain load. - The hotplug path, including the ecaps reseeds, runs with the hotplug lock held, which excludes the scx_root writers. Add scx_root_protected(), which accepts either the hotplug lock or scx_enable_mutex. - Is-root tests use a zero level instead of comparing against the global. touch_core_sched_dispatch() stays naked, to be resolved by a later patch. Signed-off-by: Tejun Heo <tj@kernel.org>
12 dayssched_ext: Add scx_cgroup_sched() for cgrp->scx_sched readsTejun Heo
cgrp->scx_sched is __rcu and published with rcu_assign_pointer() but every reader loads it with a plain access, so sparse flags all of them. The reads are lock-protected: enable/disable paths rewrite the field under all of scx_enable_mutex, scx_fork_rwsem and cgroup_mutex, and cgroup creation inherits the parent's sched under cgroup_mutex before the new cgroup is reachable, so holding any one of the three locks makes the read stable. Add scx_cgroup_sched() which states the protection with rcu_dereference_check() and convert the readers. No functional changes. Signed-off-by: Tejun Heo <tj@kernel.org>
12 daysMerge tag 'rust-fixes-7.2-2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux Pull rust fixes from Miguel Ojeda: "Toolchain and infrastructure: - 'zerocopy' crates: update to v0.8.54 to fix a modpost error under 'CONFIG_CC_OPTIMIZE_FOR_SIZE=y'. There are actually two updates in the PR: the one to v0.8.52 is fairly large and was originally not intended for a fixes PR, but the actual fix landed in the v0.8.54 one. Thus I included both here. The v0.8.52 update includes two things upstream added for us: '--cfg no_fp_fmt_parse' to avoid a local workaround, and the new 'most_traits' feature. The good news is that, after these updates, the delta with upstream is now trivial: only an identifier prefix change and the SPDX parentheses. - Fix an objtool warning by adding one more 'noreturn' function for Rust 1.99.0 (expected 2026-10-01). - Clean up new 'semicolon_in_expressions_from_macros' lint errors for Rust 1.99.0 (expected 2026-10-01). The lint can be allowed, but it will be a hard error at some point in the future anyway, so clean it up now. - Locally allow new 'suspicious_runtime_symbol_definitions' lint for Rust 1.98.0 (expected 2026-08-20). - Globally allow 'clippy::unwrap_or_default' lint since it relies on optimizations -- under 'CONFIG_CC_OPTIMIZE_FOR_SIZE=y' it does not work well. 'kernel' crate: - 'time' module: fix 'Delta::as_micros_ceil()' to round negative values correctly" * tag 'rust-fixes-7.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux: rust: time: fix as_micros_ceil() to round correctly for negative Delta rust: device: avoid trailing ; in printing macros objtool/rust: add one more `noreturn` Rust function for Rust 1.99.0 rust: zerocopy: update to v0.8.54 rust: zerocopy: update to v0.8.52 rust: allow `clippy::unwrap_or_default` globally rust: allow `suspicious_runtime_symbol_definitions` lint for Rust >= 1.98
12 daysmemory: jz4780-nemc: Use dev_err_probe() for clock errorMiles Krause
Use dev_err_probe() to simplify clock acquisition error handling and avoid logging probe deferral as an error. No functional change. Signed-off-by: Miles Krause <mileskrause5200@gmail.com> Link: https://patch.msgid.link/20260711-jz4780-nemc-dev-err-probe-v1-1-afb6f6a82752@gmail.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
12 daysMerge branch 'next/dt64' into for-nextKrzysztof Kozlowski
12 daysarm64: dts: amd: seattle: Remove useless xgbe DTSI includeKrzysztof Kozlowski
The "amd-seattle-xgbe-b.dtsi" file is included exactly once, so paste the contents directly in proper DTSI. No functional impact. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20260706093523.274093-4-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
12 daysarm64: dts: amd: seattle: Remove useless clocks DTSI includeKrzysztof Kozlowski
The "amd-seattle-clks.dtsi" file is included exactly once, so paste the contents directly in proper DTSI. No functional impact. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20260706093523.274093-3-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
12 dayspower: supply: bq257xx: Add support for BQ25792Alexey Charkov
Add support for TI BQ25792 integrated battery charger and buck-boost converter. It shares high-level logic of operation with the already supported BQ25703A, but has a different register map, bit definitions and some of the lower-level hardware states. Signed-off-by: Alexey Charkov <alchark@flipper.net> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Link: https://patch.msgid.link/20260603-bq25792-v7-7-d487bed276d0@flipper.net Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
12 daysARM: dts: nvidia: tegra114-asus-tf701t: Correct trailing whitespaceKrzysztof Kozlowski
Drop trailing whitespace. No functional impact (same DTB). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20260706101757.340149-2-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
12 daysARM: dts: vt8500: Correct indentationKrzysztof Kozlowski
Correct spaces or mix of tabs+spaces into proper tab-indented lines. No functional impact (same DTB). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20260706101805.341103-2-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
12 daysARM: dts: microchip: at91: Correct indentationKrzysztof Kozlowski
Correct spaces or mix of tabs+spaces into proper tab-indented lines. No functional impact (same DTB). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20260706101843.341339-2-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
12 daysARM: dts: arm: Correct indentationKrzysztof Kozlowski
Correct spaces or mix of tabs+spaces into proper tab-indented lines. No functional impact (same DTB). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Linus Walleij <linusw@kernel.org> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/20260706101942.341681-2-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
12 daysARM: dts: sigmastar: Correct indentationKrzysztof Kozlowski
Correct indentation to one tab. No functional impact (same DTB). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Acked-by: Daniel Palmer <daniel@thingy.jp> Link: https://patch.msgid.link/20260706180404.648545-2-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
12 dayspower: supply: twl4030_charger: cancel workers via devmMaoyi Xie
bci is devm-allocated. Two workers (bci->work and bci->current_worker) dereference it. twl4030_bci_remove() disables charging and masks interrupts. It cancels neither worker. A worker pending at remove() can run after devm frees bci. The USB transceiver comes from devm_usb_get_phy_by_node(). devm unregisters its notifier only after remove() returns. A cancel_work_sync() in remove() can then race a notifier reschedule. devm_work_autocancel() and devm_delayed_work_autocancel() avoid that. They cancel the workers during devm release, before bci is freed. The current_worker is registered first, since devm will cancel in reverse order and bci->work can reschedule current_worker. Suggested-by: Sebastian Reichel <sre@kernel.org> Fixes: d6ccc442b1210 ("twl4030_charger: Make the driver atomic notifier safe") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20260702172128.2001753-1-maoyixie.tju@gmail.com Signed-off-by: Maoyi Xie <maoyixie.tju@gmail.com> Link: https://patch.msgid.link/20260725072540.3092504-1-maoyixie.tju@gmail.com [Move comment about order into the commit message] Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
12 daysMerge tag 'perf-tools-fixes-for-v7.2-1-2026-07-25' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools Pull perf tools fixes from Arnaldo Carvalho de Melo: - Update header copies of kernel headers, including const.h, fs.h, perf_event.h, gfp_types.h, kvm.h, cpufeatures.h, rtnetlink.hp, msr-index.h, drm.h and socket.h - Add some build files related to BPF skels to .gitignore * tag 'perf-tools-fixes-for-v7.2-1-2026-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools: tools headers: Sync KVM headers with the kernel sources tools headers: Sync UAPI linux/fs.h with the kernel sources perf beauty: Update copy of linux/socket.h with the kernel sources tools headers: Sync UAPI drm/drm.h with kernel sources tools arch x86: Sync the msr-index.h copy with the kernel sources tools headers x86 cpufeatures: Sync with the kernel sources tools headers: Sync linux/gfp_types.h with the kernel sources tools headers UAPI: Sync linux/rtnetlink.h with the kernel sources tools headers UAPI: Sync linux/const.h with the kernel sources perf bench bpf: Add missing .gitignore file
12 daysfbdev: core: Clamp total_size to smem_len in read/write functionsMingyu Wang
Some legacy fbdev drivers may incorrectly set info->screen_size to a value larger than the actual mapped framebuffer size (info->fix.smem_len) during mode switches. This could allow out-of-bounds I/O and system memory accesses in fb_io_read(), fb_io_write(), fb_sys_read(), and fb_sys_write(). Prevent this by clamping total_size to smem_len when smem_len is non-zero. Virtual framebuffers (smem_len == 0) are unaffected. This is a hardening measure; no specific crash is fixed by this patch. Signed-off-by: Mingyu Wang <25181214217@stu.xidian.edu.cn> Signed-off-by: Helge Deller <deller@gmx.de>
12 daysfbdev: kyro: Validate overlay viewport coordinatesDanila Chernetsov
The overlay viewport end coordinates are computed from the viewport origin and dimensions using 32-bit unsigned arithmetic. Large input values can cause these calculations to wrap around before the resulting coordinates are passed to SetOverlayViewPort(). SetOverlayViewPort() packs the viewport coordinates into 16-bit register fields. The X coordinates are additionally adjusted by +2 and +1 before being written. Validate the coordinate calculations for 32-bit wraparound and ensure that the adjusted coordinates fit within their 16-bit register fields before calling SetOverlayViewPort(). Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Danila Chernetsov <listdansp@mail.ru> Signed-off-by: Helge Deller <deller@gmx.de>
12 daysfbdev: mb862xx: replace dead select with dependencyJulian Braha
'select' does not work on config options in a 'choice', so currently it is possible to enable FB_MB862XX_LIME without FB_LITTLE_ENDIAN. We cannot replace the 'select FB_LITTLE_ENDIAN' without also changing FB_FOREIGN_ENDIAN from 'select' to 'depends on', otherwise we will get a recursive dependency. Since the default choice is FB_BOTH_ENDIAN, let's use: 'depends on FB_LITTLE_ENDIAN || FB_BOTH_ENDIAN' to avoid breaking defconfig. This dead select was found by kconfirm, a static analysis tool for Kconfig. Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Julian Braha <julianbraha@gmail.com> Link: https://lore.kernel.org/all/20260722220023.196029-1-julianbraha@gmail.com/ Signed-off-by: Helge Deller <deller@gmx.de>
12 daysMerge tag 'firewire-fixes-7.2-rc5' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394 Pull firewire fix from Takashi Sakamoto: "Fix a bug in unit driver for RFC 2734 IPv4 over IEEE 1394. The driver failed to reassemble a complete datagram when it was stored across multiple buffer ranges in the list. Ruoyu Wang reported and fixed it" * tag 'firewire-fixes-7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: firewire: net: Fix fragmented datagram reassembly
12 daysMerge tag 'loongarch-fixes-7.2-1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch fixes from Huacai Chen: - fix build warnings and errors - move jump_label_init() before parse_early_param() - retrieve CPU package ID from PPTT when available - fix some bugs kgdb, BPF JIT and laptop platform driver bugs * tag 'loongarch-fixes-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: platform/loongarch: laptop: Explicitly reset bl_powered state when suspend platform/loongarch: laptop: Stop setting acpi_device_class() LoongArch: BPF: Fix memory leak in bpf_jit_free() LoongArch: BPF: Zero-extend signed ALU32 div/mod results LoongArch: Fix oops during single-step debugging LoongArch: Fix address space mismatch in kexec command line lookup LoongArch: Retrieve CPU package ID from PPTT when available LoongArch: Move jump_label_init() before parse_early_param() LoongArch: Fix build errors due to wrong instructions for 32BIT LoongArch: Increase TASK_STRUCT_OFFSET up to 2040 for 32BIT
12 daysfbdev: core: Fix pointer desynchronization in fb_io_read()Mingyu Wang
In fb_io_read(), if copy_to_user() performs a partial copy (e.g., due to a faulty user buffer), the loop adjusts the chunk size 'c' and updates the remaining 'count'. However, the hardware 'src' pointer has already been eagerly advanced by the original chunk size. If the loop is allowed to continue, the read will resume from an incorrect, over-advanced offset. Since the remaining 'count' was only decremented by the successful bytes, this desynchronization causes the next iterations to execute more hardware reads than originally bounded, eventually leading to out-of-bounds I/O reads. Fix this by breaking out of the loop immediately upon a partial copy_to_user(). A partial copy indicates a faulty user buffer, making subsequent read attempts futile. Breaking out ensures we return the number of successfully read bytes without risking out-of-bounds hardware accesses in subsequent mismatched iterations. Fixes: 6121cd9ef911 ("fbdev: Move I/O read and write code into helper functions") Cc: stable@vger.kernel.org Signed-off-by: Mingyu Wang <25181214217@stu.xidian.edu.cn> Signed-off-by: Helge Deller <deller@gmx.de>
12 daysfbdev: sa1100fb: Remove redundant dev_err()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() automatically logs detailed error messages on failure. Remove the now-redundant driver-specific dev_err() call. Signed-off-by: Pan Chuang <panchuang@vivo.com> Signed-off-by: Helge Deller <deller@gmx.de>
12 daysfbdev: s3c-fb: Remove redundant dev_err()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() automatically logs detailed error messages on failure. Remove the now-redundant driver-specific dev_err() call. Signed-off-by: Pan Chuang <panchuang@vivo.com> Signed-off-by: Helge Deller <deller@gmx.de>
12 daysfbdev: pxafb: Remove redundant dev_err()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() automatically logs detailed error messages on failure. Remove the now-redundant driver-specific dev_err() call. Signed-off-by: Pan Chuang <panchuang@vivo.com> Signed-off-by: Helge Deller <deller@gmx.de>
12 daysfbdev: pxa3xx-gcu: Remove redundant dev_err()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() automatically logs detailed error messages on failure. Remove the now-redundant driver-specific dev_err() call. Signed-off-by: Pan Chuang <panchuang@vivo.com> Signed-off-by: Helge Deller <deller@gmx.de>
12 daysfbdev: pxa168fb: Remove redundant dev_err()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() automatically logs detailed error messages on failure. Remove the now-redundant driver-specific dev_err() call. Signed-off-by: Pan Chuang <panchuang@vivo.com> Signed-off-by: Helge Deller <deller@gmx.de>
12 daysfbdev: omapfb/dsi-cm: Remove redundant dev_err()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() automatically logs detailed error messages on failure. Remove the now-redundant driver-specific dev_err() call. Signed-off-by: Pan Chuang <panchuang@vivo.com> Signed-off-by: Helge Deller <deller@gmx.de>
12 daysfbdev: mmp: Remove redundant dev_err()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() automatically logs detailed error messages on failure. Remove the now-redundant driver-specific dev_err() call. Signed-off-by: Pan Chuang <panchuang@vivo.com> Signed-off-by: Helge Deller <deller@gmx.de>
12 dayspinctrl: mediatek: mt7986: register both platform drivers from a single initcallJustin Yeh
The MT7986 driver registers two separate platform drivers (mt7986a and mt7986b) and used to call arch_initcall() twice, once for each. This is fine while the driver is built-in, but a single translation unit can only provide one module_init(). Since arch_initcall() expands to module_init() when built as a module, having two of them would break the module build with a redefinition of init_module()/__inittest(). Fold both platform drivers into a single driver array and register them from one initcall using platform_register_drivers(), matching the shape of the other MediaTek pinctrl SoC drivers. platform_register_drivers() also rolls back the first registration if the second one fails. No functional change for built-in builds; this is a preparatory cleanup for enabling module builds. Signed-off-by: Justin Yeh <justin.yeh@mediatek.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
12 dayspinctrl: mediatek: allow common drivers to be built as modulesJustin Yeh
The MediaTek SoC pinctrl drivers link against the shared implementations in pinctrl-mtk-common.c (v1), pinctrl-moore.c and pinctrl-mtmips.c. These were built-in only: their Kconfig symbols were bool, they did not export their entry points and they carried no MODULE_LICENSE(). To let the individual SoC drivers be built as loadable modules (required for Android GKI + vendor_dlkm, where vendor drivers must live outside the GKI vmlinux), the shared code they depend on has to be modular too. Otherwise selecting a SoC driver as =m forces the common symbol to =y and the resulting module fails to link against the unexported common entry points. Convert PINCTRL_MTK, PINCTRL_MTK_MOORE and PINCTRL_MTK_MTMIPS to tristate, export the entry points used by the SoC drivers, and add MODULE_DESCRIPTION()/MODULE_LICENSE() to the three common files. The v2 common code (PINCTRL_MTK_V2) is already modular, but mtk_rmw() was never exported. It is called directly by SoC drivers such as mt7623, so export it as well to keep those drivers linking once they are modular. Rather than exporting these shared symbols into the global namespace, export them in the "MTK_PINCTRL" symbol namespace with EXPORT_SYMBOL_NS_GPL() so they are only visible to drivers that opt in. Each SoC driver that uses them therefore declares MODULE_IMPORT_NS("MTK_PINCTRL"). Signed-off-by: Justin Yeh <justin.yeh@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
12 dayspinctrl: mediatek: free EINT resources on unbindJustin Yeh
mtk_eint_do_init() creates an IRQ domain, populates it with a mapping for every EINT line and installs a chained handler on the parent interrupt, but none of these are ever released. This was harmless while the drivers were built-in, but now that they can be built as modules and unbound/rmmod'd it leaves behind a dangling IRQ domain, interrupt mappings whose chip data points at freed memory, and a chained handler that keeps firing into that freed data. The plain allocations in mtk_eint_do_init() already use the device-managed devm_*() helpers, so tear the remaining resources down the same way: register a devm action that detaches the chained handler, waits for any in-flight handler to finish, disposes of the per-line mappings and removes the IRQ domain. This mirrors the device-managed lifecycle adopted for the GPIO chip and keeps the whole EINT setup self-cleaning on unbind. Fixes: e46df235b4e6 ("pinctrl: mediatek: refactor EINT related code for all MediaTek pinctrl can fit") Signed-off-by: Justin Yeh <justin.yeh@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
12 dayspinctrl: mediatek: use devm_gpiochip_add_data() for GPIO chipJustin Yeh
The gpio_chip is allocated with device-managed memory but registered with the non-managed gpiochip_add_data(). This was harmless while the drivers were built-in, but once they can be built as modules and unbound/rmmod'd, devm frees the gpio_chip's memory while it is still registered, causing a use-after-free. Register it with devm_gpiochip_add_data() so it shares the same device-managed lifecycle, which also lets the manual gpiochip_remove() error paths go away. Fixes: a6df410d420a ("pinctrl: mediatek: Add Pinctrl/GPIO driver for mt8135.") Fixes: 805250982bb5 ("pinctrl: mediatek: add pinctrl-paris that implements the vendor dt-bindings") Fixes: e78d57b2f87c ("pinctrl: mediatek: add pinctrl-moore that implements the generic pinctrl dt-bindings") Signed-off-by: Justin Yeh <justin.yeh@mediatek.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Signed-off-by: Linus Walleij <linusw@kernel.org>
12 dayskho: align kho_scratch to MAX_ORDER_NR_PAGES pagesMichal Clapinski
While booting with KHO, the following crash was observed: BUG: unable to handle page fault for address: ff19164fffff8328 RIP: 0010:__free_one_page+0x1a1/0x6b0 Call Trace: <TASK> [<ffffffff913208bf>] free_one_page+0xaf/0x240 [<ffffffff93973288>] deferred_free_pages+0xa8/0xd0 [<ffffffff93971b4f>] deferred_init_memmap_chunk+0x10f/0x1b0 [<ffffffff9396e265>] padata_mt_helper+0x65/0xa0 [<ffffffff90fac402>] process_scheduled_works+0x202/0x410 [<ffffffff90fae739>] worker_thread+0x1f9/0x2d0 [<ffffffff90fb62fd>] kthread+0x27d/0x2f0 [<ffffffff90fae540>] ? __pfx_worker_thread+0x10/0x10 [<ffffffff90fb6080>] ? __pfx_kthread+0x10/0x10 [<ffffffff90efdc55>] ret_from_fork+0x145/0x280 [<ffffffff90fb6080>] ? __pfx_kthread+0x10/0x10 [<ffffffff90e2e46a>] ret_from_fork_asm+0x1a/0x30 </TASK> deferred_init_memmap_chunk() interleaves initialization of struct pages with freeing them. This works fine without KHO because free regions will never be buddy neighbors. However, with KHO, free memory will be split into (free && scratch) and (free && !scratch), that can be buddy neighbors. KHO scratch is aligned to CMA_MIN_ALIGNMENT_PAGES pages but buddy looks at the neighborhood of MAX_ORDER_NR_PAGES pages. These values are configurable but CMA_MIN_ALIGNMENT_PAGES is always less or equal to MAX_ORDER_NR_PAGES. In the crashing configuration they were set as follows: CMA_MIN_ALIGNMENT_PAGES = 1 << 9 MAX_ORDER_NR_PAGES = 1 << 10 So while freeing one chunk, buddy accessed uninitialized struct pages from another chunk, tried to merge the blocks and crashed. To fix this, let's just align KHO scratch to MAX_ORDER_NR_PAGES pages. Fixes: c6073743d0c7 ("kho: make preserved pages compatible with deferred struct page init") Signed-off-by: Michal Clapinski <mclapinski@google.com> Link: https://patch.msgid.link/20260717134028.2880508-1-mclapinski@google.com [rppt: massaged the changelog] Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
12 daysliveupdate: Remember FLB retrieve() statusDavid Matlack
LUO keeps track of successful retrieve attempts on an FLB. It does so to avoid multiple retrievals of the same FLB. Multiple retrievals cause problems because once the FLB is retrieved, the serialized data structures are likely freed and the FLB is likely in a very different state from what the code expects. All this works well when retrieve succeeds. When it fails, luo_flb_retrieve_one() returns the error immediately, without ever storing anywhere that a retrieve was attempted or what its error code was. If the user attempts to retrieve another file registered with the same FLB, LUO will attempt to call the FLB's retrieve() callback again. The retry is problematic for much of the same reasons listed above. The FLB is likely in a very different state than what the retrieve logic normally expects (e.g. some KHO pages may have already been restored and freed). There is no sane way of attempting the retrieve again. Remember the error retrieve returned and directly return it on a retry. This is done by changing the retrieved bool to a retrieve_status integer. A value of 0 means retrieve was never attempted, a positive value means it succeeded, and a negative value means it failed and the error code is the value. This is similar to commit f85b1c6af5bc ("liveupdate: luo_file: remember retrieve() status") which did the same for LUO files. Fixes: cab056f2aae7 ("liveupdate: luo_flb: introduce File-Lifecycle-Bound global state") Assisted-by: Gemini:gemini-3-pro-preview Signed-off-by: David Matlack <dmatlack@google.com> Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com> Reviewed-by: Pratyush Yadav (Google) <pratyush@kernel.org> Link: https://patch.msgid.link/20260528174140.1921129-3-dmatlack@google.com Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
12 daysliveupdate: Reference count outgoing FLB dataDavid Matlack
Increment the outgoing FLB refcount in liveupdate_flb_get_outgoing() so that the FLB structure cannot be freed while the caller is actively using it. Add an additional liveupdate_flb_put_outgoing() function so the caller can explicitly indicate when it is done using the outgoing FLB. During a Live Update, the kernel may need to fetch the outgoing FLB outside of the scope of a file handler's preserve() and unpreserve() callbacks. In that situation there is no way for the caller to protect itself against the outgoing FLB from being freed while it is using it. Incrementing the reference count in liveupdate_flb_get_outgoing() ensures it cannot be freed. This change also aligns the outgoing FLB lifecycle management with the incoming FLB, since the latter uses the same get/put semantics. Fixes: cab056f2aae7 ("liveupdate: luo_flb: introduce File-Lifecycle-Bound global state") Assisted-by: Gemini:gemini-3-pro-preview Signed-off-by: David Matlack <dmatlack@google.com> Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com> Link: https://patch.msgid.link/20260528174140.1921129-2-dmatlack@google.com Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>