]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
7 weeks agoLoongArch: KVM: Replace eiointc_enable_irq() with eiointc_update_irq()
Bibo Mao [Mon, 21 Jul 2025 01:26:32 +0000 (09:26 +0800)] 
LoongArch: KVM: Replace eiointc_enable_irq() with eiointc_update_irq()

Function eiointc_enable_irq() checks mask value with char type, and
call eiointc_update_irq() eventually. Function eiointc_update_irq()
will update one single irq status directly.

Here it can check mask value with unsigned long type and call function
eiointc_update_irq(), that is simple and direct.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
7 weeks agoLoongArch: KVM: Use generic function loongarch_eiointc_write()
Bibo Mao [Mon, 21 Jul 2025 01:26:32 +0000 (09:26 +0800)] 
LoongArch: KVM: Use generic function loongarch_eiointc_write()

With all eiointc iocsr register write operation with 1/2/4/8 bytes
size, generic function loongarch_eiointc_write() is used here. And
function loongarch_eiointc_writeb(), loongarch_eiointc_writew(),
loongarch_eiointc_writel() are removed.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
7 weeks agoLoongArch: KVM: Use generic function loongarch_eiointc_read()
Bibo Mao [Mon, 21 Jul 2025 01:26:32 +0000 (09:26 +0800)] 
LoongArch: KVM: Use generic function loongarch_eiointc_read()

Generic read function loongarch_eiointc_read() is used for 1/2/4/8
bytes read access. It reads 8 bytes from emulated software state and
shift right from address offset.

Also the similar with kvm_complete_iocsr_read(), destination register
of IOCSRRD.{B/H/W} is sign extension from byte/half word/word.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
7 weeks agoLoongArch: KVM: Use standard bitops API with eiointc
Bibo Mao [Mon, 21 Jul 2025 01:26:32 +0000 (09:26 +0800)] 
LoongArch: KVM: Use standard bitops API with eiointc

Standard bitops APIs such test_bit() is used here, rather than manually
calculating the offset and mask. Also use non-atomic API __set_bit() and
__clear_bit() rather than set_bit() and clear_bit(), since the global
spinlock is held already.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
7 weeks agoLoongArch: KVM: Remove never called default case statement
Bibo Mao [Mon, 21 Jul 2025 01:26:32 +0000 (09:26 +0800)] 
LoongArch: KVM: Remove never called default case statement

IOCSR instruction supports 1/2/4/8 bytes access, len must be 1/2/4/8
bytes from iocsr exit emulation function kvm_emu_iocsr(), remove the
default case in switch case statements.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
7 weeks agoLoongArch: KVM: Remove unused parameter len
Bibo Mao [Mon, 21 Jul 2025 01:26:32 +0000 (09:26 +0800)] 
LoongArch: KVM: Remove unused parameter len

Parameter len is unused in some functions with eiointc emulation driver,
remove it here.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
7 weeks agoLoongArch: KVM: Remove unnecessary local variable
Bibo Mao [Mon, 21 Jul 2025 01:26:32 +0000 (09:26 +0800)] 
LoongArch: KVM: Remove unnecessary local variable

Local variable device1 can be replaced with existing variable device,
it makes code concise.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
7 weeks agoLoongArch: KVM: Simplify kvm_deliver_intr()
Yury Norov (NVIDIA) [Mon, 21 Jul 2025 01:26:32 +0000 (09:26 +0800)] 
LoongArch: KVM: Simplify kvm_deliver_intr()

The function opencodes for_each_set_bit() macro, which makes it bulky.
Using the proper API makes all the housekeeping code going away.

Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
7 weeks agoLoongArch: KVM: Rework kvm_send_pv_ipi()
Yury Norov (NVIDIA) [Mon, 21 Jul 2025 01:26:32 +0000 (09:26 +0800)] 
LoongArch: KVM: Rework kvm_send_pv_ipi()

The function in fact traverses a "bitmap" stored in GPR regs A1 and A2,
but does it in a non-obvious way by creating a single-word bitmap twice.

This patch switches the function to create a single 2-word bitmap, and
also employs for_each_set_bit() macro, as it helps to drop most of the
housekeeping code.

While there, convert the function to return void to not confuse readers
with unchecked result.

Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
7 weeks agosmb/server: avoid deadlock when linking with ReplaceIfExists
NeilBrown [Sun, 8 Jun 2025 23:35:09 +0000 (09:35 +1000)] 
smb/server: avoid deadlock when linking with ReplaceIfExists

If smb2_create_link() is called with ReplaceIfExists set and the name
does exist then a deadlock will happen.

ksmbd_vfs_kern_path_locked() will return with success and the parent
directory will be locked.  ksmbd_vfs_remove_file() will then remove the
file.  ksmbd_vfs_link() will then be called while the parent is still
locked.  It will try to lock the same parent and will deadlock.

This patch moves the ksmbd_vfs_kern_path_unlock() call to *before*
ksmbd_vfs_link() and then simplifies the code, removing the file_present
flag variable.

Signed-off-by: NeilBrown <neil@brown.name>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
7 weeks agosmb/server: simplify ksmbd_vfs_kern_path_locked()
NeilBrown [Sat, 19 Jul 2025 09:46:42 +0000 (18:46 +0900)] 
smb/server: simplify ksmbd_vfs_kern_path_locked()

ksmbd_vfs_kern_path_locked() first tries to look up the path with the
given case.  When this fails, if caseless is set, it loops over the
components in the path, opening the relevant directory and searching
for a name which matches.  This name is copied over the original and the
the process repeats.  Each time a lookup with the newly updated path is
repeated from the top (vfs_path_lookup()).

When the last component has been case-corrected the simplest next step
is to repeat the original lookup with ksmbd_vfs_path_lookup_locked().
If this works it gives exactly what we want, if it fails it gives the
correct failure.

This observation allows the code to be simplified, in particular
removing the ksmbd_vfs_lock_parent() call.

This patch also removes the duplication of name and filepath (two
names for the one thing) and calls path_put(parent_path) sooner so
parent_path can be passed directly to vfs_path_lookup avoiding the need
to store it temporarily in path and then copying into parent_path.

This patch removes one user of ksmbd_vfs_lock_parent() which will
simplify a future patch.

Signed-off-by: NeilBrown <neil@brown.name>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
7 weeks agosmb/server: use lookup_one_unlocked()
NeilBrown [Sun, 8 Jun 2025 23:35:07 +0000 (09:35 +1000)] 
smb/server: use lookup_one_unlocked()

In process_query_dir_entries(), instead of locking the directory,
performing a lookup, then unlocking, we can simply call
lookup_one_unlocked().  That takes locks the directory only when needed.

This removes the only users of lock_dir() and unlock_dir() so they can
be removed.

Signed-off-by: NeilBrown <neil@brown.name>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
7 weeks agodt-bindings: hwmon: adt7475: Allow and recommend #pwm-cells = <3>
Uwe Kleine-König [Thu, 19 Jun 2025 19:37:46 +0000 (21:37 +0200)] 
dt-bindings: hwmon: adt7475: Allow and recommend #pwm-cells = <3>

To make this binding match what is usally used for PWMs, deprecate 4
cells and allow 3 instead.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/77895aec937b6217f513d3b12e7945f1707fd906.1750361514.git.u.kleine-koenig@baylibre.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (adt7475) Implement support for #pwm-cells = <3>
Uwe Kleine-König [Thu, 19 Jun 2025 19:37:45 +0000 (21:37 +0200)] 
hwmon: (adt7475) Implement support for #pwm-cells = <3>

The adt7475 driver and binding are outliers requiring 4 pwm-cells. The
typical value is 3, there are a few devices that use a lesser value for
historical reasons, no other uses a value bigger than 3.

Implement support for 3 cells to make the adt7475 binding match the
usual PWM binding.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/b5cc994cbe74095e39468fd694c721d7c879db78.1750361514.git.u.kleine-koenig@baylibre.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (pmbus/tps53679) Add support for TPS53685
Chiang Brian [Thu, 19 Jun 2025 06:42:23 +0000 (14:42 +0800)] 
hwmon: (pmbus/tps53679) Add support for TPS53685

The TPS53685 is a fully AMD SVI3 compliant step down controller with
trans-inductor voltage regulator(TLVR) topology support, dual channels,
built-in non-volatile memory (NVM), PMBus interface, and full compatible
with TI NexFET smart power stages.

Add support for it to the tps53679 driver.

Signed-off-by: Chiang Brian <chiang.brian@inventec.com>
Link: https://lore.kernel.org/r/20250619064223.3165523-3-chiang.brian@inventec.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agodt-bindings: trivial: Add tps53685 support
Chiang Brian [Thu, 19 Jun 2025 06:42:22 +0000 (14:42 +0800)] 
dt-bindings: trivial: Add tps53685 support

