public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org,
	vkoul@kernel.org, liam.r.girdwood@linux.intel.com, arnd@arndb.de,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 2/6] ASoC: Intel: Skylake: stop init/probe if DSP is not present
Date: Wed, 21 Nov 2018 16:29:25 +0200	[thread overview]
Message-ID: <20181121142925.GP10650@smile.fi.intel.com> (raw)
In-Reply-To: <20181120213644.19103-3-pierre-louis.bossart@linux.intel.com>

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@linux.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



  reply	other threads:[~2018-11-21 14:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-20 21:36 [RFC PATCH 0/6] ASoC:Intel:Skylake: Enable HDaudio legacy fallback Pierre-Louis Bossart
2018-11-20 21:36 ` [RFC PATCH 1/6] ASoC: Intel: Skylake: Add CFL-S support Pierre-Louis Bossart
2018-11-21 14:27   ` Andy Shevchenko
2018-11-21 17:16     ` Pierre-Louis Bossart
2018-11-21 17:38       ` Andy Shevchenko
2018-11-21 22:17         ` Takashi Iwai
2018-11-22  9:56           ` Andy Shevchenko
2018-11-24  3:16             ` [alsa-devel] " Pierre-Louis Bossart
2018-11-20 21:36 ` [RFC PATCH 2/6] ASoC: Intel: Skylake: stop init/probe if DSP is not present Pierre-Louis Bossart
2018-11-21 14:29   ` Andy Shevchenko [this message]
2018-11-21 16:48     ` Pierre-Louis Bossart
2018-11-21 17:32       ` Andy Shevchenko
2018-11-20 21:36 ` [RFC PATCH 3/6] ASoC: Intel: Skylake: remove useless tests on DSP presence Pierre-Louis Bossart
2018-11-20 21:36 ` [RFC PATCH 4/6] ASoC: Intel: Skylake: Add more platform granularity Pierre-Louis Bossart
2018-11-20 21:36 ` [RFC PATCH 5/6] ALSA: hda: Allow fallback binding with legacy HD-audio for Intel SKL+ Pierre-Louis Bossart
2018-11-20 21:36 ` [RFC PATCH 6/6] ALSA: hda: add fallback capabilities for SKL+ platforms Pierre-Louis Bossart
2018-11-21 14:39   ` Andy Shevchenko
2018-11-21 22:20     ` Takashi Iwai
2018-11-21 10:32 ` [RFC PATCH 0/6] ASoC:Intel:Skylake: Enable HDaudio legacy fallback Takashi Iwai
2018-11-28 18:09   ` Pierre-Louis Bossart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181121142925.GP10650@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox