]> Git Repo - linux.git/log
linux.git
5 months agodrm: Fix for kernel doc warning
R Sundar [Thu, 3 Oct 2024 02:38:06 +0000 (08:08 +0530)]
drm: Fix for kernel doc warning

Added colon in kernel-doc comment to fix the warning.

./include/drm/drm_drv.h:372: warning: Incorrect use of kernel-doc format:          * @fbdev_probe
./include/drm/drm_drv.h:435: warning: Function parameter or struct member 'fbdev_probe' not described in 'drm_driver'

Signed-off-by: R Sundar <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Jani Nikula <[email protected]>
5 months agodrm/imx: add forward declarations for types
Jani Nikula [Wed, 9 Oct 2024 14:04:52 +0000 (17:04 +0300)]
drm/imx: add forward declarations for types

The imx.h header does not forward declare the types it uses, and the
header is not self-contained. Fix it.

Fixes: cc3e8a216d6b ("drm/imx: add internal bridge handling display-timings DT node")
Cc: Philipp Zabel <[email protected]>
Cc: Dmitry Baryshkov <[email protected]>
Cc: [email protected]
Cc: [email protected]
Reviewed-by: Philipp Zabel <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Jani Nikula <[email protected]>
5 months agodrm/file: fix client_name_lock kernel-doc warning
Jani Nikula [Wed, 9 Oct 2024 14:03:00 +0000 (17:03 +0300)]
drm/file: fix client_name_lock kernel-doc warning

It's client_name_lock, not name_lock. Also unify style while at it.

Reported-by: Stephen Rothwell <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]
Fixes: 56c594d8df64 ("drm: add DRM_SET_CLIENT_NAME ioctl")
Reviewed-by: Dmitry Osipenko <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Christian König <[email protected]>
5 months agodrm/writeback: remove pointless enable_signaling implementation
Christian König [Mon, 9 Sep 2024 10:21:13 +0000 (12:21 +0200)]
drm/writeback: remove pointless enable_signaling implementation

Just returning true here is a no-op, remove the optional callback.

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Simona Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodma-buf/sw_sync: remove pointless enable_signaling implementation
Christian König [Mon, 9 Sep 2024 10:12:34 +0000 (12:12 +0200)]
dma-buf/sw_sync: remove pointless enable_signaling implementation

Just returning true here is a no-op, remove the optional callback.

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Simona Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodma-buf: add WARN_ON() illegal dma-fence signaling
Christian König [Thu, 5 Sep 2024 13:51:54 +0000 (15:51 +0200)]
dma-buf: add WARN_ON() illegal dma-fence signaling

Calling the signaling a NULL fence is obviously a coding error in a
driver. Those functions unfortunately just returned silently without
raising a warning.

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Simona Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/ttm: Move pinned objects off LRU lists when pinning
Thomas Hellström [Wed, 11 Sep 2024 12:18:59 +0000 (14:18 +0200)]
drm/ttm: Move pinned objects off LRU lists when pinning

The ttm_bo_pin() and ttm_bo_unpin() functions weren't moving their
resources off the LRU list to the unevictable list.

Make sure that happens so that pinned objects don't accidently linger
on the LRU lists, and also make sure to move them back once they
are unpinned.

v2:
- Removing from a bulk move must be done with the pin-count still zero.
v3:
- ttm_resource_move_to_lru_tail must be done after pinning with a non-
  NULL resource (Intel CI).
v6:
- Use a TAB instead of space (checkpatch.pl error).

Cc: Christian König <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: <[email protected]>
Signed-off-by: Thomas Hellström <[email protected]>
Reviewed-by: Christian König <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/ttm: Move swapped objects off the manager's LRU list
Thomas Hellström [Wed, 11 Sep 2024 12:18:58 +0000 (14:18 +0200)]
drm/ttm: Move swapped objects off the manager's LRU list

Resources of swapped objects remains on the TTM_PL_SYSTEM manager's
LRU list, which is bad for the LRU walk efficiency.

Rename the device-wide "pinned" list to "unevictable" and move
also resources of swapped-out objects to that list.

An alternative would be to create an "UNEVICTABLE" priority to
be able to keep the pinned- and swapped objects on their
respective manager's LRU without affecting the LRU walk efficiency.

v2:
- Remove a bogus WARN_ON (Christian König)
- Update ttm_resource_[add|del] bulk move (Christian König)
- Fix TTM KUNIT tests (Intel CI)
v3:
- Check for non-NULL bo->resource in ttm_bo_populate().
v4:
- Don't move to LRU tail during swapout until the resource
  is properly swapped or there was a swapout failure.
  (Intel Ci)
- Add a newline after checkpatch check.
v5:
- Introduce ttm_resource_is_swapped() to avoid a corner-case where
  a newly created resource was considered swapped. (Intel CI)
v6:
- Move an assert.

Cc: Christian König <[email protected]>
Cc: Matthew Brost <[email protected]>
Cc: <[email protected]>
Signed-off-by: Thomas Hellström <[email protected]>
Reviewed-by: Christian König <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/vc4: Correct generation check in vc4_hvs_lut_load
Dave Stevenson [Tue, 8 Oct 2024 16:44:36 +0000 (17:44 +0100)]
drm/vc4: Correct generation check in vc4_hvs_lut_load

Commit 24c5ed3ddf27 ("drm/vc4: Introduce generation number enum")
incorrectly swapped a check of hvs->vc4->is_vc5 to
hvs->vc4->gen == VC4_GEN_4 in vc4_hvs_lut_load, hence breaking
loading the gamma look up table on Pi0-3.

Correct that conditional.

Fixes: 24c5ed3ddf27 ("drm/vc4: Introduce generation number enum")
Reported-by: Marek Szyprowski <[email protected]>
Closes: https://lore.kernel.org/dri-devel/[email protected]/
Tested-by: Marek Szyprowski <[email protected]>
Reviewed-by: Maíra Canal <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Dave Stevenson <[email protected]>
5 months agodrm/vc4: Match drm_dev_enter and exit calls in vc4_hvs_atomic_flush
Dave Stevenson [Tue, 8 Oct 2024 16:44:35 +0000 (17:44 +0100)]
drm/vc4: Match drm_dev_enter and exit calls in vc4_hvs_atomic_flush

Commit 92c17d16476c ("drm/vc4: hvs: Ignore atomic_flush if we're disabled")
added a path which returned early without having called drm_dev_exit.

Ensure all paths call drm_dev_exit.

Fixes: 92c17d16476c ("drm/vc4: hvs: Ignore atomic_flush if we're disabled")
Tested-by: Marek Szyprowski <[email protected]>
Reviewed-by: Maíra Canal <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Dave Stevenson <[email protected]>
5 months agodrm/vc4: Match drm_dev_enter and exit calls in vc4_hvs_lut_load
Dave Stevenson [Tue, 8 Oct 2024 16:44:34 +0000 (17:44 +0100)]
drm/vc4: Match drm_dev_enter and exit calls in vc4_hvs_lut_load

Commit 52efe364d196 ("drm/vc4: hvs: Don't write gamma luts on 2711")
added a return path to vc4_hvs_lut_load that had called
drm_dev_enter, but not drm_dev_exit.

Ensure we call drm_dev_exit.

Fixes: 52efe364d196 ("drm/vc4: hvs: Don't write gamma luts on 2711")
Reported-by: Marek Szyprowski <[email protected]>
Closes: https://lore.kernel.org/dri-devel/[email protected]/
Tested-by: Marek Szyprowski <[email protected]>
Reviewed-by: Maíra Canal <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Dave Stevenson <[email protected]>
5 months agodrm/vc4: Run default client setup for all variants.
Dave Stevenson [Wed, 2 Oct 2024 15:06:19 +0000 (16:06 +0100)]
drm/vc4: Run default client setup for all variants.

Commit 45903624e9fc ("drm/vc4: Run DRM default client setup")
only added DRM_FBDEV_DMA_DRIVER_OPS for the vc4 (Pi0-3) driver
definition, which caused an issue on vc5 (Pi4) as there was no
fbdev_probe function defined.

Fixes: 45903624e9fc ("drm/vc4: Run DRM default client setup")
Reviewed-by: Maíra Canal <[email protected]>
Reviewed-by: Thomas Zimmermann <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Dave Stevenson <[email protected]>
5 months agodrm/panel: Add Samsung AMS639RQ08 panel driver
Danila Tikhonov [Mon, 30 Sep 2024 20:24:48 +0000 (23:24 +0300)]
drm/panel: Add Samsung AMS639RQ08 panel driver

Add the driver for Samsung AMS639RQ08 FHD Plus CMD mode panel support
found in:
- Xiaomi Mi 9 Lite / CC9 (sdm710-xiaomi-pyxis)
- Xiaomi Mi 9T / Redmi K20 (sm7150-xiaomi-davinci)
- Xiaomi Mi 9T Pro / Redmi K20 Pro (sm8150-xiaomi-raphael)

Tested-by: Degdag Mohamed <[email protected]> # xiaomi-raphael
Tested-by: Jens Reidel <[email protected]> # xiaomi-davinci
Signed-off-by: Danila Tikhonov <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodt-bindings: display: panel: Add Samsung AMS639RQ08
Danila Tikhonov [Mon, 30 Sep 2024 20:24:47 +0000 (23:24 +0300)]
dt-bindings: display: panel: Add Samsung AMS639RQ08

