lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 11 May 2022 15:59:44 +0200
From:   Takashi Iwai <tiwai@...e.de>
To:     Vitaly Rodionov <vitalyr@...nsource.cirrus.com>
Cc:     Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
        Mark Brown <broonie@...nel.org>, <alsa-devel@...a-project.org>,
        <patches@...nsource.cirrus.com>, <linux-kernel@...r.kernel.org>,
        Stefan Binding <sbinding@...nsource.cirrus.com>
Subject: Re: [PATCH v2 26/26] ALSA: hda: cs35l41: Add kernel config to disable firmware autoload

On Mon, 09 May 2022 23:47:03 +0200,
Vitaly Rodionov wrote:
> 
> From: Stefan Binding <sbinding@...nsource.cirrus.com>
> 
> By default, the driver will automatically load DSP firmware
> for the amps, if available. Adding this option allows the
> autoload to be optional, which allows for different configurations.

Shouldn't this be rather a runtime option instead of a build-time
kconfig?


thanks,

Takashi

> Signed-off-by: Stefan Binding <sbinding@...nsource.cirrus.com>
> Signed-off-by: Vitaly Rodionov <vitalyr@...nsource.cirrus.com>
> ---
>  sound/pci/hda/Kconfig       |  7 +++++++
>  sound/pci/hda/cs35l41_hda.c | 12 +++++++-----
>  2 files changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig
> index 1c378cca5dac..c4282dec4dd4 100644
> --- a/sound/pci/hda/Kconfig
> +++ b/sound/pci/hda/Kconfig
> @@ -94,6 +94,13 @@ config SND_HDA_PATCH_LOADER
>  config SND_HDA_SCODEC_CS35L41
>  	tristate
>  
> +config SND_HDA_SCODEC_CS35L41_DISABLE_FIRMWARE_AUTOSTART
> +	bool "Prevent CS35L41 from starting firmware on boot"
> +	depends on SND_HDA_SCODEC_CS35L41
> +	help
> +	  Say Y here to prevent the CS35L41 HDA driver from loading DSP
> +	  Firmware at boot
> +
>  config SND_HDA_CS_DSP_CONTROLS
>  	tristate
>  	depends on CS_DSP
> diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c
> index 70e5354e3950..8b9e966145b5 100644
> --- a/sound/pci/hda/cs35l41_hda.c
> +++ b/sound/pci/hda/cs35l41_hda.c
> @@ -773,11 +773,13 @@ static int cs35l41_hda_bind(struct device *dev, struct device *master, void *mas
>  
>  	cs35l41->firmware_type = HDA_CS_DSP_FW_SPK_PROT;
>  
> -	cs35l41->request_fw_load = true;
> -	mutex_lock(&cs35l41->fw_mutex);
> -	if (cs35l41_smart_amp(cs35l41) < 0)
> -		dev_warn(cs35l41->dev, "Cannot Run Firmware, reverting to dsp bypass...\n");
> -	mutex_unlock(&cs35l41->fw_mutex);
> +	if (!IS_ENABLED(CONFIG_SND_HDA_SCODEC_CS35L41_DISABLE_FIRMWARE_AUTOSTART)) {
> +		cs35l41->request_fw_load = true;
> +		mutex_lock(&cs35l41->fw_mutex);
> +		if (cs35l41_smart_amp(cs35l41) < 0)
> +			dev_warn(cs35l41->dev, "Cannot Run Firmware, reverting to dsp bypass...\n");
> +		mutex_unlock(&cs35l41->fw_mutex);
> +	}
>  
>  	cs35l41_create_controls(cs35l41);
>  
> -- 
> 2.34.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