summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
8 daysASoC: codecs: wsa884x: disable runtime PM on unbindSrinivas Kandagatla
Probe enables runtime PM but nothing disables it on unbind. The pending autosuspend then runs wsa884x_runtime_suspend() after the devm-managed regmap is freed, and dereferences NULL: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000020 pc : regcache_cache_only+0x18/0x80 lr : wsa884x_runtime_suspend+0x24/0x40 [snd_soc_wsa884x] Use devm_pm_runtime_enable() so runtime PM is disabled before the regmap is freed. Fixes: aa21a7d4f68a ("ASoC: codecs: wsa884x: Add WSA884x family of speakers") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20261023171316.819857-5-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysASoC: codecs: wsa883x: Accept temperatures across the full trim rangeSrinivas Kandagatla
wsa883x_get_temp() rejects any reading outside 5..45 degC with -EAGAIN, so a speaker that has been playing, or sits in a warm chassis, becomes unreadable above 45 degC. Bound the check by the -10..150 degC two-point trim range instead, and use inclusive comparisons, as in_range() excludes the upper bound. Fixes: a02c42d41af7 ("ASoC: codecs: wsa883x: Implement temperature reading and hwmon") Cc: stable@vger.kernel.org Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20261023171316.819857-4-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysASoC: codecs: wsa884x: Accept temperatures across the full trim rangeSrinivas Kandagatla
wsa884x_get_temp() rejects any reading outside 5..45 degC with -EAGAIN. A speaker that has been playing, or sits in a warm laptop, easily runs above 45 degC, so its temperature becomes unreadable when it matters. The check only needs to drop bogus conversions, such as the all-zero reading before the PA is first enabled. Bound it by the -10..150 degC two-point trim range instead. Fixes: 6b99dc62d940 ("ASoC: codecs: wsa884x: Implement temperature reading and hwmon") Cc: stable@vger.kernel.org Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20261023171316.819857-3-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysASoC: qcom: audioreach: fix module cfg blob size handlingRavi Hothi
audioreach_get_module_priv_data() passes mod_array->size, a byte count, as the element count of the __le32 data[] flex array. The allocation and the copy are four times too large, and the memcpy() can read past the end of the topology firmware buffer. The size is also never checked against the private data it must lie within, and a zero size makes the loop spin forever. Convert the size to a word count, bound the blob by the remaining private data and reject a zero size. Also check the returned pointer before storing it in mod->data, as an error pointer there is dereferenced when the graph is opened. Fixes: c7ed4c2debfd ("ASoC: qcom: audioreach: add support for static calibration") Cc: stable@vger.kernel.org Signed-off-by: Ravi Hothi <ravi.hothi@oss.qualcomm.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20261023171316.819857-2-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysASoC: Intel: soc-acpi-intel-arl-match: add newMark Brown
Bard Liao <yung-chuan.liao@linux.intel.com> says: Add rt712 and rt713 + dual rt1320 configurations. Link: https://patch.msgid.link/20261002011532.3468261-1-yung-chuan.liao@linux.intel.com
8 daysASoC: Intel: soc-acpi-intel-arl-match: Add RT713 + dual RT1320 supportJJ Gault
Add a SoundWire machine-driver match entry for boards with an RT713 (SDCA "VB" jack/dmic variant) on link 0 and two RT1320 speaker amps sharing link 2 (distinguished by unique_id 0/1, left/right). This exact codec pairing is already supported on Panther Lake (ptl_sdw_rt713_vb_l2_rt1320_l13) and Lunar Lake (lnl_sdw_rt713_vb_l2_rt1320_l13); Arrow Lake was missing the corresponding entry, so affected boards fell back to the generic skl_hda_dsp_generic driver and only exposed HDMI outputs. Confirmed on an MSI Raider 16 Max HX B2WI (MS-2651): the kernel now correctly identifies the hardware and no longer falls back to the generic HDA driver. No dedicated topology has been built for this link0/link2 layout yet, so sof_tplg_filename is set to a placeholder ("sof-arl-dummy.tplg") rather than pointing at an existing but unrelated topology, per review feedback. Signed-off-by: JJ Gault <jgault87@gmail.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://patch.msgid.link/20261002011532.3468261-3-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysASoC: soc-acpi-intel-arl-match: add rt712 on link 0 configBard Liao
Add rt712 on link 0 configuration on ARL platform. Export all supported endpoints and the endpoint will be skipped if it is not listed in the SDCA DisCo table. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Tested-by: Patrick Daether <daether@pd-digital.de> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://patch.msgid.link/20261002011532.3468261-2-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysthermal: sysfs: Fix indentation in create_s32_tzp_attr()Thorsten Blum
Indent the show callback consistently with the store callback and use an early return if the thermal zone parameters are not available. Signed-off-by: Thorsten Blum <blum@kernel.org> Link: https://patch.msgid.link/20261003000011.58045-3-blum@kernel.org Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 daysASoC: qcom: q6apm: Fix shared memory unmapMark Brown
Shawn Guo <shengchao.guo@oss.qualcomm.com> says: Since the early buffer mapping, q6apm maps a front-end's DSP buffers once in pcm_new() and unmaps them in pcm_free(). The unmap side has a few problems, which show up when the sound card is unbound and bound again, e.g. by unbinding and binding any codec on the card: - The card core removes the components before it frees the PCMs, so the topology and its graph info are gone by the time pcm_free() tries to unmap. The unmap is silently skipped, the DSP keeps the old mapping, and the next bind fails to create the PCM: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x0100100c cmd snd-sc8280xp sound: ASoC: can't create pcm MultiMedia1 Playback :-22 - Once unmap is actually sent, every command stalls for five seconds, because the response handler matches on the wrong opcode: qcom-apm gprsvc:service:2:1: CMD timeout for [100100d] opcode - Unmapping the position buffer clears the circular buffer's handle instead of its own. Patch 1 fixes the unmap response handling, patch 2 makes the position buffer unmap clear its own handle, and patch 3 moves the unmap to the APM component's remove callback, before the topology is unloaded. Patches 1 and 2 go first so that patch 3 does not introduce the five second stalls. Tested on Qualcomm Ride board by unbinding and binding the PCM1681 codec. echo 0-004c > /sys/bus/i2c/drivers/pcm1681/unbind echo 0-004c > /sys/bus/i2c/drivers/pcm1681/bind Link: https://patch.msgid.link/20261021041044.2080369-1-shengchao.guo@oss.qualcomm.com
8 daysASoC: qcom: q6apm: Unmap DSP buffers before removing the topologyShawn Guo
Since buffers are mapped once in pcm_new() and unmapped in pcm_free(), the unmap relies on the graph info still being registered. During card teardown, however, soc_cleanup_card_resources() removes the components before it frees the PCM runtimes. q6apm-audio's remove callback unloads the topology, which frees every audioreach_graph_info, so by the time q6apm_dai_pcm_free() runs the idr lookup fails and the unmap silently returns -ENODEV. The DSP keeps the old mapping. When the card is bound again, for example after unbinding and binding any codec on it, pcm_new() maps the same buffer once more, the DSP rejects it and the front-end PCM is not created: qcom-apm gprsvc:service:2:1: Error (1) Processing 0x0100100c cmd qcom-apm gprsvc:service:2:1: DSP returned error[100100c] 1 q6apm-dai ...: Audio Start: Buffer Allocation failed rc = -22 snd-sc8280xp sound: ASoC: can't create pcm MultiMedia1 Playback :-22 Release the circular and position buffer mappings of all graphs in q6apm_audio_remove() while the graph info still exists. The unmap helper now takes the q6apm instance directly, since it is called from the APM component rather than from a q6apm-dai child device. Fixes: 8ea6e25c8536 ("ASoC: qcom: q6apm: Add support for early buffer mapping on DSP") Cc: stable@vger.kernel.org Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Signed-off-by: Shawn Guo <shengchao.guo@oss.qualcomm.com> Link: https://patch.msgid.link/20261021041044.2080369-4-shengchao.guo@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysASoC: qcom: q6apm: Clear the right handle on pos buffer unmapShawn Guo
Push/pull graphs map two shared-memory regions per graph, the circular buffer and the position buffer, and keep a separate DSP handle for each. The map path tags its token with APM_MMAP_TOKEN_MAP_TYPE_POS_BUF so the response lands in the right handle, but the unmap path sends a bare graph ID and the response handler always clears mem_map_handle. Unmapping the position buffer therefore wipes the circular buffer's handle and leaves pos_buf_mem_map_handle set. A subsequent unmap of the circular buffer is skipped, leaking that DSP mapping, and a remap of the position buffer is skipped because the stale handle looks valid. Tag the unmap token the same way as the map token and decode it in the response handler to clear the matching handle. Fixes: 7c1ac23b178a ("ASoC: qcom: audioreach: Add support for shared memory push/pull modules") Cc: stable@vger.kernel.org Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Signed-off-by: Shawn Guo <shengchao.guo@oss.qualcomm.com> Link: https://patch.msgid.link/20261021041044.2080369-3-shengchao.guo@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysASoC: qcom: q6apm: Fix unmap regions response handlingShawn Guo
The DSP acknowledges APM_CMD_SHARED_MEM_UNMAP_REGIONS with a GPR_BASIC_RSP_RESULT packet whose payload carries the acknowledged opcode and the status. apm_callback() stores hdr->opcode, i.e. GPR_BASIC_RSP_RESULT itself, as the result opcode, so audioreach_send_cmd_sync(), which waits for 0x0100100d, never sees a match and gives up after five seconds even though the DSP has already processed the command: qcom-apm gprsvc:service:2:1: CMD timeout for [100100d] opcode Each mapped graph costs a five second stall on unmap, and the forced status of 0 also hides real DSP failures from the caller. Record the opcode and status from the response payload, like the other basic-result commands do, and only drop the cached mapping handle when the DSP reports success. Fixes: 8ea6e25c8536 ("ASoC: qcom: q6apm: Add support for early buffer mapping on DSP") Cc: stable@vger.kernel.org Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Signed-off-by: Shawn Guo <shengchao.guo@oss.qualcomm.com> Link: https://patch.msgid.link/20261021041044.2080369-2-shengchao.guo@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysthermal: Fix CPU mask truncation in power limit trace eventHungyu Lin
num_possible_cpus() counts CPUs, but CPU IDs need not be contiguous. Using it to size the thermal_power_cpu_limit bitmap can omit CPUs with higher IDs. For example, possible CPUs 0 and 64 produce an eight-byte bitmap on a 64-bit system, dropping CPU 64. Use nr_cpumask_bits for both sizing and copying the bitmap. Fixes: 6828a4711f99 ("thermal: add trace events to the power allocator governor") Signed-off-by: Hungyu Lin <dennylin0707@gmail.com> Link: https://patch.msgid.link/20261023060724.5691-1-dennylin0707@gmail.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 daysPM: suspend: Do not call suspend_ops->begin()/end() for s2idleOvidiu Panait
Commit 7602c0ec0bbf ("firmware: psci: Set pm_set_resume/suspend_via_firmware() for SYSTEM_SUSPEND") made psci_system_suspend_begin() call pm_set_suspend_via_firmware(), so that device drivers can prepare for the possible removal of the power before PSCI SYSTEM_SUSPEND. Since then, on platforms where PSCI firmware supports SYSTEM_SUSPEND, pm_suspend_via_firmware() returns true during both s2ram and s2idle. This is inconsistent, since SYSTEM_SUSPEND is only invoked for s2ram. This was observed while investigating PCI-related suspend/resume issues on Renesas platforms (RZ/G3S, RZ/V2H), and was traced to platform_suspend_begin() falling back to suspend_ops->begin() (PSCI in this case) when there is no s2idle_ops->begin() callback: platform_suspend_begin(PM_SUSPEND_TO_IDLE) suspend_ops->begin() psci_system_suspend_begin() pm_set_suspend_via_firmware() platform_resume_end() falls back to suspend_ops->end() in the same way. Since s2idle has its own set of callbacks in s2idle_ops, make platform_suspend_begin() and platform_resume_end() only invoke those for s2idle, like the other platform_*() helpers do. Fixes: 7602c0ec0bbf ("firmware: psci: Set pm_set_resume/suspend_via_firmware() for SYSTEM_SUSPEND") Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com> Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Link: https://patch.msgid.link/20261005111157.17256-1-ovidiu.panait.rb@renesas.com [ rjw: Added Fixes: tag ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 daysMerge tag 'backlight-next-7.4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight updates from Lee Jones: "Improvements & Fixes: - Qualcomm WLED: Fix a NULL pointer dereference in `wled_remove()` by setting platform driver data in `wled_probe()` - Qualcomm WLED: Fix the WLED3 brightness register stride to prevent consecutive string writes from overlapping - Qualcomm WLED: Read back the hardware-programmed brightness at probe, expose it via `get_brightness()`, and prevent unbalanced OVP IRQ enabling - TI LM3630A: Cancel delayed work synchronously after freeing the IRQ and before destroying the workqueue in `lm3630a_remove()` Cleanups & Refactoring: - Ilitek ILI9320 / Kinetic KTD253: Fix spelling typos in comments" * tag 'backlight-next-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: qcom-wled: Read back the programmed brightness at probe backlight: qcom-wled: Fix unbalanced OVP IRQ enable at probe backlight: qcom-wled: Fix WLED3 brightness register stride backlight: qcom-wled: Fix NULL pointer dereference in wled_remove() backlight: lm3630a: Cancel delayed work before destroying workqueue backlight: ili9320/ktd253: Fix typos in comments
8 daysselftests/thermal: allow cross builds of the Intel testsSasha Levin
The power_floor and workload_hint Makefiles build nothing when CROSS_COMPILE is set, even for an x86 target, and they include lib.mk only on x86. Other architectures therefore have no install or emit_tests rules for these suites, and their installation fails with a missing target. Select the x86 tests from the target ARCH when it is given and from the host's SUBARCH otherwise, and include lib.mk unconditionally so that the suites install and emit an empty runlist on other architectures. Use a private ARCH_PROCESSED instead of the ARCH override added by commit 5a1292137e89 ("selftests: fix ARCH normalization to handle command-line argument"): the override changed the value lib.mk uses to pick the clang target, whereas leaving ARCH unset lets lib.mk use the compiler's native triple. A command-line ARCH such as x86_64 is still normalized for the selection, while an ARCH spelling that lib.mk does not know, such as i686 with LLVM=1, is rejected as in other selftests. Fixes: 27801542b2b8 ("selftests/thermel/intel: Add test to read workload hint") Fixes: d4d27e5a1a88 ("selftests/thermel/intel: Add test to read power floor status") Signed-off-by: Sasha Levin <sashal@kernel.org> Link: https://patch.msgid.link/20261014200127.1363472-4-sashal@kernel.org Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 daysintel_idle: Adjust state names and descriptions for _LPI statesRafael J. Wysocki
The value of the _LPI "State Name" field is used as the description of the given idle state (that is, the value of its "desc" attribute in sysfs) which is not consistent with idle state descriptions used when the idle state information comes from an ACPI _CST object. To rectify that, use the _LPI "State Name" field value as the value of the "name" sysfs attribute of a given idle state and use the MWAIT hint value from the _LPI register address value to derive the value of its "desc" sysfs attribute in analogy with the _CST case. Fixes: abc5c103c66d ("intel_idle: Add ACPI _LPI support") Tested-by: Len Brown <len.brown@intel.com> Cc: 7.3+ <stable@vger.kernel.org> # 7.3+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> [ rjw: Adjusted scnprintf() format string, tweaked changelog ] Link: https://patch.msgid.link/6061409.DvuYhMxLoT@rafael.j.wysocki Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 daysMerge tag 'leds-next-7.4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds Pull LED updates from Lee Jones: "New Support & Features: - Core: Add `led_trigger_notify_hw_control_changed()` to allow drivers to notify the core of autonomous hardware control transitions - Core: Add the `hw_offloaded()` trigger callback and `trigger_may_offload_to_hw` sysfs attribute to expose hardware-offloaded triggers - Netdev Trigger: Implement the `hw_offloaded()` callback to report hardware control state to the LED core - Analog Devices LTC3208: Add support for the LTC3208 7-channel multi-display I2C LED driver - ChromeOS EC: Implement the `hw_offloaded()` callback for the `chromeos-auto` trigger - CZ.NIC Turris Omnia: Implement the `hw_offloaded()` callback and declare `omnia-mcu` as a hardware control trigger - STMicroelectronics ST1202: Add hardware-accelerated blink support via `blink_set()` Improvements & Fixes: - Class: Always hold the `led_access` mutex in `brightness_show()` to avoid exposing transient registration states - Class: Deactivate active hardware control triggers when writing to the `brightness` sysfs attribute - Core: Enforce strict validation in `led_trigger_is_hw_controlled()` and warn on legacy fallback paths - Flash Class: Initialize the fault variable in `flash_fault_show()` to prevent undefined behavior when callbacks perform bitwise ORs - Kinetic KTD2692: Pass the driver context directly to `regulator_disable_action()` to prevent a NULL pointer dereference during error unwinding - Maxim MAX77705: Use `fwnode_for_each_child_node_scoped()` in `max77705_add_led()` to prevent child node reference leaks on error paths - NXP PCA9532: Check the return value of `i2c_smbus_read_byte_data()` in `pca9532_getled()` to avoid integer underflow on read errors - Qualcomm WLED: Fix a NULL pointer dereference in `wled_remove()` by setting platform driver data in `wled_probe()` - Qualcomm WLED: Fix the WLED3 brightness register stride to prevent consecutive string writes from overlapping - Qualcomm WLED: Read back the hardware-programmed brightness at probe, expose it via `get_brightness()`, and prevent unbalanced OVP IRQ enabling - STMicroelectronics ST1202: Clear unused PWM pattern slots in `pattern_set()` and `blink_set()` to prevent unintended output when sharing the global sequencer - STMicroelectronics ST1202: Program and cap the channel current according to `max_brightness` across brightness, blink, and hardware pattern modes, and scale pattern brightness to the 12-bit PWM range - STMicroelectronics ST1202: Retain a reference to each child LED firmware node for the lifetime of the device - STMicroelectronics ST1202: Use only the blocking `brightness_set_blocking()` callback to avoid sleeping in atomic context during I2C transfers - TI LM3692x: Check the final register write in `lm3692x_leds_enable()` to prevent regulator/GPIO leaks and an inconsistent enabled state - TI LP8860: Fix a `device_node` reference leak in `lp8860_probe()` using `__free(device_node)` Cleanups & Refactoring: - Core: Move `led_trigger_is_hw_controlled()` and `led_trigger_group` from `led-class.c` into `led-triggers.c` - Core: Replace conditional `set_bit()`/`clear_bit()` patterns with `assign_bit()` and `__assign_bit()` - Flash Class: Simplify `flash_fault_show()` using `sysfs_emit_at()` and omit the trailing space - Maintainers: Add Griffin Kroah-Hartman as an LED subsystem reviewer - Intel SS4200: Fix a spelling typo in a comment - ISSI IS31FL32xx: Convert DT-specific parsing helpers to generic device and fwnode property APIs - NXP PCA955x: Drop redundant intermediate platform data and allocate the LED array using a flexible array member - Qualcomm LPG: Convert LED and channel parsing to fwnode APIs and avoid leaving `default_trigger` uninitialized - Skyworks AAT1290: Use `ARRAY_SIZE()` when allocating `mm_current_scale` to match the target pointer type for type-aware allocators - STMicroelectronics ST1202: Introduce a `st1202_iled_max()` helper to unify channel current ceiling calculations - STMicroelectronics ST1202: Standardize variable and macro naming, fix helper spelling, and use `u8` consistently instead of `uint8_t` - Syscon: Convert from OF-specific property helpers to the generic device property and fwnode APIs Device Tree Binding Updates: - Core: Allow PHY RX triggers (`phy[0-9]+rx`) in `linux,default-trigger` - Core: Standardize example indentation across multiple LED and backlight binding schemas - Analog Devices LTC3208: Document the LTC3208 multi-display LED driver - LaCie netxbig: Convert LED bindings to DT schema - Motorola CPCAP: Convert LED bindings to DT schemaLEDs for v7.4" * tag 'leds-next-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds: (49 commits) dt-bindings: leds: lacie,netxbig-leds: Convert to DT schema leds: pca955x: Drop platform data and allocate LEDs with the device dt-bindings: leds: Use consistent indentation in the example backlight: qcom-wled: Read back the programmed brightness at probe backlight: qcom-wled: Fix unbalanced OVP IRQ enable at probe backlight: qcom-wled: Fix WLED3 brightness register stride backlight: qcom-wled: Fix NULL pointer dereference in wled_remove() dt-bindings: leds: Allow PHY RX triggers MAINTAINERS: Add myself as a LED SUBSYSTEM reviewer leds: trigger: Add led_trigger_notify_hw_control_changed() interface leds: trigger: Enforce strict checks in led_trigger_is_hw_controlled() leds: trigger: netdev: Implement hw_offloaded() callback leds: turris-omnia: Implement hw_offloaded() trigger callback and declare hw_control_trigger leds: cros_ec: Implement hw_offloaded() trigger callback leds: trigger: Add hw_offloaded() callback and provide trigger_may_offload_to_hw attribute leds: trigger: Move led_trigger_group to the right place leds: class: Remove hardware control trigger when writing brightness leds: trigger: Move led_trigger_is_hw_controlled() to the right place leds: class: Always protect brightness_show() with led_access dt-bindings: leds: leds-cpcap: Convert to DT schema ...
8 daysuaccess: fix some erroneous kerneldoc commentsJonathan Corbet
Several of the comments in include/linux/uaccess.h generate kerneldoc warnings due to the use of "/**" markers on non-kerneldoc comments and unmarked literal blocks. Bring these digressions into form and eliminate a number of docs-build warnings. No changes to code or documentation content. Reviewed-by: SJ Park <sj@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <87se1ww4ld.fsf@trenco.lwn.net>
8 daysMerge tag 'mfd-next-7.4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Support & Features: - Cirrus Logic CS42L43: Add support for the CS42L44 variant - Khadas MCU: Add support for the VIM4 MCU variant along with per-variant fan duty-cycle levels and optional fan supply regulator support - Maxim MAX77705: Add support for the PASS2 hardware revision - MediaTek MT6397: Add AUXADC sub-device support for MT6397 - Motorola CPCAP: Support per-board sub-device compositions and add the Tegra20 Mot composition - ROHM BD73800: Add support for the BD73800 PMIC core, regulator, RTC, clock gate, and GPIO sub-devices - TI LM3533: Add VIN regulator supply support, configure initial backlight mapping mode from Device Tree, and implement the `backlight_scale` property - X-Powers AC200: Add support for the AC200 I2C mixed-signal companion IC Improvements & Fixes: - Cirrus Logic CS42L43: Synchronize SoundWire enumeration work in `remove()` before devres cleanup begins - Dialog DA903x: Manage IRQ work cancellation and sub-device removal via devres to prevent use-after-free during teardown - Dialog DA9150: Balance `enable_irq_wake()` with `disable_irq_wake()` during probe failure and driver removal - Intel LPSS: Add DMI quirks for Dell Latitude 5285 and 7275 to ignore ACPI resource conflicts on the I2C4 controller - Intel Quark I2C/GPIO: Manage the fixed-rate clock and its clkdev lookup with devres to fix a resource leak on unbind - Maxim MAX77705: Select `REGMAP_I2C` and `REGMAP_IRQ` in Kconfig to fix build errors - Qualcomm WCD934x: Initialize the parent DMA mask to suppress "DMA mask not set" warnings on child devices - Qualcomm WCD934x: Pass the valid device pointer to `dev_err_probe()` on IRQ lookup failure to avoid a NULL pointer dereference - Rockchip RK8xx: Register the poweroff handler in the atomic `SYS_OFF_MODE_POWER_OFF` phase so polling I2C transfers complete during shutdown - ST-Ericsson AB8500: Use `devm_mfd_add_devices()` to prevent leaking child devices on probe failure - TI BQ257xx: Mark self-modifying BQ25792 configuration registers as volatile - TI LM3533: Set `coherent_dma_mask` to zero to suppress "DMA mask not set" warnings - TI TPS65217: Check for errors during IRQ initialization and masking, and manage IRQ domain and wake teardown with devres - TI TWL: Unregister the auxiliary platform device via a devres action on probe failure and driver unbind Cleanups & Refactoring - Core: Convert drivers from deprecated `SIMPLE_DEV_PM_OPS()` to `DEFINE_SIMPLE_DEV_PM_OPS()` and `pm_sleep_ptr()` - Core: Fix spelling mistakes in comments across various MFD drivers and headers - Maintainers: Add ROHM BD73800 PMIC files under the ROHM PMIC entry - Maintainers: Specify the `for-mfd-next` branch for the MFD and Syscon git trees - Dialog DA9062: Use `DEFINE_RES_IRQ_NAMED()` for IRQ resource definitions - Intel LPSS: Simplify DebugFS handling by dropping redundant error checks and intermediate dentry variables, using octal permissions, and switching to `debugfs_remove()` - Khadas MCU: Convert MFD cell arrays to `const` and use `MFD_CELL_NAME()` - ST-Ericsson AB8500: Fix a spelling typo in a comment - TI LM3533: Convert from platform data to Device Tree bindings and pass only regmap and light sensor presence to child devices - TI LM3533: Remove driver-specific regmap wrappers, redundant pdata helpers, and unnecessary `extern` qualifiers, and use `dev_groups` for sysfs attributes - Wolfson WM831x: Fix a spelling typo in a comment Device Tree Binding Updates - HiSilicon Hi6421 SPMI: Fix the compatible string to match `hisilicon,hi6421-spmi` - MediaTek MT6357: Allow an `adc` child node - MediaTek MT6360: Allow two-cell interrupt specifiers with trigger flags - MediaTek MT6397: Document the `#sound-dai-cells` property - MediaTek MT6397: Document the battery-backed NVMEM layout under the RTC child node - MediaTek MT6397: Document the MT6323 PMIC EFUSE child node - Motorola CPCAP: Convert MFD and power button bindings to DT schema and document the Mapphone and Mot compositions - Qualcomm SPMI PMIC: Document the PM4125 audio codec compatible - Qualcomm SPMI PMIC: Document the PMAU0102 PMIC compatible - Qualcomm TCSR: Document the MSM8952 TCSR compatible - Rockchip RK805: Fold the pin controller binding into the RK805 PMIC DT schema - ROHM BD73800: Document the BD73800 PMIC and its regulators - ROHM PMIC: Factor out common pin properties into `rohm,pmic-pins.yaml` and reference them across BD71815, BD71828, and BD72720 bindings - ST-Ericsson AB8500: Document AB8500 and AB8505 buck converter regulators - ST-Ericsson AB8500: Document codec audio graph ports, sound DAI cells, and analog microphone wiring properties - ST-Ericsson DB8500 PRCMU: Deprecate the `db8500-prcmu-regulators` child node and make it optional - Syscon: Document the Ambarella CV75 secure scratchpad compatible - TI BQ25703A: Add the BQ25798 compatible with fallback to BQ25792 - TI Keystone: Convert Device State Control bindings to DT schema - TI LM3533: Document the LM3533 LED controller, backlight, and indicator LED bindings - TI LP3943: Convert MFD and PWM bindings to DT schema - TI TPS61050: Convert bindings to DT schema - TI TPS65086: Make the `regulators` child node optional - TI TPS65910: Document `wakeup-source` and GPIO hog child nodes - TI TWL6040: Convert bindings to DT schema and align property names with the driver - X-Powers AC200: Document the AC200 mixed-signal companion IC" * tag 'mfd-next-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (74 commits) dt-bindings: mfd: db8500-prcmu: Deprecate EPOD regulators dt-bindings: mfd: syscon: Add Ambarella CV75 secure scratchpad dt-bindings: mfd: rockchip,rk805: Convert pinctrl to DT schema mfd: intel-lpss: Add Dell Latitude 7275 to the resource conflict quirk mfd: intel-lpss: Add resource conflict quirk for Dell Latitude 5285 mfd: tps65217: Use devres for IRQ domain and wake teardown mfd: tps65217: Check return value when masking interrupt sources mfd: tps65217: Fix NULL pointer dereference on IRQ init failure dt-bindings: mfd: qcom,spmi-pmic: Add compatibles for pm4125-codec mfd: bq257xx: Mark self-modifying BQ25792 registers volatile dt-bindings: mfd: mediatek: mt6397: describe the RTC's nvmem layout mfd: mt6397-core: Add mt6397 AUXADC support mfd: max77705: Mark PASS2 revision as supported mfd: ab8500: Fix child device leaks on probe failure dt-bindings: mfd: Add MT6397 sound DAI cells dt-bindings: mfd: mediatek: mt6397: Add mt6323 PMIC EFUSE dt-bindings: mfd: hisilicon: Fix Hi6421 SPMI compatible dt-bindings: mfd: ti,bq25703a: Expand to include BQ25798 dt-bindings: mfd: Allow MT6360 interrupt flags dt-bindings: mfd: mediatek: Allow MT6357 ADC ...
8 daysASoC: qcom: qdsp6: q6afe: fix clk vote response type mismatchVal Packett
The response sent by the firmware when requesting a clock vote (opcode AFE_CMD_RSP_REMOTE_LPASS_CORE_HW_VOTE_REQUEST) does not actually have the same opcode + status payload as APR_BASIC_RSP_RESULT. Rather, it returns one single u32 which is the client_handle that must be used in future unvote requests for the same clock. As a result of this type confusion, the status returned by the callback to q6afe_vote_lpass_core_hw was actually an out-of-bounds read. It was only interpreted as success (0) most of the time due to luck, but there are some reports of random errors such as: [ 20.961100] qcom-q6afe aprsvc:service:4:4: AFE failed to vote (3) [ 20.961131] Failed to prepare clk 'core': -110 Fix by correctly interpreting the response as a single u32, and actually store it as the client_handle to ensure unvote would work correctly. Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/5976946.DvuYhMxLoT@antlia/ Fixes: 55e07531d922 ("ASoC: q6dsp: q6afe: add lpass hw voting support") Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Signed-off-by: Val Packett <val@packett.cool> Link: https://patch.msgid.link/20261016063536.598610-1-val@packett.cool Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysspi: cs42l43: Add speaker ID quirk for Dell XPS 13 DX13260 SKU 0E54Jérémie Rodon
The Dell XPS 13 DX13260 is also sold with SKU 0E54, which has the same ACPI speaker ID layout as SKU 0E53: two pins in one GpioIo() while the spk-id-gpios _DSD property references only the first. Without the quirk the speaker ID is wrong (0), so there is no speaker audio and no amp firmware is loaded. Add a DMI entry for SKU 0E54 using the same handler. Fixes: cad16d850e37 ("spi: cs42l43: Workaround for wrong speaker ID on Dell XPS 13 DX13260") Signed-off-by: Jérémie Rodon <jeremie.rodon@gmail.com> Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20261025095037.18891-1-jeremie.rodon@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
8 daysblock: advance iterator after copy-in for SG_DXFER_TO_FROM_DEVTJ Adams
When a passthrough request uses transfer direction SG_DXFER_TO_FROM_DEV, bio_copy_user_iov() sets up a temporary iterator iter2 with data_source = ITER_SOURCE to copy user data into the bio pages before execution. bio_copy_from_iter(bio, &iter2) copies the data and advances iter2, but the original iter is never advanced. Consequently, iov_iter_count(&i) remains non-zero in the caller loop in blk_rq_map_user_iov(): i = *iter; do { if (copy) ret = bio_copy_user_iov(rq, map_data, &i, gfp_mask); ... } while (iov_iter_count(&i)); Because i is never advanced, blk_rq_map_user_iov() loops indefinitely, continually allocating bios and consuming map_data pages until it exhausts pages and fails with -EINVAL. Fix this by calling iov_iter_advance(iter, bio->bi_iter.bi_size) in the map_data && map_data->from_user branch after bio_copy_from_iter(). Fixes: 13f3956eb568 ("block: Fix WARNING in _copy_from_iter") Signed-off-by: Terrence Adams <tadamsjr@google.com> Assisted-by: LLM Acked-by: Christian A. Ehrhardt <lk@c--e.de> Link: https://patch.msgid.link/20260929160813.1599129-1-tadamsjr@google.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 daysio_uring/register: enforce per-task restrictions in io_uring_register_blind()Dominik Maier
When io_uring_register(2) is invoked with fd == -1, it dispatches directly to io_uring_register_blind() without checking current->io_uring_restrict. As a result, a task with per-task register restrictions installed via IORING_REGISTER_RESTRICTIONS can still invoke blind registration opcodes such as IORING_REGISTER_SEND_MSG_RING even when those opcodes are not in the task's allowed register_op bitmap. Check current->io_uring_restrict->register_op in io_uring_register_blind() before dispatching blind registration opcodes. Fixes: ed82f35b926b ("io_uring: allow registration of per-task restrictions") Assisted-by: ARTIST LLM Signed-off-by: Dominik Maier <dmnk@google.com> Link: https://patch.msgid.link/20261022232121.2538616-1-dmnk@google.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 daysio_uring/net: mask socket type with SOCK_TYPE_MASK in io_socket_bpf_populate()Dominik Maier
When an IORING_OP_SOCKET request is prepared in io_socket_prep(), sock->type retains creation flags such as SOCK_CLOEXEC and SOCK_NONBLOCK until __sys_socket_file() masks them off with SOCK_TYPE_MASK during execution. However, io_socket_bpf_populate() copies sock->type into bctx->socket.type without masking off ~SOCK_TYPE_MASK. As a result, a cBPF filter inspecting bctx->socket.type against socket types such as SOCK_DGRAM or SOCK_STREAM can be bypassed by ORing SOCK_CLOEXEC or SOCK_NONBLOCK into the socket type. Mask sock->type with SOCK_TYPE_MASK when populating bctx->socket.type. Fixes: cff1c26b4223 ("io_uring/net: allow filtering on IORING_OP_SOCKET data") Assisted-by: ARTIST LLM Signed-off-by: Dominik Maier <dmnk@google.com> Link: https://patch.msgid.link/20261022232120.2537530-1-dmnk@google.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 daysio_uring/net: Remove useless min_not_zero() usageClément Léger
In the else arm, sel->val is necessarily 0 so the min_not_zero() actually always returns kmsg->msg.msg_inq. Remove the min_not_zero() usage and replace it with kmsg->msg.msg_inq. Signed-off-by: Clément Léger <cleger@meta.com> Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de> Link: https://patch.msgid.link/20261023144953.3584118-1-cleger@meta.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 daysio_uring/net: keep recvmsg buffer select length within MAX_RW_COUNTYichong Chen
io_recvmsg() takes the transfer length from the ring provided buffer when sqe->len is 0, and such a buffer can be up to 4G. min_ret is an int, so 2G or more makes it negative and the (ret < min_ret) block is skipped, and the oversized length reaches the socket layer unchanged: an empty socket then completes with 0 instead of arming poll, and a short read is reported as complete. Clamp the length to MAX_RW_COUNT, as io_recv() does. Fixes: c7fb19428d67 ("io_uring: add support for ring mapped supplied buffers") Signed-off-by: Yichong Chen <chenyichong@uniontech.com> Link: https://patch.msgid.link/20261023112209.87979-1-chenyichong@uniontech.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 daysio_uring/kbuf: advance head when a pickup empties the buffer ringYichong Chen
io_ring_buffers_peek() flags the request with REQ_F_BL_EMPTY if the buffers it picked were the last ones available, comparing head to tail. When the loop breaks because max_len was exhausted the buffer was picked, but head is left pointing at it, so the flag isn't set if it was the last buffer. A bundle receive then retries, finds no buffer, and the request, which has received data, is marked as failed on account of the -ENOBUFS. That severs a link, and ends a multishot. Fixes: 35c8711c8fc4 ("io_uring/kbuf: add helpers for getting/peeking multiple buffers") Signed-off-by: Yichong Chen <chenyichong@uniontech.com> Link: https://patch.msgid.link/20261023091711.83481-1-chenyichong@uniontech.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
8 dayscgroup/cpuset: Integrate compute_partition_effective_cpumask() into ↵Waiman Long
compute_effective_cpumask() Update compute_effective_cpumask() to call compute_partition_effective_cpumask() directly if the given cpuset is a valid remote or local partition root. This simplifies the call sites where they are being involved. No functional change is expected. Suggested-by: Ridong Chen <ridong.chen@linux.dev> Signed-off-by: Waiman Long <longman@redhat.com> Acked-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Signed-off-by: Tejun Heo <tj@kernel.org>
8 dayscgroup/cpuset: Relocate compute_*effective_cpumask() and ↵Waiman Long
compute_effective_nodemask() Relocate compute_partition_effective_cpumask(), compute_effective_cpumask(), and compute_effective_nodemask() together so that compute_effective_cpumask() and compute_partition_effective_cpumask() can be further integrated together. There is no functional change. Signed-off-by: Waiman Long <longman@redhat.com> Acked-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Signed-off-by: Tejun Heo <tj@kernel.org>
8 dayscgroup/cpuset: Release invalid isolated CPUs with a shrunk root partition parentWaiman Long
It is also reported by sashiko that there may be leakages of isolated CPUs when a root partition parent shrinks its effective_xcpus with isolated partition children. Leakage here means that isolated_cpus may contain extra CPUs that are not in any isolated partitions and not boot time isolated. Those CPUs cannot be used in any isolated partitions anymore. There are 2 different cases here. The effective_xcpus becomes empty and the isolated partition should be invalidated in this case. Alternatively some of its effective_xcpus are not in parent's effective xcpus but still have some valid effective_xcpus left. The isolated partition can remain valid. In both cases, the invalid isolated CPUs will have to be released from isolated_cpus if appropriate. Fix that by calling isolated_cpus_release() to release those isolated CPUs from isolated_cpus. New test cases are added to test_cpuset_prs.sh to test this. Fixes: 11e5f407b64a ("cgroup/cpuset: Keep track of CPUs in isolated partitions") Signed-off-by: Waiman Long <longman@redhat.com> Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Tested-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Signed-off-by: Tejun Heo <tj@kernel.org>
8 dayscgroup/cpuset: Release invalid isolated CPUs in ↵Waiman Long
compute_partition_effective_cpumask() It is found by sashiko that when a child isolated partition with parent root partition is invalidated in compute_partition_effective_cpumask(), the switching of the isolated exclusive CPUs from child to parent will not be reflected in isolated_cpus leading to CPU leakage. Fix that by calling isolated_cpus_update() when that happens. Also simplify compute_partition_effective_cpumask() by doing child partition invalidation only for the special case of no more effective_cpus left in a populated parent. The other case doesn't actually warrant invalidation at this stage and subsequent iteration in update_cpumasks_hier() and update_parent_effective_cpumask() for that child should handle that. Also drop the make_partition_invalid() helper by inlining it into compute_partition_effective_cpumask() as it is the only caller. A new test case is add to test_cpuset_prs.sh to verify this. Fixes: 11e5f407b64a ("cgroup/cpuset: Keep track of CPUs in isolated partitions") Signed-off-by: Waiman Long <longman@redhat.com> Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Tested-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Signed-off-by: Tejun Heo <tj@kernel.org>
8 dayscgroup/cpuset: Make sure compute_partition_effective_cpumask() is only ↵Waiman Long
called for valid partition With visual inspection to make sure that compute_partition_effective_cpumask() is only called for valid partition root, it was found that the function can be called for an invalidated partition near the end of cpuset_hotplug_update_tasks(). When partcmd is set, update_parent_effective_cpumask() is called to either invalidate a valid partition or with partcmd_update to check if an invalid partition can be switched back to valid. In both cases, cpuset_force_rebuild() should be invoked. However, compute_partition_effective_cpumask() should only be called when an invalid partition is switched back to valid. When a partition is invalidated, compute_effective_cpumask() should be called instead. Also add a WARN_ON_ONCE() in compute_partition_effective_cpumask() to ensure that a valid partition root is passed in. Fixes: 72c6303acfa1 ("cgroup/cpuset: Take isolated CPUs out of workqueue unbound cpumask") Signed-off-by: Waiman Long <longman@redhat.com> Acked-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Signed-off-by: Tejun Heo <tj@kernel.org>
8 dayscgroup/cpuset: Prevent recursive call of remote_cpus_update() via ↵Waiman Long
update_cpumasks_hier() Guopeng reports that changing the cpumask of a remote partition root may set the effective_cpus of the top_cpuset incorrectly. It is due to the following call sequence: update_cpumask() -> partition_cpus_change() -> remote_cpus_update() -> update_sibling_cpumasks() -> update_cpumasks_hier() -> remote_cpus_update() The second remote_cpus_update() call passes in the cs->effective_xcpus instead of the trialcs->effective_xcpus of the first remote_cpus_update() call. As a result, the second call can revert what has been done in the first call leading to incorrect effective_cpus of the top_cpuset as well as subpartitions_cpus. Fix that by adding a new remote_partition_updating flag into the cpuset structure to indicate that a remote partition is being updated and update_cpumasks_hier() should skip the whole subtree as update_cpumask() or update_exclusive_cpumask() which calls partition_cpus_change() will eventually calls update_cpumasks_hier() for that subtree anyway. This new flag is currently set only in remote_cpus_update() to prevent recursive call of remote_cpus_update() on the same cpuset. A test case is added to test_cpuset_prs.sh to verify this change. Reported-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Link: https://lore.kernel.org/lkml/20261010075947.333549-2-guopeng.zhang@linux.dev Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Tested-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Fixes: f62a5d39368e ("cgroup/cpuset: Remove remote_partition_check() & make update_cpumasks_hier() handle remote partition") Signed-off-by: Waiman Long <longman@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>
8 daysselftests/cgroup: Check for a single range nohz_full CPUs before running ↵Waiman Long
test matrix Commit 989ca25c10ca ("selftests/cgroup: Add tests for nohz_full housekeeping check") adds a nohz_full test matrix that will only be run when a nohz_full boot parameter cover all the CPUs beyond CPUs 0-7. The code looks for the first and last CPU numbers in the nohz_full sysfs file to determine if that criterion is met. However if there are holes in the range (i.e. has ",") the test matrix may be incorrectly run leading to unexpected test failure. Fix that by skipping "," and anything after that to make sure the first range will cover all the remaining CPUs. Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Tested-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Signed-off-by: Waiman Long <longman@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>
8 dayscgroup/cpuset: Minor fixes to prstate_housekeeping_conflict()Waiman Long
Commit 9527ff78a413 ("cgroup/cpuset: Consider all the exclusive CPUs when doing housekeeping check") changes the way prstate_housekeeping_conflict() is being used by considering all the exclusive xcpus to be owned by the partition when doing housekeeping check. However there are two minor issues reported by sashiko with that patch: 1) In partition_cpus_change(), prstate_housekeeping_conflict() can be called with an invalid partition root. In that case, there are no isolated CPUs that are going to be returned back to the system to become housekeeping CPUs, so the calculation of the del_cpus cpumask is meaningless. 2) The checking of del_cpus in prstate_housekeeping_conflict() to see if it can contain an active housekeeping CPU that can be returned to the system ignores the fact that an active CPU not in HK_TYPE_DOMAIN_BOOT HK cpumask will not become an active housekeeping CPU when it is released by an isolated partition. Update the existing code to handle these two issues properly to make prstate_housekeeping_conflict() produce more accurate result. Fixes: 9527ff78a413 ("cgroup/cpuset: Consider all the exclusive CPUs when doing housekeeping check") Signed-off-by: Waiman Long <longman@redhat.com> Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Signed-off-by: Tejun Heo <tj@kernel.org>
8 dayscgroup/cpuset: Fix incorrect effective_cpus bug in update_cpumasks_hier()Waiman Long
With the introduction of cpuset.cpus.exclusive, the computation of effective_cpus differs depending on if a cpuset is a valid partition root or not. In update_cpumasks_hier(), effective_cpus is computed early to check if the current subtree can be skipped. Later on update_parent_effective_cpumask() may be called which can change the partition state from valid to invalid or vice versa. If the partition state changes, the previously computed effective_cpus may no longer be valid. Fix that by recomputing effective_cpus again when that happens. Also add a new test case into test_cpuset_prs.sh to verify this change. Fixes: e2ffe502ba45 ("cgroup/cpuset: Add cpuset.cpus.exclusive for v2") Signed-off-by: Waiman Long <longman@redhat.com> Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Signed-off-by: Tejun Heo <tj@kernel.org>
8 dayscgroup/cpuset: Properly compute effective xcpus in ↵Waiman Long
update_parent_effective_cpumask() Since the introduction of cpuset.cpus.exclusive in commit e2ffe502ba45 ("cgroup/cpuset: Add cpuset.cpus.exclusive for v2"), a compute_effective_exclusive_cpumask() helper which is later renamed to compute_excpus() is added to compute the effective xcpus of a partition root. However update_parent_effective_cpumask() is not updated in all proper places to use the new helper to check if a given cpuset should remain a valid partition root. This can cause a cpuset to incorrectly remain a valid partition root even if no effective xcpus is left. Fix that problem by using compute_excpus() to compute the effective xcpus into delmask in all cases except partcmd_disable, partcmd_invalidate or partcmd_update with newmask set and use it for tasks_nocpu_error() check as well as checking its emptiness. This enables us to catch invalid partition root more accurately in update_parent_effective_cpumask(). In the case of partcmd_update with newmask set, the passed in new effective xcpus value will directly be used in the tasks_nocpu_error() check without relying on old data in the cpuset. For the partcmd_update with NULL newmask case, the cpu exclusivity test there is also relaxed to be performed only if exclusive_cpus is empty. Some test case are added to test_cpuset_prs.sh for invalidating a partition root due to its effective xcpus becoming empty as well as making sure that an invalid partition can only be revived when exclusive CPUs are available agin. Fixes: e2ffe502ba45 ("cgroup/cpuset: Add cpuset.cpus.exclusive for v2") Signed-off-by: Waiman Long <longman@redhat.com> Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Tested-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Signed-off-by: Tejun Heo <tj@kernel.org>
8 dayscgroup/cpuset: Find furthest isolated ancestor for invalidated isolated ↵Waiman Long
partition Commit 46b885416c27 ("cgroup/cpuset: Fix a missing isolated_cpus update in update_cpumasks_hier()") searches for the closet partition root ancestor to determine if the isolated CPUs in a to be invalidated isolation partition should be removed from isolated_cpus or not. As reported by sashiko, this method may not work when there is a deeply nested isolated partition hierarchy. For instance, Consider a nested hierarchy A0 -> A1 -> A2 -> A3 where all four are PRS_ISOLATED: A0: effective_xcpus = 0-4 A1: effective_xcpus = 1-4 A2: effective_xcpus = 2-4 A3: effective_xcpus = 3-4 When A1 shrinks its exclusive_cpus from 1-4 to 1-2, A2 will update it effective_xcpus to 2. A3 will find its closet partition root ancestor A2 and decides that its effective_xcpus 3-4 should be removed from isolated_cpus which is incorrect. Address this corner case by adding a new isolated_cpus_release() helper to replace the existing ancestor_partition() helper. This new helper will search for the furthest isolated partition root ancestor to decide if some or all of its isolated CPUs should be removed from isolated_cpus and also perform the removal when appropriate. The is_remote_partition() and is_local_partition() helpers are also moved up so they can be used in earlier functions. There are other pre-existing problems that will still prevent the above test case to work correctly. These problems will be addressed in subsequent patches. Fixes: 46b885416c27 ("cgroup/cpuset: Fix a missing isolated_cpus update in update_cpumasks_hier()") Signed-off-by: Waiman Long <longman@redhat.com> Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn> Signed-off-by: Tejun Heo <tj@kernel.org>
8 daysMerge tag 'ata-7.4-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux Pull ata updates from Niklas Cassel: - Make ata_generic refuse to bind to non-IDE devices (me) - Add missing <linux/pm_runtime.h> includes (Vladimir) - Add pata_cswarp driver for the Amiga CS-Lab Warp card (Paolo) - Fix a use-after-free and a parport attach bug in pata_parport (Pei) - Switch ahci_da850 to DEFINE_SIMPLE_DEV_PM_OPS() (Li) - Documentation and kernel-doc fixes (Karl, Bart, me) - Remove the broken sata_inic162x driver (Ethan) - Fix probe() error paths in libata, libahci and several drivers (me) - Fail probe in sata_dwc_460ex if host activation fails (Nikolay) - Use the standard DMA engine API in pata_arasan_cf (Frank) - Abort multi-sector pass-through commands when multi_count is 0 (Hui) - Replace kmap_atomic() with kmap_local_page() in libata-sff (Danish) - Revert the no longer needed JMB582/JMB585 32-bit DMA quirk (Mario) - Enable SATA LED presence indication in sata_mv (Carlos) - Re-enable FBS after error handling on a port multiplier (Kyrylo) - Fix NO_FUA quirks shadowed by earlier quirk entries (me) - Do not overwrite the Marvell PATA quirk port mask in ahci (zhoumin) - Ignore libata.force transfer modes the host does not support (Rand) - Fix a race between IRQ deferral and ata_sff_flush_pio_task() (me) * tag 'ata-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux: (26 commits) ata: libata-sff: fix race between IRQ deferral and ata_sff_flush_pio_task() ata: libata-core: Ignore forced transfer modes the host does not support ata: ahci: preserve preset port masks ata: libata-core: Fix NO_FUA quirks shadowed by earlier quirk entries ata: libahci: re-enable FBS after error handling on a port multiplier ata: sata_mv: enable SoC SATA LED presence indication ata: libata: Fix scsi_done() documentation Revert "ata: ahci: force 32-bit DMA for JMicron JMB582/JMB585" ata: pata_parport: fix parport attach idr_alloc for ata: libata-sff: replace kmap_atomic() with kmap_local_page() ata: libata-scsi: abort multi-sector pass-through commands when multi_count is 0 ata: pata_arasan_cf: use standard DMA engine API ata: sata_dwc_460ex: Don't enable interrupt if libATA core registration fails ata: libata-core: Fix the ata_host_register() kdoc ata: libata: Do not leave ata_host_stop() registered when activation fails ata: libahci: Free the IRQs when activating a multi-IRQ host fails ata: sata_fsl: Fix use-after-free of host_priv on probe() failure ata: ahci_st: Assert the power down reset in the probe() error path ata: ahci_st: Do not ignore errors when getting the reset controls ata: sata_inic162x: remove dangerous broken driver ...
8 daysfuse: handle extent map files in fuse_passthrough_fadvise()John Groves
This addresses a collision between the pending backing_file fadvise patch and the new extent-mapping code for famfs (which falls into the passthrough bucket. A file opened with FOPEN_PASSTHROUGH on an extent map backing has no backing file: fuse_passthrough_open() returns before setting ff->passthrough and ff->cred. fuse_file_fadvise() routes every FOPEN_PASSTHROUGH file to fuse_passthrough_fadvise(), which installed the NULL ff->cred on the task with override_creds() and then passed the NULL backing file to vfs_fadvise(). Any posix_fadvise(), readahead() or madvise(MADV_WILLNEED) on such a file oopsed. fio triggers it at file open with its default invalidate and fadvise_hint settings. Fall back to generic_fadvise() when there is no backing file, as the other passthrough helpers fall back to their extent map or generic implementations. generic_fadvise() already ignores advice on DAX inodes while keeping the EINVAL and ESPIPE checks. Reported-by: Aravind Ramesh <arramesh@micron.com> Fixes: 69f77a06ffad ("fuse: Forward vfs_fadvise to backing_file in passthrough mode") Tested-by: John Groves <john@groves.net> Signed-off-by: John Groves <john@groves.net> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
8 daysMerge tag 'i2c-7.4-part2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux Pull more i2c updates from Andi Shyti: "This introduces dynamic transfer timeouts in the I2C core, already used by qcom-geni. Alongside some driver improvements and fixes, it also brings in the Rust I2C pull request. Core: - core, qcom-geni: add and use a dynamic timeout helper - acpi: fix adapter reference leak when creating I2C clients Drivers: - imx: support reversed address direction and no-start transfers - designware: queue block data reads once length is known - mt7621: skip the second data register for chunks up to 4 bytes - sh_mobile: ensure IRQs are freed before unmapping registers Rust: - Remove unsound device-to-client reference conversion" * tag 'i2c-7.4-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux: i2c: sh_mobile: request IRQs after mapping registers i2c: imx: add I2C_M_REV_DIR_ADDR and I2C_M_NOSTART i2c: mt7621: fix copying uninitialized kernel stack with reduced page_len i2c: designware: queue only one read command for block reads i2c: acpi: Fix adapter reference leak in i2c_acpi_new_device_by_fwnode() i2c: qcom-geni: Add dynamic transfer timeout based on transfer length and frequency i2c: core: Add i2c_update_timeout() helper for dynamic transfer timeouts rust: i2c: remove TryFrom<&Device> implementation for &I2cClient
8 daysMerge tag 'driver-core-7.4-rc1-2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core Pull driver core fixes from Danilo Krummrich: - Make parent-lock requirements per device type instead of per bus, fixing a use-after-free on USB disconnect by limiting the requirement to USB interfaces, which retain a reference to their parent - Honor parent-lock requirements during deferred and asynchronous probing, fixing USB interface probe races, including duplicate endpoint creation attempts in sysfs * tag 'driver-core-7.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core: driver core: take parent lock in async device attach driver core: take parent lock on deferred probe driver core: fix parent lock use-after-free on USB disconnect
8 daysMerge tag 'hwmon-for-v7.4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: "New drivers: - Axiado AX3000 and AX3005 PWM fan controller - AX3000/AX3005 TSADC - HONOR FMI-XX - Minisforum UM780 XTX EC monitoring and fan control - pmbus: MAX20826, MAX20855B, MAX20908, MAX20912, MAX20826, and MAX20916 - pmbus: Infineon TDA38740/TDA38725 Added support to existing drivers: - asus-ec-sensors: ROG STRIX X670E-A GAMING WIFI and ROG STRIX Z490-A GAMING - asus_rog_ryujin: ROG Ryujin III 360 - dell-smm: Dell 16 DC16250, Dell OptiPlex 7090, Dell Precision 3650 Tower, Add Latitude 5420 - it87: IT8613E - k10temp: 1ah/80h devices. Drop support for Hygon devices (support to be re-added with separate patches later) - lm63: Sensylink CTF2301 - nct6683: MSI MAG B550M MORTAR MAX WIFI, MSI MAG B650 TOMAHAWK WIFI, MSI MAG B650M MORTAR WIFI (MS-7D76), and MSI MAG B850M MORTAR WIFI - nct6775: NCT6122D and NCT6126D - pmbus/isl68137: Renesas RAA229639 and RAA229640 - pmbus/max34440: ADPM12300 - pmbus/tps25990: TPS1689 - pmbus/tps53679: TPS53622, TPS53659 and TPS536C7 - pmbus/xdpe1a2g7b: xdpe1a2g7c - sht4x: Sensirion STS4x - socfpga: Agilex 5 - yogafan: Lenovo Yoga Pro 9 16IMH9, Yoga 14cACN 2021, IdeaPad 3 15ALC6 Ub, Yoga 740-15IML Core updates: - Support for currX_emergency and inX_[l]emergency attributes Notable bug fixes and changes: - Add missing locks to corsair-cpro, ftsteutates, nct7904, and npcm750-pwm-fan drivers - Fix jiffies wraparound in tmp102 and tmp108 drivers - Documentation updates (document missing chip support, typo fixes, clarifications) - pmbus/ltc4286: Add writable shunt_resistor sysfs attribute - coretemp: Document sysfs numbering and label meaning, fix handling of isolated SMT siblings, read TjMax only when refreshing the temperature, refresh the temperature on the first read, and return -ENODATA for invalid temperature readings - spd5118: Avoid probing when 16-bit addressing is enabled, and select page 0 unconditionally during probe - arctic_fan_controller: Default PWM cache to MCU 40%, Dual-license GPL-2.0-or-later OR BSD-2-Clause, and update maintainer address Various other minor bug fixes and improvements" * tag 'hwmon-for-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (97 commits) hwmon: (npcm750-pwm-fan) serialize PWM register updates hwmon: (nct7904) serialise the watchdog and sensors hwmon: (ftsteutates) serialise the watchdog and sensors hwmon: (acpi_power_meter) Fix 18.45 TW bug hwmon: (sht3x) Return the consumed count for heater writes hwmon: (mcp9982) Update the interval cache only after successful writes hwmon: (gigabyte_waterforce) reject short input reports hwmon: (coretemp) Fix handling of isolated SMT siblings hwmon: (coretemp) Document sysfs numbering and label meaning hwmon: (asus_wmi_sensors) Reword BIOS upgrade advice hwmon: Replace __MODULE_STRING() with __stringify() hwmon:(pmbus/xdpe1a2g7b) Add support for xdpe1a2g7c controller dt-bindings: trivial-devices: Add support for XDPE1A2G7C hwmon: (pmbus/isl68137) Add Renesas RAA229639 and RAA229640 dt-bindings: hwmon: pmbus/isl68137: Add Renesas RAA229639 and RAA229640 hwmon: (coretemp) Read TjMax only when refreshing the temperature hwmon: (pmbus/ibm-cffps) Avoid format truncation warnings hwmon: (dell-smm) Add Dell 16 DC16250 to fan control whitelist hwmon: (nct6683) Add more MSI boards to list of tested boards hwmon: (nct6683) Add MSI B850M to list of tested boards ...
8 daysMerge tag 'tpm-v7.4-rc1-rebased' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd Pull TPM updates from Jarkko Sakkinen: "Features and Improvements: - improve tpm_crb behaviour by putting the chip into an idle state for each transmission. This improves firmware behavior as the kernel now better cancels its state as if it had never touched it in the first place. - Drop a spurious (but harmless) wmb() from tpm_pm_resume(). - tpm_tis_i2c now requests the optional reset control and deasserts it before communicating with the TPM. - replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS across the whole driver stack. - Validate during driver initialization that no duplicate banks are received. It's unlikely corruption but since it happening would cause oops I decided to retain it as a sanity check. Bug fixes: - tpm2_probe() misinterpreted a transport error on TPM2_GetCapability as the chip not being probed, and the chip was detected as a TPM 1 chip. This can happen in reality only in the extremely rare case of bus corruption. Despite the odds, a fix was landed, as it is still technically a legit bug fix. - It is not really worth the time and energy to go into details as tpm_nsc is a somewhat legacy driver, but one null pointer dereference bug and another causing use-after-free were fixed. - read() of /dev/tpm{,rm}0 with zero size caused a pending response to be consumed. Just return immediately" * tag 'tpm-v7.4-rc1-rebased' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: tpm: reject duplicate PCR banks in tpm2_get_pcr_allocation tpm: use DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr() char: tpm: Use SIMPLE_DEV_PM_OPS for ibmvtpm power management tpm: tis_i2c: Deassert optional reset line before probing tpm: Remove ineffective wmb() from tpm_pm_resume() tpm: Call cmd_ready/go_idle for each command transmission tpm: fix zero-length read discarding the pending response tpm: tpm_nsc: stop using the cleanup callback as dev.release tpm: tpm_nsc: fix NULL pointer dereference on init failure tpm: tpm2_probe: propagate transport errors
8 daysMerge tag 'cxl-for-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxlLinus Torvalds
Pull CXL updates from Dave Jiang: "The headline item is the first part of support for Dynamic Capacity Devices (DCD). It covers flagging DCD support in the mailbox, reading the dynamic capacity configuration from the device, gathering DSMAS data for the DCD partitions, and configuring the dynamic capacity interrupts. It also adds a documentation update and a cleanup that enforces partition ordering. DCD is not enabled yet with these code changes. Patches are applied to reduce the whole set in order to relief the burden of very large patch set review. Zero sized HDM decoders are now allowed, along with cxl_test support for them. There is also a set of decoder hardening patches for switch decoder enumeration. Latency calculations now account for link width and use consistent units. The GPF timeout programming has been reworked. The pull also has a number of misc patches. A large number of bug fixes against pre-existing issues make up the rest of the pull. Many of these were flagged by review of patches posted to the mailing list by sashiko. Also adding Richard Cheng as a reviewer (R) to the CXL sub-system" * tag 'cxl-for-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl: (49 commits) cxl/events: Test CME counter expiry with equality, not bitwise AND Documentation/cxl: Document DPA partition layout and ordering rules cxl/core: Enforce partition order/simplify partition calls cxl/mem: Configure dynamic capacity interrupts cxl/pci: Factor out interrupt policy check cxl/events: Split event msgnum configuration from irq setup cxl/cdat: Gather DSMAS data for DCD partitions cxl/mem: Read dynamic capacity configuration from the device cxl/mbox: Flag support for Dynamic Capacity Devices (DCD) cxl/acpi: Convert QTG _DSM latencies to picoseconds cxl: Account for link width in latency calculation cxl/port: Convert PCIe link latency to nanoseconds cxl/pci: Update only the Port GPF timeout fields cxl/pci: Program the Port GPF timeouts before caching the DVSEC cxl/pci: Use the Device GPF DVSEC for restricted endpoints cxl/port: Attach endpoints to a dport under the lock that pins it cxl/core: Hold the dport host lock across dport lookup and use cxl/port: Clear cached dport pointers when a dport is removed cxl/region: Warn on user region position mismatch cxl/acpi: Check ACPI companion before use ...
8 daysf2fs: compress: don't overwrite populated compress cache entryChao Yu
f2fs_cache_compressed_page() looks up the entry of blkaddr w/ f2fs_find_cache(), and then grabs it w/ f2fs_grab_cache() and F2FS_CACHE_LOCK_CREATE. If another reader populates the entry in between, f2fs_grab_cache() returns that uptodate entry, and we will overwrite its ino and data. Before the compress cache was converted to the generic cache, add_to_page_cache_lru() failed w/ -EEXIST in this case, and the existing page was left untouched. Normally, the racer is a reader of the same block of the same inode, so both copies are the same, let's just back off, as f2fs_ra_meta_caches() does. A block address can only be owned by one inode at a time, the block can not be freed and reused by another inode during population, since the reader holds the locks of the cluster's pagecache pages until decompression completes, and truncation must lock these pages before freeing blocks. So if the uptodate entry was cached by another inode, it's a bug, and one of the copies must be stale, let's report the bug, and drop the entry, then readers will load the block from disk. Cc: stable@kernel.org Fixes: 6a78d0488116 ("f2fs: cache: use compress cache") Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
8 daysf2fs: fix to update superblock crc in sanity_check_area_boundary()Chao Yu
This patch fixes the bug reported by Sashiko: We should update superblock crc along w/ raw_super->segment_count in sanity_check_area_boundary() if sb_checksum feature is enabled. Cc: stable@kernel.org Fixes: d440c52d3151 ("f2fs: support superblock checksum") Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
8 daysf2fs: fix to fetch ino via ino_of_node() under cache lockChao Yu
In f2fs_writeback_node_caches(), it's better to fetch ino via ino_of_node() under cache lock, otherwise, node cache content may become stale after cache is unlocked due to racing w/ truncation. Commit 493b9dc8b52c ("f2fs: cache: use node cache") fixes similar issue in f2fs_flush_inline_data() introduced in commit 34c061ad85a2 ("f2fs: Avoid double lock for cp_rwsem during checkpoint"). Cc: stable@kernel.org Fixes: 2049d4fcb057 ("f2fs: avoid multiple node page writes due to inline_data") Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
8 daystools/power turbostat: Add rugged Panther Lake supportKuppuswamy Sathyanarayanan
Add CPU model for rugged Panther Lake to the platform and perf model tables. It uses the same cores as Panther Lake, so use the same settings. Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Co-developed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>