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, 21 Nov 2018 16:29:25 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
Cc:     alsa-devel@...a-project.org, tiwai@...e.de, broonie@...nel.org,
        vkoul@...nel.org, liam.r.girdwood@...ux.intel.com, arnd@...db.de,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 2/6] ASoC: Intel: Skylake: stop init/probe if DSP is
 not present

On Tue, Nov 20, 2018 at 03:36:40PM -0600, Pierre-Louis Bossart wrote:
> Check immediately if the DSP can be found, bail and avoid doing inits
> to enable legacy fallback without delay.

It does slightly more than described. Please do either remove unrelated changes, or fill the gap in the commit message. In the latter case it may require to split patch to two.

> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
> ---
>  sound/soc/intel/skylake/skl.c | 26 +++++++++++++++++---------
>  1 file changed, 17 insertions(+), 9 deletions(-)
> 
> diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
> index df36b8fe6d5e..1d7146773d19 100644
> --- a/sound/soc/intel/skylake/skl.c
> +++ b/sound/soc/intel/skylake/skl.c
> @@ -931,6 +931,12 @@ static int skl_first_init(struct hdac_bus *bus)
>  
>  	snd_hdac_bus_parse_capabilities(bus);
>  
> +	/* check if dsp is there */
> +	if (!bus->ppcap) {
> +		dev_err(bus->dev, "bus ppcap not set, DSP not present?\n");
> +		return -ENODEV;
> +	}
> +
>  	if (skl_acquire_irq(bus, 0) < 0)
>  		return -EBUSY;
>  
> @@ -940,23 +946,25 @@ static int skl_first_init(struct hdac_bus *bus)
>  	gcap = snd_hdac_chip_readw(bus, GCAP);
>  	dev_dbg(bus->dev, "chipset global capabilities = 0x%x\n", gcap);
>  
> -	/* allow 64bit DMA address if supported by H/W */
> -	if (!dma_set_mask(bus->dev, DMA_BIT_MASK(64))) {
> -		dma_set_coherent_mask(bus->dev, DMA_BIT_MASK(64));
> -	} else {
> -		dma_set_mask(bus->dev, DMA_BIT_MASK(32));
> -		dma_set_coherent_mask(bus->dev, DMA_BIT_MASK(32));
> -	}
> -
>  	/* read number of streams from GCAP register */
>  	cp_streams = (gcap >> 8) & 0x0f;
>  	pb_streams = (gcap >> 12) & 0x0f;
>  
> -	if (!pb_streams && !cp_streams)
> +	if (!pb_streams && !cp_streams) {
> +		dev_err(bus->dev, "no streams found in GCAP definitions?\n");
>  		return -EIO;
> +	}
>  
>  	bus->num_streams = cp_streams + pb_streams;
>  
> +	/* allow 64bit DMA address if supported by H/W */
> +	if (!dma_set_mask(bus->dev, DMA_BIT_MASK(64))) {
> +		dma_set_coherent_mask(bus->dev, DMA_BIT_MASK(64));
> +	} else {
> +		dma_set_mask(bus->dev, DMA_BIT_MASK(32));
> +		dma_set_coherent_mask(bus->dev, DMA_BIT_MASK(32));
> +	}
> +
>  	/* initialize streams */
>  	snd_hdac_ext_stream_init_all
>  		(bus, 0, cp_streams, SNDRV_PCM_STREAM_CAPTURE);
> -- 
> 2.17.1
> 

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