summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2026-10-01drm/i915/vma: use intel_gtt_view_is_*() helpers moreJani Nikula
Prefer using the intel_gtt_view_is_*() helpers instead of comparing the view type directly. Reviewed-by: Maarten Lankhorst <dev@lankhorst.se> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patch.msgid.link/5bc8331cab1d15855b378bd01c76fb0fc4be5c7f.1790780340.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2026-10-01drm/i915/gem: use intel_gtt_view_is_*() helpers moreJani Nikula
Prefer using the intel_gtt_view_is_*() helpers instead of comparing the view type directly. Reviewed-by: Maarten Lankhorst <dev@lankhorst.se> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patch.msgid.link/1b7f309d0c5c5891caa2ec84c04ce8a4438f1207.1790780340.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2026-10-01drm/xe/display: use intel_gtt_view_is_*() helpers moreJani Nikula
Prefer using the intel_gtt_view_is_*() helpers instead of comparing the view type directly. Reviewed-by: Maarten Lankhorst <dev@lankhorst.se> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patch.msgid.link/e05bf916d46007f8e655beb6c31748a8f69e09f3.1790780340.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2026-10-01drm/intel: rename i915_gtt_view* struct/enum to intel_gtt_view*Jani Nikula
Make enum i915_gtt_view_type and struct i915_gtt_view less i915 specific, and rename them enum intel_gtt_view_type and struct intel_gtt_view, respectively. $ sed -i 's/i915_gtt_view/intel_gtt_view/g' -- $(git grep -l i915_gtt_view) Reviewed-by: Maarten Lankhorst <dev@lankhorst.se> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patch.msgid.link/4ca4ad3d11b0f8167a54d69d6eef0c8a78218c53.1790780340.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2026-10-01drm/intel: rename i915_gtt_view_is_*() helpers to intel_gtt_view_is_*()Jani Nikula
Make the i915_gtt_view_is_*() helpers less i915 specific, and rename them intel_gtt_view_is_*(). $ sed -i 's/i915_gtt_view_is_/intel_gtt_view_is_/g' -- $(git grep -l i915_gtt_view_is_) Reviewed-by: Maarten Lankhorst <dev@lankhorst.se> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patch.msgid.link/8230339be1738a1f7c87047f2516dfa66b03d9aa.1790780340.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2026-10-01drm/intel: move i915_gtt_view_types.h to include/drm/intelJani Nikula
The i915 and xe drivers share i915_gtt_view_types.h from i915 source. Move it to include/drm/intel/gtt_view_types.h. Remove the i915 compat header. v2: Keep comment for header guard #endif (Ville) Reviewed-by: Maarten Lankhorst <dev@lankhorst.se> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patch.msgid.link/174f7e26be755b29a1286bf8b8ef0342dcc083a6.1790780340.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2026-10-01staging: rtl8723bs: align function parameters in aes_decipherRishik Yechuri
Fix checkpatch.pl alignment check in aes_decipher() where parameter alignment on the second line didn't match the open parenthesis Signed-off-by: Rishik Yechuri <rishikyechuri@protonmail.com> Link: https://patch.msgid.link/20260925162828.221356-1-rishikyechuri@protonmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01Staging: rtl8723bs: fixed camel case coding style issue.Franco Hector Hugo Montenegro
Fixed a coding style issue for the field dot118021XPrivacy in the struct sta_info. Signed-off-by: Franco Hector Hugo Montenegro <franco.montenegro.ruke@gmail.com> Link: https://patch.msgid.link/20260924222122.682920-1-franco.montenegro.ruke@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01staging: rtl8723bs: fix block comment styleSiho Kim
Add a leading asterisk to each line of block comments to follow the kernel coding style. Signed-off-by: Siho Kim <siho93.kim@gmail.com> Link: https://patch.msgid.link/20260923185649.1634863-1-siho93.kim@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01staging: rtl8723bs: remove unused NDIS association and auth definesIñaki Sobera Sotomayor
The NDIS_802_11_AI_REQFI_*, NDIS_802_11_AI_RESFI_* and NDIS_802_11_AUTH_REQUEST_* macros are leftovers from the original NDIS-based vendor driver. None of them is referenced anywhere in the driver, so drop them. No functional change intended. Signed-off-by: Iñaki Sobera Sotomayor <inakisobera8@gmail.com> Link: https://patch.msgid.link/20260923172049.1644917-1-inakisobera8@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01staging: rtl8723bs: remove reduntant externs in rtw_xmit.hMatheus Alves de Almeida
Several function declarations in rtw_xmit.h are currently done with extern. This is not necessary, so remove the extern from them. Signed-off-by: Matheus Alves de Almeida <matheus.aalmeida@inf.ufrgs.br> Link: https://patch.msgid.link/20260919212950.26636-1-matheus.aalmeida@inf.ufrgs.br Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01staging: rtl8723bs: Remove redundant else blockShyam Sunder Reddy Padira
When the if branch returns directly, the following else block is unnecessary. Remove the redundant else block to improve readability. No functional change. Signed-off-by: Shyam Sunder Reddy Padira <shyamsunderreddypadira@gmail.com> Link: https://patch.msgid.link/20260919165205.9896-1-shyamsunderreddypadira@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01staging: rtl8723bs: fix lines exceeding 100 columns in rtw_security.cRareș-Mihai Vladu
Reformat long lines in rtw_security.c to fit within the 100-column limit by splitting function arguments, expressions, and moving Signed-off-by: Rareș-Mihai Vladu <vladurares@gmail.com> Link: https://patch.msgid.link/20260916074843.1038743-1-vladurares@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01net: axienet: add a MODULE_ALIAS for platform instantiationSagi Maimon
The module is built as xilinx_emac.ko while the platform driver it registers is named xilinx_axienet. For a device tree instantiation that mismatch does not matter, because the OF match table supplies the modalias udev uses to load the module. A device registered by name from another driver has no OF node and so no OF modalias. It advertises platform:xilinx_axienet, which matches nothing, and the device is created but never bound. ptp_ocp is going to register the AXI Ethernet MAC of the ADVA TimeCard X2 this way, as a child platform device described by a software node. Add the corresponding MODULE_ALIAS so name-based instantiation can autoload the driver, and give the name a define now that it is used in more than one place. Tested on the X2 with a local ptp_ocp change: with this patch the module is loaded and binds when ptp_ocp registers the device; without it the device stays unbound until xilinx_emac is loaded by hand. Assisted-by: LLM sparse Signed-off-by: Sagi Maimon <maimon.sagi@gmail.com> Link: https://patch.msgid.link/20260928074256.462345-3-maimon.sagi@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-10-01net: axienet: use device_property and fwnode APIs for probe-time configSagi Maimon
axienet_probe() reads its configuration exclusively through the of_* API, so the driver can only be instantiated from a device tree node. The ADVA TimeCard X2 is a PCIe timing card, driven by ptp_ocp, whose FPGA contains an AXI Ethernet MAC with an AXI DMA engine. ptp_ocp is going to register the MAC as a child platform device described by a software node, so that this driver runs it rather than a copy in ptp_ocp. That needs the probe-time configuration to be readable from a software node. Convert only the lookups such a caller needs: "xlnx,rxmem", which probe requires; "phy-mode"; the MAC address; and the PHY connection, which is where phylink finds a "fixed-link" child. On a device tree this is a no-op: device_property_read_u32() dispatches to the of_* implementation when dev->fwnode is an OF node, phylink_of_phy_connect() is a wrapper around phylink_fwnode_phy_connect(), and device_get_phy_mode() and device_get_mac_address() are thin fwnode wrappers around the same lookups. device_get_mac_address() also keeps the "mac-address" nvmem cell fallback that of_get_mac_address() has. Note that device_get_phy_mode() returns the mode as a positive value rather than through an out parameter, so the error test changes from "if (ret)" to "if (ret < 0)". Everything else stays on the OF API. "xlnx,txcsum", "xlnx,rxcsum" and "xlnx,switch-x-sgmii" are optional, and "xlnx,phy-type" is deprecated in favour of "phy-mode". Without an OF node each of those lookups finds nothing, exactly as for a device tree node that leaves them out: no checksum offload, no runtime SGMII/1000BASE-X switching and a fall-through to "phy-mode". The "dmas" test likewise selects the built-in AXI DMA engine. The "axistream-connected", "pcs-handle" and "phy-handle" phandle lookups stay too: a caller without an OF node takes neither branch, getting its DMA registers from its own platform resources, and it cannot use the SGMII and 1000BASE-X modes, which need a PCS. No functional change intended. Tested on the X2 with a local ptp_ocp change, with CONFIG_OF disabled and enabled: the interface probes with its configuration read from the software node and passes traffic. No device tree board was available, so the claim that this is a no-op for device tree users rests on the dispatch described above. Assisted-by: LLM sparse Signed-off-by: Sagi Maimon <maimon.sagi@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Suraj Gupta <suraj.gupta2@amd.com> Reviewed-by: Suraj Gupta <suraj.gupta2@amd.com> Link: https://patch.msgid.link/20260928074256.462345-2-maimon.sagi@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2026-10-01staging: rtl8723bs: add braces on all arms of if/else in rtw_mlme_ext.cMuhammad Israr
Fix checkpatch CHECKs: braces {} should be used on all arms of this statement, and Unbalanced braces around else statement. i checked the kernel CodingStyle, when one branch of an if/else requires braces, both branches should use braces. did not change any functionality Signed-off-by: Muhammad Israr <7israr.work@gmail.com> Link: https://patch.msgid.link/20260914135639.28269-1-7israr.work@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01staging: rtl8723bs: rename CamelCase variables in function paramaterIsaac Aneek Sarker
As per the kernel style guidelines, and reported by checkpatch.pl rename CamelCase variable naming in function parameters and also inside the function Signed-off-by: Isaac Aneek Sarker <alvasarker2004@gmail.com> Link: https://patch.msgid.link/20260912052648.12007-1-alvasarker2004@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01staging: greybus: gbphy: use sysfs_emit() instead of sprintf()Park Tae-sun
The sysfs documentation (Documentation/filesystems/sysfs.rst) recommends using sysfs_emit() instead of sprintf() in sysfs show() callbacks. Replace sprintf() with sysfs_emit() in the protocol_id_show() callback. This follows the standard kernel practice and existing use of sysfs_emit() in other Greybus sysfs show functions. No functional change. Signed-off-by: Park Tae-sun <ts930@dgu.ac.kr> Link: https://patch.msgid.link/178991148260.29938.9272611738457436343@naver.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01staging: greybus: remove camera driver marked as broken since 2016Ethan Nelson-Moore
The Greybus camera driver has been marked as BROKEN since commit d4f56b47a8fa ("staging: greybus: Add drivers/staging/greybus to the build"). It has not been able to compile since at least commit ec0ad868173d ("staging: greybus: move core include files to include/linux/greybus/") because it includes greybus_protocols.h from its own directory. These two facts make it very clear there is no demand for this driver. Remove it from the kernel. Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com> Link: https://patch.msgid.link/20260918011437.108678-1-enelsonmoore@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01staging: greybus: remove driver depending on nonexistent config optionEthan Nelson-Moore
The Greybus Arche Platform driver depends on the config options USB_HSIC_USB3613 or COMPILE_TEST. USB_HSIC_USB3613 has never existed in mainline Linux, and COMPILE_TEST is intended to enable the compilation of drivers on platforms that can't support them to improve code coverage and ease testing of trivial or tree-wide changes. Therefore, it is impossible for anyone to be using this driver with unmodified mainline kernels. Remove it and move the former maintainer to the CREDITS file. Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com> Link: https://patch.msgid.link/20260915020308.83636-1-enelsonmoore@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01staging: greybus: remove empty TODO fileEthan Nelson-Moore
drivers/staging/greybus/TODO has been empty since commit d85bef159923 ("staging: greybus: remove completed GPIO conversion task from TODO"). Remove it. Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com> Reviewed-by: Alex Elder <elder@riscstar.com> Link: https://patch.msgid.link/20260918011654.115001-1-enelsonmoore@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01vt: selection: Fix unsigned underflow and slab-out-of-bounds read in ↵Hui Peng
paste_selection() In paste_selection(), the loop copies min_t(unsigned int, vc_sel.buf_len - pasted,tty->receive_room) bytes per iteration into tty_ldisc_receive_buf() and increments pasted += count. Because the selection mutex (vc_sel.lock) is dropped inside the loop Whenever the line discipline buffer fills up and paste_selection() sleeps on tty->write_wait, a concurrent TIOCLINUX (TIOCL_SETSEL) ioctl can replace vc_sel.buffer with a shorter selection and reduce vc_sel.buf_len below pasted. When paste_selection() resumes, vc_sel.buf_len - pasted underflows as an unsigned integer to a large positive value, causing tty_ldisc_receive_buf(ld, vc_sel.buffer + pasted, NULL, count) to read up to 4094 bytes out-of-bounds past the newly allocated vc_sel.buffer. Fix this by terminating the loop when pasted >= vc_sel.buf_len. Kernel stack trace (Linux 7.3.0-rc3): ================================================================== BUG: KASAN: slab-out-of-bounds in n_tty_receive_buf_common+0xa01/0x1650 Read of size 4094 at addr ffff888101c58010 by task kworker/u17:1/65 Workqueue: events_unbound flush_to_ldisc Call Trace: <TASK> dump_stack_lvl+0x70/0xa0 print_report+0x153/0x4c6 kasan_report+0xf1/0x120 kasan_check_range+0x11c/0x200 __asan_memcpy+0x29/0x70 n_tty_receive_buf_common+0xa01/0x1650 tty_ldisc_receive_buf+0x66/0x110 tty_port_default_receive_buf+0x6b/0xb0 flush_to_ldisc+0x1b4/0x410 process_one_work+0x6ff/0x1110 worker_thread+0x4a8/0xb70 kthread+0x307/0x3e0 ret_from_fork+0x3ed/0x680 </TASK> ================================================================== Fixes: e8c75a30a23c ("vt: selection, push sel_lock up") Cc: stable <stable@kernel.org> Assisted-by: LLM Signed-off-by: Hui Peng <benquike@gmail.com> Link: https://patch.msgid.link/20260919110041.3763078-1-benquike@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01vt: skip screen update for DEC alignment test on backgroup consolesZizhi Wo
[BUG] Recently, we encountered a KASAN warning as follows: BUG: KASAN: slab-out-of-bounds in fb_pad_aligned_buffer+0x11f/0x140 Read of size 1 at addr ff1100015fd9f6a4 by task tty_fbcon_oob/1239 CPU: 7 UID: 0 PID: 1239 Comm: tty_fbcon_oob Not tainted 7.3.0-rc1 #100 PREEMPT(full) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.17.0-4.fc41 04/01/2014 Call Trace: <TASK> ... kasan_report+0xf0/0x120 fb_pad_aligned_buffer+0x11f/0x140 ccw_putcs+0x86c/0xa80 fbcon_putcs+0x338/0x410 do_update_region+0x21d/0x450 do_con_write+0x1e0e/0x4880 con_write+0x13/0x80 n_tty_write+0x374/0x1010 file_tty_write.isra.0+0x404/0x7a0 ... reproduce: 1) open /dev/tty0, set a KDFONTOP ioctl with op.op = KD_FONT_OP_SET, op.width = 8 and op.height = 16 (visible VC1) 2) open /dev/tty1, set a KDFONTOP ioctl with op.op = KD_FONT_OP_SET, op.width = 28 and op.height = 24 (invisible VC2) 3) echo 3 > /sys/devices/virtual/graphics/fbcon/rotate_all 4) write EShash8(esc hash8) to tty1 [CAUSE] All VCs render to the framebuffer. setfont only modifies the target VC's font without resizing the framebuffer backing buffer (par->rotated.buf); the buffer is only resized for the visible VC (fbcon_do_set_font -> ... -> vc_do_resize -> update_screen). This relies on the con_should_update() check performed before every update_region(). However, the ESC # 8 path (do_con_trol -> do_update_region) omits the con_should_update() check. After changing the font size of an invisible VC, do_update_region() fills using the new font size against a buffer that was never resized, causing an out-of-bounds access. [FIX] Only push the update when the console is visible and not blanked, add the con_should_update() check in the do_con_trol() like every other call site of do_update_region() (update_region(), invert_screen(), ...). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable <stable@kernel.org> Signed-off-by: Zizhi Wo <wozizhi@huawei.com> Link: https://patch.msgid.link/20260905064337.3083103-1-wozizhi@huaweicloud.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01vc_screen: reload vc pointer before if (ret) in vcs_write() to avoid UAFYi Yang
The reload of 'vc' added by commit 8fb9ea65c9d1 ("vc_screen: reload load of struct vc_data pointer in vcs_write() to avoid UAF") sits after the 'if (ret)' block, so the copy-failure break path exits the loop without reloading vc. If the vc was kfree()'d via vc_port_destruct during the unlocked copy_from_user() window, the post-loop 'if (written && vc) vcs_scr_updated(vc)' is reached with a stale non-NULL vc. The '&& vc' guard from commit a287620312dc ("vc_screen: fix null-ptr-deref in vcs_notifier() during concurrent vcs_write") only handles the NULL case, not this stale-non-NULL case; vcs_notifier() then reads param->vc->vc_num from freed memory: BUG: KASAN: slab-use-after-free in vcs_notifier+0x7c/0xd0 Read of size 2 at addr ffff888007149190 Call Trace: vcs_notifier+0x7c/0xd0 atomic_notifier_call_chain+0x70/0xa0 vcs_scr_updated+0x77/0xa0 vcs_write+0x71b/0x7e0 Allocated by task: vc_allocate -> con_install -> tty_open Freed by task: kfree <- vt_ioctl (VT_DISALLOCATE -> vc_port_destruct) Move the reload to immediately after console_lock(), before 'if (ret)', so every break path below passes a fresh vc to the post-loop vcs_scr_updated(). Fixes: a287620312dc ("vc_screen: fix null-ptr-deref in vcs_notifier() during concurrent vcs_write") Cc: stable@kernel.org Signed-off-by: Yi Yang <yiyang13@huawei.com> Link: https://patch.msgid.link/20260901113131.2760010-1-yiyang13@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01serial: 8250: Fix section mismatch with CONFIG_MODULES=nDanish Khateeb
Without CONFIG_MODULES, __init_or_module means __init, so serial8250_pnp_exit() and serial8250_hub6_exit() end up in .init.text. They are also called from serial8250_exit(), which is __exit, and modpost warns: WARNING: modpost: vmlinux: section mismatch in reference: serial8250_exit+0x2a (section: .exit.text) -> serial8250_pnp_exit (section: .init.text) The exit code never runs in such a kernel, so nothing breaks at runtime. But a function that is called from both __init and __exit code can't carry either annotation, so drop it. Fixes: a300273c458c ("serial: 8250: hub6: Add cleanup code") Fixes: 4cf187f9dea9 ("serial: 8250: pnp: Annotate init and exit functions for conditional discarding") Assisted-by: LLM Signed-off-by: Danish Khateeb <danishkhateeb03@gmail.com> Link: https://patch.msgid.link/20260926163506.487201-1-danishkhateeb03@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01serial: core: fix NULL/dangling port_dev on failed re-registerCui GaoSheng
serial8250_unregister_port() removes a port and then re-registers it against the legacy serial8250 device when that device is still present, ignoring the return value of uart_add_one_port(). When the re-register fails, the error path of serial_core_register_port() removes the port device but leaves port->port_dev dangling (or NULL if the port device allocation itself failed). serial8250 matches ports on ->dev, so such half-registered slots still reach serial_core_unregister_port() on the next unbind: KASAN: null-ptr-deref in range [0x40-0x47] RIP: serial_core_unregister_port+0xe5/0xa00 serial8250_unregister_port+0x103 serial8250_remove+0x61 Fix the error path to clear port->port_dev, and bail out of serial_core_unregister_port() when port_dev is NULL. Read port->port_dev under port_mutex, like all of its writers. Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM") Assisted-by: LLM Signed-off-by: Cui GaoSheng <cuigaosheng1@huawei.com> Link: https://patch.msgid.link/20260929023155.3259567-1-cuigaosheng1@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01serial: amba-pl011: use dmaengine public API instead of raw opsFrank Li
Replace direct calls to the internal DMA device ops (device->device_tx_status() and device->device_issue_pending()) with the proper public DMA engine wrappers: - dmaengine_tx_status() - dma_async_issue_pending() Drivers must not call device ops directly; the wrappers provide locking, debug checks, and a stable interface that hides internal implementation details of the DMA controller driver. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260928183252.1965169-2-Frank.Li@oss.nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01serial: use dmaengine_get_dma_device() instead of chan->device->devFrank Li
Replace direct dma_chan::device::dev access with the proper dmaengine_get_dma_device() for consumer API chan->device->dev is not always the device used for DMA mapping. Some DMA engines support per-channel IOMMU mappings, so different channels may use different DMA devices. dmaengine_get_dma_device() returns the correct device for each channel. This also prepares for making the DMA engine provider data structures private. DMA consumers should not access DMA engine internals directly. Assisted-by: LLM Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260928183252.1965169-1-Frank.Li@oss.nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01serial: 8250_port: properly handle runtime PM in IRQAndy Shevchenko
We can't and basically don't need to call runtime PM in IRQ handler. If IRQ is ours, the device must be powered on. Otherwise check if the device is powered off and return immediately. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20260924122549.668680-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01serial: 8250_mid: Add missing module namespace import for SERIAL_8250Nathan Chancellor
After commit 1c305d5f1daa ("serial: 8250_mid: wait for LSR tx empty before setting termios"), modpost errors (or warning with CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS=y): ERROR: modpost: drivers/tty/serial/8250/8250_mid.ko: module uses symbol 'serial8250_wait_for_xmitr' from namespace 'SERIAL_8250', but does not import it. Add the missing module namespace import to clear up the error/warning. Fixes: 1c305d5f1daa ("serial: 8250_mid: wait for LSR tx empty before setting termios") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Link: https://patch.msgid.link/20260927-tty-8250_mid-ns-import-v1-1-84d0482e1c5d@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01serial: 8250: Add Armada 38x earlycon supportRosen Penev
Register the Armada 38x UART compatible with the built-in 8250 earlycon implementation so stdout-path can enable an early console without adding a generic ns16550a compatible to the device tree. Keeping the vendor-specific compatible avoids exposing the UART to the generic OF 8250 runtime driver while preserving the DesignWare driver Armada-specific runtime handling. Assisted-by: Codex:GPT-5 Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://patch.msgid.link/20260902221709.340393-1-rosenp@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01serial: tegra-tcu: Make use of dev_err_probe() in .probe()Uwe Kleine-König
Usage of dev_err_probe() is (sometimes) a bit more compact than dev_err(), it properly handles ENOMEM and EPROBE_DEFER and emits the error code symbolically. Also introduce a variable to hold &pdev->dev to reduce line length a bit. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Link: https://patch.msgid.link/e5a1565edc2b8c0241827f4b9c40c53fca064415.1786547950.git.u.kleine-koenig@baylibre.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01serial: sc16is7xx: reduce TX refill rate with half-FIFO triggerPaul Mbewe
With the TX trigger set to 8 free spaces, THRI is generated roughly once per 8 transmitted bytes. At 115200 baud 8N1, this corresponds to approximately 0.7 ms between TX refill events. Set the TX trigger to 32 free spaces via TLR[3:0]. This makes each refill larger and reduces the refill rate by about 4x. At 115200 baud 8N1, the refill cadence becomes approximately 2.8 ms. The trade-off is that the time-to-empty after THRI asserts is reduced from 56 to 32 byte times. The fresh-TXLVL refill loop fills the hardware TX FIFO strictly below whichever trigger is selected. This patch changes only the refill frequency and the associated latency trade-off. With the two TX gap fixes applied in both configurations, changing the trigger from 8 to 32 free spaces produced the following median values from repeated top snapshots under the same continuous Modbus RTU load. Each transaction used an 8-byte RX request and a 255-byte TX response, so the workload was dominated by TX traffic: trigger=8 trigger=32 SPI IRQ thread CPU 15% 5% system CPU 44% 29% idle CPU 40% 52% one-minute load 2.02 0.99 The datasets contain 547 snapshots with trigger=8 and 535 snapshots with trigger=32. Only TLR[3:0] is changed. TLR[7:4] remains zero so the RX trigger retains its FCR setting. RX trigger tuning may also be useful, but generic RX/TX trigger configuration is left for follow-up work. SC16IS7XX_TX_TRIGGER_LEVEL is used for both the programmed TLR value and the TXLVL refill-loop threshold, keeping the hardware trigger and the software refill condition synchronized. TCR/TLR access requires EFR[4] and MCR[2], which are already enabled by the TCR setup immediately preceding the TLR write. Reviewed-by: Joachim Knorr <joachim.knorr@ziehl-abegg.de> Link: https://lore.kernel.org/linux-serial/20260623112225.82386-3-paultyson.mbewe@ziehl-abegg.de/ Signed-off-by: Paul Mbewe <paultyson.mbewe@ziehl-abegg.de> Link: https://patch.msgid.link/20260930145628.566535-3-paultyson.mbewe@ziehl-abegg.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01serial: sc16is7xx: refill TX FIFO below trigger using fresh TXLVLPaul Mbewe
sc16is7xx_handle_tx() reads TXLVL once and sizes the hardware TX FIFO write from that value. TXLVL reports free space in the hardware TX FIFO. On this SPI-backed path, hardirq/softirq activity, RT scheduling, and waiting for synchronous SPI transfers can delay the refill while the UART continues draining. The TXLVL value can therefore become stale before the hardware TX FIFO write completes. One failing ftrace with the default 8-free-space trigger showed: tx_start txlvl=9 txlvl_read_us=580 tx_pre_write sent=9 pre_write_us=16 tx_segment sent=9 seg_us=364 tx_post_write txlvl_before=9 sent=9 txlvl_after=12 pending_after=29 post_gap_us=12 post_txlvl_us=130 The driver read 9 free spaces and wrote 9 bytes to the hardware TX FIFO, but the post-write TXLVL read still reported 12 free spaces while 29 bytes remained queued in the xmit kfifo. Even allowing for the post-write read window, the hardware TX FIFO had not been filled below the 8-free-space trigger, so no new threshold crossing was expected. The captured failing samples had the same pattern: data remained queued in the xmit kfifo while post-write TXLVL remained above the hardware trigger. The hardware TX FIFO then drained empty before another refill was requested, producing an unintended gap on the wire. Fix this by re-reading TXLVL after each hardware TX FIFO write while data remains queued in the xmit kfifo. If TXLVL is still at or above the trigger, top up the hardware TX FIFO again. Stop when the xmit kfifo is empty or a TXLVL read confirms that hardware TX FIFO free space is strictly below the trigger. Stopping when TXLVL was equal to the trigger still allowed TX gaps in the tested workload. Continuing until TXLVL was strictly below the trigger eliminated the observed gaps caused by stale-TXLVL under-fill. Program the hardware TX trigger explicitly through TLR using the same constant as the refill-loop threshold. This prevents the software refill condition from diverging from the programmed hardware trigger. Tested on SC16IS752 over 1 MHz SPI on an i.MX6ULL single-core PREEMPT_RT system, transmitting RS-485 at 115200 baud 8N1 under continuous Modbus RTU load. Fixes: dfeae619d781 ("serial: sc16is7xx") Cc: stable@kernel.org Reported-by: Tobias Gannert <tobias.gannert@ziehl-abegg.de> Link: https://lore.kernel.org/linux-serial/20260623112225.82386-3-paultyson.mbewe@ziehl-abegg.de/ Signed-off-by: Paul Mbewe <paultyson.mbewe@ziehl-abegg.de> Reviewed-by: David Laight <david.laight.linux@gmail.com> Link: https://patch.msgid.link/20260930145628.566535-2-paultyson.mbewe@ziehl-abegg.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01serial: tegra: don't clear the Tx FIFO on an Rx-only resetSimon Gassner
tegra_uart_fifo_reset() applies the Tegra30 workaround for "cannot clear the Tx FIFO while FIFO mode is enabled" unconditionally: it leaves FIFO mode, writes the requested FCR clear bits, and re-enters FIFO mode. Leaving FIFO mode empties both FIFOs, so an Rx-only reset discards queued Tx data as well. The break handler in tegra_uart_decode_rx_error() calls it with UART_FCR_CLEAR_RCVR only. On a half-duplex RS485 board whose Rx line is pulled low while the transceiver drives the bus, every transmission raises a spurious break, and all but the first character of the frame is lost. Only take the FIFO-mode path when the caller actually asked for CLEAR_XMIT. Likewise only wait for TEMT in that case: with the Tx FIFO deliberately left intact, that loop would otherwise spin for a full frame time in hard IRQ context with the port lock held. Tested on a Colibri T30 (Tegra30) with Rx DMA: - Break during transmission: the reset still fires from tegra_uart_decode_rx_error(), and the complete frame now reaches the peer. Before this change only the character in the shift register was sent. - Internal loopback with a generated break: the Rx FIFO is correctly cleared by the plain FCR write, and subsequent receive works with no frame, parity or overrun errors. Fixes: e9ea096dd225 ("serial: tegra: add serial driver") Cc: stable@kernel.org Signed-off-by: Simon Gassner <simon.gassner@noxsystems.com> Link: https://patch.msgid.link/20261001060539.32659-1-simon.gassner@noxsystems.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01serial: sc16is7xx: fix TX gap caused by kfifo circular buffer wrap-aroundPaul Mbewe
kfifo_out_linear_ptr() returns only one contiguous linear segment of the xmit kfifo. When transmit data wraps around the end of the kfifo, only the first segment up to the buffer end is sent. The remaining data at the start of the kfifo is not sent until the next TX interrupt fires, resulting in a visible mid-frame TX gap on the wire. The resulting gap is unintended: data remains queued in the xmit kfifo, but the hardware TX FIFO drains empty before the remaining segment is sent. Such gaps can break timing-sensitive serial protocols such as Modbus RTU. Modbus RTU requires a message to be transmitted as a continuous stream. For baud rates above 19200, the Modbus Serial Line guide recommends a fixed 750 us inter-character timeout. On the tested 115200-baud system, oscilloscope measurements showed mid-frame gaps exceeding that value. Receivers using the recommended timeout may therefore discard the incomplete message. The incomplete transfer also causes unnecessary TX interrupts: instead of using all available hardware TX FIFO space in one go, the driver requires an extra interrupt to send the remaining segment after the wrap. After the tty xmit buffer was converted to a kfifo, the driver used uart_fifo_out() to copy data into a linear staging buffer, allowing a transfer to span the kfifo wrap-around boundary. Commit 133f4c00b8b2 ("serial: sc16is7xx: fix TX fifo corruption") replaced uart_fifo_out() with a single kfifo_out_linear_ptr() call to remove the shared TX/RX buffer. Since kfifo_out_linear_ptr() exposes only one contiguous segment, that change lost the wrap-around handling. Fix this by calling kfifo_out_linear_ptr() in a loop, advancing through all contiguous segments until the available hardware TX FIFO space is exhausted or the xmit kfifo is empty. This fixes the kfifo wrap-around gap independently of the stale-TXLVL refill issue. Tested on SC16IS752 over SPI driving RS-485 at 115200 baud 8N1 on an i.MX6ULL-based board. Oscilloscope measurements confirmed mid-frame breaks at the kfifo wrap-around boundary before the fix; no such breaks were observed afterward. Fixes: 133f4c00b8b2 ("serial: sc16is7xx: fix TX fifo corruption") Cc: stable@kernel.org Reported-by: Tobias Gannert <tobias.gannert@ziehl-abegg.de> Reviewed-by: Joachim Knorr <joachim.knorr@ziehl-abegg.de> Link: https://lore.kernel.org/linux-serial/20260623112225.82386-2-paultyson.mbewe@ziehl-abegg.de/ Signed-off-by: Paul Mbewe <paultyson.mbewe@ziehl-abegg.de> Link: https://patch.msgid.link/20260930143207.542930-1-paultyson.mbewe@ziehl-abegg.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01tty: fix saved termios reset raceJohan Hovold
Resetting saved termios state on device registration is needed where a minor number can be reused for an entirely different device and where the old settings may prevent the port from even being opened (e.g. when CLOCAL is not set). Not all TTY drivers guarantee that the minor number is no longer in use when registering devices however, something which can lead to a use-after-free when closing a TTY (and saving its termios) races with re-registration. Add a new TTY_DRIVER_RESET_SAVED_TERMIOS flag to request that any saved termios state is reset on registration and only set it for drivers that make sure that the minor number is no longer in use. Fixes: 93857edd9829 ("tty: reset termios state on device registration") Reported-by: Chengfeng Ye <nicoyip.dev@gmail.com> Link: https://lore.kernel.org/20260926184154.3017929-1-nicoyip.dev@gmail.com Cc: stable@kernel.org # 4.12 Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20260930131845.1809256-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01tty: serial: mpc52xx_uart: move static declarations up.Rosen Penev
Avoid a compilation error so that they're not used before being declared. Fixes: 4d105880666a ("tty: serial: mpc52xx_uart: add bounds check for psc_num array index") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202609260356.tJWbd1WU-lkp@intel.com/ Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://patch.msgid.link/20260927203501.14105-1-rosenp@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01media: mali-c55: Ignore disconnected queues when checking readinessLinus Walleij
mali_c55_pipeline_ready() waits for every video queue to enter its start_streaming callback, regardless of whether its media link is enabled. When libcamera uses the TPG, it disables the statistics and parameters links and queues only image buffers. Although STREAMON succeeds on the metadata nodes, videobuf2 never invokes their callbacks without queued buffers. The ISP and TPG are therefore never enabled and capture hangs. An unused full-resolution or downscaled output can similarly prevent the pipeline from starting. Only require queues connected through enabled media links to have started. Use media_pad_remote_pad_first() to check the video node pads, retaining the capability check before accessing the optional downscale device. The shared readiness check also keeps stream-off consistent: the first active queue to stop disables the ISP. Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Linus Walleij <linusw@kernel.org> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-10-01media: mali-c55: Check the statistics buffer address before fillingDavid Carlier
mali_c55_stats_cpu_read() copies the metering registers into the buffer returned by vb2_plane_vaddr() without checking it. As for the parameters queue, a DMABUF whose exporter cannot be vmapped yields NULL, and the memcpy_fromio() then dereferences it from the threaded interrupt handler. Report the failure to mali_c55_stats_fill_buffer() and complete the buffer with VB2_BUF_STATE_ERROR. Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Cc: stable@vger.kernel.org Signed-off-by: David Carlier <devnexen@gmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-10-01media: mali-c55: Check the parameters buffer address before copyingDavid Carlier
mali_c55_params_buf_prepare() copies the parameters buffer supplied by userspace into the driver's scratch buffer, using the result of vb2_plane_vaddr() as the source without checking it. The queue accepts VB2_DMABUF, and vb2_dc_vaddr() returns NULL for an exporter that cannot be vmapped, so the memcpy() dereferences NULL. Reject the buffer at prepare time instead. Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Cc: stable@vger.kernel.org Signed-off-by: David Carlier <devnexen@gmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-10-01media: mali-c55: Free the ISP control handler on unregisterDavid Carlier
mali_c55_isp_init_controls() initialises isp->handler and adds the capabilities control, but mali_c55_unregister_isp() never frees it. Neither v4l2_device_unregister_subdev() nor v4l2_subdev_cleanup() touches sd->ctrl_handler, so the handler and its control are leaked on every unbind or module removal. The probe error path already frees it, and the TPG subdevice does so in its own unregister function. Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Cc: stable@vger.kernel.org Signed-off-by: David Carlier <devnexen@gmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-10-01media: arm: mali-c55: Use devm_of_reserved_mem_device_init()Mukesh Ojha
Use the devres-managed devm_of_reserved_mem_device_init() instead of the manual of_reserved_mem_device_init()/of_reserved_mem_device_release() pair, letting the device resource manager handle cleanup automatically. Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-10-01media: mali-c55: fail power-on when safe stop times outPengpeng Hou
The power-on path requests safe stop to establish a non-streaming state but ignores the polling result and publishes runtime resume success. Power the block back off and propagate a safe-stop timeout. Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver") Cc: stable@vger.kernel.org Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-10-01media: v4l2-isp: reject zero-sized parameter blocksDavid Carlier
v4l2_isp_params_validate_buffer() walks the blocks of a parameters buffer by adding block->size to the current offset. A block whose type_info[] entry is an uninitialised hole passes every check on the way there: a size of 0 is not caught by the block->size > buffer_size test, and the match against the type info size compares 0 with the hole's own 0 and passes as well. The walk then makes no forward progress and loops forever. Drivers build their type_info[] arrays with designated initialisers indexed by their block type enumeration, so an enumerator left without an entry leaves a zeroed hole rather than failing the build. Drivers call the validator from vb2 .buf_prepare, so such a hole turns a VIDIOC_QBUF on the parameters video device into an unkillable task spinning with the queue mutex held. Reject a block whose type info entry is empty. The driver does not implement the type, so it cannot tell whether the block content is meaningful, and accepting it silently would leave that content unconstrained until a later kernel implements the type and starts validating it. The size match then always runs against a non-zero size, and no block can advance the walk by zero. Fixes: 3cb6de6fafb8 ("media: v4l2-core: Introduce v4l2-isp.c") Cc: stable@vger.kernel.org Suggested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: David Carlier <devnexen@gmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-10-01media: renesas: rzv2h-ivc: manage runtime PM with devresMyeonghun Pak
Runtime PM is enabled before the IRQ is looked up. If that lookup fails, probe returns without disabling runtime PM. The subdevice initialization error path disables runtime PM but leaves autosuspend enabled, while the remove path does neither. Use devm_pm_runtime_enable() so the driver core disables autosuspend and runtime PM on every failed probe and after remove. This also makes the manual subdevice error unwind unnecessary. This issue was identified during our ongoing static-analysis research while reviewing kernel code. Fixes: f0b3984d821b ("media: platform: Add Renesas Input Video Control block driver") Cc: stable@vger.kernel.org Signed-off-by: Ijae Kim <ae878000@gmail.com> Signed-off-by: Myeonghun Pak <mhun512@gmail.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-10-01tty: serial: max3100: shut down timer before freeing portFan Wu
max3100_shutdown() stops the polling timer but returns early during system suspend. If the SPI device is unbound before resume, the serial core does not call max3100_shutdown() again, so max3100_remove() frees the port while the timer remains armed. max3100_timeout() may then access the freed port and re-arm the timer. Add final timer teardown to max3100_remove() and use timer_shutdown_sync() to prevent a racing callback from re-arming it. Also free the IRQ and destroy the workqueue there before freeing the port. Keep timer_delete_sync() in max3100_shutdown() so that a subsequent open() can re-arm the timer. The workqueue is created before request_irq() and destroyed on both request_irq() failure and normal shutdown. Its presence at remove thus identifies the IRQ left registered when suspend bypasses shutdown. Free the IRQ before destroying the workqueue, in both max3100_shutdown() and max3100_remove(), and cancel the pending work in between. free_irq() waits for a running interrupt handler to finish and no new handler can start afterwards, so a racing handler cannot queue work on a workqueue that is being destroyed; the force_end_work check in max3100_dowork() only narrows that window, as a handler delayed between the check and queue_work() could still run after the teardown has cleared the workqueue pointer. Cancelling the work also keeps destroy_workqueue() from waiting on a queued work item in case remove() ever runs while the freezable workqueue is still frozen, e.g. device removal during the resume window, before workqueues are thawed. This issue was found by an in-house static analysis tool. Fixes: 7831d56b0a35 ("tty: MAX3100") Cc: stable@kernel.org # 6.2+ Assisted-by: Codex:gpt-5.6 Signed-off-by: Fan Wu <fanwu01@zju.edu.cn> Link: https://patch.msgid.link/20260927055957.561030-1-fanwu01@zju.edu.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01gpio: exar: initialize the ID before registering its cleanupSang-Hoon Choi
devm_add_action_or_reset() invokes the cleanup action immediately when registering the action fails. gpio_exar_probe() currently stores the allocated ID in exar_gpio only after registering the action, so that failure makes exar_devm_ida_free() release ID 0. If the allocated ID is nonzero, this leaks that ID and can free ID 0 belonging to another device. Store the ID before registering the cleanup action so both the immediate failure path and normal device teardown release the correct allocation. Fixes: 5300ebb695fa ("gpio: exar: use devm action for freeing the IDA and drop remove()") Reported-by: Changyul Lee <lcy8047@gmail.com> Assisted-by: LLM Signed-off-by: Sang-Hoon Choi <csh0052@gmail.com> Reviewed-by: Linus Walleij <linusw@kernel.org> Link: https://patch.msgid.link/179070265834.12871.48183786512201899.idr-bug-79@gmail.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-10-01usb: dwc3: gadget: fix IRQ storm on invalid event buffer countJiazi Liu
When dwc3_check_event_buf() reads a GEVNTCOUNT value exceeding the event buffer length, commit 63ccd26cd1f6 ("usb: dwc3: gadget: check that event count does not exceed event buffer length") returns IRQ_NONE without writing back GEVNTCOUNT. Since the DWC3 interrupt is level-triggered, the uncleared IRQ source keeps the line asserted, causing a tight IRQ storm that accumulates 99,900 unhandled interrupts and triggers spurious.c:184 BUG -> kernel panic. The resulting call stack: __report_bad_irq+0xac/0xc8 note_interrupt+0x340/0x468 handle_irq_event+0xac/0xc0 handle_fasteoi_irq+0x120/0x228 gic_handle_irq+0x68/0x108 ... kernel BUG at kernel/irq/spurious.c:184 To reproduce, write a bogus value exceeding the event buffer length directly to the GEVNTCOUNT register: devmem <DWC3_BASE + 0xc40c> 4 0x1004 Write the bogus count back to GEVNTCOUNT to clear the IRQ source, consistent with the stale event clearing pattern in dwc3_event_buffers_setup(), and schedule error recovery to reinitialize the controller. Fixes: 63ccd26cd1f6 ("usb: dwc3: gadget: check that event count does not exceed event buffer length") Cc: stable <stable@kernel.org> Suggested-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Signed-off-by: Jiazi Liu <jiazi.liu1984@gmail.com> Link: https://patch.msgid.link/20260915110637.17658-1-jiazi.liu1984@gmail.com Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01Revert "usb: dwc3: gadget: fix IRQ storm on invalid event buffer count"Greg Kroah-Hartman
This reverts commit a107edec57659c5a1a2f016311b944af58c904c9. It was incorrectly applied, and was 2 versions old. The "correct" one will be added instead afterward... Cc: stable <stable@kernel.org> Cc: Jiazi Liu <jiazi.liu1984@gmail.com> Reported-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Fixes: a107edec5765 ("usb: dwc3: gadget: fix IRQ storm on invalid event buffer count") Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>