|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5, v6.13-rc4, v6.13-rc3, v6.13-rc2, v6.13-rc1, v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2 |
|
| #
d278a9de |
| 02-Oct-2024 |
Jaroslav Kysela <[email protected]> |
ALSA: core: add isascii() check to card ID generator
The card identifier should contain only safe ASCII characters. The isalnum() returns true also for characters for non-ASCII characters.
Link: ht
ALSA: core: add isascii() check to card ID generator
The card identifier should contain only safe ASCII characters. The isalnum() returns true also for characters for non-ASCII characters.
Link: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4135 Link: https://lore.kernel.org/linux-sound/yk3WTvKkwheOon_LzZlJ43PPInz6byYfBzpKkbasww1yzuiMRqn7n6Y8vZcXB-xwFCu_vb8hoNjv7DTNwH5TWjpEuiVsyn9HPCEXqwF4120=@protonmail.com/ Cc: [email protected] Reported-by: Barnabás Pőcze <[email protected]> Signed-off-by: Jaroslav Kysela <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
|
Revision tags: v6.12-rc1, v6.11, v6.11-rc7, v6.11-rc6, v6.11-rc5, v6.11-rc4, v6.11-rc3 |
|
| #
f428cc9e |
| 09-Aug-2024 |
Takashi Iwai <[email protected]> |
ALSA: control: Rename ctl_files_rwlock to controls_rwlock
We'll re-use the existing rwlock for the protection of control list lookup, too, and now rename it to a more generic name.
This is a prelim
ALSA: control: Rename ctl_files_rwlock to controls_rwlock
We'll re-use the existing rwlock for the protection of control list lookup, too, and now rename it to a more generic name.
This is a preliminary change, only the rename of the struct field here, no functional changes.
Signed-off-by: Takashi Iwai <[email protected]> Link: https://patch.msgid.link/[email protected]
show more ...
|
|
Revision tags: v6.11-rc2, v6.11-rc1, v6.10, v6.10-rc7, v6.10-rc6, v6.10-rc5, v6.10-rc4, v6.10-rc3, v6.10-rc2, v6.10-rc1 |
|
| #
495000a3 |
| 24-May-2024 |
Takashi Iwai <[email protected]> |
ALSA: core: Remove debugfs at disconnection
The card-specific debugfs entries are removed at the last stage of card free phase, and it's performed after synchronization of the closes of all opened f
ALSA: core: Remove debugfs at disconnection
The card-specific debugfs entries are removed at the last stage of card free phase, and it's performed after synchronization of the closes of all opened fds. This works fine for most cases, but it can be potentially problematic for a hotplug device like USB-audio. Due to the nature of snd_card_free_when_closed(), the card free isn't called immediately after the driver removal for a hotplug device, but it's left until the last fd is closed. It implies that the card debugfs entries also remain. Meanwhile, when a new device is inserted before the last close and the very same card slot is assigned, the driver tries to create the card debugfs root again on the very same path. This conflicts with the remaining entry, and results in the kernel warning such as: debugfs: Directory 'card0' with parent 'sound' already present! with the missing debugfs entry afterwards.
For avoiding such conflicts, remove debugfs entries at the device disconnection phase instead. The jack kctl debugfs entries get removed in snd_jack_dev_disconnect() instead of each kctl private_free.
Fixes: 2d670ea2bd53 ("ALSA: jack: implement software jack injection via debugfs") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
| #
c1a8d5f3 |
| 22-May-2024 |
Takashi Iwai <[email protected]> |
ALSA: core: Enable proc module when CONFIG_MODULES=y
We used '#ifdef MODULE' for judging whether the system supports the sound module or not, and /proc/asound/modules is created only when '#ifdef MO
ALSA: core: Enable proc module when CONFIG_MODULES=y
We used '#ifdef MODULE' for judging whether the system supports the sound module or not, and /proc/asound/modules is created only when '#ifdef MODULE' is true. The check is not really appropriate, though, because the flag means only for the sound core and the drivers are still allowed to be built as modules even if 'MODULE' is not set in sound/core/init.c.
For fixing the inconsistency, replace those ifdefs with 'ifdef CONFIG_MODULES'. One place for a NULL module check is rewritten with IS_MODULE(CONFIG_SND) to be more intuitive. It can't be changed to CONFIG_MODULES; otherwise it would hit a WARN_ON() incorrectly.
This is a slight behavior change; the modules proc entry appears now no matter whether the sound core is built-in or not as long as modules are enabled on the kernel in general. This can't be avoided due to the nature of kernel builds.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]> Tested-by: Xu Yang <[email protected]> Link: https://lore.kernel.org/r/[email protected]
show more ...
|
| #
39381fe7 |
| 22-May-2024 |
Takashi Iwai <[email protected]> |
ALSA: core: Fix NULL module pointer assignment at card init
The commit 81033c6b584b ("ALSA: core: Warn on empty module") introduced a WARN_ON() for a NULL module pointer passed at snd_card object cr
ALSA: core: Fix NULL module pointer assignment at card init
The commit 81033c6b584b ("ALSA: core: Warn on empty module") introduced a WARN_ON() for a NULL module pointer passed at snd_card object creation, and it also wraps the code around it with '#ifdef MODULE'. This works in most cases, but the devils are always in details. "MODULE" is defined when the target code (i.e. the sound core) is built as a module; but this doesn't mean that the caller is also built-in or not. Namely, when only the sound core is built-in (CONFIG_SND=y) while the driver is a module (CONFIG_SND_USB_AUDIO=m), the passed module pointer is ignored even if it's non-NULL, and card->module remains as NULL. This would result in the missing module reference up/down at the device open/close, leading to a race with the code execution after the module removal.
For addressing the bug, move the assignment of card->module again out of ifdef. The WARN_ON() is still wrapped with ifdef because the module can be really NULL when all sound drivers are built-in.
Note that we keep 'ifdef MODULE' for WARN_ON(), otherwise it would lead to a false-positive NULL module check. Admittedly it won't catch perfectly, i.e. no check is performed when CONFIG_SND=y. But, it's no real problem as it's only for debugging, and the condition is pretty rare.
Fixes: 81033c6b584b ("ALSA: core: Warn on empty module") Reported-by: Xu Yang <[email protected]> Closes: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Tested-by: Xu Yang <[email protected]> Link: https://lore.kernel.org/r/[email protected]
show more ...
|
|
Revision tags: v6.9 |
|
| #
da0713ff |
| 10-May-2024 |
Takashi Iwai <[email protected]> |
ALSA: core: Remove superfluous CONFIG_PM
Since the recent code change, the conditional build with CONFIG_PM is calling only snd_power_sync_ref(). As a dummy function is provided for this function,
ALSA: core: Remove superfluous CONFIG_PM
Since the recent code change, the conditional build with CONFIG_PM is calling only snd_power_sync_ref(). As a dummy function is provided for this function, we can get rid of CONFIG_PM gracefully now.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
| #
87988a53 |
| 10-May-2024 |
Takashi Iwai <[email protected]> |
ALSA: Fix deadlocks with kctl removals at disconnection
In snd_card_disconnect(), we set card->shutdown flag at the beginning, call callbacks and do sync for card->power_ref_sleep waiters at the end
ALSA: Fix deadlocks with kctl removals at disconnection
In snd_card_disconnect(), we set card->shutdown flag at the beginning, call callbacks and do sync for card->power_ref_sleep waiters at the end. The callback may delete a kctl element, and this can lead to a deadlock when the device was in the suspended state. Namely:
* A process waits for the power up at snd_power_ref_and_wait() in snd_ctl_info() or read/write() inside card->controls_rwsem.
* The system gets disconnected meanwhile, and the driver tries to delete a kctl via snd_ctl_remove*(); it tries to take card->controls_rwsem again, but this is already locked by the above. Since the sleeper isn't woken up, this deadlocks.
An easy fix is to wake up sleepers before processing the driver disconnect callbacks but right after setting the card->shutdown flag. Then all sleepers will abort immediately, and the code flows again.
So, basically this patch moves the wait_event() call at the right timing. While we're at it, just to be sure, call wait_event_all() instead of wait_event(), although we don't use exclusive events on this queue for now.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=218816 Cc: <[email protected]> Reviewed-by: Jaroslav Kysela <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
|
Revision tags: v6.9-rc7, v6.9-rc6, v6.9-rc5, v6.9-rc4, v6.9-rc3, v6.9-rc2, v6.9-rc1, v6.8, v6.8-rc7 |
|
| #
742ecf3c |
| 27-Feb-2024 |
Takashi Iwai <[email protected]> |
ALSA: core: Use guard() for locking
We can simplify the code gracefully with new guard() macro and co for automatic cleanup of locks.
Only the code refactoring, and no functional changes.
Signed-o
ALSA: core: Use guard() for locking
We can simplify the code gracefully with new guard() macro and co for automatic cleanup of locks.
Only the code refactoring, and no functional changes.
Signed-off-by: Takashi Iwai <[email protected]> Link: https://lore.kernel.org/r/[email protected]
show more ...
|
|
Revision tags: v6.8-rc6, v6.8-rc5, v6.8-rc4, v6.8-rc3, v6.8-rc2, v6.8-rc1, v6.7, v6.7-rc8, v6.7-rc7, v6.7-rc6, v6.7-rc5, v6.7-rc4, v6.7-rc3, v6.7-rc2, v6.7-rc1, v6.6, v6.6-rc7, v6.6-rc6, v6.6-rc5, v6.6-rc4, v6.6-rc3, v6.6-rc2 |
|
| #
091c2848 |
| 12-Sep-2023 |
Peter Ujfalusi <[email protected]> |
ALSA: core: Use dev_name of card_dev as debugfs directory name
There is no need to use temporary string for the debugfs directory name as we can use the device name of the card.
This change will al
ALSA: core: Use dev_name of card_dev as debugfs directory name
There is no need to use temporary string for the debugfs directory name as we can use the device name of the card.
This change will also fixes the following compiler warning/error (W=1):
sound/core/init.c: In function ‘snd_card_init’: sound/core/init.c:367:28: error: ‘%d’ directive writing between 1 and 10 bytes into a region of size 4 [-Werror=format-overflow=] 367 | sprintf(name, "card%d", idx); | ^~ sound/core/init.c:367:23: note: directive argument in the range [0, 2147483646] 367 | sprintf(name, "card%d", idx); | ^~~~~~~~ sound/core/init.c:367:9: note: ‘sprintf’ output between 6 and 15 bytes into a destination of size 8 367 | sprintf(name, "card%d", idx); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors
The idx is guarantied to be less than SNDRV_CARDS (max 256 or 8) by the code in snd_card_init(), however the compiler does not see that.
The warnings got brought to light by a recent patch upstream: commit 6d4ab2e97dcf ("extrawarn: enable format and stringop overflow warnings in W=1")
Suggested-by: Arnd Bergmann <[email protected]> Suggested-by: Takashi Iwai <[email protected]> Signed-off-by: Peter Ujfalusi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
|
Revision tags: v6.6-rc1, v6.5, v6.5-rc7 |
|
| #
01ed7f35 |
| 16-Aug-2023 |
Takashi Iwai <[email protected]> |
ALSA: core: Drop snd_device_initialize()
Now all users of snd_device_intialize() are gone, let's drop it.
Reviewed-by: Jaroslav Kysela <[email protected]> Signed-off-by: Curtis Malainey <cujomalainey@
ALSA: core: Drop snd_device_initialize()
Now all users of snd_device_intialize() are gone, let's drop it.
Reviewed-by: Jaroslav Kysela <[email protected]> Signed-off-by: Curtis Malainey <[email protected]> Tested-by: Curtis Malainey <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
| #
7f018db1 |
| 16-Aug-2023 |
Takashi Iwai <[email protected]> |
ALSA: core: Introduce snd_device_alloc()
Introduce a new helper, snd_device_alloc(), for allocating a struct device that is bound with the sound class. It's a replacement of snd_device_initialize()
ALSA: core: Introduce snd_device_alloc()
Introduce a new helper, snd_device_alloc(), for allocating a struct device that is bound with the sound class. It's a replacement of snd_device_initialize().
Reviewed-by: Jaroslav Kysela <[email protected]> Signed-off-by: Curtis Malainey <[email protected]> Tested-by: Curtis Malainey <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
|
Revision tags: v6.5-rc6, v6.5-rc5, v6.5-rc4, v6.5-rc3, v6.5-rc2, v6.5-rc1, v6.4 |
|
| #
8d0cf150 |
| 20-Jun-2023 |
Ivan Orlov <[email protected]> |
sound: make all 'class' structures const
Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read
sound: make all 'class' structures const
Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read-only memory, instead of having to be dynamically allocated at load time.
Cc: Jaroslav Kysela <[email protected]> Cc: Takashi Iwai <[email protected]> Cc: Ivan Orlov <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Geoff Levand <[email protected]> Cc: Thierry Reding <[email protected]> Cc: "Uwe Kleine-König" <[email protected]> Cc: [email protected] Suggested-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Ivan Orlov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
|
Revision tags: v6.4-rc7, v6.4-rc6, v6.4-rc5, v6.4-rc4, v6.4-rc3, v6.4-rc2, v6.4-rc1, v6.3, v6.3-rc7, v6.3-rc6, v6.3-rc5, v6.3-rc4, v6.3-rc3, v6.3-rc2, v6.3-rc1, v6.2, v6.2-rc8 |
|
| #
25a5a77a |
| 07-Feb-2023 |
Uwe Kleine-König <[email protected]> |
ALSA: core: Make snd_card_free() return void
The function returns 0 unconditionally. Make it return void instead and simplify all callers accordingly.
Signed-off-by: Uwe Kleine-König <u.kleine-koen
ALSA: core: Make snd_card_free() return void
The function returns 0 unconditionally. Make it return void instead and simplify all callers accordingly.
Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Jaroslav Kysela <[email protected]> Reviewed-by: Takashi Sakamoto <[email protected]> Acked-by: Geoff Levand <[email protected]> Acked-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
| #
73c5685c |
| 07-Feb-2023 |
Uwe Kleine-König <[email protected]> |
ALSA: core: Make snd_card_free_when_closed() return void
All callers from other files ignore the return value of this function. And it can only ever return a non-zero value if the parameter card is
ALSA: core: Make snd_card_free_when_closed() return void
All callers from other files ignore the return value of this function. And it can only ever return a non-zero value if the parameter card is NULL.
This cannot happen in snd_card_free() as card was dereferenced just before snd_card_free_when_closed() is called. So the error handling can be dropped there.
Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Jaroslav Kysela <[email protected]> Reviewed-by: Takashi Sakamoto <[email protected]> Acked-by: Geoff Levand <[email protected]> Acked-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
| #
663f922f |
| 07-Feb-2023 |
Uwe Kleine-König <[email protected]> |
ALSA: core: Make snd_card_disconnect() return void
All callers from other files ignore the return value of this function. And it can only ever return a non-zero value if the parameter card is NULL.
ALSA: core: Make snd_card_disconnect() return void
All callers from other files ignore the return value of this function. And it can only ever return a non-zero value if the parameter card is NULL.
Move the check for card being NULL into snd_card_free_when_closed() to keep the previous behaviour. Note this isn't necessary for snd_card_disconnect_sync() because if card was NULL in there the dereference of card for dev_err() would oops the kernel. Replace this by an oops triggered by the dereference of card for spin_lock_irq().
Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Jaroslav Kysela <[email protected]> Reviewed-by: Takashi Sakamoto <[email protected]> Acked-by: Geoff Levand <[email protected]> Acked-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
|
Revision tags: v6.2-rc7, v6.2-rc6, v6.2-rc5, v6.2-rc4, v6.2-rc3, v6.2-rc2, v6.2-rc1, v6.1, v6.1-rc8, v6.1-rc7, v6.1-rc6, v6.1-rc5, v6.1-rc4, v6.1-rc3, v6.1-rc2, v6.1-rc1, v6.0, v6.0-rc7 |
|
| #
c3afa2a4 |
| 19-Sep-2022 |
Takashi Iwai <[email protected]> |
ALSA: core: Fix double-free at snd_card_new()
During the code change to add the support for devres-managed card instance, we put an explicit kfree(card) call at the error path in snd_card_new(). Th
ALSA: core: Fix double-free at snd_card_new()
During the code change to add the support for devres-managed card instance, we put an explicit kfree(card) call at the error path in snd_card_new(). This is needed for the early error path before the card is initialized with the device, but is rather superfluous and causes a double-free at the error path after the card instance is initialized, as the destructor of the card object already contains a kfree() call.
This patch fixes the double-free situation by removing the superfluous kfree(). Meanwhile we need to call kfree() explicitly for the early error path, so it's added there instead.
Fixes: e8ad415b7a55 ("ALSA: core: Add managed card creation") Reported-by: Rondreis <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/CAB7eexL1zBnB636hwS27d-LdPYZ_R1-5fJS_h=ZbCWYU=UPWJg@mail.gmail.com Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
|
Revision tags: v6.0-rc6, v6.0-rc5, v6.0-rc4, v6.0-rc3, v6.0-rc2, v6.0-rc1 |
|
| #
0031812b |
| 01-Aug-2022 |
Takashi Iwai <[email protected]> |
ALSA: core: Replace scnprintf() with sysfs_emit()
sysfs_emit() is a new helper to simplify the sysfs string output. Replace the open-code with this new helper.
Link: https://lore.kernel.org/r/20220
ALSA: core: Replace scnprintf() with sysfs_emit()
sysfs_emit() is a new helper to simplify the sysfs string output. Replace the open-code with this new helper.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
|
Revision tags: v5.19, v5.19-rc8, v5.19-rc7 |
|
| #
281dee67 |
| 13-Jul-2022 |
Takashi Iwai <[email protected]> |
ALSA: core: Fix missing return value comments for kernel docs
Each kernel doc comment expects the definition of the return value in a proper format. This patch adds or fixes the missing entries for
ALSA: core: Fix missing return value comments for kernel docs
Each kernel doc comment expects the definition of the return value in a proper format. This patch adds or fixes the missing entries for the remaining ALSA core API functions.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
|
Revision tags: v5.19-rc6, v5.19-rc5, v5.19-rc4, v5.19-rc3, v5.19-rc2 |
|
| #
c27e1efb |
| 10-Jun-2022 |
Takashi Iwai <[email protected]> |
ALSA: control: Use xarray for faster lookups
The control elements are managed in a single linked list and we traverse the whole list for matching each numid or ctl id per every inquiry of a control
ALSA: control: Use xarray for faster lookups
The control elements are managed in a single linked list and we traverse the whole list for matching each numid or ctl id per every inquiry of a control element. This is OK-ish for a small number of elements but obviously it doesn't scale. Especially the matching with the ctl id takes time because it checks each field of the snd_ctl_id element, e.g. the name string is matched with strcmp().
This patch adds the hash tables with Xarray for improving the lookup speed of a control element. There are two xarray tables added to the card; one for numid and another for ctl id. For the numid, we use the numid as the index, while for the ctl id, we calculate a hash key.
The lookup is done via a single xa_load() execution. As long as the given control element is found on the Xarray table, that's fine, we can give back a quick lookup result. The problem is when no entry hits on the table, and for this case, we have a slight optimization. Namely, the driver checks whether we had a collision on Xarray table, and do a fallback search (linear lookup of the full entries) only if a hash key collision happened beforehand. So, in theory, the inquiry for a non-existing element might take still time even with this patch in a worst case, but this must be pretty rare.
The feature is enabled via CONFIG_SND_CTL_FAST_LOOKUP, which is turned on as default. For simplicity, the option can be turned off only when CONFIG_EXPERT is set ("You are expert? Then you manage 1000 knobs").
Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
|
Revision tags: v5.19-rc1, v5.18, v5.18-rc7, v5.18-rc6, v5.18-rc5, v5.18-rc4, v5.18-rc3 |
|
| #
fee2b871 |
| 12-Apr-2022 |
Takashi Iwai <[email protected]> |
ALSA: core: Add snd_card_free_on_error() helper
This is a small helper function to handle the error path more easily when an error happens during the probe for the device with the device-managed car
ALSA: core: Add snd_card_free_on_error() helper
This is a small helper function to handle the error path more easily when an error happens during the probe for the device with the device-managed card. Since devres releases in the reverser order of the creations, usually snd_card_free() gets called at the last in the probe error path unless it already reached snd_card_register() calls. Due to this nature, when a driver expects the resource releases in card->private_free, this might be called too lately.
As a workaround, one should call the probe like:
static int __some_probe(...) { // do real probe.... }
static int some_probe(...) { return snd_card_free_on_error(dev, __some_probe(dev, ...)); }
so that the snd_card_free() is called explicitly at the beginning of the error path from the probe.
This function will be used in the upcoming fixes to address the regressions by devres usages.
Fixes: e8ad415b7a55 ("ALSA: core: Add managed card creation") Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
|
Revision tags: v5.18-rc2, v5.18-rc1, v5.17, v5.17-rc8, v5.17-rc7, v5.17-rc6, v5.17-rc5, v5.17-rc4, v5.17-rc3, v5.17-rc2, v5.17-rc1 |
|
| #
8c0ae778 |
| 19-Jan-2022 |
Takashi Iwai <[email protected]> |
ALSA: core: Simplify snd_power_ref_and_wait() with the standard macro
Use wait_event_cmd() macro and simplify snd_power_ref_wait() implementation. This may also cover possible races in the current
ALSA: core: Simplify snd_power_ref_and_wait() with the standard macro
Use wait_event_cmd() macro and simplify snd_power_ref_wait() implementation. This may also cover possible races in the current open code, too.
Reviewed-by: Jaroslav Kysela <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
|
Revision tags: v5.16, v5.16-rc8, v5.16-rc7, v5.16-rc6, v5.16-rc5, v5.16-rc4, v5.16-rc3, v5.16-rc2, v5.16-rc1, v5.15, v5.15-rc7, v5.15-rc6, v5.15-rc5, v5.15-rc4, v5.15-rc3, v5.15-rc2, v5.15-rc1, v5.14, v5.14-rc7, v5.14-rc6, v5.14-rc5, v5.14-rc4 |
|
| #
825a5248 |
| 31-Jul-2021 |
Takashi Iwai <[email protected]> |
ALSA: core: Fix double calls of snd_card_free() via devres
At the transition to the devres-managed card release, we've put the check of double-free at trigger_card_release(). But this wasn't enough
ALSA: core: Fix double calls of snd_card_free() via devres
At the transition to the devres-managed card release, we've put the check of double-free at trigger_card_release(). But this wasn't enough, as the code path calls snd_card_free() again, and it would lead to the doubly snd_card_free() calls.
Actually the v1 patch was correct to handle this, but I forgot that corner case and moved the check to the more obvious place as I thought it's clearer. But, as usual, devils live in details.
This patch corrects the check of the double-free to the right place, with a bit more comments.
Fixes: e8ad415b7a55 ("ALSA: core: Add managed card creation") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
|
Revision tags: v5.14-rc3, v5.14-rc2 |
|
| #
e8ad415b |
| 15-Jul-2021 |
Takashi Iwai <[email protected]> |
ALSA: core: Add managed card creation
As a second step for preliminary to widen the devres usages among sound drivers, this patch adds a new ALSA core API function, snd_devm_card_new(), to create a
ALSA: core: Add managed card creation
As a second step for preliminary to widen the devres usages among sound drivers, this patch adds a new ALSA core API function, snd_devm_card_new(), to create a snd_card object via devres. When a card object is created by this new function, snd_card_free() is called automatically and the card object resource gets released at the device unbinding time.
However, the story isn't that simple. A caveat is that we have to call snd_card_free() at the very first of the whole resource release procedure, in order to assure that the all exposed devices on user-space are deleted and sync with processes accessing those devices before releasing resources.
For achieving it, snd_card_register() adds a new devres action to trigger snd_card_free() automatically when the given card object is a "managed" one. Since usually snd_card_register() is the last step of the initialization, this should work in most cases.
With all these tricks, some drivers can get rid of the whole driver remove callback code.
About a bit of implementation details: the patch adds two new flags to snd_card object: managed and releasing. The former indicates that the object was created via snd_devm_card_new(), and the latter is used for avoiding the double-free of snd_card_free() calls. Both flags are fairly internal and likely uninteresting to normal users.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
|
Revision tags: v5.14-rc1, v5.13, v5.13-rc7, v5.13-rc6 |
|
| #
e3ded899 |
| 08-Jun-2021 |
Takashi Iwai <[email protected]> |
ALSA: core: Fix assignment in if condition
There are a few places doing assignments in if condition in ALSA core code, which is a bad coding style that may confuse readers and occasionally lead to b
ALSA: core: Fix assignment in if condition
There are a few places doing assignments in if condition in ALSA core code, which is a bad coding style that may confuse readers and occasionally lead to bugs.
This patch is merely for coding-style fixes, no functional changes.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
|
Revision tags: v5.13-rc5, v5.13-rc4 |
|
| #
873fd813 |
| 26-May-2021 |
YueHaibing <[email protected]> |
ALSA: core: use DEVICE_ATTR_*() macro
Use DEVICE_ATTR_*() helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read.
Signed-off-by: YueHaibing <[email protected]
ALSA: core: use DEVICE_ATTR_*() macro
Use DEVICE_ATTR_*() helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read.
Signed-off-by: YueHaibing <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|