Add device type support for tps53685

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Chiang Brian <chiang.brian@inventec.com>
Link: https://lore.kernel.org/r/20250619064223.3165523-2-chiang.brian@inventec.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (pmbus/adp1050) Add regulator support for ltp8800
Cedric Encarnacion [Wed, 9 Jul 2025 05:43:27 +0000 (13:43 +0800)] 
hwmon: (pmbus/adp1050) Add regulator support for ltp8800

Add regulator support for the single-channel LTP8800-1A/-2/-4A
150A/135A/200A DC/DC µModule Regulator.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
Link: https://lore.kernel.org/r/20250709-adp1051-v5-3-539254692252@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (pmbus/adp1050) Add support for adp1051, adp1055 and ltp8800
Cedric Encarnacion [Wed, 9 Jul 2025 05:43:26 +0000 (13:43 +0800)] 
hwmon: (pmbus/adp1050) Add support for adp1051, adp1055 and ltp8800

Introduce hardware monitoring support for the following devices:

    ADP1051: 6 PWM for I/O Voltage, I/O Current, Temperature
    ADP1055: 6 PWM for I/O Voltage, I/O Current, Power, Temperature
    LTP8800-1A/-2/-4A: 150A/135A/200A DC/DC µModule Regulator

The ADP1051 and ADP1055 are similar digital controllers for high
efficiency DC-DC power conversion while the LTP8800 is a family of
step-down μModule regulators that provides microprocessor core voltage
from 54V power distribution architecture. All of the above components
features telemetry monitoring of input/output voltage, input current,
output power, and temperature over PMBus.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Co-developed-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Signed-off-by: Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
Link: https://lore.kernel.org/r/20250709-adp1051-v5-2-539254692252@analog.com
[groeck: Dropped unnecessaary spaces after type casts]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agodt-bindings: hwmon: pmbus/adp1050: Add adp1051, adp1055 and ltp8800
Cedric Encarnacion [Wed, 9 Jul 2025 05:43:25 +0000 (13:43 +0800)] 
dt-bindings: hwmon: pmbus/adp1050: Add adp1051, adp1055 and ltp8800

Add support for adp1051, adp1055, and ltp8800.
    ADP1051: 6 PWM for I/O Voltage, I/O Current, Temperature
    ADP1055: 6 PWM for I/O Voltage, I/O Current, Power, Temperature
    LTP8800-1A/-2/-4A: 150A/135A/200A DC/DC µModule Regulator

Co-developed-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
Signed-off-by: Cedric Encarnacion <cedricjustine.encarnacion@analog.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20250709-adp1051-v5-1-539254692252@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (max31827) use sysfs_emit() in temp1_resolution_show()
Khaled Elnaggar [Sat, 12 Jul 2025 13:14:46 +0000 (16:14 +0300)] 
hwmon: (max31827) use sysfs_emit() in temp1_resolution_show()

Replace scnprintf() with sysfs_emit() in temp1_resolution_show(),
as recommended in Documentation/filesystems/sysfs.rst: show() callbacks
should use sysfs_emit() or sysfs_emit_at() to format values returned to
userspace.

Signed-off-by: Khaled Elnaggar <khaledelnaggarlinux@gmail.com>
Link: https://lore.kernel.org/r/20250712131447.326995-1-khaledelnaggarlinux@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (ltc4282) convert from round_rate() to determine_rate()
Brian Masney [Thu, 10 Jul 2025 18:10:41 +0000 (14:10 -0400)] 
hwmon: (ltc4282) convert from round_rate() to determine_rate()

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
appended to the "under-the-cut" portion of the patch.

Signed-off-by: Brian Masney <bmasney@redhat.com>
Link: https://lore.kernel.org/r/20250710-hwmon-round-rate-v1-1-64fbe4bf3d05@redhat.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (corsair-psu) add support for HX1200i Series 2025
Shantanu Tushar [Mon, 30 Jun 2025 20:14:44 +0000 (22:14 +0200)] 
hwmon: (corsair-psu) add support for HX1200i Series 2025

Add the USB ID of the Corsair HXi Series 2025 HX1200i PSU (CP-9020307).
Update the documentation to mention this.

Signed-off-by: Shantanu Tushar <shantanu@kde.org>
Reviewed-by: Wilken Gottwalt <wilken.gottwalt@posteo.net>
Link: https://lore.kernel.org/r/20250630201444.210420-1-shantanu@kde.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agodt-bindings: hwmon: pmbus: ti,ucd90320: Add missing compatibles
Rob Herring (Arm) [Tue, 1 Jul 2025 21:00:44 +0000 (16:00 -0500)] 
dt-bindings: hwmon: pmbus: ti,ucd90320: Add missing compatibles

Add several compatibles already in use to the ti,ucd90320 binding.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250701-dt-hwmon-compatibles-v1-5-ad99e65cf11b@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agodt-bindings: hwmon: maxim,max20730: Add maxim,max20710 compatible
Rob Herring (Arm) [Tue, 1 Jul 2025 21:00:43 +0000 (16:00 -0500)] 
dt-bindings: hwmon: maxim,max20730: Add maxim,max20710 compatible

The maxim,max20710 compatible is already in use. Add it to the
maxim,max20730 binding as the device appears to be similar.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250701-dt-hwmon-compatibles-v1-4-ad99e65cf11b@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agodt-bindings: hwmon: lltc,ltc2978: Add lltc,ltc713 compatible
Rob Herring (Arm) [Tue, 1 Jul 2025 21:00:42 +0000 (16:00 -0500)] 
dt-bindings: hwmon: lltc,ltc2978: Add lltc,ltc713 compatible

The lltc,ltc713 compatible is already in use. Add it to the lltc,ltc2978
binding as the device appears to be similar.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250701-dt-hwmon-compatibles-v1-3-ad99e65cf11b@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agodt-bindings: hwmon: ti,lm87: Add adi,adm1024 compatible
Rob Herring (Arm) [Tue, 1 Jul 2025 21:00:41 +0000 (16:00 -0500)] 
dt-bindings: hwmon: ti,lm87: Add adi,adm1024 compatible

The adi,adm1024 compatible is already in use. Add it to the lm87
binding as the device appears to be compatible.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250701-dt-hwmon-compatibles-v1-2-ad99e65cf11b@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agodt-bindings: hwmon: national,lm90: Add missing Dallas max6654 and onsemi nct72, nct21...
Rob Herring (Arm) [Tue, 1 Jul 2025 21:00:40 +0000 (16:00 -0500)] 
dt-bindings: hwmon: national,lm90: Add missing Dallas max6654 and onsemi nct72, nct214, and nct218

The onsemi nct72, nct214, and nct218 and Dallas/Analog max6654
temperature sensors are already supported, but not documented. Add
them to the LM90 binding.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20250701-dt-hwmon-compatibles-v1-1-ad99e65cf11b@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (w83627ehf) make the read-only arrays 'bit' static const
Colin Ian King [Mon, 14 Jul 2025 15:55:05 +0000 (16:55 +0100)] 
hwmon: (w83627ehf) make the read-only arrays 'bit' static const

Don't populate the read-only arrays 'bit' on the stack at run time,
instead make them static const.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20250714155505.1234012-1-colin.i.king@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (emc2305) Set initial PWM minimum value during probe based on thermal state
Florin Leotescu [Tue, 3 Jun 2025 11:31:25 +0000 (14:31 +0300)] 
hwmon: (emc2305) Set initial PWM minimum value during probe based on thermal state

Prevent the PWM value from being set to minimum when thermal zone
temperature exceeds any trip point during driver probe. Otherwise, the
PWM fan speed will remains at minimum speed and not respond to
temperature changes.

Signed-off-by: Florin Leotescu <florin.leotescu@nxp.com>
Link: https://lore.kernel.org/r/20250603113125.3175103-5-florin.leotescu@oss.nxp.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (emc2305) Enable PWM polarity and output configuration
Florin Leotescu [Tue, 3 Jun 2025 11:31:24 +0000 (14:31 +0300)] 
hwmon: (emc2305) Enable PWM polarity and output configuration

Enable configuration of PWM polarity and PWM output config
based Device Tree properties.

Signed-off-by: Florin Leotescu <florin.leotescu@nxp.com>
Link: https://lore.kernel.org/r/20250603113125.3175103-4-florin.leotescu@oss.nxp.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (emc2305) Configure PWM channels based on DT properties
Florin Leotescu [Tue, 3 Jun 2025 11:31:23 +0000 (14:31 +0300)] 
hwmon: (emc2305) Configure PWM channels based on DT properties

Add support for configuring each PWM channel using Device Tree (DT)
properties by parsing the 'pwms' phandle arguments.

Signed-off-by: Florin Leotescu <florin.leotescu@nxp.com>
Link: https://lore.kernel.org/r/20250603113125.3175103-3-florin.leotescu@oss.nxp.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (emc2305) Add support for PWM frequency, polarity and output
Florin Leotescu [Tue, 3 Jun 2025 11:31:22 +0000 (14:31 +0300)] 
hwmon: (emc2305) Add support for PWM frequency, polarity and output

