Commit graph

1,399,042 commits

Author SHA1 Message Date
Imre Deak
7acc7a6fc7 drm/i915/dp: Limit max link bpp properly to a fractional value on SST
The maximum link bpp - determined by the link BW for instance - can be
fractional, handle this properly during computing the link bpp on SST.

This keeps the pipe joiner specific maximum link bpp as a rounded-down
integer value still, changing that to a fractional value is left for
later.

v2: Align the min/max bpp value to the bpp step.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250509180340.554867-8-imre.deak@intel.com
2025-05-12 15:22:49 +03:00
Imre Deak
1f581f38bc drm/i915/dp_mst: Simplify computing the min/max compressed bpp limits
Adjusting the compressed bpp range min/max limits in
intel_dp_dsc_nearest_valid_bpp() is unnecessary:

- The source/sink min/max values are enforced already by the
  link_config_limits::min_bpp_x16/max_bpp_x16 values computed early in
  intel_dp_compute_config_link_bpp_limits().
- The fixed set of valid bpps are enforced already - for all bpps in the
  min .. max range by intel_dp_dsc_valid_compressed_bpp() called from
  intel_dp_mtp_tu_compute_config().

The only thing needed is limiting max compressed bpp below the
uncompressed pipe bpp, do that one thing only instead of calling
intel_dp_dsc_nearest_valid_bpp().

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250509180340.554867-7-imre.deak@intel.com
2025-05-12 15:22:48 +03:00
Imre Deak
c2a38dc300 drm/i915/dp_mst: Check BW limit on the local MST link early
Check the BW requirement of a selected compressed bpp against the total
MST link BW early. This didn't cause a problem, since all the BW limits
within the MST topology are checked during the later MST topology BW
check. However it doesn't make sense to defer the total link BW check,
since for resolving a BW limit issue due to this later also (a) requires
selecting a pipe to reduce its bpp, ending up reducing the bpp for
another pipe, which is not ideal (b) requires recomputing the state for
all CRTC/stream's in the topology which may slow down the commit
considerably (especially when using fractional bpps).

Based on the above, check a stream bpp's BW requirement against the MST
link's total BW early.

Ideally drm_dp_atomic_find_time_slots() should check internally the
corresponding PBN/TU slot BW against the total link BW, returning an
error if the check fails, however that change would also affect other
drivers, so leaving this for a follow-up.

v2: Rephrase description of pipe selection/bpp reduction in commit
    message. (Ankit)

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250509180340.554867-6-imre.deak@intel.com
2025-05-12 15:22:48 +03:00
Imre Deak
dd697c720f drm/i915/dp_mst: Update the total link slot count early
A follow up change will check a selected bpp's BW requirement in
intel_dp_mtp_tu_compute_config(), however that requires the total link
slot count to be up-to-date. The latter in turn depends on the channel
encoding and hence the link rate used, so it can be set after the
link rate used is selected.

This also allows simplifying mst_stream_update_slots(), do that as well,
moving the function definition before its use.

Cc: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250509180340.554867-5-imre.deak@intel.com
2025-05-12 15:22:48 +03:00
Imre Deak
97ae79d3ad drm/i915/dp_mst: Validate compressed bpp vs. platform restrictions
Atm TGL supports only a fixed set of valid DSC compressed bpps
(6,8,10,12,15), but this is not taken into account while looking for a
bpp in the minimum..maximum compressed bpp range.

This happened to work only by chance since atm from the above min..max
range it's always the maximum bpp that is selected, which is one of the
above valid bpps (see mst_stream_dsc_compute_link_config() ->
intel_dp_dsc_nearest_valid_bpp()). Before selecting a bpp however, the
bpp's BW requirement should be checked wrt. to the MST total link BW;
after doing that - in a follow-up change - the validity of any bpp in
the min..max range must be ensured before the bpp is selected, do that
here.

Cc: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250509180340.554867-4-imre.deak@intel.com
2025-05-12 15:22:47 +03:00
Imre Deak
49a50054b7 drm/i915/dp_mst: Simplify handling the single-bpp case during state computation
A follow-up change wants to skip invalid bpps in the bpp select loop of
a stream state computation. To allow for that, using the usual
'continue' statement in the loop, change the way the single-bpp range is
handled.

v2: Fix typo in commit message. (Ankit)

Cc: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250509180340.554867-3-imre.deak@intel.com
2025-05-12 15:22:46 +03:00
Imre Deak
266e2fcfe2 drm/i915/dp_mst: Use the correct connector while computing the link BPP limit on MST
Atm, on an MST link in DSC mode
intel_dp_compute_config_link_bpp_limits() calculates the maximum link
bpp limit using the MST root connector's DSC capabilities. That's not
correct in general: the decompression could be performed by a branch
device downstream of the root branch device or the sink itself.