The Samsung AMS639RQ08 is a 6.39 inch 1080x2340 MIPI-DSI CMD mode
AMOLED panel used in:
- Xiaomi Mi 9 Lite / CC9 (sdm710-xiaomi-pyxis)
- Xiaomi Mi 9T / Redmi K20 (sm7150-xiaomi-davinci)
- Xiaomi Mi 9T Pro / Redmi K20 Pro (sm8150-xiaomi-raphael)
Add a dt-binding for it.

Signed-off-by: Danila Tikhonov <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm: panel: jd9365da-h3: Remove unused num_init_cmds structure member
Hugo Villeneuve [Mon, 30 Sep 2024 17:05:03 +0000 (13:05 -0400)]
drm: panel: jd9365da-h3: Remove unused num_init_cmds structure member

Now that the driver has been converted to use wrapped MIPI DCS functions,
the num_init_cmds structure member is no longer needed, so remove it.

Fixes: 35583e129995 ("drm/panel: panel-jadard-jd9365da-h3: use wrapped MIPI DCS functions")
Cc: [email protected]
Signed-off-by: Hugo Villeneuve <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Reviewed-by: Jessica Zhang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/panel: Add support for S6E3HA8 panel driver
Dzmitry Sankouski [Sun, 6 Oct 2024 18:18:21 +0000 (21:18 +0300)]
drm/panel: Add support for S6E3HA8 panel driver

Add support for MIPI-DSI based S6E3HA8 AMOLED panel
driver. This panel has 1440x2960 resolution, 5.8-inch physical
size, and can be found in starqltechn device.
Brightness regulation is not yet supported.

Reviewed-by: Neil Armstrong <[email protected]>
Signed-off-by: Dzmitry Sankouski <[email protected]>
Link: https://lore.kernel.org/r/20241006-starqltechn_integration_upstream-v6-3-8336b9cd6c34@gmail.com
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20241006-starqltechn_integration_upstream-v6-3-8336b9cd6c34@gmail.com
5 months agodt-bindings: panel: add Samsung s6e3ha8
Dzmitry Sankouski [Sun, 6 Oct 2024 18:18:20 +0000 (21:18 +0300)]
dt-bindings: panel: add Samsung s6e3ha8

Add binding for the Samsung s6e3ha8 panel found in the Samsung S9.

Reviewed-by: Conor Dooley <[email protected]>
Signed-off-by: Dzmitry Sankouski <[email protected]>
Link: https://lore.kernel.org/r/20241006-starqltechn_integration_upstream-v6-2-8336b9cd6c34@gmail.com
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20241006-starqltechn_integration_upstream-v6-2-8336b9cd6c34@gmail.com
5 months agodrm/mipi-dsi: add mipi_dsi_compression_mode_multi
Dzmitry Sankouski [Sun, 6 Oct 2024 18:18:19 +0000 (21:18 +0300)]
drm/mipi-dsi: add mipi_dsi_compression_mode_multi

mipi_dsi_compression_mode_multi can help with
error handling.

Signed-off-by: Dzmitry Sankouski <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/20241006-starqltechn_integration_upstream-v6-1-8336b9cd6c34@gmail.com
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20241006-starqltechn_integration_upstream-v6-1-8336b9cd6c34@gmail.com
5 months agodrm/panel: ilitek-ili9881c: Report subpixel order according to rotation
Philipp Zabel [Wed, 26 Jun 2024 14:40:39 +0000 (16:40 +0200)]
drm/panel: ilitek-ili9881c: Report subpixel order according to rotation

Assume a default RGB subpixel order and flip it around if 180° rotation
is configured via address mode. Report subpixel order to userspace.

Signed-off-by: Philipp Zabel <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/20240626-drm-panel-ili9881c-rotation-v1-2-e0ff54173e32@pengutronix.de
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20240626-drm-panel-ili9881c-rotation-v1-2-e0ff54173e32@pengutronix.de
5 months agodrm/panel: ilitek-ili9881c: Explicitly set address mode, allow 180° rotation
Philipp Zabel [Wed, 26 Jun 2024 14:40:38 +0000 (16:40 +0200)]
drm/panel: ilitek-ili9881c: Explicitly set address mode, allow 180° rotation

We can use horizontal and vertical flipping via the MIPI DCS address
mode to rotate the display by 180° using the device tree "rotation"
property. Since the tl050hdv35 panel has been defined as rotated,
we have to invert the bits there.

Signed-off-by: Philipp Zabel <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/20240626-drm-panel-ili9881c-rotation-v1-1-e0ff54173e32@pengutronix.de
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/20240626-drm-panel-ili9881c-rotation-v1-1-e0ff54173e32@pengutronix.de
5 months agodt-bindings: display: panel-lvds: Add compatible for Jenson BL-JT60050-01A
Frieder Schrempf [Wed, 28 Aug 2024 07:46:54 +0000 (09:46 +0200)]
dt-bindings: display: panel-lvds: Add compatible for Jenson BL-JT60050-01A

The Jenson BL-JT60050-01A is a 7" 1024x600 LVDS display.

Signed-off-by: Frieder Schrempf <[email protected]>
Acked-by: Conor Dooley <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodt-bindings: vendor-prefixes: Add Jenson Display
Frieder Schrempf [Wed, 28 Aug 2024 07:46:53 +0000 (09:46 +0200)]
dt-bindings: vendor-prefixes: Add Jenson Display

