Commit graph

1,481,701 commits

Author SHA1 Message Date
Xu Rao
e48844ece5 thunderbolt: icm: Preserve USB4 proxy data-valid bit
The ICM USB4 switch operation request encodes two values in
request.data_len_valid: bit 4 marks the data payload valid, while bits
3:0 hold the payload length in dwords.  A zero length with the valid bit
set represents the full 16-dword data array.

icm_usb4_switch_op() sets the valid bit when a transmit payload is
present.  For payloads shorter than the full 16 dwords, it then assigns
the length to the whole field and clears the valid bit that was just set.
The payload is still copied into the request, but the descriptor sent to
firmware marks that data as invalid.

This affects USB4 router operations that send short payloads through the
firmware connection manager.  In particular, USB4 NVM writes can send a
short final block when the image size is not aligned to the 64-byte proxy
payload size.  Firmware may then ignore or reject that final block, while
full 16-dword blocks are unaffected because they are encoded as length 0
with the valid bit set.

OR the short payload length into data_len_valid so the valid bit is
preserved.

Fixes: 9039387e16 ("thunderbolt: Add USB4 router operation proxy for firmware connection manager")
Cc: stable@vger.kernel.org
Signed-off-by: Xu Rao <raoxu@uniontech.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2026-07-27 13:04:09 +02:00
Nicolás Antinori
6d0795b507 rust: pin-init: mark pin_init::zeroed and Zeroable::zeroed as #[inline]
The `pin_init::zeroed` function is a trivial wrapper around
`unsafe { core::mem::zeroed() }`, whereas `Zeroable::zeroed` is a trivial
wrapper around `pin_init::zeroed`. Mark them both as `#[inline]` to avoid
generating unnecessary symbols for them.

Signed-off-by: Nicolás Antinori <nico.antinori.7@gmail.com>
Signed-off-by: Gary Guo <gary@garyguo.net>
2026-07-27 11:52:08 +01:00
Nicolás Antinori
9e813b9abd rust: pin-init: docs: link Zeroable::zeroed and pin_init::zeroed in documentation
Modify the comments in the `pin_init::zeroed` and `Zeroable::zeroed`
functions to cross-reference each other and make developers aware of both
options.

This also adapts the example code in `Zeroable::zeroed` doc comments to use
that function.

Suggested-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://lore.kernel.org/rust-for-linux/CANiq72kdCAyRUmXFcqQfkHpk1miG8Gagsn0_5U8p4WpKxv9d_g@mail.gmail.com/
Signed-off-by: Nicolás Antinori <nico.antinori.7@gmail.com>
[ Fix link. - Gary ]
Signed-off-by: Gary Guo <gary@garyguo.net>
2026-07-27 11:52:08 +01:00
Gary Guo
5bbf2b2deb rust: pin-init: internal: rework how #[pin_data] handles cfg
Attribute macros are invoked without cfg being resolved. This adds quite a
bit complexity to the macro because all of the macro needs to be careful to
attach necessary cfgs. This becomes especially tricky for tuple structs.
Thus, it is convenient if cfgs are all resolved like derive macros.

The most optimal way to handle this is via `TokenStream::expand_expr`, but
that is still unstable. We can also create an internal derive macro and
transform the attribute macro invocation to be derive macro, but doing
requires us to serialize all extracted information in a form of helper
attributes; it would also make it more difficult if we want to make changes
to the struct (which the self-reference feature would need).

Implement an approach where we generate two cfg-gated macro invocations
with cfg resolved within the invocation. This would mean when the loop
falls through, all field cfgs are resolved, so remove all handling of
cfg_attrs for the rest of the macro.

Signed-off-by: Gary Guo <gary@garyguo.net>
2026-07-27 11:52:08 +01:00
Matthew Auld
05649458e4 drm/xe/bo: optimise TT population for DONTNEED BOs
When a VRAM buffer object is marked as DONTNEED, like in Mesa, the
driver skips migrating its contents to system memory and instead purges
the backing store during eviction (via xe_ttm_bo_purge).

However, xe_evict_flags() still returns tt_placement (XE_PL_TT) for VRAM
BOs even if they were marked DONTNEED.  This causes
ttm_bo_handle_move_mem() to always call ttm_bo_populate() to allocate
destination system pages, only for those pages to be immediately freed
right after when xe_bo_move() calls xe_ttm_bo_purge().

Fix this by changing xe_evict_flags() to return sys_placement
(XE_PL_SYSTEM) for DONTNEED BOs.  This causes TTM to skip the population
step while still ensuring that TTM calls xe_bo_move(), so
xe_ttm_bo_purge() still triggers.

v2 (Thomas):
  - Add a comment to highlight why sys_placement over purge_placement.

Assisted-by: Copilot:gemini-3.1-pro-preview
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Maarten Lankhorst <dev@lankhorst.se>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20260723161542.1220276-2-matthew.auld@intel.com
2026-07-27 11:41:01 +01:00
Manuel Ebner
21ed236e70 docs: admin-guide: thunderbolt: Fix sentence structure
Replace ')' with ',' and add 'in' to sentence.

Signed-off-by: Manuel Ebner <manuelebner@mailbox.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2026-07-27 12:40:35 +02:00
Milo Chen
e027dba038 thunderbolt: xdomain: Notify peers after enumeration
Service drivers may register local XDomain properties while discovery is
still in progress. This can cause the properties changed notification to be
sent before the peer is ready to act on it.

If the peer has already read the local property block before the service
was registered, it may keep using the old property generation and miss the
newly registered service. With ThunderboltIP this can leave the network
service half-discovered after a warm reboot and the login request
eventually times out.

Queue another properties changed notification after the XDomain reaches
ENUMERATED so the peer can re-read the final local properties.