Fix the above by passing to intel_dp_compute_config_link_bpp_limits()
the actual connector being modeset, containing the correct DSC
capabilities.

Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Fixes: 1c5b72daff ("drm/i915/dp: Set the DSC link limits in intel_dp_compute_config_link_bpp_limits")
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250509180340.554867-2-imre.deak@intel.com
2025-05-12 15:22:46 +03:00
Arnd Bergmann
6c265faf1a i.MX arm64 device tree change for 6.16:
- New board support: TQMa8XxS, TQMa95xxSA, TQMa93xx, MBa91xxCA,
   i.MX943 EVK, Nitrogen8M Plus ENC Carrier, Toradex SMARC i.MX8MP,
   Libra-i.MX 8M Plus FPSC board
 - A couple of imx8mp-tqma8mpql-mba8mp-ras314 board updates that support
   Raspberry Pi Camera V2 and LVDS using device tree overlay
 - A series from Adam Ford that updates i.MX8M Beacon boards for RTC
   capacitive load, HDMI audio, Ethernet PHY, etc.
 - A set of changes from Daniel Baluta that enables i.MX8MP DSP node
   for rproc usage
 - A few changes from Francesco Dolcini that add EEPROM compatible
   fallback for imx8mp-verdin board, add fan PWM configuation for
   imx8mp-toradex-smarc board
 - A series from Frank Li to enable PCIe EP support all i.MX8 devices
   using device tree overlay
 - A change from Laurentiu Mihalcea to enable Sound Open Firmware (SOF)
   support on imx95-19x19-evk board
 - A few changes from Markus Niebel to disable MDIO Open Drain for
   imx93-tqma9352 devices
 - A couple of changes from Max Krummenacher to enable PCIe and SATA
   support for i.MX8 Apalis and Colibri boards
 - A series from Primoz Fiser to enable various devices/functions for
   i.MX93 phycore boards
 - A patch set from Xu Yang to add USB2.0 support for i.MX95 EVK boards
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmghzEsUHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM7o7gf+K6yNLsEH7fJ/L1faCYfElURJXg+f
 X3nfCJwlC7rHAa7yFTb8U2Fu/1Tl4Xm8EtBr8RYIiPq3i+K80jRk/Ns9g/YJPIAT
 XrPFVXI9OFWKrYazZVcMvxIDSDS6oB+HjugKb4iJGqktDDvvC+hVc1dzjvyTua39
 N0sU3vOUDMPVfmzUFuedfH181M8MLe2gK3dM8t+5c8asVSogP6XElZG+nLF/2djm
 /ZuBTUePrMLLnVWTSNzbmYZcFxMoK34Bl87yoin47S1zALL9gfxS/VMXFXiJsQ8Q
 c0be/siJQlwSCzmkvrDzuU7Nw5mEboNHM1e7bDEMfdtrZfkA3b7z0bTIVQ==
 =8sq6
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmgh56YACgkQYKtH/8kJ
 Uic7eg//VbLKZM1GQH52y0LRQCpklQRG4l3PjiOJyMAsFEf0GTTEPgNiRNiSv5WS
 kXlsojsS0QulOZdRb2v84fOFmffaG7pq0o4dgN4+iWSbGUvWLb+PM46CMi39DeOD
 lqgRlAVdKkOLxvDnIAEq7ce6/C4EIoIYul4D9CXLF7Jnf/NnGpB5lv8M+Sh1nv5D
 xurEzUlbNuSBbxkw0mgoeiqXaGO3sFeILEV6F67np1Z6QvgeJ6nNDrX5Dd7FlwwV
 eqMWpXMwGHLFok0RYWlBCpFO//hrjQi4T9y+weKEnzI1TRIiDWxH1kUWdNMpGQ5l
 EcbpT42zaQamnqgbC25K+dqpSyZLLWSXZb/DkbaFvDY++riXRIEU9qOrWxBkQ73V
 AWjldmzI8h1mKJKPkvHeo8gY4lmm9aaQSlzELyC8zYo8HJkcsyTQCG31uc/50S0z
 765SoGd4eFTyC1aqwd01sJTqIJpi4nTAObWdCf7ptjaBFrQjliUgjTwbRY0Y8IFr
 erk86QJJw9ti2RdVz4ygKjiwpin7ROBvgzNkjh8Ud/DKYhKX6BAMXKcz38MOYoV/
 jg5V2EJt2U02XzdP2C8pSe1TNlaibMDgvR+KSs/8hlIvokhX/HNm01ET2y/EONbi
 7M0s7sYN4Ii8X39bG5BOh/wRCZo9sLfsdHA2buOWwlQ5NgvyHWM=
 =A7Fy
 -----END PGP SIGNATURE-----

Merge tag 'imx-dt64-6.16' of https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/dt

i.MX arm64 device tree change for 6.16:

- New board support: TQMa8XxS, TQMa95xxSA, TQMa93xx, MBa91xxCA,
  i.MX943 EVK, Nitrogen8M Plus ENC Carrier, Toradex SMARC i.MX8MP,
  Libra-i.MX 8M Plus FPSC board
- A couple of imx8mp-tqma8mpql-mba8mp-ras314 board updates that support
  Raspberry Pi Camera V2 and LVDS using device tree overlay
- A series from Adam Ford that updates i.MX8M Beacon boards for RTC
  capacitive load, HDMI audio, Ethernet PHY, etc.
- A set of changes from Daniel Baluta that enables i.MX8MP DSP node
  for rproc usage
- A few changes from Francesco Dolcini that add EEPROM compatible
  fallback for imx8mp-verdin board, add fan PWM configuation for
  imx8mp-toradex-smarc board
- A series from Frank Li to enable PCIe EP support all i.MX8 devices
  using device tree overlay
- A change from Laurentiu Mihalcea to enable Sound Open Firmware (SOF)
  support on imx95-19x19-evk board
- A few changes from Markus Niebel to disable MDIO Open Drain for
  imx93-tqma9352 devices
- A couple of changes from Max Krummenacher to enable PCIe and SATA
  support for i.MX8 Apalis and Colibri boards
- A series from Primoz Fiser to enable various devices/functions for
  i.MX93 phycore boards
- A patch set from Xu Yang to add USB2.0 support for i.MX95 EVK boards

* tag 'imx-dt64-6.16' of https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (71 commits)
  arm64: dts: freescale: Add PHYTEC phyBOARD-Nash-i.MX93 support
  arm64: dts: freescale: imx8mp-toradex-smarc: use generic gpio node name
  arm64: dts: freescale: imx8mp-toradex-smarc: add gpio expander
  arm64: dts: freescale: imx8mp-toradex-smarc: add embedded controller
  arm64: dts: freescale: imx8mp-toradex-smarc: add fan PWM configuration
  arm64: dts: imx93-tqma9352-mba91xxca: disable Open Drain for MDIO
  arm64: dt: imx95: Add TQMa95xxSA
  arm64: dts: imx: Align wifi node name with bindings
  arm64: dts: freescale: add initial device tree for TQMa8XxS
  arm64: dts: imx8mp-tqma8mpql-mba8mp-ras314: Add Raspberry Pi Camera V2 overlay
  arm64: dts: imx8mp-tqma8mpql-mba8mp-ras314: Add LVDS device tree overlay
  arm64: dts: freescale: Add minimal dts support for imx943 evk
  arm64: dts: freescale: Add basic dtsi for imx943
  arm64: dts: imx8-colibri: Add PCIe support
  arm64: dts: freescale: imx93-phyboard-segin: Order node alphabetically
  arm64: dts: freescale: imx93-phyboard-segin: Add EQOS Ethernet
  arm64: dts: freescale: imx93-phyboard-segin: Add I2S audio
  arm64: dts: freescale: imx93-phyboard-segin: Add USB support
  arm64: dts: freescale: imx93-phyboard-segin: Add CAN support
  arm64: dts: freescale: imx93-phyboard-segin: Add RTC support
  ...