Add vendor prefix for manufacturer Jenson Display (http://jensondisplay.com).

Signed-off-by: Frieder Schrempf <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm: use drm_file client_name in fdinfo
Pierre-Eric Pelloux-Prayer [Thu, 3 Oct 2024 12:43:10 +0000 (14:43 +0200)]
drm: use drm_file client_name in fdinfo

Add an optional drm-client-name field to drm fdinfo's output.

Reviewed-by: Christian König <[email protected]>
Reviewed-by: Tvrtko Ursulin <[email protected]>
Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Christian König <[email protected]>
5 months agodrm: add DRM_SET_CLIENT_NAME ioctl
Pierre-Eric Pelloux-Prayer [Thu, 3 Oct 2024 12:43:09 +0000 (14:43 +0200)]
drm: add DRM_SET_CLIENT_NAME ioctl

Giving the opportunity to userspace to associate a free-form
name with a drm_file struct is helpful for tracking and debugging.

This is similar to the existing DMA_BUF_SET_NAME ioctl.

Access to client_name is protected by a mutex, and the 'clients' debugfs
file has been updated to print it.

Userspace MR to use this ioctl:
   https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1428

If the string passed by userspace contains chars that would mess up output
when it's going to be printed (in dmesg, fdinfo, etc), -EINVAL is returned.

A 0-length string is a valid use, and clears the existing name.

Reviewed-by: Tvrtko Ursulin <[email protected]>
Reviewed-by: Dmitry Osipenko <[email protected]>
Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Christian König <[email protected]>
5 months agodrm/vc4: Use `vc4_perfmon_find()`
Maíra Canal [Fri, 4 Oct 2024 12:35:59 +0000 (09:35 -0300)]
drm/vc4: Use `vc4_perfmon_find()`

Similar to commit f2a4bcb25328 ("drm/v3d: Use v3d_perfmon_find()"),
replace the open-coded `vc4_perfmon_find()` with the real thing.

Cc: Christian Gmeiner <[email protected]>
Signed-off-by: Maíra Canal <[email protected]>
Reviewed-by: Juan A. Suarez <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/bridge: it6505: Drop EDID cache on bridge power off
Pin-yen Lin [Thu, 26 Sep 2024 09:29:09 +0000 (17:29 +0800)]
drm/bridge: it6505: Drop EDID cache on bridge power off

The bridge might miss the display change events when it's powered off.
This happens when a user changes the external monitor when the system
is suspended and the embedded controller doesn't not wake AP up.

It's also observed that one DP-to-HDMI bridge doesn't work correctly
when there is no EDID read after it is powered on.

Drop the cache to force an EDID read after system resume to fix this.

Fixes: 11feaef69d0c ("drm/bridge: it6505: Add caching for EDID")
Signed-off-by: Pin-yen Lin <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Signed-off-by: Douglas Anderson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/bridge: anx7625: Drop EDID cache on bridge power off
Pin-yen Lin [Thu, 26 Sep 2024 09:29:08 +0000 (17:29 +0800)]
drm/bridge: anx7625: Drop EDID cache on bridge power off

The bridge might miss the display change events when it's powered off.
This happens when a user changes the external monitor when the system
is suspended and the embedded controller doesn't not wake AP up.

It's also observed that one DP-to-HDMI bridge doesn't work correctly
when there is no EDID read after it is powered on.

Drop the cache to force an EDID read after system resume to fix this.

Fixes: 8bdfc5dae4e3 ("drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP")
Signed-off-by: Pin-yen Lin <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Signed-off-by: Douglas Anderson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/nouveau/i2c: rename aux.c and aux.h to auxch.c and auxch.h
Benjamin Szőke [Mon, 3 Jun 2024 09:15:58 +0000 (11:15 +0200)]
drm/nouveau/i2c: rename aux.c and aux.h to auxch.c and auxch.h

The goal is to clean-up Linux repository from AUX file names, because
the use of such file names is prohibited on other operating systems
such as Windows, so the Linux repository cannot be cloned and
edited on them.

Signed-off-by: Benjamin Szőke <[email protected]>
Reviewed-by: Ben Skeggs <[email protected]>
Signed-off-by: Danilo Krummrich <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodocs/gpu: ci: update flake tests requirements
Vignesh Raman [Mon, 30 Sep 2024 09:52:47 +0000 (15:22 +0530)]
docs/gpu: ci: update flake tests requirements

Update the documentation to specify linking to a relevant GitLab
issue or email report for each new flake entry. Added specific
GitLab issue urls for amdgpu, i915, msm and xe driver.

Acked-by: Maxime Ripard <[email protected]>
Acked-by: Rodrigo Vivi <[email protected]> #intel and xe
Acked-by: Abhinav Kumar <[email protected]> # msm
Acked-by: Dmitry Baryshkov <[email protected]> # msm
Signed-off-by: Vignesh Raman <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Signed-off-by: Helen Koike <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/client: Extract drm_connector_first_mode()
Ville Syrjälä [Thu, 4 Apr 2024 20:33:32 +0000 (23:33 +0300)]
drm/client: Extract drm_connector_first_mode()

Use a consistent method for picking the first mode from the
connnector's mode list.

Signed-off-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Jani Nikula <[email protected]>
5 months agodrm/client: Use drm_mode_destroy()
Ville Syrjälä [Thu, 4 Apr 2024 20:33:27 +0000 (23:33 +0300)]
drm/client: Use drm_mode_destroy()

Prefer drm_mode_destroy() over bare kfree(), for consistency
and setting a good example.

Signed-off-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
5 months agodrm/client: s/drm_connector_has_preferred_mode/drm_connector_preferred_mode/
Ville Syrjälä [Thu, 4 Apr 2024 20:33:26 +0000 (23:33 +0300)]
drm/client: s/drm_connector_has_preferred_mode/drm_connector_preferred_mode/

Drop the "has" from drm_connector_has_preferred_mode() to better
describe what it does.

Signed-off-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
5 months agodrm/panthor: add sysfs knob for enabling job profiling
Adrián Larumbe [Mon, 23 Sep 2024 23:06:25 +0000 (00:06 +0100)]
drm/panthor: add sysfs knob for enabling job profiling

This commit introduces a DRM device sysfs attribute that lets UM control
the job accounting status in the device. The knob variable had been brought
in as part of a previous commit, but now we're able to fix it manually.

As sysfs files are part of a driver's uAPI, describe its legitimate input
values and output format in a documentation file.

Signed-off-by: Adrián Larumbe <[email protected]>
Reviewed-by: Steven Price <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/panthor: enable fdinfo for memory stats
Adrián Larumbe [Mon, 23 Sep 2024 23:06:24 +0000 (00:06 +0100)]
drm/panthor: enable fdinfo for memory stats

Implement drm object's status callback.

Also, we consider a PRIME imported BO to be resident if its matching
dma_buf has an open attachment, which means its backing storage had already
been allocated.

Signed-off-by: Adrián Larumbe <[email protected]>
Reviewed-by: Steven Price <[email protected]>
Reviewed-by: Liviu Dudau <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/panthor: add DRM fdinfo support
Adrián Larumbe [Mon, 23 Sep 2024 23:06:23 +0000 (00:06 +0100)]
drm/panthor: add DRM fdinfo support

Drawing from the FW-calculated values in a previous commit, we can increase
the numbers for an open file by collecting them from finished jobs when
updating their group synchronisation objects.

Display of fdinfo key-value pairs is governed by a bitmask that is by
default unset in the present commit, and supporting manual toggle of it
will be the matter of a later commit.

Signed-off-by: Adrián Larumbe <[email protected]>
Reviewed-by: Steven Price <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/panthor: record current and maximum device clock frequencies
Adrián Larumbe [Mon, 23 Sep 2024 23:06:22 +0000 (00:06 +0100)]
drm/panthor: record current and maximum device clock frequencies

In order to support UM in calculating rates of GPU utilisation, the current
operating and maximum GPU clock frequencies must be recorded during device
initialisation, and also during OPP state transitions.

Signed-off-by: Adrián Larumbe <[email protected]>
Reviewed-by: Steven Price <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/panthor: introduce job cycle and timestamp accounting
Adrián Larumbe [Mon, 23 Sep 2024 23:06:21 +0000 (00:06 +0100)]
drm/panthor: introduce job cycle and timestamp accounting

Enable calculations of job submission times in clock cycles and wall
time. This is done by expanding the boilerplate command stream when running
a job to include instructions that compute said times right before and
after a user CS.

A separate kernel BO is created per queue to store those values. Jobs can
access their sampled data through an index different from that of the
queue's ringbuffer. The reason for this is saving memory on the profiling
information kernel BO, since the amount of simultaneous profiled jobs we
can write into the queue's ringbuffer might be much smaller than for
regular jobs, as the former take more CSF instructions.

This commit is done in preparation for enabling DRM fdinfo support in the
Panthor driver, which depends on the numbers calculated herein.

A profile mode mask has been added that will in a future commit allow UM to
toggle performance metric sampling behaviour, which is disabled by default
to save power. When a ringbuffer CS is constructed, timestamp and cycling
sampling instructions are added depending on the enabled flags in the
profiling mask.

A helper was provided that calculates the number of instructions for a
given set of enablement mask, and these are passed as the number of credits
when initialising a DRM scheduler job.

Signed-off-by: Adrián Larumbe <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Reviewed-by: Liviu Dudau <[email protected]>
Reviewed-by: Steven Price <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agodrm/panel: elida-kd35t133: transition to mipi_dsi wrapped functions
Tejas Vipin [Wed, 25 Sep 2024 08:00:03 +0000 (13:30 +0530)]
drm/panel: elida-kd35t133: transition to mipi_dsi wrapped functions

Changes the elida-kd35t133 panel to use multi style functions for
improved error handling.

Reviewed-by: Jessica Zhang <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Signed-off-by: Tejas Vipin <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Signed-off-by: Douglas Anderson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agofbdev: sh_mobile_lcdc_fb: Use backlight power constants
Thomas Zimmermann [Wed, 31 Jul 2024 12:33:50 +0000 (14:33 +0200)]
fbdev: sh_mobile_lcdc_fb: Use backlight power constants

Replace FB_BLANK_ constants with their counterparts from the
backlight subsystem. The values are identical, so there's no
change in functionality or semantics.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Helge Deller <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agofbdev: rivafb: Use backlight power constants
Thomas Zimmermann [Wed, 31 Jul 2024 12:33:49 +0000 (14:33 +0200)]
fbdev: rivafb: Use backlight power constants

Replace FB_BLANK_ constants with their counterparts from the
backlight subsystem. The values are identical, so there's no
change in functionality or semantics.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Antonino Daplas <[email protected]>
Cc: Helge Deller <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agofbdev: radeonfb: Use backlight power constants
Thomas Zimmermann [Wed, 31 Jul 2024 12:33:48 +0000 (14:33 +0200)]
fbdev: radeonfb: Use backlight power constants

Replace FB_BLANK_ constants with their counterparts from the
backlight subsystem. The values are identical, so there's no
change in functionality or semantics.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Helge Deller <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agofbdev: omapfb: Use backlight power constants
Thomas Zimmermann [Wed, 31 Jul 2024 12:33:47 +0000 (14:33 +0200)]
fbdev: omapfb: Use backlight power constants

Replace FB_BLANK_ constants with their counterparts from the
backlight subsystem. The values are identical, so there's no
change in functionality or semantics.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Helge Deller <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agofbdev: nvidiafb: Use backlight power constants
Thomas Zimmermann [Wed, 31 Jul 2024 12:33:46 +0000 (14:33 +0200)]
fbdev: nvidiafb: Use backlight power constants

Replace FB_BLANK_ constants with their counterparts from the
backlight subsystem. The values are identical, so there's no
change in functionality or semantics.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Antonino Daplas <[email protected]>
Cc: Helge Deller <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agofbdev: chipsfb: Use backlight power constants
Thomas Zimmermann [Wed, 31 Jul 2024 12:33:45 +0000 (14:33 +0200)]
fbdev: chipsfb: Use backlight power constants

Replace FB_BLANK_ constants with their counterparts from the
backlight subsystem. The values are identical, so there's no
change in functionality or semantics

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Helge Deller <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agofbdev: atyfb: Use backlight power constants
Thomas Zimmermann [Wed, 31 Jul 2024 12:33:44 +0000 (14:33 +0200)]
fbdev: atyfb: Use backlight power constants

Replace FB_BLANK_ constants with their counterparts from the
backlight subsystem. The values are identical, so there's no
change in functionality or semantics.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Helge Deller <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agofbdev: aty128fb: Use backlight power constants
Thomas Zimmermann [Wed, 31 Jul 2024 12:33:43 +0000 (14:33 +0200)]
fbdev: aty128fb: Use backlight power constants

Replace FB_BLANK_ constants with their counterparts from the
backlight subsystem. The values are identical, so there's no
change in functionality or semantics.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Helge Deller <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agofbdev: atmel_lcdfb: Use backlight power constants
Thomas Zimmermann [Wed, 31 Jul 2024 12:33:42 +0000 (14:33 +0200)]
fbdev: atmel_lcdfb: Use backlight power constants

Replace FB_BLANK_ constants with their counterparts from the
backlight subsystem. The values are identical, so there's no
change in functionality or semantics.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Claudiu Beznea <[email protected]>
Reviewed-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 months agoMerge drm/drm-next into drm-misc-next
Thomas Zimmermann [Mon, 30 Sep 2024 08:50:54 +0000 (10:50 +0200)]
Merge drm/drm-next into drm-misc-next

Get drm-misc-next to up v6.12-rc1.

Signed-off-by: Thomas Zimmermann <[email protected]>
5 months agoLinux 6.12-rc1 v6.12-rc1
Linus Torvalds [Sun, 29 Sep 2024 22:06:19 +0000 (15:06 -0700)]
Linux 6.12-rc1

5 months agox86: kvm: fix build error
Linus Torvalds [Sun, 29 Sep 2024 21:47:33 +0000 (14:47 -0700)]
x86: kvm: fix build error

The cpu_emergency_register_virt_callback() function is used
unconditionally by the x86 kvm code, but it is declared (and defined)
conditionally:

  #if IS_ENABLED(CONFIG_KVM_INTEL) || IS_ENABLED(CONFIG_KVM_AMD)
  void cpu_emergency_register_virt_callback(cpu_emergency_virt_cb *callback);
  ...

leading to a build error when neither KVM_INTEL nor KVM_AMD support is
enabled:

  arch/x86/kvm/x86.c: In function ‘kvm_arch_enable_virtualization’:
  arch/x86/kvm/x86.c:12517:9: error: implicit declaration of function ‘cpu_emergency_register_virt_callback’ [-Wimplicit-function-declaration]
  12517 |         cpu_emergency_register_virt_callback(kvm_x86_ops.emergency_disable_virtualization_cpu);
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  arch/x86/kvm/x86.c: In function ‘kvm_arch_disable_virtualization’:
  arch/x86/kvm/x86.c:12522:9: error: implicit declaration of function ‘cpu_emergency_unregister_virt_callback’ [-Wimplicit-function-declaration]
  12522 |         cpu_emergency_unregister_virt_callback(kvm_x86_ops.emergency_disable_virtualization_cpu);
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix the build by defining empty helper functions the same way the old
cpu_emergency_disable_virtualization() function was dealt with for the
same situation.

Maybe we could instead have made the call sites conditional, since the
callers (kvm_arch_{en,dis}able_virtualization()) have an empty weak
fallback.  I'll leave that to the kvm people to argue about, this at
least gets the build going for that particular config.

Fixes: 590b09b1d88e ("KVM: x86: Register "emergency disable" callbacks when virt is enabled")
Cc: Paolo Bonzini <[email protected]>
Cc: Sean Christopherson <[email protected]>
Cc: Kai Huang <[email protected]>
Cc: Chao Gao <[email protected]>
Cc: Farrah Chen <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
5 months agoMerge tag 'mailbox-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar...
Linus Torvalds [Sun, 29 Sep 2024 16:53:04 +0000 (09:53 -0700)]
Merge tag 'mailbox-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox

Pull mailbox updates from Jassi Brar:

 - fix kconfig dependencies (mhu-v3, omap2+)

 - use devie name instead of genereic imx_mu_chan as interrupt name
   (imx)

 - enable sa8255p and qcs8300 ipc controllers (qcom)

 - Fix timeout during suspend mode (bcm2835)

 - convert to use use of_property_match_string (mailbox)

 - enable mt8188 (mediatek)

 - use devm_clk_get_enabled helpers (spreadtrum)

 - fix device-id typo (rockchip)

* tag 'mailbox-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox:
  mailbox, remoteproc: omap2+: fix compile testing
  dt-bindings: mailbox: qcom-ipcc: Document QCS8300 IPCC
  dt-bindings: mailbox: qcom-ipcc: document the support for SA8255p
  dt-bindings: mailbox: mtk,adsp-mbox: Add compatible for MT8188
  mailbox: Use of_property_match_string() instead of open-coding
  mailbox: bcm2835: Fix timeout during suspend mode
  mailbox: sprd: Use devm_clk_get_enabled() helpers
  mailbox: rockchip: fix a typo in module autoloading
  mailbox: imx: use device name in interrupt name
  mailbox: ARM_MHU_V3 should depend on ARM64

5 months agoMerge tag 'i2c-for-6.12-rc1-additional_fixes' of git://git.kernel.org/pub/scm/linux...
Linus Torvalds [Sun, 29 Sep 2024 16:47:33 +0000 (09:47 -0700)]
Merge tag 'i2c-for-6.12-rc1-additional_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:

 - fix DesignWare driver ENABLE-ABORT sequence, ensuring ABORT can
   always be sent when needed

 - check for PCLK in the SynQuacer controller as an optional clock,
   allowing ACPI to directly provide the clock rate

 - KEBA driver Kconfig dependency fix

 - fix XIIC driver power suspend sequence

* tag 'i2c-for-6.12-rc1-additional_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: xiic: Fix pm_runtime_set_suspended() with runtime pm enabled
  i2c: keba: I2C_KEBA should depend on KEBA_CP500
  i2c: synquacer: Deal with optional PCLK correctly
  i2c: designware: fix controller is holding SCL low while ENABLE bit is disabled

5 months agoMerge tag 'dma-mapping-6.12-2024-09-29' of git://git.infradead.org/users/hch/dma...
Linus Torvalds [Sun, 29 Sep 2024 16:35:10 +0000 (09:35 -0700)]
Merge tag 'dma-mapping-6.12-2024-09-29' of git://git.infradead.org/users/hch/dma-mapping

Pull dma-mapping fix from Christoph Hellwig:

 - handle chained SGLs in the new tracing code (Christoph Hellwig)

* tag 'dma-mapping-6.12-2024-09-29' of git://git.infradead.org/users/hch/dma-mapping:
  dma-mapping: fix DMA API tracing for chained scatterlists

5 months agoMerge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Linus Torvalds [Sun, 29 Sep 2024 16:22:34 +0000 (09:22 -0700)]
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull more SCSI updates from James Bottomley:
 "These are mostly minor updates.

  There are two drivers (lpfc and mpi3mr) which missed the initial
  pull and a core change to retry a start/stop unit which affect
  suspend/resume"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (32 commits)
  scsi: lpfc: Update lpfc version to 14.4.0.5
  scsi: lpfc: Support loopback tests with VMID enabled
  scsi: lpfc: Revise TRACE_EVENT log flag severities from KERN_ERR to KERN_WARNING
  scsi: lpfc: Ensure DA_ID handling completion before deleting an NPIV instance
  scsi: lpfc: Fix kref imbalance on fabric ndlps from dev_loss_tmo handler
  scsi: lpfc: Restrict support for 32 byte CDBs to specific HBAs
  scsi: lpfc: Update phba link state conditional before sending CMF_SYNC_WQE
  scsi: lpfc: Add ELS_RSP cmd to the list of WQEs to flush in lpfc_els_flush_cmd()
  scsi: mpi3mr: Update driver version to 8.12.0.0.50
  scsi: mpi3mr: Improve wait logic while controller transitions to READY state
  scsi: mpi3mr: Update MPI Headers to revision 34
  scsi: mpi3mr: Use firmware-provided timestamp update interval
  scsi: mpi3mr: Enhance the Enable Controller retry logic
  scsi: sd: Fix off-by-one error in sd_read_block_characteristics()
  scsi: pm8001: Do not overwrite PCI queue mapping
  scsi: scsi_debug: Remove a useless memset()
  scsi: pmcraid: Convert comma to semicolon
  scsi: sd: Retry START STOP UNIT commands
  scsi: mpi3mr: A performance fix
  scsi: ufs: qcom: Update MODE_MAX cfg_bw value
  ...

5 months agoMerge tag 'bcachefs-2024-09-28' of git://evilpiepirate.org/bcachefs
Linus Torvalds [Sun, 29 Sep 2024 16:17:44 +0000 (09:17 -0700)]
Merge tag 'bcachefs-2024-09-28' of git://evilpiepirate.org/bcachefs

Pull more bcachefs updates from Kent Overstreet:
 "Assorted minor syzbot fixes, and for bigger stuff:

  Fix two disk accounting rewrite bugs:

   - Disk accounting keys use the version field of bkey so that journal
     replay can tell which updates have been applied to the btree.

     This is set in the transaction commit path, after we've gotten our
     journal reservation (and our time ordering), but the
     BCH_TRANS_COMMIT_skip_accounting_apply flag that journal replay
     uses was incorrectly skipping this for new updates generated prior
     to journal replay.

     This fixes the underlying cause of an assertion pop in
     disk_accounting_read.

   - A couple of fixes for disk accounting + device removal.

     Checking if acocunting replicas entries were marked in the
     superblock was being done at the wrong point, when deltas in the
     journal could still zero them out, and then additionally we'd try
     to add a missing replicas entry to the superblock without checking
     if it referred to an invalid (removed) device.

  A whole slew of repair fixes:

   - fix infinite loop in propagate_key_to_snapshot_leaves(), this fixes
     an infinite loop when repairing a filesystem with many snapshots

   - fix incorrect transaction restart handling leading to occasional
     "fsck counted ..." warnings

   - fix warning in __bch2_fsck_err() for bkey fsck errors

   - check_inode() in fsck now correctly checks if the filesystem was
     clean

   - there shouldn't be pending logged ops if the fs was clean, we now
     check for this

   - remove_backpointer() doesn't remove a dirent that doesn't actually
     point to the inode

   - many more fsck errors are AUTOFIX"

* tag 'bcachefs-2024-09-28' of git://evilpiepirate.org/bcachefs: (35 commits)
  bcachefs: check_subvol_path() now prints subvol root inode
  bcachefs: remove_backpointer() now checks if dirent points to inode
  bcachefs: dirent_points_to_inode() now warns on mismatch
  bcachefs: Fix lost wake up
  bcachefs: Check for logged ops when clean
  bcachefs: BCH_FS_clean_recovery
  bcachefs: Convert disk accounting BUG_ON() to WARN_ON()
  bcachefs: Fix BCH_TRANS_COMMIT_skip_accounting_apply
  bcachefs: Check for accounting keys with bversion=0
  bcachefs: rename version -> bversion
  bcachefs: Don't delete unlinked inodes before logged op resume
  bcachefs: Fix BCH_SB_ERRS() so we can reorder
  bcachefs: Fix fsck warnings from bkey validation
  bcachefs: Move transaction commit path validation to as late as possible
  bcachefs: Fix disk accounting attempting to mark invalid replicas entry
  bcachefs: Fix unlocked access to c->disk_sb.sb in bch2_replicas_entry_validate()
  bcachefs: Fix accounting read + device removal
  bcachefs: bch_accounting_mode
  bcachefs: fix transaction restart handling in check_extents(), check_dirents()
  bcachefs: kill inode_walker_entry.seen_this_pos
  ...

5 months agoMerge tag 'x86-urgent-2024-09-29' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 29 Sep 2024 16:10:00 +0000 (09:10 -0700)]
Merge tag 'x86-urgent-2024-09-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Ingo Molnar:
 "Fix TDX MMIO #VE fault handling, and add two new Intel model numbers
  for 'Pantherlake' and 'Diamond Rapids'"