Add three new attributes to the driver data structures to support
configuration of PWM frequency, PWM polarity and PWM output config.

Signed-off-by: Florin Leotescu <florin.leotescu@nxp.com>
Link: https://lore.kernel.org/r/20250603113125.3175103-2-florin.leotescu@oss.nxp.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (amc6821) Add cooling device support
João Paulo Gonçalves [Fri, 13 Jun 2025 13:42:40 +0000 (10:42 -0300)] 
hwmon: (amc6821) Add cooling device support

Add support for using the AMC6821 as a cooling device. The AMC6821
registers with the thermal framework only if the `cooling-levels`
property is present in the fan device tree child node. If this property
is present, the driver assumes the fan will operate in open-loop, and
the kernel will control it directly. In this case, the driver will
change the AMC6821 mode to manual (software DCY) and set the initial PWM
duty cycle to the maximum fan cooling state level as defined in the DT.
It is worth mentioning that the cooling device is registered on the
child fan node, not on the fan controller node. Existing behavior is
unchanged, so the AMC6821 can still be used without the thermal
framework (hwmon only).

Signed-off-by: João Paulo Gonçalves <joao.goncalves@toradex.com>
Link: https://lore.kernel.org/r/20250613-b4-amc6821-cooling-device-support-v4-3-a8fc063c55de@toradex.com
[groeck: Reduced line length when registering thermal device]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (amc6821) Move reading fan data from OF to a function
João Paulo Gonçalves [Fri, 13 Jun 2025 13:42:39 +0000 (10:42 -0300)] 
hwmon: (amc6821) Move reading fan data from OF to a function

Move fan property reading from OF to a separate function. This keeps OF
data handling separate from the code logic and makes it easier to add
features like cooling device support that use the same fan node.

Signed-off-by: João Paulo Gonçalves <joao.goncalves@toradex.com>
Link: https://lore.kernel.org/r/20250613-b4-amc6821-cooling-device-support-v4-2-a8fc063c55de@toradex.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agodt-bindings: hwmon: amc6821: Add cooling levels
João Paulo Gonçalves [Fri, 13 Jun 2025 13:42:38 +0000 (10:42 -0300)] 
dt-bindings: hwmon: amc6821: Add cooling levels

The fan can be used as a cooling device, add a description of the
`cooling-levels` property and restrict the maximum value to 255, which
is the highest PWM duty cycle supported by the AMC6821 fan controller.

Signed-off-by: João Paulo Gonçalves <joao.goncalves@toradex.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20250613-b4-amc6821-cooling-device-support-v4-1-a8fc063c55de@toradex.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (ibmaem) match return type of wait_for_completion_timeout
Qiushi Wu [Fri, 13 Jun 2025 18:24:13 +0000 (14:24 -0400)] 
hwmon: (ibmaem) match return type of wait_for_completion_timeout

Return type of wait_for_completion_timeout is unsigned long not int.
Check its return value inline instead of introducing a throw-away
variable.

Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Qiushi Wu <qiushi@linux.ibm.com>
Link: https://lore.kernel.org/r/20250613182413.1426367-1-qiushi@linux.ibm.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (ltc4282) fix copy paste on variable name
Nuno Sá [Wed, 11 Jun 2025 16:26:13 +0000 (17:26 +0100)] 
hwmon: (ltc4282) fix copy paste on variable name

The struct hwmon_chip_info was named ltc2947_chip_info which is
obviously a copy paste leftover. Name it accordingly.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250611-fix-ltc4282-repetead-write-v1-2-fe46edd08cf1@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (pmbus/isl68137) Add support for RAA229621
Chiang Brian [Thu, 5 Jun 2025 04:01:34 +0000 (12:01 +0800)] 
hwmon: (pmbus/isl68137) Add support for RAA229621

The RAA229621 is a digital dual output multiphase (X+Y <= 8) PWM controller
designed to be compliant with AMD SVI3 specifications, targeting VDDCR_CPU
and VDDCR_SOC rails.

Add support for it to the isl68137 driver.

Signed-off-by: Chiang Brian <chiang.brian@inventec.com>
Link: https://lore.kernel.org/r/20250605040134.4012199-3-chiang.brian@inventec.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agodt-bindings: hwmon: (pmbus/isl68137) Add RAA229621 support
Chiang Brian [Thu, 5 Jun 2025 04:01:33 +0000 (12:01 +0800)] 
dt-bindings: hwmon: (pmbus/isl68137) Add RAA229621 support

Add device type support for raa229621

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Chiang Brian <chiang.brian@inventec.com>
Link: https://lore.kernel.org/r/20250605040134.4012199-2-chiang.brian@inventec.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (asus-ec-sensors) add ProArt X870E-CREATOR WIFI
Eugene Shalygin [Sat, 7 Jun 2025 10:26:14 +0000 (12:26 +0200)] 
hwmon: (asus-ec-sensors) add ProArt X870E-CREATOR WIFI

Adds support for the ProArt X870E-CREATOR WIFI board.

Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250607102626.9051-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (asus-ec-sensors) add support for ROG STRIX Z490-F GAMING
Roy Seitz [Thu, 29 May 2025 09:01:41 +0000 (11:01 +0200)] 
hwmon: (asus-ec-sensors) add support for ROG STRIX Z490-F GAMING

This adds support for the ROG STRIX Z490-F GAMING board.

Signed-off-by: Roy Seitz <royseitz@bluewin.ch>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20250529090222.154696-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agohwmon: (gsc-hwmon) fix fan pwm setpoint show functions
Tim Harvey [Fri, 18 Jul 2025 20:02:59 +0000 (13:02 -0700)] 
hwmon: (gsc-hwmon) fix fan pwm setpoint show functions

The Linux hwmon sysfs API values for pwmX_auto_pointY_pwm represent an
integer value between 0 (0%) to 255 (100%) and the pwmX_auto_pointY_temp
represent millidegrees Celcius.