Link: https://lore.kernel.org/r/20250512103858.50501-4-shawnguo@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2025-05-12 14:20:54 +02:00
Arnd Bergmann
71cefdd273 i.MX ARM device tree change for 6.16:
- A series from Alexander Stein that updates ls1021a-tqmals1021a device
   tree mostly for display support inlcuding HDMI, LVDS and CDTech panel
 - A change from Dario Binacchi to use pad config defines for i.MX23/28
   device trees
 - A i.MX7D change from Efe Can İçöz to include min and max voltage in
   opp-microvolt
 - A few patches from Fabio Estevam to fix dt-schema warnings
 - A couple of changes from Krzysztof Kozlowski to align NAND and WIFI
   node name with binings
 - A clean-up change from Rob Herring to drop redundant CPU
   "clock-latency"
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmghwGUUHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM6e6AgAudNxNY08NmcooFSWVc/b50X86M1n
 zJUBlrgMQW6/C+JcjfqFSiPUa2tVjRXKQ0w3vyBfK5tXdPmWjxBK+It91fPCPHt6
 U95diIs5RyrKuueTG4VBk1IEDQ7CO9CQueYezeAz7/ysv5kpDHLlLgFq0XZ1VrNK
 RFfQjuU9ZWG5seV2Ji5D8FXT3JksTgXHSVZtV/qcjN2hDzs0wu0GwP4ShbuadZoW
 TECM8GJbdHCv0A79litox8mkCK8+qmqXyU6SR4SXGVrIiuSWQkziB4VzoC6UbKfa
 fWXpGmuCYZW5ohFxc4cKI/Bl+Fk0b6mbVfumM5tTwmUhtjOPHiP6Zsby3Q==
 =OpE5
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmgh51AACgkQYKtH/8kJ
 UieX4BAA2sLQ9hrV9iTJ6pw+/Pbu/785mGcZJcg7b/RGsXYVepVuxanEopQjbazQ
 CFN1HJjEZ6RTM+9Ieu2dwDAsx/iCv1izMba2h3gh+Fcd2HjSaABNMiuoNPDNNxB+
 mNGhKLVe7n/eGX2i5kDazscibpcliPOnrGgbZKKhkjOZXZMGFamwugSIiMvaDn8g
 PSyQB/hZilM4n1yeFEo/dMA+70MtiMU+BtLuYpx8GDn09wmkDKPY6/bMVBPQyGCF
 k+hs4AOoUJTmnZpBMOuMb4rKfL+T9hHCfw8k6fNzucv3vjLDxmflRoMpN4VrH8ZA
 ho+kXYs2zlXdzRm1173zEt6fbNZ0po5ky9nyfJfQkEInH7RGfHlfZdqnuBIS6ZXN
 w6cCKdIojoOtHNcsT1CSgH830ImdWfnoFQtyWdU4hQ8oxGNexbdW2FcN+8tb6yJw
 M3ewczPrKN4i6ZZ2sJIotBDWPhtmdUb7Th1BwrJzxfVfmmdoDxweJ5BRILCrh7j/
 5U0TwYO75tpzmDMgiPlRpyjSJxp/NcdIrA7dzTPLGdbfWlwWLpxssE6ICcaJ/6lR
 EoAPkXqHUMxkiJOmgABtA+weflyeJtfmbouxAAfTuMW5FzDbJfibYCq62UUnt8Cl
 MxvQG3ByqbwfPOtQA+CdyHUNl1787LdgG0SN8UWWv5cbSOgBUs8=
 =4zTX
 -----END PGP SIGNATURE-----

Merge tag 'imx-dt-6.16' of https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/dt

i.MX ARM device tree change for 6.16:

- A series from Alexander Stein that updates ls1021a-tqmals1021a device
  tree mostly for display support inlcuding HDMI, LVDS and CDTech panel
- A change from Dario Binacchi to use pad config defines for i.MX23/28
  device trees
- A i.MX7D change from Efe Can İçöz to include min and max voltage in
  opp-microvolt
- A few patches from Fabio Estevam to fix dt-schema warnings
- A couple of changes from Krzysztof Kozlowski to align NAND and WIFI
  node name with binings
- A clean-up change from Rob Herring to drop redundant CPU
  "clock-latency"

* tag 'imx-dt-6.16' of https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  ARM: dts: mxs: use padconfig macros
  ARM: dts: imx7d: update opp-table voltages
  ARM: dts: nxp: Align wifi node name with bindings
  ARM: dts: imx6q-apalis: remove pcie-switch node
  ARM: dts: ls1021a-tqmals1021a: change sound card model name
  ARM: dts: ls1021a-tqmals1021a: Add overlay for CDTech DC44 RGB display
  ARM: dts: ls1021a-tqmals1021a: Add overlay for CDTech FC21 RGB display
  ARM: dts: ls1021a-tqmals1021a: Add LVDS overlay for Tianma TM070JVGH33
  ARM: dts: ls1021a-tqmals1021a: Add HDMI overlay
  ARM: dts: ls1021a-tqmals1021a: Add vcc-supply for spi-nor
  ARM: dts: ls1021a-tqmals1021a: Fix license
  ARM: dts: imx: Drop redundant CPU "clock-latency"
  ARM: dts: imx51-digi-connectcore-som: Fix MMA7455 compatible
  ARM: dts: nxp: Align NAND controller node name with bindings
  ARM: dts: imx: Fix the iim compatible string
  ARM: dts: imx31/imx6: Use flash as the NOR node name