* tag 'x86-urgent-2024-09-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/cpu: Add two Intel CPU model numbers
  x86/tdx: Fix "in-kernel MMIO" check

5 months agoMerge tag 'locking-urgent-2024-09-29' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 29 Sep 2024 15:51:30 +0000 (08:51 -0700)]
Merge tag 'locking-urgent-2024-09-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking updates from Ingo Molnar:
 "lockdep:
    - Fix potential deadlock between lockdep and RCU (Zhiguo Niu)
    - Use str_plural() to address Coccinelle warning (Thorsten Blum)
    - Add debuggability enhancement (Luis Claudio R. Goncalves)

  static keys & calls:
    - Fix static_key_slow_dec() yet again (Peter Zijlstra)
    - Handle module init failure correctly in static_call_del_module()
      (Thomas Gleixner)
    - Replace pointless WARN_ON() in static_call_module_notify() (Thomas
      Gleixner)

  <linux/cleanup.h>:
    - Add usage and style documentation (Dan Williams)

  rwsems:
    - Move is_rwsem_reader_owned() and rwsem_owner() under
      CONFIG_DEBUG_RWSEMS (Waiman Long)

  atomic ops, x86:
    - Redeclare x86_32 arch_atomic64_{add,sub}() as void (Uros Bizjak)
    - Introduce the read64_nonatomic macro to x86_32 with cx8 (Uros
      Bizjak)"