Signed-off-by: Milo Chen <cmh79479@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2026-07-27 11:59:44 +02:00
Uwe Kleine-König (The Capable Hub)
9990c493ef thunderbolt: Drop comma after device id array terminator
The usual style for other device id arrays doesn't have a comma after
the initializer.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2026-07-27 11:59:44 +02:00
Uwe Kleine-König (The Capable Hub)
36eea3468c thunderbolt: Assert that a service driver has a probe callback
tb_service_probe() calls the driver's probe function unconditionally.
Check at driver register time that this callback is valid to prevent a
NULL pointer exception.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2026-07-27 11:59:44 +02:00
Uwe Kleine-König (The Capable Hub)
45f104755a thunderbolt: Stop passing matched device ID to .probe()
No driver makes use of that parameter, so drop it and don't spend the
effort to determine the matching entry.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2026-07-27 11:59:44 +02:00
Basavaraj Natikar
5f40cba7d4 thunderbolt: Assert downstream port reset on shutdown
On shutdown the connection manager tears down the router tree without
signalling connected devices. A Thunderbolt 3 device directly connected
to a USB4 host never receives a disconnect indication and during shutdown
this can cause polling the dead link for up to 60 seconds. On some
platforms this behavior leads to a warm reset instead of a shutdown due
to this timeout.

Fix this by asserting PORT_CS_19.DPR on each connected downstream port
before tearing down the router tree. This drives SBTX low (USB4 spec
section 6.9), causing the device to detect SBRX low and transition to
Uninitialized Unplugged state immediately.

Always do this on system shutdown/reboot by forcing host_reset in the
PCI ->shutdown callback. On plain driver unload only do it when the host
router was actually reset on load (host_reset=1), since in that case the
tunnels are not preserved across reload anyway; with host_reset=0 the
tunnels are kept alive across unload/reload so the links are left intact.
Restrict the reset to Thunderbolt 3 devices.

Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Co-developed-by: Sanath S <Sanath.S@amd.com>
Signed-off-by: Sanath S <Sanath.S@amd.com>
Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2026-07-27 11:59:43 +02:00
Bryam Vargas
d6764992f1 thunderbolt: Bound the DROM dual link port number before indexing sw->ports
tb_drom_parse_entry_port() validates the device-supplied header->index
against sw->config.max_port_number before indexing sw->ports[], but the
sibling field entry->dual_link_port_nr -- a 6-bit value also read from
the DROM -- indexes the same array with no such check. A malicious or
malformed Thunderbolt device can set dual_link_port_nr beyond the
allocated sw->ports[] (max_port_number + 1 entries), producing an
out-of-bounds tb_port pointer that is stored and later dereferenced.

Reject a port entry whose dual_link_port_nr exceeds max_port_number,
the same bound already applied to header->index.

Fixes: cd22e73bdf ("thunderbolt: Read port configuration from eeprom.")
Cc: stable@vger.kernel.org
Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2026-07-27 11:58:54 +02:00
Xu Rao
d2ee4d47aa thunderbolt: Fix bandwidth group reservation indexing
Valid bandwidth group IDs range from 1 through MAX_GROUPS, while Group
ID 0 is reserved. tb_consumed_dp_bandwidth() uses the Group ID directly
to index its local group_reserved[] array.

The array currently has MAX_GROUPS entries, so its valid indices are 0
through MAX_GROUPS - 1. Group ID MAX_GROUPS therefore accesses one
element past the end, and the final group's reserved bandwidth is not
included when the array is summed.

Give group_reserved[] MAX_GROUPS + 1 entries so direct Group ID
indexing covers the reserved ID 0 and valid IDs 1 through MAX_GROUPS.

Fixes: 52a4490e89 ("thunderbolt: Reserve released DisplayPort bandwidth for a group for 10 seconds")
Cc: stable@vger.kernel.org
Signed-off-by: Xu Rao <raoxu@uniontech.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2026-07-27 11:58:54 +02:00
Xu Rao
97b228e596 thunderbolt: stream: Unmap buffers with mapped size
The size passed to dma_unmap_page() must match the size used for the
corresponding dma_map_page() call.

Stream RX and TX buffers are mapped with TB_MAX_FRAME_SIZE when the
buffer pools are allocated. However, tbstream_ring_free() currently uses
tb_ring_frame_size() as the unmap size.

That helper returns the current frame payload size, not the DMA mapping
size. On the TX path, tbstream_dev_alloc_tx() stores a shorter payload
length in frame.size when the payload is smaller than TB_MAX_FRAME_SIZE.
This happens for a short final DATA frame, and also for the CLOSE frame,
which is allocated with SZ_256.

In those cases the buffer was mapped with TB_MAX_FRAME_SIZE, but
tb_ring_frame_size() returns the shorter frame payload length. This makes
the dma_unmap_page() size differ from the original dma_map_page() size.

Use TB_MAX_FRAME_SIZE when unmapping stream buffers so the unmap size
matches the DMA mapping size used by the buffer allocation paths.

Signed-off-by: Xu Rao <raoxu@uniontech.com>
Fixes: 6db21d817b ("thunderbolt: Add support for USB4STREAM")
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2026-07-27 11:58:54 +02:00
Zhipeng Wang
aadb7d1f2c clk: imx: imx8qxp: add soft dependency on SCU power domain driver
The i.MX8QXP SCU clock driver manually attaches power domains to each
clock device via of_genpd_add_device() in imx_clk_scu_attach_pd().
If the SCU power domain provider has not probed yet, the attachment
fails silently with a pr_warn() and the clock device is registered
without a power domain.

