All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>
To: Daniel Baluta <daniel.baluta@oss.nxp.com>, broonie@kernel.org
Cc: pierre-louis.bossart@linux.intel.com,
	alsa-devel@alsa-project.org, kai.vehmanen@linux.intel.com,
	lgirdwood@gmail.com, linux-kernel@vger.kernel.org,
	ranjani.sridharan@linux.intel.com,
	Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
	daniel.baluta@nxp.com
Subject: Re: [PATCH v2 10/12] ASoC: SOF: Intel: hda: make sure DAI widget is set up before IPC
Date: Thu, 23 Sep 2021 15:54:11 +0300	[thread overview]
Message-ID: <203bf6cd-6407-f01d-52c3-e399d06cb3f6@linux.intel.com> (raw)
In-Reply-To: <20210917143659.401102-11-daniel.baluta@oss.nxp.com>



On 17/09/2021 17:36, Daniel Baluta wrote:
> From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> 
> With the implementation of the dynamic pipeline feature, widgets
> will only be setup when a PCM is opened during the
> hw_params ioctl. The BE hw_params callback is responsible for
> sending the DAI_CONFIG for the DAI widgets in the DSP.
> With dynamic pipelines, the DAI widgets will need to set up
> first before sending the DAI_CONFIG IPC in the BE hw_params.
> 
> Update the BE hw_params/hw_free callbacks for all ALH, HDA and SSP
> DAIs to set up/free the DAI widget before/after DAI_CONFIG IPC.
> 
> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> ---
>  sound/soc/sof/intel/hda-dai.c | 176 ++++++++++++++++++++-------------
>  sound/soc/sof/intel/hda.c     | 177 +++++++++++++++++++++++++---------
>  sound/soc/sof/intel/hda.h     |   5 +
>  sound/soc/sof/sof-audio.c     |   1 +
>  sound/soc/sof/sof-audio.h     |   2 +-
>  sound/soc/sof/topology.c      |   3 -
>  6 files changed, 245 insertions(+), 119 deletions(-)
> 
> diff --git a/sound/soc/sof/intel/hda-dai.c b/sound/soc/sof/intel/hda-dai.c
> index 2f54a659b78a..d1ec8bfb6002 100644
> --- a/sound/soc/sof/intel/hda-dai.c
> +++ b/sound/soc/sof/intel/hda-dai.c
> @@ -155,49 +155,70 @@ static int hda_link_dma_params(struct hdac_ext_stream *stream,
>  	return 0;
>  }
>  
> -/* Send DAI_CONFIG IPC to the DAI that matches the dai_name and direction */
> -static int hda_link_config_ipc(struct sof_intel_hda_stream *hda_stream,
> -			       const char *dai_name, int channel, int dir)
> +/* Update config for the DAI widget */
> +static struct sof_ipc_dai_config *hda_dai_update_config(struct snd_soc_dapm_widget *w,
> +							int channel)
>  {
> +	struct snd_sof_widget *swidget = w->dobj.private;
>  	struct sof_ipc_dai_config *config;
>  	struct snd_sof_dai *sof_dai;
> -	struct sof_ipc_reply reply;
> -	int ret = 0;
>  
> -	list_for_each_entry(sof_dai, &hda_stream->sdev->dai_list, list) {
> -		if (!sof_dai->cpu_dai_name)
> -			continue;
> +	if (!swidget) {
> +		dev_err(swidget->scomp->dev, "error: No private data for widget %s\n", w->name);

NULL pointer dereference, just return NULL without the print. The caller
is printing anyways.

> +		return NULL;
> +	}
>  

-- 
Péter

  reply	other threads:[~2021-09-23 12:55 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 14:36 [PATCH v2 00/12] Add support for on demand pipeline setup/destroy Daniel Baluta
2021-09-17 14:36 ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 01/12] ASoC: topology: change the complete op in snd_soc_tplg_ops to return int Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 02/12] ASoC: SOF: control: Add access field in struct snd_sof_control Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 03/12] ASoC: SOF: topology: Add new token for dynamic pipeline Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 04/12] ASoC: SOF: sof-audio: add helpers for widgets, kcontrols and dai config set up Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 05/12] AsoC: dapm: export a couple of functions Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 06/12] ASoC: SOF: Add new fields to snd_sof_route Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 07/12] ASoC: SOF: restore kcontrols for widget during set up Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 08/12] ASoC: SOF: Don't set up widgets during topology parsing Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 09/12] ASoC: SOF: Introduce widget use_count Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 10/12] ASoC: SOF: Intel: hda: make sure DAI widget is set up before IPC Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-23 12:54   ` Péter Ujfalusi [this message]
2021-09-23 12:58     ` Pierre-Louis Bossart
2021-09-23 12:58       ` Pierre-Louis Bossart
2021-09-23 13:00       ` Péter Ujfalusi
2021-09-23 13:00         ` Péter Ujfalusi
2021-09-24  7:42         ` Daniel Baluta
2021-09-24  7:42           ` Daniel Baluta
2021-09-27  9:09           ` Péter Ujfalusi
2021-09-27  9:09             ` Péter Ujfalusi
2021-09-17 14:36 ` [PATCH v2 11/12] ASoC: SOF: Add support for dynamic pipelines Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta
2021-09-17 14:36 ` [PATCH v2 12/12] ASoC: SOF: topology: Add kernel parameter for topology verification Daniel Baluta
2021-09-17 14:36   ` Daniel Baluta

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=203bf6cd-6407-f01d-52c3-e399d06cb3f6@linux.intel.com \
    --to=peter.ujfalusi@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=daniel.baluta@oss.nxp.com \
    --cc=guennadi.liakhovetski@linux.intel.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.