summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-06-17 11:18:45 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2026-06-17 11:18:45 +0100
commit056e065a6b6e01ab54bb9770c0d5a15350e571e2 (patch)
tree63be3ecd091bdc31deb882057a1061f0cc7c2229 /drivers/base
parent4b99990cdf9560e8a071640baf19f312e6ae02f4 (diff)
parentc5e90e8844692deb7bbcd029e8b92b3a20441903 (diff)
Merge tag 'sound-7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai: "Unsurprisingly, we've had a fairly busy development cycle with various fixes and enhancements. While the majority of changes consist of device-specific fixes, a significant number of cleanups, hardening, and modernizations have been applied to the core frameworks as well. Below are some highlights: ALSA Core: - Hardening, race condition, and UAF/leak fixes in the ALSA timer and sequencer cores - Widespread adoption of flexible array members across core structures - Integration of new simple refcount helper functions to simplify code ASoC Core: - Introduction of a unified SoundWire enumeration helper to clean up redundant device initialization across codecs - Enhancements to SDCA support, including handling devices with multiple functions of the same type and proper jack reporting masks - Continued refactoring of ASoC component debugfs and DAPM structures - Simplification and improvements to the format auto-selection mechanism - Added shared BCLK rate constraints for cross-DAI coordination ASoC Platforms & Codecs: - Initial bring-up and power management support for AMD ACP 7.x - Support for Everest Semi ES9356 (SDCA), Mediatek MT2701 (on-chip HDMI) and MT8196 SoCs, Renesas RZ/G3E, SpacemiT K3, and TI TAC5xx2/TAS67524 - Added a new generic driver for GPIO-driven amplifiers - Continued mass conversion of locking code to guard() helpers across numerous platform drivers (MediaTek, Rockchip, STM32, Samsung, etc) - Cleanup of legacy non-DT platform data and rollbacks for obsolete SH Ecovec24/7724se boards HD- and USB-Audio: - Device-specific hardware quirks and fixes for various Realtek HD-Audio devices (Lenovo, HP, ASUS, Acer, Clevo) - Refinements to Qualcomm USB-audio offloading support - Front-panel controls and autogain status support for Scarlett Gen 4 - Quirks for XIBERIA (K03S), Sennheiser (MOMENTUM 3), Edifier (MF200), Novation (Mininova), and Behringer (Flow 8) USB-audio devices - Improved robustness by rolling back or propagating write errors to the mixer control caches (Babyface Pro, US-16x08, Scarlett) Others: - Support for the HT-Omega eClaro PCI sound card in the Oxygen driver - Robustness improvements and fixes for Virtio-audio, Xen-front, and legacy OSS dmasound drivers" * tag 'sound-7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (483 commits) ALSA: usb-audio: Add iface reset and delay quirk for XIBERIA K03S ALSA: hda/realtek: Add quirk for Lenovo Xiaoxin 14 GT ALSA: hda/realtek: Add CS35L41 I2C quirk for ASUS UM3405GA ALSA: timer: Fix racy timeri->timer changes with rwlock ALSA: core: Fix unintuitive behavior of snd_power_ref_and_wait() ALSA: seq: avoid stale FIFO cells during resize ALSA: seq: oss: Serialize readq reset state with q->lock ASoC: dt-bindings: Fix RT5677 "realtek,gpio-config" type ASoC: audio-graph-card2: recommend to use auto select DAI format ASoC: update auto format selection method ASoC: renesas: rcar: update auto select format ASoC: codecs: pcm3168a: update auto select format ASoC: codecs: ak4619: update auto select format ASoC: codecs: peb2466: don't use array if single pattern ASoC: codecs: idt821034: don't use array if single pattern ASoC: codecs: framer-codec: don't use array if single pattern ASoC: remove SND_SOC_POSSIBLE_xBx_xFx ASoC: adau1372: Clear PLL_EN on failed PLL lock without reset GPIO ALSA: seq: Don't re-bounce the error event ASoC: bcm: cygnus: use scoped child node loop ...
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/firmware_loader/main.c68
1 files changed, 64 insertions, 4 deletions
diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c
index c96312ac2be7..24213a0ea831 100644
--- a/drivers/base/firmware_loader/main.c
+++ b/drivers/base/firmware_loader/main.c
@@ -1132,6 +1132,7 @@ EXPORT_SYMBOL(release_firmware);
/* Async support */
struct firmware_work {
struct work_struct work;
+ struct list_head list;
struct module *module;
const char *name;
struct device *device;
@@ -1140,6 +1141,17 @@ struct firmware_work {
u32 opt_flags;
};
+static LIST_HEAD(firmware_work_list);
+static DEFINE_SPINLOCK(firmware_work_lock);
+
+static void firmware_work_free(struct firmware_work *fw_work)
+{
+ put_device(fw_work->device); /* taken in request_firmware_nowait() */
+ module_put(fw_work->module);
+ kfree_const(fw_work->name);
+ kfree(fw_work);
+}
+
static void request_firmware_work_func(struct work_struct *work)
{
struct firmware_work *fw_work;
@@ -1150,11 +1162,15 @@ static void request_firmware_work_func(struct work_struct *work)
_request_firmware(&fw, fw_work->name, fw_work->device, NULL, 0, 0,
fw_work->opt_flags);
fw_work->cont(fw, fw_work->context);
- put_device(fw_work->device); /* taken in request_firmware_nowait() */
- module_put(fw_work->module);
- kfree_const(fw_work->name);
- kfree(fw_work);
+ spin_lock_irq(&firmware_work_lock);
+ if (!list_empty(&fw_work->list)) {
+ list_del_init(&fw_work->list);
+ spin_unlock_irq(&firmware_work_lock);
+ firmware_work_free(fw_work);
+ return;
+ }
+ spin_unlock_irq(&firmware_work_lock);
}
@@ -1164,6 +1180,7 @@ static int _request_firmware_nowait(
void (*cont)(const struct firmware *fw, void *context), bool nowarn)
{
struct firmware_work *fw_work;
+ unsigned long flags;
fw_work = kzalloc_obj(struct firmware_work, gfp);
if (!fw_work)
@@ -1196,7 +1213,12 @@ static int _request_firmware_nowait(
get_device(fw_work->device);
INIT_WORK(&fw_work->work, request_firmware_work_func);
+
+ spin_lock_irqsave(&firmware_work_lock, flags);
+ list_add_tail(&fw_work->list, &firmware_work_list);
schedule_work(&fw_work->work);
+ spin_unlock_irqrestore(&firmware_work_lock, flags);
+
return 0;
}
@@ -1259,6 +1281,44 @@ int firmware_request_nowait_nowarn(
}
EXPORT_SYMBOL_GPL(firmware_request_nowait_nowarn);
+/**
+ * request_firmware_nowait_cancel() - cancel an async firmware request
+ * @device: device for which the firmware is being loaded
+ * @context: context passed to request_firmware_nowait()
+ * @cont: callback passed to request_firmware_nowait()
+ *
+ * Cancel a pending request_firmware_nowait() request for @device, @context
+ * and @cont. If the associated work has already started, this function waits
+ * until the callback has returned. If the callback has already completed, this
+ * function does nothing.
+ *
+ * This function may sleep.
+ */
+void request_firmware_nowait_cancel(struct device *device, void *context,
+ void (*cont)(const struct firmware *fw,
+ void *context))
+{
+ struct firmware_work *fw_work = NULL;
+ struct firmware_work *tmp;
+
+ spin_lock_irq(&firmware_work_lock);
+ list_for_each_entry_reverse(tmp, &firmware_work_list, list) {
+ if (tmp->device == device && tmp->context == context &&
+ tmp->cont == cont) {
+ fw_work = tmp;
+ list_del_init(&fw_work->list);
+ break;
+ }
+ }
+ spin_unlock_irq(&firmware_work_lock);
+
+ if (!fw_work)
+ return;
+ cancel_work_sync(&fw_work->work);
+ firmware_work_free(fw_work);
+}
+EXPORT_SYMBOL_GPL(request_firmware_nowait_cancel);
+
#ifdef CONFIG_FW_CACHE
static ASYNC_DOMAIN_EXCLUSIVE(fw_cache_domain);