Signed-off-by: Ingo Molnar <[email protected]>
* tag 'locking-urgent-2024-09-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  locking/rwsem: Move is_rwsem_reader_owned() and rwsem_owner() under CONFIG_DEBUG_RWSEMS
  jump_label: Fix static_key_slow_dec() yet again
  static_call: Replace pointless WARN_ON() in static_call_module_notify()
  static_call: Handle module init failure correctly in static_call_del_module()
  locking/lockdep: Simplify character output in seq_line()
  lockdep: fix deadlock issue between lockdep and rcu
  lockdep: Use str_plural() to fix Coccinelle warning
  cleanup: Add usage and style documentation
  lockdep: suggest the fix for "lockdep bfs error:-1" on print_bfs_bug
  locking/atomic/x86: Redeclare x86_32 arch_atomic64_{add,sub}() as void
  locking/atomic/x86: Introduce the read64_nonatomic macro to x86_32 with cx8

5 months agoMerge tag 'cocci-for-6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall...
Linus Torvalds [Sun, 29 Sep 2024 15:44:28 +0000 (08:44 -0700)]
Merge tag 'cocci-for-6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux

Pull coccinelle updates from Julia Lawall:
 "Extend string_choices.cocci to use more available helpers

  Ten patches from Hongbo Li extending string_choices.cocci with the
  complete set of functions offered by include/linux/string_choices.h.

  One patch from myself reducing the number of redundant cases that are
  checked by Coccinelle, giving a small performance improvement"

* tag 'cocci-for-6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux:
  Reduce Coccinelle choices in string_choices.cocci
  coccinelle: Remove unnecessary parentheses for only one possible change.
  coccinelle: Add rules to find str_yes_no() replacements
  coccinelle: Add rules to find str_on_off() replacements
  coccinelle: Add rules to find str_write_read() replacements
  coccinelle: Add rules to find str_read_write() replacements
  coccinelle: Add rules to find str_enable{d}_disable{d}() replacements
  coccinelle: Add rules to find str_lo{w}_hi{gh}() replacements
  coccinelle: Add rules to find str_hi{gh}_lo{w}() replacements
  coccinelle: Add rules to find str_false_true() replacements
  coccinelle: Add rules to find str_true_false() replacements

5 months agoMerge tag 'linux_kselftest-next-6.12-rc1-fixes' of git://git.kernel.org/pub/scm/linux...
Linus Torvalds [Sun, 29 Sep 2024 15:37:03 +0000 (08:37 -0700)]
Merge tag 'linux_kselftest-next-6.12-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest fix from Shuah Khan:
 "One urgent fix to vDSO as automated testing is failing due to this
  bug"

* tag 'linux_kselftest-next-6.12-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests: vDSO: align stack for O2-optimized memcpy

5 months agoMerge branch 'locking/core' into locking/urgent, to pick up pending commits
Ingo Molnar [Sun, 29 Sep 2024 06:57:18 +0000 (08:57 +0200)]
Merge branch 'locking/core' into locking/urgent, to pick up pending commits

Merge all pending locking commits into a single branch.

Signed-off-by: Ingo Molnar <[email protected]>
5 months agoReduce Coccinelle choices in string_choices.cocci
Julia Lawall [Sat, 28 Sep 2024 19:26:22 +0000 (21:26 +0200)]
Reduce Coccinelle choices in string_choices.cocci

The isomorphism neg_if_exp negates the test of a ?: conditional,
making it unnecessary to have an explicit case for a negated test
with the branches inverted.

At the same time, we can disable neg_if_exp in cases where a
different API function may be more suitable for a negated test.

Finally, in the non-patch cases, E matches an expression with
parentheses around it, so there is no need to mention ()
explicitly in the pattern.  The () are still needed in the patch
cases, because we want to drop them, if they are present.

Signed-off-by: Julia Lawall <[email protected]>
5 months agococcinelle: Remove unnecessary parentheses for only one possible change.
Hongbo Li [Wed, 11 Sep 2024 01:09:27 +0000 (09:09 +0800)]
coccinelle: Remove unnecessary parentheses for only one possible change.

The parentheses are only needed if there is a disjunction, ie a
set of possible changes. If there is only one pattern, we can
remove these parentheses. Just like the format:

  -  x
  +  y

not:

  (
  -  x
  +  y
  )

Signed-off-by: Hongbo Li <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
5 months agococcinelle: Add rules to find str_yes_no() replacements
Hongbo Li [Wed, 11 Sep 2024 01:09:26 +0000 (09:09 +0800)]
coccinelle: Add rules to find str_yes_no() replacements

As other rules done, we add rules for str_yes_no()
to check the relative opportunities.

Signed-off-by: Hongbo Li <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
5 months agococcinelle: Add rules to find str_on_off() replacements
Hongbo Li [Wed, 11 Sep 2024 01:09:25 +0000 (09:09 +0800)]
coccinelle: Add rules to find str_on_off() replacements

As other rules done, we add rules for str_on_off()
to check the relative opportunities.

Signed-off-by: Hongbo Li <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
5 months agococcinelle: Add rules to find str_write_read() replacements
Hongbo Li [Wed, 11 Sep 2024 01:09:24 +0000 (09:09 +0800)]
coccinelle: Add rules to find str_write_read() replacements

As other rules done, we add rules for str_write_read()
to check the relative opportunities.

Signed-off-by: Hongbo Li <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
5 months agococcinelle: Add rules to find str_read_write() replacements
Hongbo Li [Wed, 11 Sep 2024 01:09:23 +0000 (09:09 +0800)]
coccinelle: Add rules to find str_read_write() replacements

As other rules done, we add rules for str_read_write()
to check the relative opportunities.