When both drivers are built as modules, there is no implicit
dependency to guarantee load order. Add MODULE_SOFTDEP("pre:
scu_pd") so that modprobe loads the SCU power domain module
before the clock module.

Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
2026-07-27 11:57:16 +02:00
Zhipeng Wang
daa5fba89c pmdomain: imx: scu-pd: allow building as a module
Convert CONFIG_IMX_SCU_PD from bool to tristate to allow building as a
loadable module. This is needed on Android devices using the Generic
Kernel Image (GKI), where SoC-specific drivers must be built as modules
rather than built into the core kernel image.

For i.MX8Q devices running Android with a GKI kernel, the SCU power
domain driver must be loadable. Without tristate support, power domains
cannot be properly initialized, preventing these systems from
functioning under GKI.

Use subsys_initcall() so that when built-in the power domain provider
probes before its consumers (e.g. the SCU clock driver at
device_initcall level), fixing "failed to attached the power domain"
warnings at boot. When built as a module, subsys_initcall() is
equivalent to module_init(). No module_exit() is provided because the
SCU power domain provider is a system-level resource that cannot be
safely removed at runtime.

Add MODULE_DEVICE_TABLE() for OF-based module autoloading.

Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
2026-07-27 11:56:55 +02:00
Zhipeng Wang
fad41cdd09 of: export of_stdout symbol
of_stdout is declared extern in include/linux/of.h alongside of_root
and of_chosen, but unlike those two it is not exported, preventing
modules from referencing it.

Export it with EXPORT_SYMBOL_GPL() so drivers that need the stdout
device node can be built as modules.

Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
2026-07-27 11:53:04 +02:00
Ulf Hansson
84a89ca15b pmdomain: Merge branch fixes into next
Merge the pmdomain fixes for v7.2-rc[n] into the next branch, to allow
them to get tested together with the pmdomain changes that are targeted
for the next release.

Signed-off-by: Ulf Hansson <ulfh@kernel.org>
2026-07-27 11:49:03 +02:00
Guangshuo Li
3e013bc8b9 pmdomain: mediatek: fix remaining %pOF after of_node_put()
scpsys_get_bus_protection_legacy() looks up several legacy bus
protection regmaps from device-tree nodes.

Two error paths put the device node before checking whether the regmap
lookup failed, but still pass that node to dev_err_probe() with %pOF on
failure. If of_node_put() drops the last reference, the later %pOF
formatting can dereference a freed device node.

Keep the node reference until after the error message has been emitted in
the infracfg and SMI lookup paths. Also drop the SMI node before
returning when the SMI phandle is missing.

Fixes: c29345fa5f ("pmdomain: mediatek: Refactor bus protection regmaps retrieval")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
2026-07-27 11:46:33 +02:00
Sang-Heon Jeon
ee59788040 pinctrl: mediatek: remove conditional return with no effect
Both branches of the check return the same value, so the check has
no effect. Remove it and return the value directly.

This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-07-27 11:11:18 +02:00
Justin Yeh
5f30668104 pinctrl: mediatek: enable module build support for all SoC drivers
Convert the Kconfig option of every MediaTek pinctrl SoC driver from bool
to tristate and add MODULE_DESCRIPTION()/MODULE_LICENSE() so that they can
be built as loadable kernel modules.

This is required for Android GKI + vendor_dlkm deployments, where
vendor-specific drivers must be kept separate from the GKI vmlinux and
loaded as modules from the vendor partition.

Signed-off-by: Justin Yeh <justin.yeh@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
[linusw@kernel.org: Rebased and added MT6858]
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-07-27 11:11:13 +02:00
Arnd Bergmann
a4bc8e323d Renesas DTS updates for v7.3
- Add sound support for the RZ/G3E SoC and the RZ/G3E SMARC EVK board,
   - Add more serial and SPI support for the RZ/G3L SoC and the RZ/G3L
     SMARC EVK board,
   - Add SMP support (32x Cortex-A720AE) for the R-Car X5H SoC,
   - Add hwspinlock and mailbox (MFIS) support for the R-Car V4H SoC,
   - Add GPU support for R-Car M3-N-based Salvator-X(S) and ULCB
     development boards,
   - Add SPI and FRAM support for the RZ/N1D SoC and the RZN1D Expansion
     Board,
   - Add PCIe support for the RZ/V2H SoC and the RZ/V2H EVK development
     board,
   - Miscellaneous fixes and improvements.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCaligHAAKCRCKwlD9ZEnx
 cE6GAP9BfMB05l1EhSa3szAnTXyt0K+anWkg+Ul+UtwAjTgYKQD/aKQwJDJG0Uz5
 qIJnhwhBaG3uCmzgVShqtFqjF3k2mw8=
 =7Vge
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmpnF38ACgkQmmx57+YA
 GNm+ug/+KXefNPHtCipn8c0mzlyU6gCr1rySbFGvBl/atXwcj6vbh8q8ZeUDfiQL
 e+w2FNb8ceq/gUWFvRdzyFJCu6uNz0ADaN82kXIwoVE98Thq+vxkx5eEW9t1iu/Y
 R7DQe/MBDnmwv2FgAn6dA7f6/vayzD6AqNMFeq7jCCN+440YTrVrtDtwt1pmn2qA
 KPKs2D4H9PiDfXehx7xe2ZLVYYi0qx/9dsWQ3xEKAeaQkHU36osL9ZuIJzGXkaPm
 984q4xKyuJ6UqeoBUYB5JDhOY7thsxolm7KFn5sjRH0WmNZqQ+0GDlQkJlJ9rvvw
 aaiDhxjGZvpY27Dgh+vyTvN6oLDQK2F0rAGgflwYWu3bcvKFV7IbcD6wK5mI/shh
 cFRkEl6Wsc66M/G5nYPJ+80/W7VfLSFnTOlJpbk9YhZrsHUZKDjvOrYiEf/8kSld
 3p956B6eebXJayfpcbIAwEhWpbSFDtqxu5vBjsx5JVLMoQuIbHwTbZVnEfprhFgC
 L+qv1WqqbbTBvJ8Jo9Q+v13uXkigD+IEf7GkPKONVwQqSf4RXt9aBsdfexgZ+42Z
 UHvFfNJPn33jgGwCwwRy+IXtf5U/O7ns8r81z+W0UAcHdVopNoJraP1Cp5HDSRCp
 BKJJR5kA9dee7JQmiUZjPe7y7TwcvR3duGa9KSbRf6u1kNmLwP0=
 =dDyF
 -----END PGP SIGNATURE-----

Merge tag 'renesas-dts-for-v7.3-tag1' of https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/dt

Renesas DTS updates for v7.3

  - Add sound support for the RZ/G3E SoC and the RZ/G3E SMARC EVK board,
  - Add more serial and SPI support for the RZ/G3L SoC and the RZ/G3L
    SMARC EVK board,
  - Add SMP support (32x Cortex-A720AE) for the R-Car X5H SoC,
  - Add hwspinlock and mailbox (MFIS) support for the R-Car V4H SoC,
  - Add GPU support for R-Car M3-N-based Salvator-X(S) and ULCB
    development boards,
  - Add SPI and FRAM support for the RZ/N1D SoC and the RZN1D Expansion
    Board,
  - Add PCIe support for the RZ/V2H SoC and the RZ/V2H EVK development
    board,
  - Miscellaneous fixes and improvements.

* tag 'renesas-dts-for-v7.3-tag1' of https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: (29 commits)
  arm64: dts: renesas: r9a09g047: Fix PCIe dma-ranges memory space code
  arm64: dts: renesas: r9a09g056: Fix PCIe dma-ranges memory space code
  arm64: dts: renesas: r9a09g057h44-rzv2h-evk: Enable PCIe
  arm64: dts: renesas: r9a09g057: Add PCIe nodes
  ARM: dts: renesas: r9a06g032-rzn1d400-eb: Enable SPI-FRAM
  ARM: dts: renesas: r9a06g032: Describe SPI controllers
  arm64: dts: renesas: rzt2h-n2h-evk-common: Add memory nodes
  arm64: dts: renesas: Add soc: labels to soc nodes
  arm64: dts: renesas: r9a09g047e57-smarc: Add DA7212 audio codec support
  arm64: dts: renesas: rzg3e-smarc-som: Add audio pinmux definitions
  arm64: dts: renesas: rzg3e-smarc-som: Add Versa3 clock generator
  arm64: dts: renesas: r9a09g047: Add RZ/G3E Sound support
  arm64: dts: renesas: r8a77965-ulcb: Enable GPU support
  arm64: dts: renesas: r8a77965-salvator-xs: Enable GPU support
  arm64: dts: renesas: r8a77965-salvator-x: Enable GPU support
  ARM: dts: renesas: r8a7740: Add FSI clocks
  arm64: dts: renesas: r9a09g047: Add max-frequency to SDHI nodes
  arm64: dts: renesas: r9a09g047e57-smarc: Drop SW_SER0_PMOD condition for rsci4
  arm64: dts: renesas: r8a779g0: Add MFIS node
  arm64: dts: renesas: r8a78000: Enable application CPU cores via PSCI
  ...

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2026-07-27 10:31:55 +02:00
David Carlier
4085da1e6a drm/panel: novatek-nt36536: Fix panel double-remove on attach failure
The DSI attach error path calls drm_panel_remove() by hand even though
the panel was registered with devm_drm_panel_add(), which already
arranges for drm_panel_remove() to run on driver detach. When
mipi_dsi_attach() fails the panel is therefore removed twice: once
directly and once again while devres unwinds.

drm_panel_add() takes a reference and drm_panel_remove() drops one, so
the extra removal releases the last reference early and frees the panel
container. The put registered by devm_drm_panel_alloc() then operates on
freed memory, resulting in a use-after-free and a reference-count
underflow when a DSI host rejects the requested configuration during
probe.

Drop the manual drm_panel_remove() and let the managed cleanup handle
it, matching the other dual-DSI panel drivers.

Fixes: 75a5dbd1f4 ("drm/panel: Add Novatek NT36536 panel driver")
Signed-off-by: David Carlier <devnexen@gmail.com>
Reviewed-by: Pengyu Luo <mitltlatltl@gmail.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260724041746.12887-1-devnexen@gmail.com
2026-07-27 10:08:18 +02:00
Paul Louvel
e1bde8ef0a drm/panel: simple: Add Ampire AM-800480N3TZQW-00H
Add support for the Ampire AM-800480N3TZQW-00H 5" WVGA TFT LCD panel.

Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260723-support-am-800480n3tzqw-00h-v1-2-6a4ae0575a19@bootlin.com
2026-07-27 10:05:52 +02:00
Paul Louvel
108a73346f dt-bindings: display: simple: Add Ampire AM-800480N3TZQW-00H
Add compatible for the AM-800480N3TZQW-00H from Ampire Co. Ltd.

Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260723-support-am-800480n3tzqw-00h-v1-1-6a4ae0575a19@bootlin.com
2026-07-27 10:05:52 +02:00
Alexandre Hamamdjian
4c0fe6422f drm/panel: st7703: Add AYANEO Pocket DS Lower Panel Support
Add support for the lower (secondary) panel of the AYANEO Pocket DS, a
dual-screen QCS8550 (Snapdragon 8 Gen 2) handheld. It is a 5.0" 1024x768
4:3 IPS LCD driven by a Sitronix ST7703 DDIC: every command in the vendor
init sequence maps to an ST7703 manufacturer command (SETEXTC, SETMIPI,
SETRGBIF, SETSCR, SETPOWER, SETGAMMA, SETGIP1/2), and the SETMIPI and
SETRGBIF payloads are near-identical to the already-supported Powkiddy
RGB10MAX3.

The panel is mounted in portrait (768x1024) and rotated 270 degrees in
the device, expressed through the panel rotation property. The SETEXTC
unlock password ends in 0x87 rather than the canonical 0x83; this is the
value shipped by the vendor firmware and is kept verbatim.

Init sequence extracted from the AYANEO Pocket DS BSP kernel, via the
ROCKNIX SM8550 port.

Signed-off-by: Alexandre Hamamdjian <azkali.limited@gmail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260723-b4-st7703-pocketds-lower-v1-2-e3db246589f4@gmail.com
2026-07-27 10:05:44 +02:00
Alexandre Hamamdjian
9836f0236b dt-bindings: display: Add AYANEO Pocket DS lower panel
The lower (secondary) 5.0" 1024x768 IPS LCD panel of the AYANEO Pocket DS
dual-screen handheld is driven by a Sitronix ST7703 DDIC, as identified
by its ST7703 manufacturer command set (SETEXTC 0xB9, SETMIPI 0xBA,
SETGIP1/2 0xE9/0xEA). Document its compatible alongside the other ST7703
panels.

Signed-off-by: Alexandre Hamamdjian <azkali.limited@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260723-b4-st7703-pocketds-lower-v1-1-e3db246589f4@gmail.com
2026-07-27 09:58:40 +02:00
Marc-Olivier Champagne
ea3d663c10 drm: panel: jd9365da: Add DCLTek 300250 9.35in display
The DCLTek dt300250 is a LCD panel using the jd9365da controller.
Add the panel to the driver.

Suggested-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Marc-Olivier Champagne <marc-olivier.champagne@savoirfairelinux.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260722173840.3576444-5-marc-olivier.champagne@savoirfairelinux.com
2026-07-27 09:58:10 +02:00
Marc-Olivier Champagne
ebd2effb16 dt-bindings: display: panel: add compatible for DCLTek 300250 9.35in panel
The DCLTek dt300250 is a panel using the jadard-jd9365da controller.
Add a new compatible for it.

Suggested-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Marc-Olivier Champagne <marc-olivier.champagne@savoirfairelinux.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260722173840.3576444-4-marc-olivier.champagne@savoirfairelinux.com
2026-07-27 09:58:10 +02:00
Marc-Olivier Champagne
2599b6a5f7 dt-bindings: vendor-prefixes: Add DCLTEK
Add DCL Technologies Inc. (DCLTEK) to the devicetree vendor prefixes
registry.

Link: https://www.dcltek.com/

Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Marc-Olivier Champagne <marc-olivier.champagne@savoirfairelinux.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260722173840.3576444-3-marc-olivier.champagne@savoirfairelinux.com
2026-07-27 09:58:09 +02:00
Marc-Olivier Champagne
b1d7f31f7d drm: panel: jd9365da: Enable LPM mode
The JD9365DA-H3 uses DSI LPM for command transmissions, make sure
this is configured correctly in the DSI mode flags.

Suggested-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Marc-Olivier Champagne <marc-olivier.champagne@savoirfairelinux.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260722173840.3576444-2-marc-olivier.champagne@savoirfairelinux.com
2026-07-27 09:58:08 +02:00
Bartosz Golaszewski
8bdba6f6cf gpio: legacy interface cleanups for 7.3
These are the remaining patches for legacy gpio interface
 cleanup, ensuring that files referencing them are sure to
 have CONFIG_GPIOLIB_LEGACY set, and use linux/gpio/legacy.h
 instead of the old linux/gpio.h header.
 
 There are a few more patches already merged in other
 branches for 7.3, including soc, led, net and media. Once
 everything is in, we can apply the final patches to turn
 off CONFIG_GPIOLIB_LEGACY by default and remove the obsolete
 header file.
 
 This branch is based on the immutable ib-mfd-legacy-gpio-7.3
 branch from mfd.git to avoid a conflict in the rohm drivers.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmpjrCwACgkQmmx57+YA
 GNlhuA//eRNxgyDFRUtuRchUUnIjpCzPdZOXTvnTmDTVYIsHaKS6J/KTBZcxRG7g
 tA749mgpQ2tT0hZFhT1XHCaxHwwBfmV0lomIO65pNcmqmEAUODxTwEy3t4ON4loi
 Ee0SqEXhI+NhMbEoQkrpcCk5y+89Xo+iABbEv12UL/V/K0PKfRDCRs2ZbARnE0yu
 L9wiqt2TJn3baHMabxBZJSWXrYpHCaPqm+vQgIhELQZ4TGswfi6OvCEPhUkk1QUa
 mVvWH7LtUi1A0Ya1HvAhgncvboY6LZYjDHMw7meQmUOSTIu7XoQ6+XjEJ6LJSgtH
 rLAdrFUHFezoHd0UaklnB3taEa7KOZIljNIY8IGRMSqv7jYF8fYXTPuxnS9fuj2o
 u+GxDriWYLp1DfH7HlkrVbmVeX6zunH8qYx91z5aRl7YHNKfwg0wRv8mxAgeBTJy
 1HO/su+ZT0X21hvVibiQNy08VWiQ5+9F5DV+SPTKtaT8chGjjx6uw7oyZkgvzWyu
 xdHuwOzH9WAhL7WnGcJ7PkJzWDoLVkl3KzRCCaYMXBCyLRwCIJTfC5CH7hJNh41i
 fW8b5Nfh7DRAhEuapQk87/NE/sRIFKZW2kfyzbCzsJHm+TW/5X+O6OwoJ+KUSdWQ
 SqVJOVUKDWjg0S8+jxu0mr1ikzwKgrFv2gzWFxaffb6Oi0rqBc4=
 =Ybrr
 -----END PGP SIGNATURE-----

Merge tag 'config-gpio-legacy-for-7.3' of https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground into gpio/for-next

gpio: legacy interface cleanups for 7.3

These are the remaining patches for legacy gpio interface
cleanup, ensuring that files referencing them are sure to
have CONFIG_GPIOLIB_LEGACY set, and use linux/gpio/legacy.h
instead of the old linux/gpio.h header.

There are a few more patches already merged in other
branches for 7.3, including soc, led, net and media. Once
everything is in, we can apply the final patches to turn
off CONFIG_GPIOLIB_LEGACY by default and remove the obsolete
header file.

This branch is based on the immutable ib-mfd-legacy-gpio-7.3
branch from mfd.git to avoid a conflict in the rohm drivers.
2026-07-27 09:56:49 +02:00
Asim Viladi Oglu Manizada
7bad4bda74 xfrm: ah6: validate routing header segments_left
AH6 rearranges routing-header addresses before computing or verifying the
ICV. ipv6_rearrange_rthdr() assumes that segments_left is not larger than
the number of addresses described by the routing header's hdrlen field.

That assumption does not hold for raw IPv6 HDRINCL packets. A packet with
hdrlen equal to 2 describes one address, but can carry an arbitrary
segments_left value. With segments_left equal to 255, the function moves
its address pointer 4,064 bytes backwards and passes a 4,064-byte length to
memmove(), resulting in an out-of-bounds access.

Validate the invariant locally before modifying the routing header or
performing any address-pointer arithmetic, and propagate malformed-header
errors to the existing AH6 input and output error paths.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Assisted-by: avom-custom-harness:gpt-5.5-qwen3.6-mod-mix
Signed-off-by: Asim Viladi Oglu Manizada <manizada@pm.me>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
2026-07-27 09:40:23 +02:00
Arnd Bergmann
77d0531ac4 ARM: nxp: lpc32xx: ARM changes for v7.3
NXP LPC32xx ARM changes for v7.3 contain:
 
 - Karl Mehltretter fixes a multiplatform kernel runtime execution by
   limiting LPC32xx SoC specific init functions to be run on this
   platform only,
 - a stale method of populating DMA, SLC and MLC NAND controllers is
   removed from platform code, this change was announced to happen by
   the end of this year, all touched by the change controllers are
   properly described in the platform device tree for years, and very
   old board dtbs are recommended to be updated.
 -----BEGIN PGP SIGNATURE-----
 
 iQJBBAABCgArFiEETKMJMWSwX7CFTVIOqj3i2jwlOWUFAmpj0sYNHHZ6QG1sZWlh
 LmNvbQAKCRCqPeLaPCU5Zf+cD/9xrU205ChyR4mSCTlUCxLcQI8kripeF96Zx7Q7
 Xo+dKlTjzTQYW8omBWlYSvOVY4rZVMB1NzwVPmPHIkBm13xdV0ybMVWmenOY7UD0
 cG4yDcgkQETsH4XJnPLCDFZHDG8HS+eiYCr7Mb2sAmNWcb2iGdoW7y5GxHtiZsJL
 IgydEqu/dOZCVkgnjlr2rS3EjbKpqyI6zPQ2TPAAzWch93Yczwk1NIYKM32ws6u1
 MQ6Mf7hHggDiV85G/hch7k+z6F4LC6UlOxBNEtUmziJ8kjNGq5IMu42jNLMsDlS4
 IGstOpckU0rr8BwuJG+5BNc+xK4EYaPac4uj1RRr1Nqwd/KzSKXjeNfdrds9XRdm
 U6DPFO8q6vADvOdn5SlFaiYKi/vvnUDq2rsl5DjP6cnRLkDzhdIlufWz4n6/zY42
 cmEwNstH1+fiGDeQcrWiG1pI6allKFAfbsBhgd7rXGlmOGeta1MqSyf326E1y/TP
 sqiR9yWDI/rgceOJ4pPsZM7rXmh6kGa+NiYY1paHMR/N0RDKXeh+yeNyPC8RHgfs
 tcFZ/KcRrsKd3huMbCHBQqGgpvKEM3Gh616keb1zZryO2XoSVAPXSy53NXtP7//V
 qx89yYz2gqEl8C8bR+KooFWpK6bhmZpu9cPljA/Pnr0nzZrWEMlp9TueQCp7tAPX
 TFoXag==
 =n2BM
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmpnCA0ACgkQmmx57+YA
 GNn6dw//YKJr1HFeXzPnQHCjULX/oEd20WVFdX/YAHfgz3sBpnGyrMOPsFn0kmHp
 HGKtztBkNOo0oq+IoMoWnpfoIFsYHpW4JB3wFYh0PUZ7tAi5eBTHcTTBJMCIta1a
 huBj4tF5xU5ORv90qRT2cNWTxHYbw4sKxjhuT7RihUC5m2MzelWBY52dCmsSdSTq
 i/wC6m7h7U4eQa81FQK7Q63YvGpBYAuJdfGJKNrtt3BefG5Og3ks3otiOkMcA8hm
 bbY1l+dijHLe3oMD8w1pdu3mejvA+AhI8V1PBTsGKfAB/axsNSY5S/pSLRtowU6B
 ZLoz47tQgqQamkxX/qdFy0PjlC8Juq/IHG/Kb1nyyD4GRVL27Ya8F9IAUt93PIdc
 9V5vQyE4hmcY2oqxpGyK2YZoLRLBlGhjkMTV2qT4F6ejCgpt+J4l62ITwv0RPvNf
 cJrTR3UuZd5BlxIGLx2bCxTISCuzZQy9czHTfhI3SX3o4ywgyxxW4uO6W/E5rzH2
 IBhq7g5II+WXoyEQ8XWRskFbOSzZIWCxTp2inDKumzKCYxqwXD/a4JyjvNjZv/T0
 tnKbtogO0CTvF0gJZhw6JbpdNUlQrwDRnTJOG3P5Do1iHazbdoh4ybzGi0L1y+SL
 GQym1LIpA6ClYz7X13X+tTTDzupdCHgSwkJYMFvSZ2xB/ttIf6U=
 =CrQ8
 -----END PGP SIGNATURE-----

Merge tag 'lpc32xx-arm-for-7.3' of https://github.com/vzapolskiy/linux-lpc32xx into soc/arm

ARM: nxp: lpc32xx: ARM changes for v7.3

NXP LPC32xx ARM changes for v7.3 contain:

- Karl Mehltretter fixes a multiplatform kernel runtime execution by
  limiting LPC32xx SoC specific init functions to be run on this
  platform only,
- a stale method of populating DMA, SLC and MLC NAND controllers is
  removed from platform code, this change was announced to happen by
  the end of this year, all touched by the change controllers are
  properly described in the platform device tree for years, and very
  old board dtbs are recommended to be updated.

* tag 'lpc32xx-arm-for-7.3' of https://github.com/vzapolskiy/linux-lpc32xx:
  ARM: lpc32xx: remove a few manually populated OF devices
  ARM: lpc32xx: only run SoC init on LPC32xx hardware

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2026-07-27 09:25:58 +02:00
Jaehoon Kim
9972befc3e KVM: s390: Fall back to short-term pinning in MAP ioctl
FOLL_LONGTERM pinning fails for some memory types, such as file-backed
guest memory. As a result, kvm_s390_adapter_map() returns -EINVAL and
irqfd adapter registration fails even though interrupt delivery could
still work via the existing non-atomic path.

When FOLL_LONGTERM pinning fails, verify that the page is accessible
using a short-term pin instead. If the short-term pin succeeds, unpin
the page and add a map entry with pinned=false to preserve MAP/UNMAP
symmetry. The non-atomic irqfd path already performs short-term pinning
for interrupt delivery, so this restores the previous behavior for
memory that cannot be pinned long-term.

get_map_info() is updated to return NULL for unpinned entries so that
the atomic irqfd fast path falls back to the non-atomic path.
kvm_s390_adapter_unmap() and kvm_s390_unmap_all_adapters() skip dirty
marking and unpin for unpinned entries.

Update Documentation/virt/kvm/devices/s390_flic.rst to reflect the
new MAP/UNMAP behavior.

Fixes: c9a5688380 ("KVM: s390: Add map/unmap ioctl and clean mappings post-guest")
Signed-off-by: Jaehoon Kim <jhkim@linux.ibm.com>
Reviewed-by: Douglas Freimuth <freimuth@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
2026-07-27 09:23:53 +02:00
Michael Guralnik
ba7f6f2f16 RDMA/mlx5: Deprecate latency-sensitive QPs feature
New HW no longer implements a separate class for latency-sensitive QPs and
advertises this by a new cap bit.
REG_UMR is the only QP that used this feature, so gate its usage of the
feature on this cap.

Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
Reviewed-by: Patrisious Haddad <phaddad@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Link: https://patch.msgid.link/20260726-deprecate-lat-qps-v2-2-5e0c2ee55046@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2026-07-27 03:17:32 -04:00
Greg Kroah-Hartman
64c9e49eb1 Merge 7.2-rc5 into staging-next
We need the staging driver fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-27 09:01:45 +02:00
Greg Kroah-Hartman
a5339effdd Merge 7.2-rc5 into tty-next
We need the serial driver fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-27 08:58:54 +02:00
Robert Marko
8258a4bcfa arm64: dts: microchip: lan969x: add QSPI nodes
Add the required DT nodes for both QSPI controllers.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Link: https://lore.kernel.org/r/20260709112006.390742-6-robert.marko@sartura.hr
Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
2026-07-27 09:57:02 +03:00
Greg Kroah-Hartman
5d5fd841c3 Merge 7.2-rc5 into usb-next
We need the USB fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-27 08:40:53 +02:00
Leon Romanovsky
86ae5b515f mlx5: Deprecate latency-sensitive QPs feature
New HW no longer implements a separate class for latency-sensitive QPs
and advertises this by a new cap bit.

Signed-off-by: Leon Romanovsky <leon@kernel.org>
2026-07-27 02:37:29 -04:00
Michael Guralnik
36b1d3299d net/mlx5: Add qp_latency_sensitive_disable cap bit
Introduce the qp_latency_sensitive_disable capability bit to indicate
that the device no longer implements a separate class for
latency-sensitive QPs, so drivers can stop programming the
latency_sensitive QPC field and skip allocating the dedicated
fast-path bfreg on such HW.

Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
Reviewed-by: Patrisious Haddad <phaddad@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Link: https://patch.msgid.link/20260726-deprecate-lat-qps-v2-1-5e0c2ee55046@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2026-07-27 02:35:16 -04:00
Maher Sanalla
dec47e4b0f RDMA/mlx5: Fix integer overflow of user QP buffer size
set_user_buf_size() computes the QP buffer size by left-shifting the
user-supplied rq.wqe_cnt and rq.wqe_shift values as signed integers.
A sufficiently large rq.wqe_cnt causes signed integer overflow, which
is undefined behavior, and yields a small or negative buf_size, causing
ib_umem_get() to map a buffer smaller than the hardware will actually
write into.

Replace the shifts and addition with check_shl_overflow() and
check_add_overflow(), rejecting invalid user inputs.

Moreover, guard the identical shift computing qp->sq.offset in
_create_user_qp() before set_user_buf_size() is reached.

Fixes: e126ba97db ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Link: https://patch.msgid.link/20260723-fix-qp-buf-size-overflow-v1-1-ccb05ee43a7b@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2026-07-27 02:31:34 -04:00
Michael Gur
0087470661 RDMA/mlx5: Expose RoCE acceleration counters on all functions
Decouple RoCE acceleration counters exposure from the roce_accl device
cap. The device cap is intended to protect the access to the roce_accl
register and was disabled on VFs for that purpose.
Reading the acceleration counters, however, does not involve that
register, the counters are read-only statistics that carry no
configuration risk. Gating their exposure on the capability therefore
needlessly hides useful diagnostic data on VFs.
Expose the counters on all functions regardless of the capability.

Signed-off-by: Michael Gur <michaelgur@nvidia.com>
Reviewed-by: Chiara Meiohas <cmeiohas@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Link: https://patch.msgid.link/20260723-expose-roce-accl-counters-v1-1-967618b550cd@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2026-07-27 02:29:02 -04:00
Leon Romanovsky
c715007b21 RDMA/mlx5: Make sure that UMR page is aligned to PAGE_SIZE
The UMR XLT buffer needs to be aligned to PAGE_SIZE.

Fixes: b2022068de ("RDMA/mlx5: use kmalloc() for UMR translation buffers")
Link: https://patch.msgid.link/20260722-fix-get-order-alignment-v1-1-ece212ddb5dc@nvidia.com
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
2026-07-27 02:22:03 -04:00
Reinette Chatre
854db793d4 fs/resctrl: Inform user space when status buffer overflowed
resctrl fs commands are becoming more powerful with, for example, a user able
to use syntax like '*' to make broad configuration changes. Such commands that
span multiple domains may result in more than one message printed to the
last_cmd_status buffer with more planned.

Issue "[truncated]" when displaying the last_cmd_status buffer to communicate
if it overflowed. Upon encountering this, user space is expected to combine
details about the failure found in info/last_cmd_status with related resctrl
files to learn the accurate system state after the command failure.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Ben Horgan <ben.horgan@arm.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Tested-by: Babu Moger <babu.moger@amd.com>
Link: https://patch.msgid.link/eb3d1aaa41d1f2bf6b1bb26ceafd52f04912121d.1782857711.git.reinette.chatre@intel.com
2026-07-26 21:40:26 -07:00
Michael Bommarito
c9b47e6b23 erofs: cap LZMA stream pool size
fs/erofs/decompressor_lzma.c sizes the module-global MicroLZMA stream
pool from num_possible_cpus() when the lzma_streams module parameter is
unset, then z_erofs_load_lzma_config() preallocates one image-supplied
dictionary per stream, accepting dictionaries up to 8 MiB.  On high-CPU
systems, a small EROFS image can pin hundreds of MiB of vmalloc-backed
decoder state until the erofs module is unloaded.

Impact: An EROFS image mounted by the system can pin up to 8 MiB of
vmalloc memory per LZMA stream, either as intended or unexpectedly.

Bound the default stream count by a new
CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS option, default 16, so the
worst-case default preallocation is 128 MiB if the number of CPUs is no
less than 16 while preserving the existing per-image dictionary limit.
An explicit lzma_streams module parameter is still honoured as-is, so
administrators who deliberately size the pool are not affected.

Fixes: 622ceaddb7 ("erofs: lzma compression support")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2026-07-27 12:31:11 +08:00
Gao Xiang
96b2dbbe58 erofs: ensure valid f_path for page cache sharing
Previously, backing files for page cache sharing were set up with
f_path left as NULL (only f_inode was valid).  It worked, but a recent
mincore fix relies on f_path.mnt and crashes (found by "erofs/028" on
7.2-rc4):

 BUG: kernel NULL pointer dereference, address: 0000000000000018
 #PF: supervisor read access in kernel mode
 #PF: error_code(0x0000) - not-present page
 PGD 0 P4D 0
 Oops: Oops: 0000 [#1] SMP PTI
 CPU: 3 UID: 0 PID: 675528 Comm: fincore Not tainted 7.2.0-rc4-00002-g[]-dirty #1 PREEMPT(lazy)
 Hardware name: Red Hat KVM, BIOS 1.16.0-4.al8 04/01/2014
 RIP: 0010:__do_sys_mincore+0xc0/0x2c0
 ...

Specify valid paths using valid disconnected dentries together with
erofs_ishare_mnt instead of leaving f_path empty, so they are more
like real backing files in a pseudo filesystem and standard
backing_file_open() can be used directly.

Fixes: e187bc02f8 ("mm: do file ownership checks with the proper mount idmap")
Acked-by: Hongbo Li <hongbohbli@tencent.com>
Signed-off-by: Gao Xiang <xiang@kernel.org>
2026-07-27 12:31:02 +08:00
Reinette Chatre
bb38d45719 fs/resctrl: Communicate resource group deleted error via last_cmd_status
User space expects last_cmd_status to contain additional information if any
resctrl command fails.

A resctrl command may be blocked on the rdtgroup_mutex waiting for another
command to finish and find that once the mutex is available that the resource
group has since been deleted.

In this scenario the command will fail while last_cmd_status contains either
"ok" if the last_cmd_status buffer is empty or an outdated error from
a previous command failure if last_cmd_status buffer has content.

Include clearing of last_cmd_status buffer as part of rdtgroup_kn_lock_live()
that is used to obtain access and needed locking to a resource group before
attempting a command on the group.

With the last_cmd_status buffer ready, provide an appropriate message to user
space if the resource group has been deleted.

No last_cmd_status treatment is needed for the remaining failure of
rdtgroup_kn_lock_live() encountering a non-existent resource group since that
could only occur during an attempt to obtain a resource group lock on a file
in info/ which is an invalid usage.

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/9982141ec6f3ec18e0c53d7feabb19651583cf0e.1782857711.git.reinette.chatre@intel.com
2026-07-26 21:28:31 -07:00
Reinette Chatre
b37678cfe5 fs/resctrl: Add last_cmd_status support for writes to max_threshold_occupancy
info/last_cmd_status is intended to contain more information if a write to
any resctrl file fails. Writes to max_threshold_occupancy did not receive
last_cmd_status support during initial last_cmd_status enabling. Add it now.

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/dfc60cf5324e15612db075b0987bd89c490fbad5.1782857711.git.reinette.chatre@intel.com
2026-07-26 21:22:37 -07:00