Link: https://lore.kernel.org/r/20250512103858.50501-3-shawnguo@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2025-05-12 14:19:28 +02:00
Arnd Bergmann
34df63331e i.MX dt-bindings change for 6.16:
- New compatibles for TQ Group boards, i.MX943 EVK, Nitrogen8M Plus ENC
   Carrier, phyBOARD-Nash-i.MX93 and phyCORE-i.MX8MP FPSC from PHYTEC,
   and Toradex SMARC iMX8MP SoM/carrier
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmghrxoUHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM6ZDgf8CIp31y6doCMpZU+Vlx5NqBhHxpZ9
 aXN4soa9rrIbWNZqN1QSt+/Nc6gt4cMiT5cGXcQ6hLrZtI66rM4an+sSdLPV6S/P
 D1iSz0K3CfFjOX9cHV57XOS2IRwZB8BBwN9AnOaSy+uP4Hu/tdvl0SNglszFclK+
 YJh+Tl9w642kEkeg6dlLkTKYAqAWZKan6QTFVkWtarA8Zxk7SM6Rn86bi2FY9L8s
 V+A9mZjbC18fQiNw3YNsJmlodT70Mh4lCl8E4SEV9brpowZs8v/mD7311894QKAP
 z2kolSCX2t+DIlnZumbb21CeWWUE2ywACsrINt1bqQ85+rERBUh7D/RPUA==
 =ysUL
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmgh5xcACgkQYKtH/8kJ
 UifHxBAAhUNfacGHfm7DiuxWnCUStchRMNCB1HBLe0vWePTEQlR2EnJ3sGtznLzw
 Xd1n9Z4v+nfv8oB3HmqStNrhK5ESfE4gZyR+9TM2rqFMyRAGtcWANZGtOuWzwRjo
 j51lYgnY+j2BJ6m6UK7LMmOmmpSzp6SQfvHQhLlvNa/a1ZQqKD5iw/PdEeZeupUD
 SxVH2I/tP43xggwjYwk8QzFkmUz6uFJb+gbcC3m18dp/8TswgGu/ksllVD+sRNeV
 sa3GNmC4r/YUcUgROZFVfKCfahoICMfKv+nV5dfUFKPLoO/IwZuMb7LchZ7TmbKp
 +O8s8ub+k5bIflbchYFfSTjgtUaJrcaxNCAgZgG4O/NcB2a8UPeOxKt42m31obBh
 qrnOpYLvZOsUT8Q+m6GmtTunUxbDtgUkneCPsxPGHkZrV4CJMpBbblsh2rRn0/c8
 7jupsG4DMXxhzgbRzryc6NlomUB0MaaTXzIhXW5TstclOESotWjXEgB22kraGAxo
 aPh1PWtrXMP0RazInfwbOm9PoRarzXhVVkNKlCQ1rpWzDqKA9rdu0qolpEnAWEkF
 HtMgnSBfS9JpwyjRKD4GslzzYiBXMwSI+0Iv81j6hsci5rZNpoh4xwortoUhonf8
 EJFAB0a6u4njymVUsfx6AXrY95heX9TQR5j2hFSeQeUEJ5hiWDw=
 =Tmb5
 -----END PGP SIGNATURE-----

Merge tag 'imx-bindings-6.16' of https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/dt

i.MX dt-bindings change for 6.16:

- New compatibles for TQ Group boards, i.MX943 EVK, Nitrogen8M Plus ENC
  Carrier, phyBOARD-Nash-i.MX93 and phyCORE-i.MX8MP FPSC from PHYTEC,
  and Toradex SMARC iMX8MP SoM/carrier

* tag 'imx-bindings-6.16' of https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  bindings: arm: fsl: Add PHYTEC phyBOARD-Nash-i.MX93 board
  dt: bindings: arm: add bindings for TQMa95xxSA
  dt-bindings: arm: add TQMa8XxS boards
  dt-bindings: arm: fsl: add i.MX943 EVK board
  dt-bindings: arm: add imx8mp-libra-rdk-fpsc
  dt-bindings: arm: add MBa91xxCA Mainboard for TQMa93xxCA/LA SOM
  dt-bindings: arm: fsl: add Toradex SMARC iMX8MP SoM and carrier
  dt-bindings: arm: fsl: Add Boundary Device Nitrogen8M Plus ENC Carrier Board

Link: https://lore.kernel.org/r/20250512103858.50501-2-shawnguo@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2025-05-12 14:18:31 +02:00
Greg Kroah-Hartman
f27ae3a6ce Merge 6.15-rc6 into driver-core-next
We need the driver core fix in here as well for testing

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-05-12 14:16:34 +02:00
Arnd Bergmann
b892924264 i.MX drivers change for 6.16:
- A series from Peng Fan to dump full 128-bits UID for i.MX8MP
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCgAyFiEEFmJXigPl4LoGSz08UFdYWoewfM4FAmghimgUHHNoYXduZ3Vv
 QGtlcm5lbC5vcmcACgkQUFdYWoewfM5aJggAlDCcQsA4z24IPWb8FRKWb4r48sSv
 4Jpn1lkr42rIkGO/VwuBuPRbRWCz+zBulT9YDfLanSNUj5BCjhfHg+EUCjoy/KWz
 pdXNeRCQyQs9M4n0X6tyyRtNDhp/z9e7K5ZironWcJ8zKIvhtFqbzjh6fywne1Gl
 zc8rcrdgh44FsvRjrOudv1fQo7aVcURDnFAZMKT6m6VYtMa7dwb2zm+UETxvrOH/
 6GQst0q6bqG+SLljTjVGplUG0cV5gWvsAbO2ilTTq56bSXGaKNeZPJa2kNq5XCsA
 cb/OEJMBsVcM7YgpKr/Vl3/uqIamCKdMCt8QofZkj7muUVJrp6QxDsiafg==
 =J+MT
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmgh5pYACgkQYKtH/8kJ
 UieatA/9E6Gz84sqWnBLshOI9FlyTLYL3emk/yOo9YwUr2lQHg4inPce7eMBE3k3
 4pEcHh8pZK8G/on8TthK+UgVZfBA6UD9HYdIQ78fpkbaZsED30zWZDF99f13lGuq
 L7zj329q1YkNgYP3Un9LFHM51jmXJS1R2DKmEvXymQgOUasGOzAuFVCjeeX3zra6
 IJc56KYjR2DdIcKiRzL1pt8FcOQag2K6AZOMjXEFAqTv/hiNvg371Rkdb2tl0RY4
 GQa+z13gcnVXwYOyruXXvxW1+pdWY9bOLWNnHTPMZ7dKhSDtOsffZMz9HlOcopXB
 IrRpVu5x9o+e/lwvjmJFME0io9Yos6qhxW7i9XfsvpY4pak58YAYMBF+ni+heWJ8
 Z/i+3NQOoWQ+cpeuB89xz+txvKNF16DUPeMjU6Rk5sEcG8A98dj3ZsoyfQiqfuym
 LacgWVawX0CrubgzKFLS36V+M5p5jv/922WmCSnQqjYLKMM4zNVC3ZXIttAaj6Qy
 N0D3Tg0CLVqr8gA9yYdvBWki4lL6k23vUpjCU4DAc8lCXPqtNglIXkMj9aAkpI8O
 dG5LYp2C9PYKtrGc8Y43muh33YQ/Eb6EvRxeKIolo7t6y48LPowa8vu3T+xMGrQp
 415nJCDIwr/1+wuASzCEv87FcbJUIecYvbKJhYWFMD4fyxJYllw=
 =yyBZ
 -----END PGP SIGNATURE-----

