#
8f11fbe1 |
| 26-Jul-2024 |
Takashi Iwai <tiwai@suse.de> |
ALSA: hda/generic: Add a helper to mute speakers at suspend/shutdown
[ Upstream commit 6cd23b26b348fa52c88e1adf9c0e48d68e13f95e ]
Some devices indicate click noises at suspend or shutdown when the
ALSA: hda/generic: Add a helper to mute speakers at suspend/shutdown
[ Upstream commit 6cd23b26b348fa52c88e1adf9c0e48d68e13f95e ]
Some devices indicate click noises at suspend or shutdown when the speakers are unmuted. This patch adds a helper, snd_hda_gen_shutup_speakers(), to work around it. The new function is supposed to be called at suspend or shutdown by the codec driver, and it mutes the speakers.
The mute status isn't cached, hence the original mute state will be restored at resume again.
Link: https://patch.msgid.link/20240726142625.2460-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
#
5f6af005 |
| 15-Sep-2023 |
Takashi Iwai <tiwai@suse.de> |
ALSA: hda: generic: Check potential mixer name string truncation
add_control_with_pfx() constructs a mixer name element with the fixed size, and it got compile warnings with -Wformat-truncation.
Al
ALSA: hda: generic: Check potential mixer name string truncation
add_control_with_pfx() constructs a mixer name element with the fixed size, and it got compile warnings with -Wformat-truncation.
Although the size overflow is very unlikely, let's have a sanity check of the string size and returns the error if it really doesn't fit instead of silent truncation.
Link: https://lore.kernel.org/r/20230915082802.28684-14-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
3b44ec8c |
| 16-May-2023 |
Takashi Iwai <tiwai@suse.de> |
ALSA: hda: Fix Oops by 9.1 surround channel names
get_line_out_pfx() may trigger an Oops by overflowing the static array with more than 8 channels. This was reported for MacBookPro 12,1 with Cirrus
ALSA: hda: Fix Oops by 9.1 surround channel names
get_line_out_pfx() may trigger an Oops by overflowing the static array with more than 8 channels. This was reported for MacBookPro 12,1 with Cirrus codec.
As a workaround, extend for the 9.1 channels and also fix the potential Oops by unifying the code paths accessing the same array with the proper size check.
Reported-by: Olliver Schinagl <oliver@schinagl.nl> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/64d95eb0-dbdb-cff8-a8b1-988dc22b24cd@schinagl.nl Link: https://lore.kernel.org/r/20230516184412.24078-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
549f8ffc |
| 26-Jan-2022 |
Takashi Iwai <tiwai@suse.de> |
ALSA: hda: Fix UAF of leds class devs at unbinding
The LED class devices that are created by HD-audio codec drivers are registered via devm_led_classdev_register() and associated with the HD-audio c
ALSA: hda: Fix UAF of leds class devs at unbinding
The LED class devices that are created by HD-audio codec drivers are registered via devm_led_classdev_register() and associated with the HD-audio codec device. Unfortunately, it turned out that the devres release doesn't work for this case; namely, since the codec resource release happens before the devm call chain, it triggers a NULL dereference or a UAF for a stale set_brightness_delay callback.
For fixing the bug, this patch changes the LED class device register and unregister in a manual manner without devres, keeping the instances in hda_gen_spec.
Reported-by: Alexander Sergeyev <sergeev917@gmail.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20220111195229.a77wrpjclqwrx4bx@localhost.localdomain Link: https://lore.kernel.org/r/20220126145011.16728-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
327b34f2 |
| 13-Aug-2021 |
Takashi Iwai <tiwai@suse.de> |
ALSA: hda: Nuke unused reboot_notify callback
As reboot_notify callback is no longer used by the codec core, let's get rid of the unused code. Conexant codec needs a slight code change as it used t
ALSA: hda: Nuke unused reboot_notify callback
As reboot_notify callback is no longer used by the codec core, let's get rid of the unused code. Conexant codec needs a slight code change as it used to call the reboot_notify at the codec removal, too.
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045 Link: https://lore.kernel.org/r/20210813081230.4268-4-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
a2befe93 |
| 11-Aug-2021 |
Jaroslav Kysela <perex@perex.cz> |
ALSA: hda - fix the 'Capture Switch' value change notifications
The original code in the cap_put_caller() function does not handle correctly the positive values returned from the passed function for
ALSA: hda - fix the 'Capture Switch' value change notifications
The original code in the cap_put_caller() function does not handle correctly the positive values returned from the passed function for multiple iterations. It means that the change notifications may be lost.
Fixes: 352f7f914ebb ("ALSA: hda - Merge Realtek parser code to generic parser") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=213851 Cc: <stable@kernel.org> Signed-off-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20210811161441.1325250-1-perex@perex.cz Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
08a4b904 |
| 31-May-2021 |
Takashi Iwai <tiwai@suse.de> |
ALSA: hda: Fix a regression in Capture Switch mixer read
The recent commit to drop the HDA-specific mute-LED control, e65bf99718b5 ("ALSA: HDA - remove the custom implementation for the audio LED tr
ALSA: hda: Fix a regression in Capture Switch mixer read
The recent commit to drop the HDA-specific mute-LED control, e65bf99718b5 ("ALSA: HDA - remove the custom implementation for the audio LED trigger"), caused a regression on the mixer element read for "Capture Switch" when it's built from bind controls. The function create_bind_cap_vol_ctl() creates the snd_kcontrol_new object directly via snd_hda_gen_add_kctl() instead of add_control(). Although the commit above added a workaround for the SNDRV_CTL_ACCESS_READWRITE in add_control() as default, this code path fell out from the radar. As a result, now the driver gives -EPERM error because of the lack of the proper access bit at reading "Capture Switch" element value.
Fix the regression by setting the access bit properly.
Fixes: e65bf99718b5 ("ALSA: HDA - remove the custom implementation for the audio LED trigger") BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1186634 Link: https://lore.kernel.org/r/20210531180633.27831-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
e73b4c9e |
| 13-May-2021 |
Jiapeng Chong <jiapeng.chong@linux.alibaba.com> |
ALSA: hda: generic: Remove redundant assignment to dac
Variable dac is set to zero, but this value is never read as it is overwritten or not used later on, hence it is a redundant assignment and can
ALSA: hda: generic: Remove redundant assignment to dac
Variable dac is set to zero, but this value is never read as it is overwritten or not used later on, hence it is a redundant assignment and can be removed.
Clean up the following clang-analyzer warning:
sound/pci/hda/hda_generic.c:1436:4: warning: Value stored to 'dac' is never read [clang-analyzer-deadcode.DeadStores].
Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Link: https://lore.kernel.org/r/1620904271-76027-1-git-send-email-jiapeng.chong@linux.alibaba.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
f48652bb |
| 04-May-2021 |
Hui Wang <hui.wang@canonical.com> |
ALSA: hda: generic: change the DAC ctl name for LO+SPK or LO+HP
Without this change, the DAC ctl's name could be changed only when the machine has both Speaker and Headphone, but we met some machine
ALSA: hda: generic: change the DAC ctl name for LO+SPK or LO+HP
Without this change, the DAC ctl's name could be changed only when the machine has both Speaker and Headphone, but we met some machines which only has Lineout and Headhpone, and the Lineout and Headphone share the Audio Mixer0 and DAC0, the ctl's name is set to "Front".
On most of machines, the "Front" is used for Speaker only or Lineout only, but on this machine it is shared by Lineout and Headphone, This introduces an issue in the pipewire and pulseaudio, suppose users want the Headphone to be on and the Speaker/Lineout to be off, they could turn off the "Front", this works on most of the machines, but on this machine, the "Front" couldn't be turned off otherwise the headphone will be off too. Here we do some change to let the ctl's name change to "Headphone+LO" on this machine, and pipewire and pulseaudio already could handle "Headphone+LO" and "Speaker+LO". (https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/747)
BugLink: http://bugs.launchpad.net/bugs/804178 Signed-off-by: Hui Wang <hui.wang@canonical.com> Link: https://lore.kernel.org/r/20210504073917.22406-1-hui.wang@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
e65bf997 |
| 17-Mar-2021 |
Jaroslav Kysela <perex@perex.cz> |
ALSA: HDA - remove the custom implementation for the audio LED trigger
With the new snd-ctl-led module, we have a generic way to trigger audio LEDs based on the sound control changes.
Remove the cu
ALSA: HDA - remove the custom implementation for the audio LED trigger
With the new snd-ctl-led module, we have a generic way to trigger audio LEDs based on the sound control changes.
Remove the custom implementation from the HDA driver.
Move the LED initialization before snd_hda_gen_parse_auto_config() call in all drivers to create marked controls there.
Signed-off-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20210317172945.842280-5-perex@perex.cz Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
2bf44e0e |
| 11-Mar-2021 |
Hui Wang <hui.wang@canonical.com> |
ALSA: hda: generic: Fix the micmute led init state
Recently we found the micmute led init state is not correct after freshly installing the ubuntu linux on a Lenovo AIO machine. The internal mic is
ALSA: hda: generic: Fix the micmute led init state
Recently we found the micmute led init state is not correct after freshly installing the ubuntu linux on a Lenovo AIO machine. The internal mic is not muted, but the micmute led is on and led mode is 'follow mute'. If we mute internal mic, the led is keeping on, then unmute the internal mic, the led is off. And from then on, the micmute led will work correctly.
So the micmute led init state is not correct. The led is controlled by codec gpio (ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), in the patch_realtek, the gpio data is set to 0x4 initially and the led is on with this data. In the hda_generic, the led_value is set to 0 initially, suppose users set the 'capture switch' to on from user space and the micmute led should change to be off with this operation, but the check "if (val == spec->micmute_led.led_value)" in the call_micmute_led_update() will skip the led setting.
To guarantee the led state will be set by the 1st time of changing "Capture Switch", set -1 to the init led_value.
Cc: <stable@vger.kernel.org> Signed-off-by: Hui Wang <hui.wang@canonical.com> Link: https://lore.kernel.org/r/20210312041408.3776-1-hui.wang@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
3531ba21 |
| 01-Mar-2021 |
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> |
ALSA: hda: fix kernel-doc warnings
v5.12-rc1 flags new warnings with make W=1, fix missing or broken function descriptors.
sound/pci/hda/hda_codec.c:3492: warning: expecting prototype for snd_hda_i
ALSA: hda: fix kernel-doc warnings
v5.12-rc1 flags new warnings with make W=1, fix missing or broken function descriptors.
sound/pci/hda/hda_codec.c:3492: warning: expecting prototype for snd_hda_input_mux_info_info(). Prototype was for snd_hda_input_mux_info() instead
sound/pci/hda/hda_codec.c:3521: warning: expecting prototype for snd_hda_input_mux_info_put(). Prototype was for snd_hda_input_mux_put() instead
sound/pci/hda/hda_codec.c:3958: warning: expecting prototype for _snd_hda_pin_ctl(). Prototype was for _snd_hda_set_pin_ctl() instead
sound/pci/hda/hda_jack.c:223: warning: expecting prototype for snd_hda_set_dirty_all(). Prototype was for snd_hda_jack_set_dirty_all() instead
sound/pci/hda/hda_jack.c:309: warning: expecting prototype for snd_hda_jack_detect_enable_mst(). Prototype was for snd_hda_jack_detect_enable_callback_mst() instead
sound/pci/hda/hda_generic.c:3933: warning: expecting prototype for snd_dha_gen_add_mute_led_cdev(). Prototype was for snd_hda_gen_add_mute_led_cdev() instead
sound/pci/hda/hda_generic.c:4093: warning: expecting prototype for snd_dha_gen_add_micmute_led_cdev(). Prototype was for snd_hda_gen_add_micmute_led_cdev() instead
sound/pci/hda/patch_ca0132.c:2357: warning: expecting prototype for Prepare and send the SCP message to DSP(). Prototype was for dspio_scp() instead
sound/pci/hda/patch_ca0132.c:2883: warning: expecting prototype for Allocate router ports(). Prototype was for dsp_allocate_router_ports() instead
sound/pci/hda/patch_ca0132.c:3202: warning: expecting prototype for Write a block of data into DSP code or data RAM using pre(). Prototype was for dspxfr_one_seg() instead
sound/pci/hda/patch_ca0132.c:3397: warning: expecting prototype for data overlay to DSP memories(). Prototype was for dspxfr_image() instead
sound/hda/hdac_regmap.c:393: warning: expecting prototype for snd_hdac_regmap_init(). Prototype was for snd_hdac_regmap_exit() instead
sound/hda/ext/hdac_ext_controller.c:142: warning: expecting prototype for snd_hdac_ext_bus_get_link_index(). Prototype was for snd_hdac_ext_bus_get_link() instead
sound/hda/ext/hdac_ext_stream.c:140: warning: expecting prototype for snd_hdac_ext_linkstream_start(). Prototype was for snd_hdac_ext_link_stream_start() instead
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210301174617.116960-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
75b1a8f9 |
| 04-Jan-2021 |
Joe Perches <joe@perches.com> |
ALSA: Convert strlcpy to strscpy when return value is unused
strlcpy is deprecated. see: Documentation/process/deprecated.rst
Change the calls that do not use the strlcpy return value to the prefe
ALSA: Convert strlcpy to strscpy when return value is unused
strlcpy is deprecated. see: Documentation/process/deprecated.rst
Change the calls that do not use the strlcpy return value to the preferred strscpy.
Done with cocci script:
@@ expression e1, e2, e3; @@
- strlcpy( + strscpy( e1, e2, e3);
This cocci script leaves the instances where the return value is used unchanged.
After this patch, sound/ has 3 uses of strlcpy() that need to be manually inspected for conversion and changed one day.
$ git grep -w strlcpy sound/ sound/usb/card.c: len = strlcpy(card->longname, s, sizeof(card->longname)); sound/usb/mixer.c: return strlcpy(buf, p->name, buflen); sound/usb/mixer.c: return strlcpy(buf, p->names[index], buflen);
Miscellenea:
o Remove trailing whitespace in conversion of sound/core/hwdep.c
Link: https://lore.kernel.org/lkml/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/22b393d1790bb268769d0bab7bacf0866dcb0c14.camel@perches.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
242d990c |
| 27-Nov-2020 |
Takashi Iwai <tiwai@suse.de> |
ALSA: hda/generic: Add option to enforce preferred_dacs pairs
The generic parser accepts the preferred_dacs[] pairs as a hint for assigning a DAC to each pin, but this hint doesn't work always effec
ALSA: hda/generic: Add option to enforce preferred_dacs pairs
The generic parser accepts the preferred_dacs[] pairs as a hint for assigning a DAC to each pin, but this hint doesn't work always effectively. Currently it's merely a secondary choice after the trial with the path index failed. This made sometimes it difficult to assign DACs without mimicking the connection list and/or the badness table.
This patch adds a new flag, obey_preferred_dacs, that changes the behavior of the parser. As its name stands, the parser obeys the given preferred_dacs[] pairs by skipping the path index matching and giving a high penalty if no DAC is assigned by the pairs. This mode will help for assigning the fixed DACs forcibly from the codec driver.
Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20201127141104.11041-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
c7fabbc5 |
| 05-Aug-2020 |
Randy Dunlap <rdunlap@infradead.org> |
ALSA: pci: delete repeated words in comments
Drop duplicated words in sound/pci/. {and, the, at}
Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Link: https://lore.kernel.org/r/20200806021926.3
ALSA: pci: delete repeated words in comments
Drop duplicated words in sound/pci/. {and, the, at}
Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Link: https://lore.kernel.org/r/20200806021926.32418-1-rdunlap@infradead.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
9ab0cb30 |
| 17-Jul-2020 |
Takashi Iwai <tiwai@suse.de> |
ALSA: Replace the word "slave" in vmaster API
Follow the recent inclusive terminology guidelines and replace the word "slave" in vmaster API. I chose the word "follower" at this time since it seems
ALSA: Replace the word "slave" in vmaster API
Follow the recent inclusive terminology guidelines and replace the word "slave" in vmaster API. I chose the word "follower" at this time since it seems fitting for the purpose.
Note that the word "master" is kept in API, since it refers rather to audio master volume control.
Also, while we're at it, a typo in comments is corrected, too.
Link: https://lore.kernel.org/r/20200717154517.27599-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
c9e272f9 |
| 18-Jun-2020 |
Takashi Iwai <tiwai@suse.de> |
ALSA: hda: Let LED cdev handling suspend/resume
Set LED_CORE_SUSPENDRESUME to LED cdev flags, so that the LED core would store and restore the LED status at suspend/resume.
In theory, the codec dri
ALSA: hda: Let LED cdev handling suspend/resume
Set LED_CORE_SUSPENDRESUME to LED cdev flags, so that the LED core would store and restore the LED status at suspend/resume.
In theory, the codec driver should be responsible for all LED bits, but this might be safer and cover the overlooked cases.
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Link: https://lore.kernel.org/r/20200618110842.27238-14-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
15509b63 |
| 18-Jun-2020 |
Takashi Iwai <tiwai@suse.de> |
ALSA: hda: generic: Add vmaster mute LED helper
Like mic-mute LED handling, add a new helper to deal with the master mute LED with LED classdev. Unlike the mic-mute case, the playback master mute i
ALSA: hda: generic: Add vmaster mute LED helper
Like mic-mute LED handling, add a new helper to deal with the master mute LED with LED classdev. Unlike the mic-mute case, the playback master mute is hooked on vmaster, and we suppose no nested hooks allowed there.
The classdev creation code is factored out to a common function that is called from both mute and mic-mute LED helpers.
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Link: https://lore.kernel.org/r/20200618110842.27238-9-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
fe1a1621 |
| 18-Jun-2020 |
Takashi Iwai <tiwai@suse.de> |
ALSA: hda: generic: Drop the old mic-mute LED hook
Now all users of the old snd_hda_gen_add_micmute_led() have been converted to the new LED-classdev variant, and we can make it local, and remove th
ALSA: hda: generic: Drop the old mic-mute LED hook
Now all users of the old snd_hda_gen_add_micmute_led() have been converted to the new LED-classdev variant, and we can make it local, and remove the unused hda_gen_spec.micmute_led.update callback field.
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Link: https://lore.kernel.org/r/20200618110842.27238-8-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
5fc0f693 |
| 18-Jun-2020 |
Takashi Iwai <tiwai@suse.de> |
ALSA: hda: generic: Drop unused snd_hda_gen_fixup_micmute_led()
The fixup function is no longer used. Let's drop.
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Link: https://lore.kernel.o
ALSA: hda: generic: Drop unused snd_hda_gen_fixup_micmute_led()
The fixup function is no longer used. Let's drop.
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Link: https://lore.kernel.org/r/20200618110842.27238-7-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
7cdf8c49 |
| 18-Jun-2020 |
Takashi Iwai <tiwai@suse.de> |
ALSA: hda: generic: Add a helper for mic-mute LED with LED classdev
A new helper, snd_hda_gen_add_micmute_led_cdev(), is introduced here for creating a LED classdev and setting up the hook to the ca
ALSA: hda: generic: Add a helper for mic-mute LED with LED classdev
A new helper, snd_hda_gen_add_micmute_led_cdev(), is introduced here for creating a LED classdev and setting up the hook to the capture control for controlling the mic-mute LED to follow the capture switch change. This will replace the existing users of snd_hda_gen_add_micmute_led() in later patches.
Also, introduce a new kconfig CONFIG_SND_HDA_GENERIC_LEDS, to indicate the usage of mute / mic-mute LED helpers. It's selected by the codec drivers (Realtek, Conexant and Sigmatel), while it selects the necessary LED class dependencies.
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Link: https://lore.kernel.org/r/20200618110842.27238-3-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
bf61c42a |
| 18-Jun-2020 |
Takashi Iwai <tiwai@suse.de> |
ALSA: hda: generic: Always call led-trigger for mic mute LED
Instead of adding a special hook to trigger the mic-mute LED device, call it always from the common callback function. It won't hurt eve
ALSA: hda: generic: Always call led-trigger for mic mute LED
Instead of adding a special hook to trigger the mic-mute LED device, call it always from the common callback function. It won't hurt even if no corresponding led cdev is present.
This is basically a preliminary change for the later patches to convert the all mic-mute LED handling to LED class cdev.
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Link: https://lore.kernel.org/r/20200618110842.27238-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
4f5c2653 |
| 13-Jan-2020 |
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> |
ALSA: hda: correct kernel-doc parameter descriptions
make W=1 throws warnings, provide missing documentation
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https:/
ALSA: hda: correct kernel-doc parameter descriptions
make W=1 throws warnings, provide missing documentation
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200113211405.28070-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
1a462be5 |
| 09-Jan-2020 |
Takashi Iwai <tiwai@suse.de> |
ALSA: hda: Manage concurrent reg access more properly
In the commit 8e85def5723e ("ALSA: hda: enable regmap internal locking"), we re-enabled the regmap lock due to the reported regression that show
ALSA: hda: Manage concurrent reg access more properly
In the commit 8e85def5723e ("ALSA: hda: enable regmap internal locking"), we re-enabled the regmap lock due to the reported regression that showed the possible concurrent accesses. It was a temporary workaround, and there are still a few opened races even after the revert. In this patch, we cover those still opened windows with a proper mutex lock and disable the regmap internal lock again.
First off, the patch introduces a new snd_hdac_device.regmap_lock mutex that is applied for each snd_hdac_regmap_*() call, including read, write and update helpers. The mutex is applied carefully so that it won't block the self-power-up procedure in the helper function. Also, this assures the protection for the accesses without regmap, too.
The snd_hdac_regmap_update_raw() is refactored to use the standard regmap_update_bits_check() function instead of the open-code. The non-regmap case is still open-coded but it's an easy part. The all read and write operations are in the single mutex protection, so it's now race-free.
In addition, a couple of new helper functions are added: snd_hdac_regmap_update_raw_once() and snd_hdac_regmap_sync(). Both are called from HD-audio legacy driver. The former is to initialize the given verb bits but only once when it's not initialized yet. Due to this condition, the function invokes regcache_cache_only(), and it's now performed inside the regmap_lock (formerly it was racy) too. The latter function is for simply invoking regcache_sync() inside the regmap_lock, which is called from the codec resume call path. Along with that, the HD-audio codec driver code is slightly modified / simplified to adapt those new functions.
And finally, snd_hdac_regmap_read_raw(), *_write_raw(), etc are rewritten with the helper macro. It's just for simplification because the code logic is identical among all those functions.
Tested-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20200109090104.26073-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
caf3c043 |
| 03-Jan-2020 |
Michał Mirosław <mirq-linux@rere.qmqm.pl> |
ALSA: hda - constify and cleanup static NodeID tables
Make hda_nid_t tables static const, as they are not intended to be modified by callees.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl
ALSA: hda - constify and cleanup static NodeID tables
Make hda_nid_t tables static const, as they are not intended to be modified by callees.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Link: https://lore.kernel.org/r/5150c94101c9534f4c8e987324f6912c16d459f6.1578043216.git.mirq-linux@rere.qmqm.pl Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|