Commit a6d80df47ee2 ("hwmon: (gsc-hwmon) fix fan pwm temperature
scaling") properly addressed the incorrect scaling in the
pwm_auto_point_temp_store implementation but erroneously scaled
the pwm_auto_point_pwm_show (pwm value) instead of the
pwm_auto_point_temp_show (temp value) resulting in:
 # cat /sys/class/hwmon/hwmon0/pwm1_auto_point6_pwm
 25500
 # cat /sys/class/hwmon/hwmon0/pwm1_auto_point6_temp
 4500

Fix the scaling of these attributes:
 # cat /sys/class/hwmon/hwmon0/pwm1_auto_point6_pwm
 255
 # cat /sys/class/hwmon/hwmon0/pwm1_auto_point6_temp
 45000

Fixes: a6d80df47ee2 ("hwmon: (gsc-hwmon) fix fan pwm temperature scaling")
Cc: stable@vger.kernel.org
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Link: https://lore.kernel.org/r/20250718200259.1840792-1-tharvey@gateworks.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
7 weeks agoMerge tag 'drm-misc-next-2025-07-17' of https://gitlab.freedesktop.org/drm/misc/kerne...
Dave Airlie [Sun, 20 Jul 2025 23:13:15 +0000 (09:13 +1000)] 
Merge tag 'drm-misc-next-2025-07-17' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next

drm-misc-next for 6.17:

UAPI Changes:

Cross-subsystem Changes:

Core Changes:

- mode_config: Change fb_create prototype to pass the drm_format_info
  and avoid redundant lookups in drivers
- sched: kunit improvements, memory leak fixes, reset handling
  improvements
- tests: kunit EDID update

Driver Changes:

- amdgpu: Hibernation fixes, structure lifetime fixes
- nouveau: sched improvements
- sitronix: Add Sitronix ST7567 Support

- bridge:
  - Make connector available to bridge detect hook

- panel:
  - More refcounting changes
  - New panels: BOE NE14QDM

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maxime Ripard <mripard@redhat.com>
Link: https://lore.kernel.org/r/20250717-efficient-kudu-of-fantasy-ff95e0@houat
7 weeks agorust: kernel: use `core::ffi::CStr` method names
Tamir Duberstein [Fri, 4 Jul 2025 20:14:57 +0000 (16:14 -0400)] 
rust: kernel: use `core::ffi::CStr` method names

Prepare for `core::ffi::CStr` taking the place of `kernel::str::CStr` by
avoiding methods that only exist on the latter.

Also avoid `Deref<Target=BStr> for CStr` as that impl doesn't exist on
`core::ffi::CStr`.

Link: https://github.com/Rust-for-Linux/linux/issues/1075
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20250704-core-cstr-prepare-v1-6-a91524037783@gmail.com
[ Reworded title. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
7 weeks agorust: str: add `CStr` methods matching `core::ffi::CStr`
Tamir Duberstein [Fri, 4 Jul 2025 20:14:56 +0000 (16:14 -0400)] 
rust: str: add `CStr` methods matching `core::ffi::CStr`

Prepare for replacing `CStr` with `core::ffi::CStr` by soft-deprecating
methods which don't exist on `core::ffi::CStr`.

We could keep `as_bytes{,_with_nul}` through an extension trait but
seeing as we have to introduce `as_char_ptr_in_const_context` as a free
function, we may as well introduce `to_bytes{,_with_nul}` here to allow
downstream code to migrate in one cycle rather than two.

Link: https://github.com/Rust-for-Linux/linux/issues/1075
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20250704-core-cstr-prepare-v1-5-a91524037783@gmail.com
[ Reworded title. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
7 weeks agorust: str: remove unnecessary qualification
Tamir Duberstein [Fri, 4 Jul 2025 20:14:55 +0000 (16:14 -0400)] 
rust: str: remove unnecessary qualification

`core::ffi::*` is in the prelude, which is imported here.

Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20250704-core-cstr-prepare-v1-4-a91524037783@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
7 weeks agorust: use `kernel::{fmt,prelude::fmt!}`
Tamir Duberstein [Fri, 4 Jul 2025 20:14:54 +0000 (16:14 -0400)] 
rust: use `kernel::{fmt,prelude::fmt!}`

Reduce coupling to implementation details of the formatting machinery by
avoiding direct use for `core`'s formatting traits and macros.

Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20250704-core-cstr-prepare-v1-3-a91524037783@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
7 weeks agorust: kernel: add `fmt` module
Tamir Duberstein [Fri, 4 Jul 2025 20:14:53 +0000 (16:14 -0400)] 
rust: kernel: add `fmt` module

`kernel::fmt` is a facade over `core::fmt` that can be used downstream,
allowing future changes to the formatting machinery to be contained
within the kernel crate without downstream code needing to be modified.

Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20250704-core-cstr-prepare-v1-2-a91524037783@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
7 weeks agorust: kernel: remove `fmt!`, fix clippy::uninlined-format-args
Tamir Duberstein [Fri, 4 Jul 2025 20:14:52 +0000 (16:14 -0400)] 
rust: kernel: remove `fmt!`, fix clippy::uninlined-format-args

Rather than export a macro that delegates to `core::format_args`, simply
re-export `core::format_args` as `fmt` from the prelude. This exposes
clippy warnings which were previously obscured by this macro, such as:

    warning: variables can be used directly in the `format!` string
      --> ../drivers/cpufreq/rcpufreq_dt.rs:21:43
       |
    21 |     let prop_name = CString::try_from_fmt(fmt!("{}-supply", name)).ok()?;
       |                                           ^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
       = note: `-W clippy::uninlined-format-args` implied by `-W clippy::all`
       = help: to override `-W clippy::all` add `#[allow(clippy::uninlined_format_args)]`
    help: change this to
       |
    21 -     let prop_name = CString::try_from_fmt(fmt!("{}-supply", name)).ok()?;
    21 +     let prop_name = CString::try_from_fmt(fmt!("{name}-supply")).ok()?;
       |

Thus fix them in the same commit. This could possibly be fixed in two
stages, but the diff is small enough (outside of kernel/str.rs) that I
hope it can be taken in a single commit.

Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20250704-core-cstr-prepare-v1-1-a91524037783@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
7 weeks agoscripts: rust: emit path candidates in panic message
Tamir Duberstein [Thu, 29 May 2025 13:14:59 +0000 (09:14 -0400)] 
scripts: rust: emit path candidates in panic message

Include all information in the panic message rather than emit fragments
to stderr to avoid possible interleaving with other output.

Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Link: https://lore.kernel.org/r/20250529-idiomatic-match-slice-v2-2-4925ca2f1550@gmail.com
[ Kept newlines using `writeln!`. Used new message from Tamir. Reworded
  title. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
7 weeks agoLinux 6.16-rc7 v6.16-rc7
Linus Torvalds [Sun, 20 Jul 2025 22:18:33 +0000 (15:18 -0700)] 
Linux 6.16-rc7

7 weeks agoscripts: rust: replace length checks with match
Tamir Duberstein [Thu, 29 May 2025 13:14:58 +0000 (09:14 -0400)] 
scripts: rust: replace length checks with match

Use a match expression with slice patterns instead of length checks and
indexing. The result is more idiomatic, which is a better example for
future Rust code authors.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Link: https://lore.kernel.org/r/20250529-idiomatic-match-slice-v2-1-4925ca2f1550@gmail.com
[ Reworded title. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
7 weeks agoMerge tag 'trace-v6.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
Linus Torvalds [Sun, 20 Jul 2025 20:03:31 +0000 (13:03 -0700)] 
Merge tag 'trace-v6.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull tracing fixes from Steven Rostedt:

 - Fix timerlat with use of FORTIFY_SOURCE

   FORTIFY_SOURCE was added to the stack tracer where it compares the
   entry->caller array to having entry->size elements.

   timerlat has the following:

      memcpy(&entry->caller, fstack->calls, size);
      entry->size = size;

   Which triggers FORTIFY_SOURCE as the caller is populated before the
   entry->size is initialized.

   Swap the order to satisfy FORTIFY_SOURCE logic.

 - Add down_write(trace_event_sem) when adding trace events in modules

   Trace events being added to the ftrace_events array are protected by
   the trace_event_sem semaphore. But when loading modules that have
   trace events, the addition of the events are not protected by the
   semaphore and loading two modules that have events at the same time
   can corrupt the list.

   Also add a lockdep_assert_held(trace_event_sem) to
   _trace_add_event_dirs() to confirm it is held when iterating the
   list.

* tag 'trace-v6.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  tracing: Add down_write(trace_event_sem) when adding trace event
  tracing/osnoise: Fix crash in timerlat_dump_stack()

7 weeks agoMerge tag 'i2c-for-6.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
Linus Torvalds [Sun, 20 Jul 2025 19:56:13 +0000 (12:56 -0700)] 
Merge tag 'i2c-for-6.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
 "omap:
   - add missing error check
   - fix PM disable in probe error path

  stm32:
   - unmap DMA buffer on transfer failure
   - use correct device when mapping and unmapping during transfers"

* tag 'i2c-for-6.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: stm32f7: unmap DMA mapped buffer
  i2c: stm32: fix the device used for the DMA map
  i2c: omap: Fix an error handling path in omap_i2c_probe()
  i2c: omap: Handle omap_i2c_init() errors in omap_i2c_probe()

7 weeks agoblock: fix module reference leak in mq-deadline I/O scheduler
Nilay Shroff [Sat, 19 Jul 2025 13:26:47 +0000 (18:56 +0530)] 
block: fix module reference leak in mq-deadline I/O scheduler

During probe, when the block layer registers a request queue, it
defaults to the mq-deadline I/O scheduler if the device is single-queue
and the mq-deadline module is available. To determine availability, the
elevator_set_default() invokes elevator_find_get(), which increments the
module's reference count. However, this reference is never released,
resulting in a module reference leak that prevents the mq-deadline module
from being unloaded.

This patch fixes the issue by ensuring the acquired module reference is
properly released.

Fixes: 1e44bedbc921 ("block: unifying elevator change")
Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250719132722.769536-1-nilay@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
7 weeks agoio_uring: fix breakage in EXPERT menu
Randy Dunlap [Sun, 20 Jul 2025 01:04:56 +0000 (18:04 -0700)] 
io_uring: fix breakage in EXPERT menu

Add a dependency for IO_URING for the GCOV_PROFILE_URING symbol.

Without this patch the EXPERT config menu ends with
"Enable IO uring support" and the menu prompts for
GCOV_PROFILE_URING and IO_URING_MOCK_FILE are not subordinate to it.
This causes all of the EXPERT Kconfig options that follow
GCOV_PROFILE_URING to be display in the "upper" menu (General setup),
just following the EXPERT menu.

Fixes: 1802656ef890 ("io_uring: add GCOV_PROFILE_URING Kconfig option")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: io-uring@vger.kernel.org
Link: https://lore.kernel.org/r/20250720010456.2945344-1-rdunlap@infradead.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
7 weeks agoMerge tag 'x86-urgent-2025-07-20' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 20 Jul 2025 18:27:52 +0000 (11:27 -0700)] 
Merge tag 'x86-urgent-2025-07-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 bug fix from Thomas Gleixner:
 "A single fix for a GCC wreckage, which emits a KCSAN instrumentation
  call in __sev_es_nmi_complete() despite the function being annotated
  with 'noinstr'.

  As all functions in that source file are noinstr, exclude the whole
  file from KCSAN in the Makefile to cure it"

* tag 'x86-urgent-2025-07-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/sev: Work around broken noinstr on GCC

7 weeks agoMerge tag 'locking-urgent-2025-07-20' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 20 Jul 2025 18:22:05 +0000 (11:22 -0700)] 
Merge tag 'locking-urgent-2025-07-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking fix from Thomas Gleixner:
 "A single fix for the futex selftest code to make 32-bit user space
  work correctly on 64-bit kernels.

  sys_futex_wait() expects a struct __kernel_timespec for the timeout,
  but the selftest uses struct timespec, which is the original 32-bit
  non 2038 compliant variant.

  Fix it up by converting the callsite supplied timespec to a
  __kernel_timespec and hand that into the syscall"

* tag 'locking-urgent-2025-07-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  selftests/futex: Convert 32-bit timespec to 64-bit version for 32-bit compatibility mode

7 weeks agoMerge tag 'sched-urgent-2025-07-20' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 20 Jul 2025 18:08:51 +0000 (11:08 -0700)] 
Merge tag 'sched-urgent-2025-07-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fix from Thomas Gleixner:
 "A single fix for the scheduler.

  A recent commit changed the runqueue counter nr_uninterruptible to an
  unsigned int. Due to the fact that the counters are not updated on
  migration of a uninterruptble task to a different CPU, these counters
  can exceed INT_MAX.

  The counter is cast to long in the load average calculation, which
  means that the cast expands into negative space resulting in bogus
  load average values.

  Convert it back to unsigned long to fix this.

* tag 'sched-urgent-2025-07-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched: Change nr_uninterruptible type to unsigned long

7 weeks agorust: io: mem: enable IoRequest doc-tests
Danilo Krummrich [Sat, 19 Jul 2025 14:08:16 +0000 (16:08 +0200)] 
rust: io: mem: enable IoRequest doc-tests

When introduced, the IoRequest doc-tests did depend on infrastructure
added in subsequent patches, hence they temporarily had to be disabled.

Now that we have the corresponding platform device infrastructure,
enable them.

Link: https://lore.kernel.org/r/DBG39YMN2TX6.1VR4PEQSI8PSG@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
7 weeks agorust: platform: add resource accessors
Daniel Almeida [Thu, 17 Jul 2025 15:55:24 +0000 (12:55 -0300)] 
rust: platform: add resource accessors

The previous patches have added the abstractions for Resources and the
ability to map them and therefore read and write the underlying memory .

The only thing missing to make this accessible for platform devices is
to provide accessors that return instances of IoRequest<'a>. These
ensure that the resource are valid only for the lifetime of the platform
device, and that the platform device is in the Bound state.

Therefore, add these accessors. Also make it possible to retrieve
resources from platform devices in Rust using either a name or an index.

Acked-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Link: https://lore.kernel.org/r/20250717-topics-tyr-platform_iomem-v15-3-beca780b77e3@collabora.com
[ Remove #[expect(dead_code)] from IoRequest::new() and move SAFETY
  comments right on top of unsafe blocks to avoid clippy warnings for
  some (older) clippy versions. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
7 weeks agorust: io: mem: add a generic iomem abstraction
Daniel Almeida [Thu, 17 Jul 2025 15:55:23 +0000 (12:55 -0300)] 
rust: io: mem: add a generic iomem abstraction

Add a generic iomem abstraction to safely read and write ioremapped
regions. This abstraction requires a previously acquired IoRequest
instance. This makes it so that both the resource and the device match,
or, in other words, that the resource is indeed a valid resource for a
given bound device.

A subsequent patch will add the ability to retrieve IoRequest instances
from platform devices.

The reads and writes are done through IoRaw, and are thus checked either
at compile-time, if the size of the region is known at that point, or at
runtime otherwise.

Non-exclusive access to the underlying memory region is made possible to
cater to cases where overlapped regions are unavoidable.

Acked-by: Miguel Ojeda <ojeda@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Link: https://lore.kernel.org/r/20250717-topics-tyr-platform_iomem-v15-2-beca780b77e3@collabora.com
[ Add #[expect(dead_code)] to avoid a temporary warning, remove
  unnecessary OF_ID_TABLE constants in doc-tests and ignore doc-tests
  for now to avoid a temporary build failure. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
7 weeks agorust: io: add resource abstraction
Daniel Almeida [Thu, 17 Jul 2025 15:55:22 +0000 (12:55 -0300)] 
rust: io: add resource abstraction

In preparation for ioremap support, add a Rust abstraction for struct
resource.

A future commit will introduce the Rust API to ioremap a resource from a
platform device. The current abstraction, therefore, adds only the
minimum API needed to get that done.

Acked-by: Miguel Ojeda <ojeda@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Co-developed-by: Fiona Behrens <me@kloenk.dev>
Signed-off-by: Fiona Behrens <me@kloenk.dev>
Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Link: https://lore.kernel.org/r/20250717-topics-tyr-platform_iomem-v15-1-beca780b77e3@collabora.com
[ Capitalize safety comments and end it with a period. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
7 weeks agorust: list: remove nonexistent generic parameter in link
Miguel Ojeda [Sat, 19 Jul 2025 23:25:00 +0000 (01:25 +0200)] 
rust: list: remove nonexistent generic parameter in link

`ListLinks` does not take a `T` generic parameter, unlike
`ListLinksSelfPtr`.

Thus fix it, which makes it also consistent with the rest of the links
in the file.

Fixes: 40c53294596b ("rust: list: add macro for implementing ListItem")
Reviewed-by: Tamir Duberstein <tamird@gmail.com>
Link: https://lore.kernel.org/r/20250719232500.822313-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
7 weeks agobcachefs: btree_node_scan: don't re-read before initializing found_btree_node
Kent Overstreet [Sun, 20 Jul 2025 00:47:09 +0000 (20:47 -0400)] 
bcachefs: btree_node_scan: don't re-read before initializing found_btree_node

If the btree node is encrypted, this caused us to initialize
found_btree_node from the encrypted header.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
7 weeks agoMerge tag 'hyperv-fixes-signed-20250718' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 20 Jul 2025 16:29:43 +0000 (09:29 -0700)] 
Merge tag 'hyperv-fixes-signed-20250718' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux

Pull hyperv fixes from Wei Liu:

 - Select use CONFIG_SYSFB only if EFI is enabled (Michael Kelley)

 - An assorted set of fixes to remove warnings for missing export.h
   header inclusion (Naman Jain)

 - An assorted set of fixes for when Linux run as the root partition
   for Microsoft Hypervisor (Mukesh Rathor, Nuno Das Neves, Stanislav
   Kinsburskii)

 - Fix the check for HYPERVISOR_CALLBACK_VECTOR (Naman Jain)

 - Fix fcopy tool to handle irregularities with size of ring buffer
   (Naman Jain)

 - Fix incorrect file path conversion in fcopy tool (Yasumasa Suenaga)

* tag 'hyperv-fixes-signed-20250718' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
  tools/hv: fcopy: Fix irregularities with size of ring buffer
  PCI: hv: Use the correct hypercall for unmasking interrupts on nested
  x86/hyperv: Expose hv_map_msi_interrupt()
  Drivers: hv: Use nested hypercall for post message and signal event
  x86/hyperv: Clean up hv_map/unmap_interrupt() return values
  x86/hyperv: Fix usage of cpu_online_mask to get valid cpu
  PCI: hv: Don't load the driver for baremetal root partition
  net: mana: Fix warnings for missing export.h header inclusion
  PCI: hv: Fix warnings for missing export.h header inclusion
  clocksource: hyper-v: Fix warnings for missing export.h header inclusion
  x86/hyperv: Fix warnings for missing export.h header inclusion
  Drivers: hv: Fix warnings for missing export.h header inclusion
  Drivers: hv: Fix the check for HYPERVISOR_CALLBACK_VECTOR
  tools/hv: fcopy: Fix incorrect file path conversion
  Drivers: hv: Select CONFIG_SYSFB only if EFI is enabled

7 weeks agoMerge tag 'usb-6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Sun, 20 Jul 2025 16:21:53 +0000 (09:21 -0700)] 
Merge tag 'usb-6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB / Thunderbolt fixes from Greg KH:
 "Here are some USB and Thunderbolt driver fixes for reported problems
  for 6.16-rc6.  Included in here are:

   - Thunderbolt fixes for some much-reported issues

   - dwc2 driver fixes

   - dwc3 driver fixes

   - new usb-serial driver device ids

   - gadgetfs configfs fix

   - musb driver fix

   - USB hub driver fix

  All of these have been in linux-next for a while with no reported
  problems"

* tag 'usb-6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  usb: hub: Don't try to recover devices lost during warm reset.
  usb: dwc2: gadget: Fix enter to hibernation for UTMI+ PHY
  usb: dwc3: qcom: Don't leave BCR asserted
  USB: serial: option: add Telit Cinterion FE910C04 (ECM) composition
  USB: serial: ftdi_sio: add support for NDI EMGUIDE GEMINI
  usb: gadget: configfs: Fix OOB read on empty string write
  usb: musb: fix gadget state on disconnect
  USB: serial: option: add Foxconn T99W640
  thunderbolt: Fix bit masking in tb_dp_port_set_hops()
  thunderbolt: Fix wake on connect at runtime

7 weeks agoMerge tag 'tty-6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Linus Torvalds [Sun, 20 Jul 2025 16:14:32 +0000 (09:14 -0700)] 
Merge tag 'tty-6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull serial driver fixes from Greg KH:
 "Here are two serial driver fixes for 6.16-rc6 that do:

   - fix for the serial core OF resource leak

   - pch_uart driver fix for a "incorrect variable" issue

  Both of these have been in linux-next for over a week with no reported
  problems"

* tag 'tty-6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  pch_uart: Fix dma_sync_sg_for_device() nents value
  serial: core: fix OF node leak

7 weeks agoMerge tag 'staging-6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
Linus Torvalds [Sun, 20 Jul 2025 16:08:55 +0000 (09:08 -0700)] 
Merge tag 'staging-6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver fixes from Greg KH:
 "Here are some small driver fixes for the vchiq_arm staging driver:

   - reverts of previous changes that turned out to caused problems.

   - change to prevent a resource leak

  All of these have been in linux-next this week with no reported
  problems"

* tag 'staging-6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: vchiq_arm: Make vchiq_shutdown never fail
  Revert "staging: vchiq_arm: Create keep-alive thread during probe"
  Revert "staging: vchiq_arm: Improve initial VCHIQ connect"

7 weeks agoMerge tag 'char-misc-6.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
Linus Torvalds [Sun, 20 Jul 2025 16:03:41 +0000 (09:03 -0700)] 
Merge tag 'char-misc-6.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char / misc / IIO fixes from Greg KH:
 "Here are some char/misc/iio and other driver fixes for 6.16-rc7.
  Included in here are:

   - IIO driver fixes for reported problems

   - Interconnect driver fixes for reported problems

   - nvmem driver fixes

   - bunch of comedi driver fixes for long-term bugs

   - Kconfig dependancy fixes for mux drivers

   - other small driver fixes for reported problems.

  All of these have been in linux-next for a while with no reported
  problems"

* tag 'char-misc-6.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (35 commits)
  nvmem: layouts: u-boot-env: remove crc32 endianness conversion
  misc: amd-sbi: Explicitly clear in/out arg "mb_in_out"
  misc: amd-sbi: Address copy_to/from_user() warning reported in smatch
  misc: amd-sbi: Address potential integer overflow issue reported in smatch
  comedi: comedi_test: Fix possible deletion of uninitialized timers
  comedi: Fix initialization of data for instructions that write to subdevice
  comedi: Fix use of uninitialized data in insn_rw_emulate_bits()
  comedi: das6402: Fix bit shift out of bounds
  comedi: aio_iiro_16: Fix bit shift out of bounds
  comedi: pcl812: Fix bit shift out of bounds
  comedi: das16m1: Fix bit shift out of bounds
  comedi: Fix some signed shift left operations
  comedi: Fail COMEDI_INSNLIST ioctl if n_insns is too large
  nvmem: imx-ocotp: fix MAC address byte length
  MAINTAINERS: add miscdevice Rust abstractions
  mux: mmio: Fix missing CONFIG_REGMAP_MMIO
  iio: dac: ad3530r: Fix incorrect masking for channels 4-7 in powerdown mode
  iio: adc: ad7380: fix adi,gain-milli property parsing
  iio: adc: ad7949: use spi_is_bpw_supported()
  iio: accel: fxls8962af: Fix use after free in fxls8962af_fifo_flush
  ...

7 weeks agoMerge tag 'spi-fix-v6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brooni...
Linus Torvalds [Sun, 20 Jul 2025 15:58:58 +0000 (08:58 -0700)] 
Merge tag 'spi-fix-v6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fix from Mark Brown:
 "A fix adding missing validation that 8 bit I/O mode is actually
  supported for the specific device when attempting to use it.

  Anything that runs into this should already have been having problems,
  enforcing this should just make things safer and more obvious"

* tag 'spi-fix-v6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: Add check for 8-bit transfer with 8 IO mode support

7 weeks agoMerge tag 'regmap-fix-v6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 20 Jul 2025 15:56:40 +0000 (08:56 -0700)] 
Merge tag 'regmap-fix-v6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap

Pull regmap fix from Mark Brown:
 "A fix for a memory leak when we get an error during regmap init for a
  bus that uses free_on_exit to clean up device specific data"

* tag 'regmap-fix-v6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: fix potential memory leak of regmap_bus

7 weeks agoMerge tag 'input-for-v6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 20 Jul 2025 15:53:58 +0000 (08:53 -0700)] 
Merge tag 'input-for-v6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input fix from Dmitry Torokhov:

 - just a small fixup to the xpad driver correcting the recent addition
   of the Acer NGR200 controller

* tag 'input-for-v6.16-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: xpad - set correct controller type for Acer NGR200

7 weeks agoapparmor: fix: accept2 being specifie even when permission table is presnt
John Johansen [Thu, 22 May 2025 20:54:05 +0000 (13:54 -0700)] 
apparmor: fix: accept2 being specifie even when permission table is presnt

The transition to the perms32 permission table dropped the need for
the accept2 table as permissions. However accept2 can be used for
flags and may be present even when the perms32 table is present. So
instead of checking on version, check whether the table is present.

Fixes: 2e12c5f06017 ("apparmor: add additional flags to extended permission.")
Signed-off-by: John Johansen <john.johansen@canonical.com>
7 weeks agoapparmor: transition from a list of rules to a vector of rules
John Johansen [Mon, 17 Feb 2025 09:46:37 +0000 (01:46 -0800)] 
apparmor: transition from a list of rules to a vector of rules

The set of rules on a profile is not dynamically extended, instead
if a new ruleset is needed a new version of the profile is created.
This allows us to use a vector of rules instead of a list, slightly
reducing memory usage and simplifying the code.

Signed-off-by: John Johansen <john.johansen@canonical.com>
7 weeks agoapparmor: fix documentation mismatches in val_mask_to_str and socket functions
Peng Jiang [Mon, 23 Jun 2025 06:41:11 +0000 (14:41 +0800)] 
apparmor: fix documentation mismatches in val_mask_to_str and socket functions

This patch fixes kernel-doc warnings:
1. val_mask_to_str:
- Added missing descriptions for `size` and `table` parameters.
- Removed outdated str_size and chrs references.
2. Socket Functions:
- Makes non-null requirements clear for socket/address args.
- Standardizes return values per kernel conventions.
- Adds Unix domain socket protocol details.

These changes silence doc validation warnings and improve accuracy for
AppArmor LSM docs.

Signed-off-by: Peng Jiang <jiang.peng9@zte.com.cn>
Signed-off-by: John Johansen <john.johansen@canonical.com>
7 weeks agoapparmor: remove redundant perms.allow MAY_EXEC bitflag set
Ryan Lee [Mon, 23 Jun 2025 21:58:00 +0000 (14:58 -0700)] 
apparmor: remove redundant perms.allow MAY_EXEC bitflag set

This section of profile_transition that occurs after x_to_label only
happens if perms.allow already has the MAY_EXEC bit set, so we don't need
to set it again.

Fixes: 16916b17b4f8 ("apparmor: force auditing of conflicting attachment execs from confined")
Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
7 weeks agoapparmor: fix kernel doc warnings for kernel test robot
John Johansen [Fri, 20 Jun 2025 22:05:01 +0000 (15:05 -0700)] 
apparmor: fix kernel doc warnings for kernel test robot

Fix kernel doc warnings for the functions
- apparmor_socket_bind
- apparmor_unix_may_send
- apparmor_unix_stream_connect
- val_mask_to_str

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506070127.B1bc3da4-lkp@intel.com/
Signed-off-by: John Johansen <john.johansen@canonical.com>
7 weeks agoapparmor: Fix unaligned memory accesses in KUnit test
Helge Deller [Sat, 31 May 2025 15:08:22 +0000 (17:08 +0200)] 
apparmor: Fix unaligned memory accesses in KUnit test

The testcase triggers some unnecessary unaligned memory accesses on the
parisc architecture:
  Kernel: unaligned access to 0x12f28e27 in policy_unpack_test_init+0x180/0x374 (iir 0x0cdc1280)
  Kernel: unaligned access to 0x12f28e67 in policy_unpack_test_init+0x270/0x374 (iir 0x64dc00ce)

Use the existing helper functions put_unaligned_le32() and
put_unaligned_le16() to avoid such warnings on architectures which
prefer aligned memory accesses.

Signed-off-by: Helge Deller <deller@gmx.de>
Fixes: 98c0cc48e27e ("apparmor: fix policy_unpack_test on big endian systems")
Signed-off-by: John Johansen <john.johansen@canonical.com>
7 weeks agoapparmor: Fix 8-byte alignment for initial dfa blob streams
Helge Deller [Sat, 31 May 2025 15:08:21 +0000 (17:08 +0200)] 
apparmor: Fix 8-byte alignment for initial dfa blob streams

The dfa blob stream for the aa_dfa_unpack() function is expected to be aligned
on a 8 byte boundary.

The static nulldfa_src[] and stacksplitdfa_src[] arrays store the initial
apparmor dfa blob streams, but since they are declared as an array-of-chars
the compiler and linker will only ensure a "char" (1-byte) alignment.

Add an __aligned(8) annotation to the arrays to tell the linker to always
align them on a 8-byte boundary. This avoids runtime warnings at startup on
alignment-sensitive platforms like parisc such as:

 Kernel: unaligned access to 0x7f2a584a in aa_dfa_unpack+0x124/0x788 (iir 0xca0109f)
 Kernel: unaligned access to 0x7f2a584e in aa_dfa_unpack+0x210/0x788 (iir 0xca8109c)
 Kernel: unaligned access to 0x7f2a586a in aa_dfa_unpack+0x278/0x788 (iir 0xcb01090)

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org
Fixes: 98b824ff8984 ("apparmor: refcount the pdb")
Signed-off-by: John Johansen <john.johansen@canonical.com>
7 weeks agoapparmor: shift uid when mediating af_unix in userns
Gabriel Totev [Wed, 16 Apr 2025 22:42:09 +0000 (18:42 -0400)] 
apparmor: shift uid when mediating af_unix in userns

Avoid unshifted ouids for socket file operations as observed when using
AppArmor profiles in unprivileged containers with LXD or Incus.

For example, root inside container and uid 1000000 outside, with
`owner /root/sock rw,` profile entry for nc:

/root$ nc -lkU sock & nc -U sock
==> dmesg
apparmor="DENIED" operation="connect" class="file"
namespace="root//lxd-podia_<var-snap-lxd-common-lxd>" profile="sockit"
name="/root/sock" pid=3924 comm="nc" requested_mask="wr" denied_mask="wr"
fsuid=1000000 ouid=0 [<== should be 1000000]

Fix by performing uid mapping as per common_perm_cond() in lsm.c

Signed-off-by: Gabriel Totev <gabriel.totev@zetier.com>
Fixes: c05e705812d1 ("apparmor: add fine grained af_unix mediation")
Signed-off-by: John Johansen <john.johansen@canonical.com>
7 weeks agoapparmor: shift ouid when mediating hard links in userns
Gabriel Totev [Wed, 16 Apr 2025 22:42:08 +0000 (18:42 -0400)] 
apparmor: shift ouid when mediating hard links in userns

When using AppArmor profiles inside an unprivileged container,
the link operation observes an unshifted ouid.
(tested with LXD and Incus)

For example, root inside container and uid 1000000 outside, with
`owner /root/link l,` profile entry for ln:

/root$ touch chain && ln chain link
==> dmesg
apparmor="DENIED" operation="link" class="file"
namespace="root//lxd-feet_<var-snap-lxd-common-lxd>" profile="linkit"
name="/root/link" pid=1655 comm="ln" requested_mask="l" denied_mask="l"
fsuid=1000000 ouid=0 [<== should be 1000000] target="/root/chain"

Fix by mapping inode uid of old_dentry in aa_path_link() rather than
using it directly, similarly to how it's mapped in __file_path_perm()
later in the file.

Signed-off-by: Gabriel Totev <gabriel.totev@zetier.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
7 weeks agoapparmor: make sure unix socket labeling is correctly updated.
John Johansen [Fri, 20 Jun 2025 05:11:52 +0000 (22:11 -0700)] 
apparmor: make sure unix socket labeling is correctly updated.

When a unix socket is passed into a different confinement domain make
sure its cached mediation labeling is updated to correctly reflect
which domains are using the socket.

Fixes: c05e705812d1 ("apparmor: add fine grained af_unix mediation")
Signed-off-by: John Johansen <john.johansen@canonical.com>
7 weeks agonet/mlx5: Expose cable_length field in PFCC register
Oren Sidi [Thu, 17 Jul 2025 06:48:15 +0000 (09:48 +0300)] 
net/mlx5: Expose cable_length field in PFCC register

Introduce new "cable_length" field in PFCC register and related fields
to enhance rx buffer configuration management:
1. cable_length: Shifts cable length handling to fw by storing a
   manually entered length from user in PFCC.cable_length
2. lane_rate_oper: In a case where PFCC.cable_length is not supported,
   helps compute a default cable length

Signed-off-by: Oren Sidi <osidi@nvidia.com>
Reviewed-by: Alex Lazar <alazar@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/1752734895-257735-4-git-send-email-tariqt@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
7 weeks agonet/mlx5: Add IFC bits and enums for buf_ownership
Oren Sidi [Thu, 17 Jul 2025 06:48:14 +0000 (09:48 +0300)] 
net/mlx5: Add IFC bits and enums for buf_ownership

Extend structure layouts and defines buf_ownership.
buf_ownership indicates whether the buffer is managed by SW or FW.

Signed-off-by: Oren Sidi <osidi@nvidia.com>
Reviewed-by: Alex Lazar <alazar@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/1752734895-257735-3-git-send-email-tariqt@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
7 weeks agonet/mlx5: Add IFC bits to support RSS for IPSec offload
Jianbo Liu [Thu, 17 Jul 2025 06:48:13 +0000 (09:48 +0300)] 
net/mlx5: Add IFC bits to support RSS for IPSec offload

This adds the capabilities, ipsec_next_header and inner/outer
l4_type_ext fields to support RSS for the decrypted packets.

These fields are specifically for firmware steering. HWS validation
logic is updated to correctly handle the changes, ensuring the
unsupported fields are not set.

Besides, reserved_at_c4 is fixed to reserved_at_d4 to reflect the
accurate offset within the structure.

Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/1752734895-257735-2-git-send-email-tariqt@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
7 weeks agoseq_buf: Introduce KUnit tests
Kees Cook [Thu, 17 Jul 2025 08:52:12 +0000 (01:52 -0700)] 
seq_buf: Introduce KUnit tests

Add KUnit tests for the seq_buf API to ensure its correctness and
prevent future regressions, covering the following functions:
- seq_buf_init()
- DECLARE_SEQ_BUF()
- seq_buf_clear()
- seq_buf_puts()
- seq_buf_putc()
- seq_buf_printf()
- seq_buf_get_buf()
- seq_buf_commit()

$ tools/testing/kunit/kunit.py run seq_buf
=================== seq_buf (9 subtests) ===================
[PASSED] seq_buf_init_test
[PASSED] seq_buf_declare_test
[PASSED] seq_buf_clear_test
[PASSED] seq_buf_puts_test
[PASSED] seq_buf_puts_overflow_test
[PASSED] seq_buf_putc_test
[PASSED] seq_buf_printf_test
[PASSED] seq_buf_printf_overflow_test
[PASSED] seq_buf_get_buf_commit_test
===================== [PASSED] seq_buf =====================

Link: https://lore.kernel.org/r/20250717085156.work.363-kees@kernel.org
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Kees Cook <kees@kernel.org>
7 weeks agoInput: xpad - set correct controller type for Acer NGR200
Nilton Perim Neto [Sun, 20 Jul 2025 05:07:36 +0000 (22:07 -0700)] 
Input: xpad - set correct controller type for Acer NGR200

The controller should have been set as XTYPE_XBOX360 and not XTYPE_XBOX.
Also the entry is in the wrong place. Fix it.

Reported-by: Vicki Pfau <vi@endrift.com>
Signed-off-by: Nilton Perim Neto <niltonperimneto@gmail.com>
Link: https://lore.kernel.org/r/20250708033126.26216-2-niltonperimneto@gmail.com
Fixes: 22c69d786ef8 ("Input: xpad - support Acer NGR 200 Controller")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 weeks agodt-bindings: clock: qcom,sm4450-dispcc: Reference qcom,gcc.yaml
Satya Priya Kakitapalli [Thu, 17 Jul 2025 06:38:36 +0000 (12:08 +0530)] 
dt-bindings: clock: qcom,sm4450-dispcc: Reference qcom,gcc.yaml

Reference the common qcom,gcc.yaml schema to unify the common
parts of the binding.

Suggested-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250717-gcc-ref-fixes-v2-4-a2a571d2be28@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
7 weeks agodt-bindings: clock: qcom,sm4450-camcc: Reference qcom,gcc.yaml
Satya Priya Kakitapalli [Thu, 17 Jul 2025 06:38:35 +0000 (12:08 +0530)] 
dt-bindings: clock: qcom,sm4450-camcc: Reference qcom,gcc.yaml

Reference the common qcom,gcc.yaml schema to unify the common
parts of the binding.

Suggested-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250717-gcc-ref-fixes-v2-3-a2a571d2be28@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
7 weeks agodt-bindings: clock: qcom,mmcc: Reference qcom,gcc.yaml
Satya Priya Kakitapalli [Thu, 17 Jul 2025 06:38:34 +0000 (12:08 +0530)] 
dt-bindings: clock: qcom,mmcc: Reference qcom,gcc.yaml

Reference the common qcom,gcc.yaml schema to unify the common
parts of the binding.

Suggested-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250717-gcc-ref-fixes-v2-2-a2a571d2be28@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
7 weeks agodt-bindings: clock: qcom,sm8150-camcc: Reference qcom,gcc.yaml
Satya Priya Kakitapalli [Thu, 17 Jul 2025 06:38:33 +0000 (12:08 +0530)] 
dt-bindings: clock: qcom,sm8150-camcc: Reference qcom,gcc.yaml

Reference the common qcom,gcc.yaml schema to unify the common
parts of the binding.

Suggested-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250717-gcc-ref-fixes-v2-1-a2a571d2be28@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
7 weeks agodt-bindings: clock: qcom: Remove double colon from description
Luca Weiss [Thu, 17 Jul 2025 06:54:44 +0000 (08:54 +0200)] 
dt-bindings: clock: qcom: Remove double colon from description

No double colon is necessary in the description. Fix it for all bindings
so future bindings won't have the same copy-paste mistake.

Reported-by: Rob Herring <robh@kernel.org>
Closes: https://lore.kernel.org/lkml/20250625150458.GA1182597-robh@kernel.org/
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250717-bindings-double-colon-v1-1-c04abc180fcd@fairphone.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
7 weeks agokasan: use vmalloc_dump_obj() for vmalloc error reports
Marco Elver [Wed, 16 Jul 2025 15:23:28 +0000 (17:23 +0200)] 
kasan: use vmalloc_dump_obj() for vmalloc error reports

Since 6ee9b3d84775 ("kasan: remove kasan_find_vm_area() to prevent
possible deadlock"), more detailed info about the vmalloc mapping and the
origin was dropped due to potential deadlocks.

While fixing the deadlock is necessary, that patch was too quick in
killing an otherwise useful feature, and did no due-diligence in
understanding if an alternative option is available.

Restore printing more helpful vmalloc allocation info in KASAN reports
with the help of vmalloc_dump_obj().  Example report:

| BUG: KASAN: vmalloc-out-of-bounds in vmalloc_oob+0x4c9/0x610
| Read of size 1 at addr ffffc900002fd7f3 by task kunit_try_catch/493
|
| CPU: [...]
| Call Trace:
|  <TASK>
|  dump_stack_lvl+0xa8/0xf0
|  print_report+0x17e/0x810
|  kasan_report+0x155/0x190
|  vmalloc_oob+0x4c9/0x610
|  [...]
|
| The buggy address belongs to a 1-page vmalloc region starting at 0xffffc900002fd000 allocated at vmalloc_oob+0x36/0x610
| The buggy address belongs to the physical page:
| page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x126364
| flags: 0x200000000000000(node=0|zone=2)
| raw: 0200000000000000 0000000000000000 dead000000000122 0000000000000000
| raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
| page dumped because: kasan: bad access detected
|
| [..]

Link: https://lkml.kernel.org/r/20250716152448.3877201-1-elver@google.com
Fixes: 6ee9b3d84775 ("kasan: remove kasan_find_vm_area() to prevent possible deadlock")
Signed-off-by: Marco Elver <elver@google.com>
Suggested-by: Uladzislau Rezki <urezki@gmail.com>
Acked-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Yeoreum Yun <yeoreum.yun@arm.com>
Cc: Yunseong Kim <ysk@kzalloc.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
7 weeks agomm/ksm: fix -Wsometimes-uninitialized from clang-21 in advisor_mode_show()
Nathan Chancellor [Tue, 15 Jul 2025 19:56:16 +0000 (12:56 -0700)] 
mm/ksm: fix -Wsometimes-uninitialized from clang-21 in advisor_mode_show()

After a recent change in clang to expose uninitialized warnings from const
variables [1], there is a false positive warning from the if statement in
advisor_mode_show().

  mm/ksm.c:3687:11: error: variable 'output' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
   3687 |         else if (ksm_advisor == KSM_ADVISOR_SCAN_TIME)
        |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  mm/ksm.c:3690:33: note: uninitialized use occurs here
   3690 |         return sysfs_emit(buf, "%s\n", output);
        |                                        ^~~~~~

Rewrite the if statement to implicitly make KSM_ADVISOR_NONE the else
branch so that it is obvious to the compiler that ksm_advisor can only be
KSM_ADVISOR_NONE or KSM_ADVISOR_SCAN_TIME due to the assignments in
advisor_mode_store().

Link: https://lkml.kernel.org/r/20250715-ksm-fix-clang-21-uninit-warning-v1-1-f443feb4bfc4@kernel.org
Fixes: 66790e9a735b ("mm/ksm: add sysfs knobs for advisor")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://github.com/ClangBuiltLinux/linux/issues/2100
Link: https://github.com/llvm/llvm-project/commit/2464313eef01c5b1edf0eccf57a32cdee01472c7
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Stefan Roesch <shr@devkernel.io>
Cc: xu xin <xu.xin16@zte.com.cn>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
7 weeks agomm: update MAINTAINERS entry for HMM
Jason Gunthorpe [Fri, 11 Jul 2025 22:34:44 +0000 (19:34 -0300)] 
mm: update MAINTAINERS entry for HMM

Jérôme has moved on from RH and has not been looking at HMM patches for
some time. I've made the most changes to the core code in the recent
period and Leon is now working on the HMM side from the RDMA ODP.

Link: https://lkml.kernel.org/r/0-v1-a1df5219c7a3+1d981-hmm_maintainers_jgg@nvidia.com
Closes: https://lore.kernel.org/all/39d43309-9f34-48bc-a9ad-108c607ba175@samsung.com/
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Leon Romanovsky <leon@kernel.org>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
7 weeks agonilfs2: reject invalid file types when reading inodes
Ryusuke Konishi [Thu, 10 Jul 2025 13:49:08 +0000 (22:49 +0900)] 
nilfs2: reject invalid file types when reading inodes

To prevent inodes with invalid file types from tripping through the vfs
and causing malfunctions or assertion failures, add a missing sanity check
when reading an inode from a block device.  If the file type is not valid,
treat it as a filesystem error.

Link: https://lkml.kernel.org/r/20250710134952.29862-1-konishi.ryusuke@gmail.com
Fixes: 05fe58fdc10d ("nilfs2: inode operations")
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Reported-by: syzbot+895c23f6917da440ed0d@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?extid=895c23f6917da440ed0d
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
7 weeks agoselftests/mm: fix split_huge_page_test for folio_split() tests
Zi Yan [Wed, 9 Jul 2025 01:27:59 +0000 (21:27 -0400)] 
selftests/mm: fix split_huge_page_test for folio_split() tests

PID_FMT does not have an offset field, so folio_split() tests are not
performed.  Add PID_FMT_OFFSET with an offset field and use it to perform
folio_split() tests.

Link: https://lkml.kernel.org/r/20250709012800.3225727-1-ziy@nvidia.com
Fixes: 80a5c494c89f ("selftests/mm: add tests for folio_split(), buddy allocator like split")
Signed-off-by: Zi Yan <ziy@nvidia.com>
Tested-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Donet Tom <donettom@linux.ibm.com>
Tested-by : Donet Tom <donettom@linux.ibm.com>
Cc: Barry Song <baohua@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Mariano Pache <npache@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
7 weeks agomailmap: add entry for Senozhatsky
Sergey Senozhatsky [Mon, 7 Jul 2025 07:52:13 +0000 (16:52 +0900)] 
mailmap: add entry for Senozhatsky

Consolidate and map all addresses to a single one.

Link: https://lkml.kernel.org/r/20250707075243.858895-1-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
7 weeks agomm/zsmalloc: do not pass __GFP_MOVABLE if CONFIG_COMPACTION=n
Harry Yoo [Fri, 4 Jul 2025 10:30:53 +0000 (19:30 +0900)] 
mm/zsmalloc: do not pass __GFP_MOVABLE if CONFIG_COMPACTION=n

Commit 48b4800a1c6a ("zsmalloc: page migration support") added support for
migrating zsmalloc pages using the movable_operations migration framework.
However, the commit did not take into account that zsmalloc supports
migration only when CONFIG_COMPACTION is enabled.  Tracing shows that
zsmalloc was still passing the __GFP_MOVABLE flag even when compaction is
not supported.

This can result in unmovable pages being allocated from movable page
blocks (even without stealing page blocks), ZONE_MOVABLE and CMA area.

Possible user visible effects:
- Some ZONE_MOVABLE memory can be not actually movable
- CMA allocation can fail because of this
- Increased memory fragmentation due to ignoring the page mobility
  grouping feature
I'm not really sure who uses kernels without compaction support, though :(

To fix this, clear the __GFP_MOVABLE flag when
!IS_ENABLED(CONFIG_COMPACTION).

Link: https://lkml.kernel.org/r/20250704103053.6913-1-harry.yoo@oracle.com
Fixes: 48b4800a1c6a ("zsmalloc: page migration support")
Signed-off-by: Harry Yoo <harry.yoo@oracle.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>