Merge tag 'imx-drivers-6.16' of https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/drivers

i.MX drivers change for 6.16:

- A series from Peng Fan to dump full 128-bits UID for i.MX8MP

* tag 'imx-drivers-6.16' of https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  soc: imx8m: Dump higher 64bits UID
  soc: imx8m: Introduce soc_uid hook
  soc: imx8m: Cleanup with adding imx8m_soc_[un]prepare

Link: https://lore.kernel.org/r/20250512103858.50501-1-shawnguo@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2025-05-12 14:16:22 +02:00
Paul Geurts
6157e62b07
regulator: pca9450: Add restart handler
When restarting a CPU powered by the PCA9450 power management IC, it
is beneficial to use the PCA9450 to power cycle the CPU and all its
connected peripherals to start up in a known state. The PCA9450 features
a cold start procedure initiated by an I2C command.

Add a restart handler so that the PCA9450 is used to restart the CPU.
The restart handler sends command 0x14 to the SW_RST register,
initiating a cold reset (Power recycle all regulators except LDO1, LDO2
and CLK_32K_OUT)

As the PCA9450 is a PMIC specific for the i.MX8M family CPU, the restart
handler priority is set just slightly higher than imx2_wdt and the PSCI
restart handler. This makes sure this restart handler takes precedence.

Signed-off-by: Paul Geurts <paul.geurts@prodrive-technologies.com>
Link: https://patch.msgid.link/20250505115936.1946891-1-paul.geurts@prodrive-technologies.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-12 21:09:50 +09:00
Kuninori Morimoto
144d6dfc74
ASoC: soc-core: merge snd_soc_unregister_component() and snd_soc_unregister_component_by_driver()
We have below 2 functions, but these are very similar

(A)	snd_soc_unregister_component_by_driver()
(B)	snd_soc_unregister_component()

(A)	void snd_soc_unregister_component_by_driver(...)
	{
		...

(a)		mutex_lock(&client_mutex);
 ^ (X)		component = snd_soc_lookup_component_nolocked(dev, component_driver->name);
 |		if (!component)					   ^^^^^^^^^^^^^^^^^^^^^^
 |			goto out;
(b)
 |		snd_soc_del_component_unlocked(component);
 v
	out:
(c)		mutex_unlock(&client_mutex);
	}

(B)	void snd_soc_unregister_component_by_driver(...)
	{
(a)		mutex_lock(&client_mutex);
 ^		while (1) {
 | (X)			struct snd_soc_component *component = snd_soc_lookup_component_nolocked(dev, NULL);
 |												     ^^^^
(b)			if (!component)
 |				break;
 |
 |			snd_soc_del_component_unlocked(component);
 v		}
(c)		mutex_unlock(&client_mutex);
	}

Both are calling lock (a), find component and remove it (b), and
unlock (c). The big diff is whether use driver name for lookup() or
not (X).

Merge these into snd_soc_unregister_component_by_driver() (B), and
snd_soc_unregister_component_by_driver() (A) can be macro.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87h61qy2vn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-12 21:09:44 +09:00
Vivek Kasireddy
44b6535d8a drm/virtio: Fix NULL pointer deref in virtgpu_dma_buf_free_obj()
There is a chance that obj->dma_buf would be NULL by the time
virtgpu_dma_buf_free_obj() is called. This can happen for imported
prime objects, when drm_gem_object_exported_dma_buf_free() gets
called on them before drm_gem_object_free(). This is because
drm_gem_object_exported_dma_buf_free() explicitly sets
obj->dma_buf to NULL.

Therefore, fix this issue by storing the dma_buf pointer in the
virtio_gpu_object instance and using it in virtgpu_dma_buf_free_obj.
This stored pointer is guaranteed to be valid until the object is
freed as we took a reference on it in virtgpu_gem_prime_import().

Fixes: 415cb45895 ("drm/virtio: Use dma_buf from GEM object instance")
Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://lore.kernel.org/r/20250501232419.180337-1-vivek.kasireddy@intel.com
2025-05-12 14:49:41 +03:00
Alexey Makhalov
386cd3dcfd MAINTAINERS: Update Alexey Makhalov's email address
Fix a typo in an email address.

Closes: https://lore.kernel.org/all/20240925-rational-succinct-vulture-cca9fb@lemur/T/
Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Reported-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/20250318004031.2703923-1-alexey.makhalov@broadcom.com
2025-05-12 13:41:06 +02:00
Arnd Bergmann
94b247343f Merge branch 'cznic/platform' of https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc into soc/drivers
These are updates from Marek Behún for the cznic platform drivers:

  This series adds support for generating ECDSA signatures with hardware
  stored private key on Turris Omnia and Turris MOX.
  This ability is exposed via the keyctl() syscall.