Signed-off-by: Hongbo Li <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
5 months agococcinelle: Add rules to find str_enable{d}_disable{d}() replacements
Hongbo Li [Wed, 11 Sep 2024 01:09:22 +0000 (09:09 +0800)]
coccinelle: Add rules to find str_enable{d}_disable{d}() replacements

As other rules done, we add rules for str_enable{d}_
disable{d}() to check the relative opportunities.

Signed-off-by: Hongbo Li <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
5 months agococcinelle: Add rules to find str_lo{w}_hi{gh}() replacements
Hongbo Li [Wed, 11 Sep 2024 01:09:21 +0000 (09:09 +0800)]
coccinelle: Add rules to find str_lo{w}_hi{gh}() replacements

As other rules done, we add rules for str_lo{w}_hi{gh}()
to check the relative opportunities.

Signed-off-by: Hongbo Li <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
5 months agococcinelle: Add rules to find str_hi{gh}_lo{w}() replacements
Hongbo Li [Wed, 11 Sep 2024 01:09:20 +0000 (09:09 +0800)]
coccinelle: Add rules to find str_hi{gh}_lo{w}() replacements

As other rules done, we add rules for str_hi{gh}_lo{w}()
to check the relative opportunities.

Signed-off-by: Hongbo Li <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
5 months agococcinelle: Add rules to find str_false_true() replacements
Hongbo Li [Wed, 11 Sep 2024 01:09:19 +0000 (09:09 +0800)]
coccinelle: Add rules to find str_false_true() replacements

As done with str_true_false(), add checks for str_false_true()
opportunities. A simple test can find over 9 cases currently
exist in the tree.

Signed-off-by: Hongbo Li <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
5 months agococcinelle: Add rules to find str_true_false() replacements
Hongbo Li [Wed, 11 Sep 2024 01:09:18 +0000 (09:09 +0800)]
coccinelle: Add rules to find str_true_false() replacements

After str_true_false() has been introduced in the tree,
we can add rules for finding places where str_true_false()
can be used. A simple test can find over 10 locations.

Signed-off-by: Hongbo Li <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
5 months agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Sat, 28 Sep 2024 16:20:14 +0000 (09:20 -0700)]
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull x86 kvm updates from Paolo Bonzini:
 "x86:

   - KVM currently invalidates the entirety of the page tables, not just
     those for the memslot being touched, when a memslot is moved or
     deleted.

     This does not traditionally have particularly noticeable overhead,
     but Intel's TDX will require the guest to re-accept private pages
     if they are dropped from the secure EPT, which is a non starter.

     Actually, the only reason why this is not already being done is a
     bug which was never fully investigated and caused VM instability
     with assigned GeForce GPUs, so allow userspace to opt into the new
     behavior.

   - Advertise AVX10.1 to userspace (effectively prep work for the
     "real" AVX10 functionality that is on the horizon)

   - Rework common MSR handling code to suppress errors on userspace
     accesses to unsupported-but-advertised MSRs

     This will allow removing (almost?) all of KVM's exemptions for
     userspace access to MSRs that shouldn't exist based on the vCPU
     model (the actual cleanup is non-trivial future work)

   - Rework KVM's handling of x2APIC ICR, again, because AMD (x2AVIC)
     splits the 64-bit value into the legacy ICR and ICR2 storage,
     whereas Intel (APICv) stores the entire 64-bit value at the ICR
     offset

   - Fix a bug where KVM would fail to exit to userspace if one was
     triggered by a fastpath exit handler

   - Add fastpath handling of HLT VM-Exit to expedite re-entering the
     guest when there's already a pending wake event at the time of the
     exit

   - Fix a WARN caused by RSM entering a nested guest from SMM with
     invalid guest state, by forcing the vCPU out of guest mode prior to
     signalling SHUTDOWN (the SHUTDOWN hits the VM altogether, not the
     nested guest)

   - Overhaul the "unprotect and retry" logic to more precisely identify
     cases where retrying is actually helpful, and to harden all retry
     paths against putting the guest into an infinite retry loop

   - Add support for yielding, e.g. to honor NEED_RESCHED, when zapping
     rmaps in the shadow MMU

   - Refactor pieces of the shadow MMU related to aging SPTEs in
     prepartion for adding multi generation LRU support in KVM

   - Don't stuff the RSB after VM-Exit when RETPOLINE=y and AutoIBRS is
     enabled, i.e. when the CPU has already flushed the RSB

   - Trace the per-CPU host save area as a VMCB pointer to improve
     readability and cleanup the retrieval of the SEV-ES host save area

   - Remove unnecessary accounting of temporary nested VMCB related
     allocations

   - Set FINAL/PAGE in the page fault error code for EPT violations if
     and only if the GVA is valid. If the GVA is NOT valid, there is no
     guest-side page table walk and so stuffing paging related metadata
     is nonsensical

   - Fix a bug where KVM would incorrectly synthesize a nested VM-Exit
     instead of emulating posted interrupt delivery to L2

   - Add a lockdep assertion to detect unsafe accesses of vmcs12
     structures

   - Harden eVMCS loading against an impossible NULL pointer deref
     (really truly should be impossible)

   - Minor SGX fix and a cleanup

   - Misc cleanups

  Generic:

   - Register KVM's cpuhp and syscore callbacks when enabling
     virtualization in hardware, as the sole purpose of said callbacks
     is to disable and re-enable virtualization as needed

   - Enable virtualization when KVM is loaded, not right before the
     first VM is created

     Together with the previous change, this simplifies a lot the logic
     of the callbacks, because their very existence implies
     virtualization is enabled

   - Fix a bug that results in KVM prematurely exiting to userspace for
     coalesced MMIO/PIO in many cases, clean up the related code, and
     add a testcase

   - Fix a bug in kvm_clear_guest() where it would trigger a buffer
     overflow _if_ the gpa+len crosses a page boundary, which thankfully
     is guaranteed to not happen in the current code base. Add WARNs in
     more helpers that read/write guest memory to detect similar bugs

  Selftests:

   - Fix a goof that caused some Hyper-V tests to be skipped when run on
     bare metal, i.e. NOT in a VM

   - Add a regression test for KVM's handling of SHUTDOWN for an SEV-ES
     guest

   - Explicitly include one-off assets in .gitignore. Past Sean was
     completely wrong about not being able to detect missing .gitignore
     entries

   - Verify userspace single-stepping works when KVM happens to handle a
     VM-Exit in its fastpath

   - Misc cleanups"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (127 commits)
  Documentation: KVM: fix warning in "make htmldocs"
  s390: Enable KVM_S390_UCONTROL config in debug_defconfig
  selftests: kvm: s390: Add VM run test case
  KVM: SVM: let alternatives handle the cases when RSB filling is required
  KVM: VMX: Set PFERR_GUEST_{FINAL,PAGE}_MASK if and only if the GVA is valid
  KVM: x86/mmu: Use KVM_PAGES_PER_HPAGE() instead of an open coded equivalent
  KVM: x86/mmu: Add KVM_RMAP_MANY to replace open coded '1' and '1ul' literals
  KVM: x86/mmu: Fold mmu_spte_age() into kvm_rmap_age_gfn_range()
  KVM: x86/mmu: Morph kvm_handle_gfn_range() into an aging specific helper
  KVM: x86/mmu: Honor NEED_RESCHED when zapping rmaps and blocking is allowed
  KVM: x86/mmu: Add a helper to walk and zap rmaps for a memslot
  KVM: x86/mmu: Plumb a @can_yield parameter into __walk_slot_rmaps()
  KVM: x86/mmu: Move walk_slot_rmaps() up near for_each_slot_rmap_range()
  KVM: x86/mmu: WARN on MMIO cache hit when emulating write-protected gfn
  KVM: x86/mmu: Detect if unprotect will do anything based on invalid_list
  KVM: x86/mmu: Subsume kvm_mmu_unprotect_page() into the and_retry() version
  KVM: x86: Rename reexecute_instruction()=>kvm_unprotect_and_retry_on_failure()
  KVM: x86: Update retry protection fields when forcing retry on emulation failure
  KVM: x86: Apply retry protection to "unprotect on failure" path
  KVM: x86: Check EMULTYPE_WRITE_PF_TO_SP before unprotecting gfn
  ...

5 months agoMerge tag 's390-6.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Linus Torvalds [Sat, 28 Sep 2024 16:11:46 +0000 (09:11 -0700)]
Merge tag 's390-6.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull more s390 updates from Vasily Gorbik:

 - Clean up and improve vdso code: use SYM_* macros for function and
   data annotations, add CFI annotations to fix GDB unwinding, optimize
   the chacha20 implementation

 - Add vfio-ap driver feature advertisement for use by libvirt and
   mdevctl

* tag 's390-6.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/vfio-ap: Driver feature advertisement
  s390/vdso: Use one large alternative instead of an alternative branch
  s390/vdso: Use SYM_DATA_START_LOCAL()/SYM_DATA_END() for data objects
  tools: Add additional SYM_*() stubs to linkage.h
  s390/vdso: Use macros for annotation of asm functions
  s390/vdso: Add CFI annotations to __arch_chacha20_blocks_nostack()
  s390/vdso: Fix comment within __arch_chacha20_blocks_nostack()
  s390/vdso: Get rid of permutation constants