* 'cznic/platform' of https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
  platform: cznic: use ffs() instead of __bf_shf()
  firmware: turris-mox-rwtm: fix building without CONFIG_KEYS
  platform: cznic: fix function parameter names
  firmware: turris-mox-rwtm: Add support for ECDSA signatures with HW private key
  firmware: turris-mox-rwtm: Drop ECDSA signatures via debugfs
  platform: cznic: turris-omnia-mcu: Add support for digital message signing with HW private key
  platform: cznic: Add keyctl helpers for Turris platform
  platform: cznic: turris-omnia-mcu: Refactor requesting MCU interrupt

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2025-05-12 13:34:21 +02:00
Shiraz Saleem
505cc26bca net: mana: Add support for auxiliary device servicing events
Handle soc servicing events which require the rdma auxiliary device resources to
be cleaned up during a suspend, and re-initialized during a resume.

Signed-off-by: Shiraz Saleem <shirazsaleem@microsoft.com>
Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Link: https://patch.msgid.link/1746633545-17653-5-git-send-email-kotaranov@linux.microsoft.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2025-05-12 07:31:48 -04:00
Jiaqing Zhao
824c6384e8 x86/mtrr: Check if fixed-range MTRRs exist in mtrr_save_fixed_ranges()
When suspending, save_processor_state() calls mtrr_save_fixed_ranges()
to save fixed-range MTRRs.

On platforms without fixed-range MTRRs like the ACRN hypervisor which
has removed fixed-range MTRR emulation, accessing these MSRs will
trigger an unchecked MSR access error. Make sure fixed-range MTRRs are
supported before access to prevent such error.

Since mtrr_state.have_fixed is only set when MTRRs are present and
enabled, checking the CPU feature flag in mtrr_save_fixed_ranges() is
unnecessary.

Fixes: 3ebad59056 ("[PATCH] x86: Save and restore the fixed-range MTRRs of the BSP when suspending")
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/20250509170633.3411169-2-jiaqing.zhao@linux.intel.com
2025-05-12 13:04:40 +02:00
Konstantin Taranov
d4293f96ce RDMA/mana_ib: unify mana_ib functions to support any gdma device
Use the installed gdma_device instead of hard-coded device
in requests to the HW.

Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Link: https://patch.msgid.link/1746633545-17653-4-git-send-email-kotaranov@linux.microsoft.com
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2025-05-12 06:44:52 -04:00
Konstantin Taranov
c390828d4d RDMA/mana_ib: Add support of mana_ib for RNIC and ETH nic
Allow mana_ib to be created over ethernet gdma device and
over rnic gdma device. The HW has two devices with different
capabilities and different use-cases. Initialize required
resources depending on the used gdma device.

Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Link: https://patch.msgid.link/1746633545-17653-3-git-send-email-kotaranov@linux.microsoft.com
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2025-05-12 06:44:52 -04:00
Konstantin Taranov
ced82fce77 net: mana: Probe rdma device in mana driver
Initialize gdma device for rdma inside mana module.
For each gdma device, initialize an auxiliary ib device.

Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Link: https://patch.msgid.link/1746633545-17653-2-git-send-email-kotaranov@linux.microsoft.com
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2025-05-12 06:44:52 -04:00
Armin Wolf
2bd1870a67
platform/x86: dell-ddv: Expose the battery health to userspace
The health of a given battery is exposed over the Dell DDV WMI
interface using the "BatteryManufactureAceess" WMI method. The
resulting data contains, among other data, the health status of
the battery.

Expose this value to userspace using the power supply extension
interface.

Tested on a Dell Inspiron 3505.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20250429003606.303870-4-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-12 13:20:42 +03:00
Armin Wolf
303ecf690a
platform/x86: dell-ddv: Expose the battery manufacture date to userspace
The manufacture date of a given battery is exposed over the Dell DDV
WMI interface using the "BatteryManufactureDate" WMI method. The
resulting data contains the manufacture date of the battery encoded
inside a 16-bit value as described in the Smart Battery Data
Specification.

Expose this value to userspace using the power supply extension
interface.