5 months agoMerge tag 'modules-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof...
Linus Torvalds [Sat, 28 Sep 2024 16:06:15 +0000 (09:06 -0700)]
Merge tag 'modules-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux

Pull module updates from Luis Chamberlain:
 "There are a few fixes / cleanups from Vincent, Chunhui, and Petr, but
  the most important part of this pull request is the Rust community
  stepping up to help maintain both C / Rust code for future Rust module
  support. We grow the set of modules maintainers by three now, and with
  this hope to scale to help address what's needed to properly support
  future Rust module support.

  A lot of exciting stuff coming in future kernel releases.

  This has been on linux-next for ~ 3 weeks now with no issues"

* tag 'modules-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux:
  module: Refine kmemleak scanned areas
  module: abort module loading when sysfs setup suffer errors
  MAINTAINERS: scale modules with more reviewers
  module: Clean up the description of MODULE_SIG_<type>
  module: Split modules_install compression and in-kernel decompression

5 months agoMerge tag 'fbdev-for-6.12-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sat, 28 Sep 2024 16:00:38 +0000 (09:00 -0700)]
Merge tag 'fbdev-for-6.12-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev

Pull fbdev fixes from Helge Deller:

 - crash fix in fbcon_putcs

 - avoid a possible string memory overflow in sisfb

 - minor code optimizations in omapfb and fbcon

* tag 'fbdev-for-6.12-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
  fbdev: sisfb: Fix strbuf array overflow
  fbcon: break earlier in search_fb_in_map and search_for_mapped_con
  fbdev: omapfb: Call of_node_put(ep) only once in omapdss_of_find_source_for_first_ep()
  fbcon: Fix a NULL pointer dereference issue in fbcon_putcs

5 months agoMerge tag 'drm-next-2024-09-28' of https://gitlab.freedesktop.org/drm/kernel
Linus Torvalds [Sat, 28 Sep 2024 15:47:46 +0000 (08:47 -0700)]
Merge tag 'drm-next-2024-09-28' of https://gitlab.freedesktop.org/drm/kernel

Pull drm fixes from Dave Airlie:
 "Regular fixes for the week to end the merge window, i915 and xe have a
  few each, amdgpu makes up most of it with a bunch of SR-IOV related
  fixes amongst others.

  i915:
   - Fix BMG support to UHBR13.5
   - Two PSR fixes
   - Fix colorimetry detection for DP

  xe:
   - Fix macro for checking minimum GuC version
   - Fix CCS offset calculation for some BMG SKUs
   - Fix locking on memory usage reporting via fdinfo and BO destroy
   - Fix GPU page fault handler on a closed VM
   - Fix overflow in oa batch buffer

  amdgpu:
   - MES 12 fix
   - KFD fence sync fix
   - SR-IOV fixes
   - VCN 4.0.6 fix
   - SDMA 7.x fix
   - Bump driver version to note cleared VRAM support
   - SWSMU fix
   - CU occupancy logic fix
   - SDMA queue fix"

* tag 'drm-next-2024-09-28' of https://gitlab.freedesktop.org/drm/kernel: (79 commits)
  drm/amd/pm: update workload mask after the setting
  drm/amdgpu: bump driver version for cleared VRAM
  drm/amdgpu: fix vbios fetching for SR-IOV
  drm/amdgpu: fix PTE copy corruption for sdma 7
  drm/amdkfd: Add SDMA queue quantum support for GFX12
  drm/amdgpu/vcn: enable AV1 on both instances
  drm/amdkfd: Fix CU occupancy for GFX 9.4.3
  drm/amdkfd: Update logic for CU occupancy calculations
  drm/amdgpu: skip coredump after job timeout in SRIOV
  drm/amdgpu: sync to KFD fences before clearing PTEs
  drm/amdgpu/mes12: set enable_level_process_quantum_check
  drm/i915/dp: Fix colorimetry detection
  drm/amdgpu/mes12: reduce timeout
  drm/amdgpu/mes11: reduce timeout
  drm/amdgpu: use GEM references instead of TTMs v2
  drm/amd/display: Allow backlight to go below `AMDGPU_DM_DEFAULT_MIN_BACKLIGHT`
  drm/amd/display: Fix kdoc entry for 'tps' in 'dc_process_dmub_dpia_set_tps_notification'
  drm/amdgpu: update golden regs for gfx12
  drm/amdgpu: clean up vbios fetching code
  drm/amd/display: handle nulled pipe context in DCE110's set_drr()
  ...

5 months agoMerge tag 'ceph-for-6.12-rc1' of https://github.com/ceph/ceph-client
Linus Torvalds [Sat, 28 Sep 2024 15:40:36 +0000 (08:40 -0700)]
Merge tag 'ceph-for-6.12-rc1' of https://github.com/ceph/ceph-client

Pull ceph updates from Ilya Dryomov:
 "Three CephFS fixes from Xiubo and Luis and a bunch of assorted
  cleanups"

* tag 'ceph-for-6.12-rc1' of https://github.com/ceph/ceph-client:
  ceph: remove the incorrect Fw reference check when dirtying pages
  ceph: Remove empty definition in header file
  ceph: Fix typo in the comment
  ceph: fix a memory leak on cap_auths in MDS client
  ceph: flush all caps releases when syncing the whole filesystem
  ceph: rename ceph_flush_cap_releases() to ceph_flush_session_cap_releases()
  libceph: use min() to simplify code in ceph_dns_resolve_name()
  ceph: Convert to use jiffies macro
  ceph: Remove unused declarations

5 months agoMerge tag 'v6.12-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd
Linus Torvalds [Sat, 28 Sep 2024 15:35:21 +0000 (08:35 -0700)]
Merge tag 'v6.12-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd

Pull smb server fixes from Steve French:

 - fix querying dentry for char/block special files

 - small cleanup patches

* tag 'v6.12-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd:
  ksmbd: Correct typos in multiple comments across various files
  ksmbd: fix open failure from block and char device file
  ksmbd: remove unsafe_memcpy use in session setup
  ksmbd: Replace one-element arrays with flexible-array members
  ksmbd: fix warning: comparison of distinct pointer types lacks a cast

5 months agoMerge tag '6.12rc-more-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6
Linus Torvalds [Sat, 28 Sep 2024 15:30:27 +0000 (08:30 -0700)]
Merge tag '6.12rc-more-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull xmb client fixes from Steve French:

 - Noisy log message cleanup

 - Important netfs fix for cifs crash in generic/074

 - Three minor improvements to use of hashing (multichannel and mount
   improvements)

 - Fix decryption crash for large read with small esize

* tag '6.12rc-more-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  smb: client: make SHA-512 TFM ephemeral
  smb: client: make HMAC-MD5 TFM ephemeral
  smb: client: stop flooding dmesg in smb2_calc_signature()
  smb: client: allocate crypto only for primary server
  smb: client: fix UAF in async decryption
  netfs: Fix write oops in generic/346 (9p) and generic/074 (cifs)

5 months agobcachefs: check_subvol_path() now prints subvol root inode
Kent Overstreet [Tue, 24 Sep 2024 02:32:47 +0000 (22:32 -0400)]
bcachefs: check_subvol_path() now prints subvol root inode

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: remove_backpointer() now checks if dirent points to inode
Kent Overstreet [Tue, 24 Sep 2024 02:27:13 +0000 (22:27 -0400)]
bcachefs: remove_backpointer() now checks if dirent points to inode

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: dirent_points_to_inode() now warns on mismatch
Kent Overstreet [Tue, 24 Sep 2024 02:22:00 +0000 (22:22 -0400)]
bcachefs: dirent_points_to_inode() now warns on mismatch

if an inode backpointer points to a dirent that doesn't point back,
that's an error we should warn about.

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: Fix lost wake up
Alan Huang [Tue, 27 Aug 2024 15:14:48 +0000 (23:14 +0800)]
bcachefs: Fix lost wake up

If the reader acquires the read lock and then the writer enters the slow
path, while the reader proceeds to the unlock path, the following scenario
can occur without the change:

writer: pcpu_read_count(lock) return 1 (so __do_six_trylock will return 0)
reader: this_cpu_dec(*lock->readers)
reader: smp_mb()
reader: state = atomic_read(&lock->state) (there is no waiting flag set)
writer: six_set_bitmask()

then the writer will sleep forever.

Signed-off-by: Alan Huang <[email protected]>
Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: Check for logged ops when clean
Kent Overstreet [Thu, 26 Sep 2024 20:23:30 +0000 (16:23 -0400)]
bcachefs: Check for logged ops when clean

If we shut down successfully, there shouldn't be any logged ops to
resume.

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: BCH_FS_clean_recovery
Kent Overstreet [Thu, 26 Sep 2024 20:19:58 +0000 (16:19 -0400)]
bcachefs: BCH_FS_clean_recovery

Add a filesystem flag to indicate whether we did a clean recovery -
using c->sb.clean after we've got rw is incorrect, since c->sb is
updated whenever we write the superblock.

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: Convert disk accounting BUG_ON() to WARN_ON()
Kent Overstreet [Sat, 28 Sep 2024 01:05:59 +0000 (21:05 -0400)]
bcachefs: Convert disk accounting BUG_ON() to WARN_ON()

We had a bug where disk accounting keys didn't always have their version
field set in journal replay; change the BUG_ON() to a WARN(), and
exclude this case since it's now checked for elsewhere (in the bkey
validate function).

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: Fix BCH_TRANS_COMMIT_skip_accounting_apply
Kent Overstreet [Thu, 26 Sep 2024 19:59:29 +0000 (15:59 -0400)]
bcachefs: Fix BCH_TRANS_COMMIT_skip_accounting_apply

This was added to avoid double-counting accounting keys in journal
replay. But applied incorrectly (easily done since it applies to the
transaction commit, not a particular update), it leads to skipping
in-mem accounting for real accounting updates, and failure to give them
a version number - which leads to journal replay becoming very confused
the next time around.

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: Check for accounting keys with bversion=0
Kent Overstreet [Thu, 26 Sep 2024 19:58:02 +0000 (15:58 -0400)]
bcachefs: Check for accounting keys with bversion=0

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: rename version -> bversion
Kent Overstreet [Thu, 26 Sep 2024 19:49:17 +0000 (15:49 -0400)]
bcachefs: rename version -> bversion

give bversions a more distinct name, to aid in grepping

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: Don't delete unlinked inodes before logged op resume
Kent Overstreet [Thu, 26 Sep 2024 19:19:17 +0000 (15:19 -0400)]
bcachefs: Don't delete unlinked inodes before logged op resume

Previously, check_inode() would delete unlinked inodes if they weren't
on the deleted list - this code dating from before there was a deleted
list.

But, if we crash during a logged op (truncate or finsert/fcollapse) of
an unlinked file, logged op resume will get confused if the inode has
already been deleted - instead, just add it to the deleted list if it
needs to be there; delete_dead_inodes runs after logged op resume.

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: Fix BCH_SB_ERRS() so we can reorder
Kent Overstreet [Thu, 26 Sep 2024 19:30:17 +0000 (15:30 -0400)]
bcachefs: Fix BCH_SB_ERRS() so we can reorder

BCH_SB_ERRS() has a field for the actual enum val so that we can reorder
to reorganize, but the way BCH_SB_ERR_MAX was defined didn't allow for
this.

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: Fix fsck warnings from bkey validation
Kent Overstreet [Thu, 26 Sep 2024 20:51:19 +0000 (16:51 -0400)]
bcachefs: Fix fsck warnings from bkey validation

__bch2_fsck_err() warns if the current task has a btree_trans object and
it wasn't passed in, because if it has to prompt for user input it has
to be able to unlock it.

But plumbing the btree_trans through bkey_validate(), as well as
transaction restarts, is problematic - so instead make bkey fsck errors
FSCK_AUTOFIX, which doesn't need to warn.

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: Move transaction commit path validation to as late as possible
Kent Overstreet [Thu, 26 Sep 2024 20:50:29 +0000 (16:50 -0400)]
bcachefs: Move transaction commit path validation to as late as possible

In order to check for accounting keys with version=0, we need to run
validation after they've been assigned version numbers.

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: Fix disk accounting attempting to mark invalid replicas entry
Kent Overstreet [Wed, 25 Sep 2024 22:17:52 +0000 (18:17 -0400)]
bcachefs: Fix disk accounting attempting to mark invalid replicas entry

This fixes the following bug, where a disk accounting key has an invalid
replicas entry, and we attempt to add it to the superblock:

bcachefs (3c0860e8-07ca-4276-8954-11c1774be868): starting version 1.12: rebalance_work_acct_fix opts=metadata_replicas=2,data_replicas=2,foreground_target=ssd,background_target=hdd,nopromote_whole_extents,verbose,fsck,fix_errors=yes
bcachefs (3c0860e8-07ca-4276-8954-11c1774be868): recovering from clean shutdown, journal seq 15211644
bcachefs (3c0860e8-07ca-4276-8954-11c1774be868): accounting_read...
accounting not marked in superblock replicas
  replicas cached: 1/1 [0], fixing
bcachefs (3c0860e8-07ca-4276-8954-11c1774be868): sb invalid before write: Invalid superblock section replicas_v0: invalid device 0 in entry cached: 1/1 [0]
replicas_v0 (size 88):
user: 2 [3 5] user: 2 [1 4] cached: 1 [2] btree: 2 [1 2] user: 2 [2 5] cached: 1 [0] cached: 1 [4] journal: 2 [1 5] user: 2 [1 2] user: 2 [2 3] user: 2 [3 4] user: 2 [4 5] cached: 1 [1] cached: 1 [3] cached: 1 [5] journal: 2 [1 2] journal: 2 [2 5] btree: 2 [2 5] user: 2 [1 3] user: 2 [1 5] user: 2 [2 4]

bcachefs (3c0860e8-07ca-4276-8954-11c1774be868): inconsistency detected - emergency read only at journal seq 15211644
accounting not marked in superblock replicas
  replicas user: 1/1 [3], fixing
bcachefs (3c0860e8-07ca-4276-8954-11c1774be868): sb invalid before write: Invalid superblock section replicas_v0: invalid device 0 in entry cached: 1/1 [0]
replicas_v0 (size 96):
user: 2 [3 5] user: 2 [1 3] cached: 1 [2] btree: 2 [1 2] user: 2 [2 4] cached: 1 [0] cached: 1 [4] journal: 2 [1 5] user: 1 [3] user: 2 [1 5] user: 2 [3 4] user: 2 [4 5] cached: 1 [1] cached: 1 [3] cached: 1 [5] journal: 2 [1 2] journal: 2 [2 5] btree: 2 [2 5] user: 2 [1 2] user: 2 [1 4] user: 2 [2 3] user: 2 [2 5]

accounting not marked in superblock replicas
  replicas user: 1/2 [3 7], fixing
bcachefs (3c0860e8-07ca-4276-8954-11c1774be868): sb invalid before write: Invalid superblock section replicas_v0: invalid device 7 in entry user: 1/2 [3 7]
replicas_v0 (size 96):
user: 2 [3 7] user: 2 [1 3] cached: 1 [2] btree: 2 [1 2] user: 2 [2 4] cached: 1 [0] cached: 1 [4] journal: 2 [1 5] user: 1 [3] user: 2 [1 5] user: 2 [3 4] user: 2 [4 5] cached: 1 [1] cached: 1 [3] cached: 1 [5] journal: 2 [1 2] journal: 2 [2 5] btree: 2 [2 5] user: 2 [1 2] user: 2 [1 4] user: 2 [2 3] user: 2 [2 5] user: 2 [3 5]

 done
bcachefs (3c0860e8-07ca-4276-8954-11c1774be868): alloc_read... done
bcachefs (3c0860e8-07ca-4276-8954-11c1774be868): stripes_read... done
bcachefs (3c0860e8-07ca-4276-8954-11c1774be868): snapshots_read... done

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: Fix unlocked access to c->disk_sb.sb in bch2_replicas_entry_validate()
Kent Overstreet [Wed, 25 Sep 2024 22:17:31 +0000 (18:17 -0400)]
bcachefs: Fix unlocked access to c->disk_sb.sb in bch2_replicas_entry_validate()

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: Fix accounting read + device removal
Kent Overstreet [Wed, 25 Sep 2024 20:46:06 +0000 (16:46 -0400)]
bcachefs: Fix accounting read + device removal

accounting read was checking if accounting replicas entries were marked
in the superblock prior to applying accounting from the journal,
which meant that a recently removed device could spuriously trigger a
"not marked in superblocked" error (when journal entries zero out the
offending counter).

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: bch_accounting_mode
Kent Overstreet [Wed, 25 Sep 2024 02:53:56 +0000 (22:53 -0400)]
bcachefs: bch_accounting_mode

Minor refactoring - replace multiple bool arguments with an enum; prep
work for fixing a bug in accounting read.

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: fix transaction restart handling in check_extents(), check_dirents()
Kent Overstreet [Tue, 24 Sep 2024 02:32:58 +0000 (22:32 -0400)]
bcachefs: fix transaction restart handling in check_extents(), check_dirents()

Dealing with outside state within a btree transaction is always tricky.

check_extents() and check_dirents() have to accumulate counters for
i_sectors and i_nlink (for subdirectories). There were two bugs:

- transaction commit may return a restart; therefore we have to commit
  before accumulating to those counters
- get_inode_all_snapshots() may return a transaction restart, before
  updating w->last_pos; then, on the restart,
  check_i_sectors()/check_subdir_count() would see inodes that were not
  for w->last_pos

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: kill inode_walker_entry.seen_this_pos
Kent Overstreet [Tue, 24 Sep 2024 02:29:05 +0000 (22:29 -0400)]
bcachefs: kill inode_walker_entry.seen_this_pos

dead code

Signed-off-by: Kent Overstreet <[email protected]>
5 months agobcachefs: Fix incorrect IS_ERR_OR_NULL usage
Kent Overstreet [Tue, 24 Sep 2024 23:31:22 +0000 (19:31 -0400)]
bcachefs: Fix incorrect IS_ERR_OR_NULL usage

Returning a positive integer instead of an error code causes error paths
to become very confused.

Closes: [email protected]
Signed-off-by: Kent Overstreet <[email protected]>
This page took 0.122145 seconds and 4 git commands to generate.