Tested on a Dell Inspiron 3505.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20250429003606.303870-3-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-12 13:20:40 +03:00
Armin Wolf
058de163a3
platform/x86: dell-ddv: Implement the battery matching algorithm
Since commit db0a507cb2 ("ACPICA: Update integer-to-hex-string
conversions") the battery serial number is no longer distorted,
allowing us to finally implement the battery matching algorithm.

The battery matchign algorithm is necessary when translating between
ACPI batteries and the associated indices used by the WMI interface
based on the battery serial number. Since this serial number can only
be retrieved when the battery is present we cannot perform the initial
translation inside dell_wmi_ddv_add_battery() because the ACPI battery
might be absent at this point in time.

Introduce dell_wmi_ddv_battery_translate() which implements the
battery matching algorithm and replaces dell_wmi_ddv_battery_index().
Also implement a translation cache for caching previous translations
between ACPI batteries and indices. This is necessary because
performing a translation can be very expensive.

Tested on a Dell Inspiron 3505.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20250429003606.303870-2-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-12 13:20:39 +03:00
Armin Wolf
f4856c20c1
power: supply: core: Add additional health status values
Some batteries can signal when an internal fuse was blown. In such a
case POWER_SUPPLY_HEALTH_DEAD is too vague for userspace applications
to perform meaningful diagnostics.

Additionally some batteries can also signal when some of their
internal cells are imbalanced. In such a case returning
POWER_SUPPLY_HEALTH_UNSPEC_FAILURE is again too vague for userspace
applications to perform meaningful diagnostics.

Add new health status values for both cases.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20250429003606.303870-1-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-12 13:20:37 +03:00
Suma Hegde
511a4a5ea2
platform/x86/amd/hsmp: acpi: Add sysfs files to display HSMP telemetry
Make frequently fetched telemetry available via sysfs. These parameters
do not fit in hwmon sensor model, hence make them available via sysfs.

Create following sysfs files per acpi device node.
* c0_residency_input
* prochot_status
* smu_fw_version
* protocol_version
* ddr_max_bw(GB/s)
* ddr_utilised_bw_input(GB/s)
* ddr_utilised_bw_perc_input(%)
* mclk_input(MHz)
* fclk_input(MHz)
* clk_fmax(MHz)
* clk_fmin(MHz)
* cclk_freq_limit_input(MHz)
* pwr_current_active_freq_limit(MHz)
* pwr_current_active_freq_limit_source

Signed-off-by: Suma Hegde <suma.hegde@amd.com>
Reviewed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20250506101542.200811-3-suma.hegde@amd.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-12 13:20:35 +03:00
Colin Ian King
8536666a52 RDMA/siw: replace redundant ternary operator with just rv
The use of the ternary operator on rv is redundant, rv is
either the initialized value of 0 or a negative error return
code, so it can never be greater than zero, and hence the
zero assignment in ternary operator is redundant. Just return
rv instead.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20250507131834.253823-1-colin.i.king@gmail.com
Acked-by: Bernard Metzler <bmt@zurich.ibm.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2025-05-12 06:20:24 -04:00
Suma Hegde
92c025db52
platform/x86/amd/hsmp: Report power via hwmon sensors
Expose power reading and power limits via hwmon power sensors.

Signed-off-by: Suma Hegde <suma.hegde@amd.com>
Reviewed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@amd.com>
Link: https://lore.kernel.org/r/20250506101542.200811-2-suma.hegde@amd.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-05-12 13:20:17 +03:00
Leon Romanovsky
15a9f67e28 RDMA/umem: Separate implicit ODP initialization from explicit ODP
Create separate functions for the implicit ODP initialization
which is different from the explicit ODP initialization.

Tested-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
2025-05-12 06:06:55 -04:00
Leon Romanovsky
1efe8c0670 RDMA/core: Convert UMEM ODP DMA mapping to caching IOVA and page linkage
Reuse newly added DMA API to cache IOVA and only link/unlink pages
in fast path for UMEM ODP flow.

Tested-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
2025-05-12 06:06:51 -04:00
Leon Romanovsky
eedd5b1276 RDMA/umem: Store ODP access mask information in PFN
As a preparation to remove dma_list, store access mask in PFN pointer
and not in dma_addr_t.

Tested-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
2025-05-12 06:06:46 -04:00
Leon Romanovsky
8cad471305 mm/hmm: provide generic DMA managing logic
HMM callers use PFN list to populate range while calling
to hmm_range_fault(), the conversion from PFN to DMA address
is done by the callers with help of another DMA list. However,
it is wasteful on any modern platform and by doing the right
logic, that DMA list can be avoided.

Provide generic logic to manage these lists and gave an interface
to map/unmap PFNs to DMA addresses, without requiring from the callers
to be an experts in DMA core API.

Tested-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
2025-05-12 06:06:42 -04:00
Leon Romanovsky
285e871884 mm/hmm: let users to tag specific PFN with DMA mapped bit
Introduce new sticky flag (HMM_PFN_DMA_MAPPED), which isn't overwritten
by HMM range fault. Such flag allows users to tag specific PFNs with
information if this specific PFN was already DMA mapped.

Tested-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
2025-05-12 06:06:37 -04:00
Christian Brauner
7ec091c559
Merge patch series "filesystems selftests cleanups and fanotify test"
Amir Goldstein <amir73il@gmail.com> says:

This adds a test for fanotify mount ns notifications inside userns [1].

While working on the test I ended up making lots of cleanups to reduce
build dependency on make headers_install.

These patches got rid of the dependency for my kvm setup for the
affected filesystems tests.

Building with TOOLS_INCLUDES dir was recommended by John Hubbard [2].

NOTE #1: these patches are based on a merge of vfs-6.16.mount
(changes wrappers.h) into v6.15-rc5 (changes mount-notify_test.c),
so if this cleanup is acceptable, we should probably setup a selftests
branch for 6.16, so that it can be used to test the fanotify patches.

NOTE #2: some of the defines in wrappers.h are left for overlayfs and
mount_setattr tests, which were not converted to use TOOLS_INCLUDES.
I did not want to mess with those tests.

* patches from https://lore.kernel.org/20250509133240.529330-1-amir73il@gmail.com:
  selftests/fs/mount-notify: add a test variant running inside userns
  selftests/filesystems: create setup_userns() helper
  selftests/filesystems: create get_unique_mnt_id() helper
  selftests/fs/mount-notify: build with tools include dir
  selftests/mount_settattr: remove duplicate syscall definitions
  selftests/pidfd: move syscall definitions into wrappers.h
  selftests/fs/statmount: build with tools include dir
  selftests/filesystems: move wrapper.h out of overlayfs subdir

Link: https://lore.kernel.org/20250509133240.529330-1-amir73il@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-05-12 11:40:18 +02:00
Amir Goldstein
781091f3f5
selftests/fs/mount-notify: add a test variant running inside userns
unshare userns in addition to mntns and verify that:

1. watching tmpfs mounted inside userns is allowed with any mark type
2. watching orig root with filesystem mark type is not allowed
3. watching mntns of orig userns is not allowed
4. watching mntns in userns where fanotify_init was called is allowed

mount events are only tested with the last case of mntns mark.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/20250509133240.529330-9-amir73il@gmail.com
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-05-12 11:40:13 +02:00
Amir Goldstein
8199e6f740
selftests/filesystems: create setup_userns() helper
Add helper to utils.c and use it in statmount userns tests.

Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/20250509133240.529330-8-amir73il@gmail.com
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-05-12 11:40:13 +02:00
Amir Goldstein
e897b9b133
selftests/filesystems: create get_unique_mnt_id() helper
Add helper to utils.c and use it in mount-notify and statmount tests.

Linking with utils.c drags in a dependecy with libcap, so add it to the
Makefile of the tests.

Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/20250509133240.529330-7-amir73il@gmail.com
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-05-12 11:40:12 +02:00
Amir Goldstein
c6d9775c20
selftests/fs/mount-notify: build with tools include dir
Copy the fanotify uapi header files to the tools include dir
and define __kernel_fsid_t to decouple dependency with headers_install
and then remove the redundant re-definitions of fanotify macros.

Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/20250509133240.529330-6-amir73il@gmail.com
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-05-12 11:40:12 +02:00
Amir Goldstein
ec050f2adf
selftests/mount_settattr: remove duplicate syscall definitions
Which are already defined in wrappers.h.

For now, the syscall defintions of mount_settattr() itself
remain in the test, which is the only test to use them.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/20250509133240.529330-5-amir73il@gmail.com
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-05-12 11:40:12 +02:00
Amir Goldstein
ef058fc1e5
selftests/pidfd: move syscall definitions into wrappers.h
There was already duplicity in some of the defintions.

Remove syscall number defintions for __ia64__ that are
both stale and incorrect.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/20250509133240.529330-4-amir73il@gmail.com
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-05-12 11:40:12 +02:00
Amir Goldstein
b13fb4ee46
selftests/fs/statmount: build with tools include dir
Copy the required headers files (mount.h, nsfs.h) to the tools
include dir and define the statmount/listmount syscall numbers
to decouple dependency with headers_install for the common cases.

Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/20250509133240.529330-3-amir73il@gmail.com
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-05-12 11:40:12 +02:00
Amir Goldstein
0bd92b9fe5
selftests/filesystems: move wrapper.h out of overlayfs subdir
This is not an overlayfs specific header.

Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/20250509133240.529330-2-amir73il@gmail.com
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-05-12 11:40:12 +02:00
Christian Brauner
d37d4720c3
selftests/mount_settattr: ensure that ext4 filesystem can be created
Filesystem too small for a journal
mount: /mnt/D/: mount failed: Operation not permitted.
mount_setattr_test.c:1076:idmap_mount_tree_invalid:Expected system("mount -o loop -t ext4 /mnt/C/ext4.img /mnt/D/") (256) == 0 (0)

Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-05-12 11:40:08 +02:00
Christian Brauner
7a012a692e
selftests/mount_settattr: add missing STATX_MNT_ID_UNIQUE define
CC       mount_setattr_test
In file included from mount_setattr_test.c:24:
mount_setattr_test.c: In function ‘mount_setattr_mount_detached_mount_on_detached_mount_and_attach’:
mount_setattr_test.c:1850:60: error: ‘STATX_MNT_ID_UNIQUE’ undeclared (first use in this function); did you mean ‘STATX_MNT_ID’?
 1850 |         ASSERT_EQ(statx(fd_tree_subdir, "", AT_EMPTY_PATH, STATX_MNT_ID_UNIQUE, &stx), 0);
      |                                                            ^~~~~~~~~~~~~~~~~~~
../kselftest_harness.h:757:20: note: in definition of macro ‘__EXPECT’
  757 |         __typeof__(_expected) __exp = (_expected); \
      |                    ^~~~~~~~~
mount_setattr_test.c:1850:9: note: in expansion of macro ‘ASSERT_EQ’
 1850 |         ASSERT_EQ(statx(fd_tree_subdir, "", AT_EMPTY_PATH, STATX_MNT_ID_UNIQUE, &stx), 0);
      |         ^~~~~~~~~
mount_setattr_test.c:1850:60: note: each undeclared identifier is reported only once for each function it appears in
 1850 |         ASSERT_EQ(statx(fd_tree_subdir, "", AT_EMPTY_PATH, STATX_MNT_ID_UNIQUE, &stx), 0);
      |                                                            ^~~~~~~~~~~~~~~~~~~
../kselftest_harness.h:757:20: note: in definition of macro ‘__EXPECT’
  757 |         __typeof__(_expected) __exp = (_expected); \
      |                    ^~~~~~~~~
mount_setattr_test.c:1850:9: note: in expansion of macro ‘ASSERT_EQ’
 1850 |         ASSERT_EQ(statx(fd_tree_subdir, "", AT_EMPTY_PATH, STATX_MNT_ID_UNIQUE, &stx), 0);
      |         ^~~~~~~~~

Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-05-12 11:40:08 +02:00
Christian Brauner
2680acd336
selftests/mount_settattr: don't define sys_open_tree() twice
CC       mount_setattr_test
mount_setattr_test.c:176:19: error: redefinition of ‘sys_open_tree’
  176 | static inline int sys_open_tree(int dfd, const char *filename, unsigned int flags)
      |                   ^~~~~~~~~~~~~
In file included from mount_setattr_test.c:23:
../filesystems/overlayfs/wrappers.h:59:19: note: previous definition of ‘sys_open_tree’ with type ‘int(int,  const char *, unsigned int)’
   59 | static inline int sys_open_tree(int dfd, const char *filename, unsigned int flags)

Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-05-12 11:40:08 +02:00
Mickaël Salaün
3039ed4327
landlock: Improve bit operations in audit code
Use the BIT() and BIT_ULL() macros in the new audit code instead of
explicit shifts to improve readability.  Use bitmask instead of modulo
operation to simplify code.

Add test_range1_rand15() and test_range2_rand15() KUnit tests to improve
get_id_range() coverage.

Signed-off-by: Günther Noack <gnoack3000@gmail.com>
Link: https://lore.kernel.org/r/20250512093732.1408485-1-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
2025-05-12 11:38:53 +02:00
Mikolaj Wasiak
5dff172414 drm/i915/selftest: allow larger memory allocation
Due to changes in allocator, the size of the allocation for
contiguous region is not rounded up to a power-of-two and
instead allocated as is. Thus, change the part of test that
expected the allocation to fail.

Signed-off-by: Mikolaj Wasiak <mikolaj.wasiak@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: Krzysztof Niemiec <krzysztof.niemiec@intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://lore.kernel.org/r/fptevdfbclvg2lbfuys5ibffbl2baouywkutnr7vdsy5tzcqfk@mpflwlh6jxfd
2025-05-12 11:31:38 +02:00
Andreas Hindborg
c6b1908224 MAINTAINERS: add configfs Rust abstractions
Add rust files to configfs MAINTAINERS entry.

Link: https://lore.kernel.org/r/20250508-configfs-v8-3-8ebde6180edc@kernel.org
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
2025-05-12 11:05:07 +02:00
Andreas Hindborg
1bfb105051 rust: configfs: add a sample demonstrating configfs usage
Add a sample to the samples folder, demonstrating the intended use of the
Rust configfs API.

Link: https://lore.kernel.org/r/20250508-configfs-v8-2-8ebde6180edc@kernel.org
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
2025-05-12 11:05:07 +02:00