All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] ASoC: SOF/Intel: small fixes and updates for 5.18
@ 2022-03-10 17:16 Pierre-Louis Bossart
  2022-03-10 17:16 ` [PATCH 1/5] ASoC: SOF: Intel: enable DMI L1 for playback streams Pierre-Louis Bossart
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Pierre-Louis Bossart @ 2022-03-10 17:16 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart

One important fix from Kai to restore DM1 L1 functionality, one
important update from Peter to use DMA trace buffers as capture-only
and sync them and a couple of minor updates for Intel/SOF platforms.

Brent Lu (1):
  ASoC: SOF: Intel: add topology overwrite for Taniks

Kai Vehmanen (1):
  ASoC: SOF: Intel: enable DMI L1 for playback streams

Muralidhar Reddy (1):
  ASoC: Intel: soc-acpi: Add entry for rt711-sdca-sdw in ADL match table

Peter Ujfalusi (1):
  ASoC: SOF: trace: Use proper DMA direction for the trace data buffer

Weiguo Li (1):
  ASoC: SOF: compress: fix null check after dereference

 sound/soc/intel/common/soc-acpi-intel-adl-match.c | 15 +++++++++++++++
 sound/soc/sof/compress.c                          |  6 ++++--
 sound/soc/sof/intel/hda-pcm.c                     |  1 +
 sound/soc/sof/sof-pci-dev.c                       |  8 ++++++++
 sound/soc/sof/trace.c                             | 12 ++++++++++--
 5 files changed, 38 insertions(+), 4 deletions(-)


base-commit: 52eaf2bbcf022a61872c812ce41855a90b814ebc
-- 
2.30.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] ASoC: SOF: Intel: enable DMI L1 for playback streams
  2022-03-10 17:16 [PATCH 0/5] ASoC: SOF/Intel: small fixes and updates for 5.18 Pierre-Louis Bossart
@ 2022-03-10 17:16 ` Pierre-Louis Bossart
  2022-03-10 17:16 ` [PATCH 2/5] ASoC: SOF: compress: fix null check after dereference Pierre-Louis Bossart
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Pierre-Louis Bossart @ 2022-03-10 17:16 UTC (permalink / raw)
  To: alsa-devel
  Cc: Kai Vehmanen, tiwai, Ranjani Sridharan, Pierre-Louis Bossart,
	broonie, Péter Ujfalusi

From: Kai Vehmanen <kai.vehmanen@linux.intel.com>

Add back logic to mark all playback streams as L1 compatible.

Fixes: 246dd4287dfb ("ASoC: SOF: Intel: make DMI L1 selection more robust")
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sof/intel/hda-pcm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/sof/intel/hda-pcm.c b/sound/soc/sof/intel/hda-pcm.c
index eec83ca557a1..3e77a2352b98 100644
--- a/sound/soc/sof/intel/hda-pcm.c
+++ b/sound/soc/sof/intel/hda-pcm.c
@@ -315,6 +315,7 @@ int hda_dsp_pcm_open(struct snd_sof_dev *sdev,
 		runtime->hw.info &= ~SNDRV_PCM_INFO_PAUSE;
 
 	if (hda_always_enable_dmi_l1 ||
+	    direction == SNDRV_PCM_STREAM_PLAYBACK ||
 	    spcm->stream[substream->stream].d0i3_compatible)
 		flags |= SOF_HDA_STREAM_DMI_L1_COMPATIBLE;
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] ASoC: SOF: compress: fix null check after dereference
  2022-03-10 17:16 [PATCH 0/5] ASoC: SOF/Intel: small fixes and updates for 5.18 Pierre-Louis Bossart
  2022-03-10 17:16 ` [PATCH 1/5] ASoC: SOF: Intel: enable DMI L1 for playback streams Pierre-Louis Bossart
@ 2022-03-10 17:16 ` Pierre-Louis Bossart
  2022-03-10 17:16 ` [PATCH 3/5] ASoC: SOF: trace: Use proper DMA direction for the trace data buffer Pierre-Louis Bossart
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Pierre-Louis Bossart @ 2022-03-10 17:16 UTC (permalink / raw)
  To: alsa-devel
  Cc: Weiguo Li, tiwai, Péter Ujfalusi, Ranjani Sridharan,
	Pierre-Louis Bossart, broonie, Daniel Baluta

From: Weiguo Li <liwg06@foxmail.com>

"cstream" is dereferenced but null checked later. Swap their
positions to avoid potential null dereference.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Weiguo Li <liwg06@foxmail.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sof/compress.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sof/compress.c b/sound/soc/sof/compress.c
index 2af8d75204e9..a8e908e50101 100644
--- a/sound/soc/sof/compress.c
+++ b/sound/soc/sof/compress.c
@@ -46,8 +46,8 @@ void snd_sof_compr_init_elapsed_work(struct work_struct *work)
  */
 void snd_sof_compr_fragment_elapsed(struct snd_compr_stream *cstream)
 {
-	struct snd_soc_pcm_runtime *rtd = cstream->private_data;
-	struct snd_compr_runtime *crtd = cstream->runtime;
+	struct snd_soc_pcm_runtime *rtd;
+	struct snd_compr_runtime *crtd;
 	struct snd_soc_component *component;
 	struct snd_compr_tstamp *tstamp;
 	struct snd_sof_pcm *spcm;
@@ -55,6 +55,8 @@ void snd_sof_compr_fragment_elapsed(struct snd_compr_stream *cstream)
 	if (!cstream)
 		return;
 
+	rtd = cstream->private_data;
+	crtd = cstream->runtime;
 	tstamp = crtd->private_data;
 	component = snd_soc_rtdcom_lookup(rtd, SOF_AUDIO_PCM_DRV_NAME);
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] ASoC: SOF: trace: Use proper DMA direction for the trace data buffer
  2022-03-10 17:16 [PATCH 0/5] ASoC: SOF/Intel: small fixes and updates for 5.18 Pierre-Louis Bossart
  2022-03-10 17:16 ` [PATCH 1/5] ASoC: SOF: Intel: enable DMI L1 for playback streams Pierre-Louis Bossart
  2022-03-10 17:16 ` [PATCH 2/5] ASoC: SOF: compress: fix null check after dereference Pierre-Louis Bossart
@ 2022-03-10 17:16 ` Pierre-Louis Bossart
  2022-03-10 17:16 ` [PATCH 4/5] ASoC: SOF: Intel: add topology overwrite for Taniks Pierre-Louis Bossart
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Pierre-Louis Bossart @ 2022-03-10 17:16 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, broonie, Peter Ujfalusi, Ranjani Sridharan, Pierre-Louis Bossart

From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>

Buffers allocated with snd_dma_alloc_pages() will have DMA direction
DMA_BIDIRECTIONAL. The trace data memory is only used for one DMA
direction: DMA_FROM_DEVICE, DMA only writes there, never reads.

We also need to do a sync before accessing (reading with CPU) from the
trace data buffer to copy it to user space.

Note: snd_dma_buffer_sync() is also used for normal playback and capture
streams to make sure that the data is available for the DMA or CPU.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sof/trace.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sof/trace.c b/sound/soc/sof/trace.c
index 104388c551cb..ea8e4506d02e 100644
--- a/sound/soc/sof/trace.c
+++ b/sound/soc/sof/trace.c
@@ -320,6 +320,13 @@ static ssize_t sof_dfsentry_trace_read(struct file *file, char __user *buffer,
 	if (count > avail)
 		count = avail;
 
+	/*
+	 * make sure that all trace data is available for the CPU as the trace
+	 * data buffer might be allocated from non consistent memory.
+	 * Note: snd_dma_buffer_sync() is called for normal audio playback and
+	 *	 capture streams also.
+	 */
+	snd_dma_buffer_sync(&sdev->dmatb, SNDRV_DMA_SYNC_CPU);
 	/* copy available trace data to debugfs */
 	rem = copy_to_user(buffer, ((u8 *)(dfse->buf) + lpos), count);
 	if (rem)
@@ -464,8 +471,9 @@ int snd_sof_init_trace(struct snd_sof_dev *sdev)
 	}
 
 	/* allocate trace data buffer */
-	ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV_SG, sdev->dev,
-				  DMA_BUF_SIZE_FOR_TRACE, &sdev->dmatb);
+	ret = snd_dma_alloc_dir_pages(SNDRV_DMA_TYPE_DEV_SG, sdev->dev,
+				      DMA_FROM_DEVICE, DMA_BUF_SIZE_FOR_TRACE,
+				      &sdev->dmatb);
 	if (ret < 0) {
 		dev_err(sdev->dev,
 			"error: can't alloc buffer for trace %d\n", ret);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] ASoC: SOF: Intel: add topology overwrite for Taniks
  2022-03-10 17:16 [PATCH 0/5] ASoC: SOF/Intel: small fixes and updates for 5.18 Pierre-Louis Bossart
                   ` (2 preceding siblings ...)
  2022-03-10 17:16 ` [PATCH 3/5] ASoC: SOF: trace: Use proper DMA direction for the trace data buffer Pierre-Louis Bossart
@ 2022-03-10 17:16 ` Pierre-Louis Bossart
  2022-03-10 17:16 ` [PATCH 5/5] ASoC: Intel: soc-acpi: Add entry for rt711-sdca-sdw in ADL match table Pierre-Louis Bossart
  2022-03-11 20:22 ` [PATCH 0/5] ASoC: SOF/Intel: small fixes and updates for 5.18 Mark Brown
  5 siblings, 0 replies; 7+ messages in thread
From: Pierre-Louis Bossart @ 2022-03-10 17:16 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Bard Liao, Brent Lu, Pierre-Louis Bossart

From: Brent Lu <brent.lu@intel.com>

Taniks has four max98357a on SSP2 with Demux and EQ in topology to
implement a 2-way speaker system.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sof/sof-pci-dev.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c
index 61f2afd54c3e..4c9596742844 100644
--- a/sound/soc/sof/sof-pci-dev.c
+++ b/sound/soc/sof/sof-pci-dev.c
@@ -75,6 +75,14 @@ static const struct dmi_system_id sof_tplg_table[] = {
 		},
 		.driver_data = "sof-adl-max98360a-rt5682-2way.tplg",
 	},
+	{
+		.callback = sof_tplg_cb,
+		.matches = {
+			DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Brya"),
+			DMI_MATCH(DMI_OEM_STRING, "AUDIO-AUDIO_MAX98357_ALC5682I_I2S_2WAY"),
+		},
+		.driver_data = "sof-adl-max98357a-rt5682-2way.tplg",
+	},
 
 	{}
 };
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] ASoC: Intel: soc-acpi: Add entry for rt711-sdca-sdw in ADL match table
  2022-03-10 17:16 [PATCH 0/5] ASoC: SOF/Intel: small fixes and updates for 5.18 Pierre-Louis Bossart
                   ` (3 preceding siblings ...)
  2022-03-10 17:16 ` [PATCH 4/5] ASoC: SOF: Intel: add topology overwrite for Taniks Pierre-Louis Bossart
@ 2022-03-10 17:16 ` Pierre-Louis Bossart
  2022-03-11 20:22 ` [PATCH 0/5] ASoC: SOF/Intel: small fixes and updates for 5.18 Mark Brown
  5 siblings, 0 replies; 7+ messages in thread
From: Pierre-Louis Bossart @ 2022-03-10 17:16 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, Bard Liao, broonie, Muralidhar Reddy, Pierre-Louis Bossart

From: Muralidhar Reddy <muralidhar.reddy@intel.com>

RT711 sdca sdw is added with SDW0 link for ADL-PS platform.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Muralidhar Reddy <muralidhar.reddy@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/common/soc-acpi-intel-adl-match.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/sound/soc/intel/common/soc-acpi-intel-adl-match.c b/sound/soc/intel/common/soc-acpi-intel-adl-match.c
index 7c89a974b59f..8bfe7070b84a 100644
--- a/sound/soc/intel/common/soc-acpi-intel-adl-match.c
+++ b/sound/soc/intel/common/soc-acpi-intel-adl-match.c
@@ -359,6 +359,15 @@ static const struct snd_soc_acpi_link_adr adl_rvp[] = {
 	{}
 };
 
+static const struct snd_soc_acpi_link_adr adlps_rvp[] = {
+	{
+		.mask = BIT(0),
+		.num_adr = ARRAY_SIZE(rt711_sdca_0_adr),
+		.adr_d = rt711_sdca_0_adr,
+	},
+	{}
+};
+
 static const struct snd_soc_acpi_link_adr adl_chromebook_base[] = {
 	{
 		.mask = BIT(0),
@@ -529,6 +538,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_sdw_machines[] = {
 		.drv_name = "sof_sdw",
 		.sof_tplg_filename = "sof-adl-rt711.tplg",
 	},
+	{
+		.link_mask = 0x1, /* link0 required */
+		.links = adlps_rvp,
+		.drv_name = "sof_sdw",
+		.sof_tplg_filename = "sof-adl-rt711.tplg",
+	},
 	{
 		.link_mask = 0x5, /* rt5682 on link0 & 2xmax98373 on link 2 */
 		.links = adl_chromebook_base,
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/5] ASoC: SOF/Intel: small fixes and updates for 5.18
  2022-03-10 17:16 [PATCH 0/5] ASoC: SOF/Intel: small fixes and updates for 5.18 Pierre-Louis Bossart
                   ` (4 preceding siblings ...)
  2022-03-10 17:16 ` [PATCH 5/5] ASoC: Intel: soc-acpi: Add entry for rt711-sdca-sdw in ADL match table Pierre-Louis Bossart
@ 2022-03-11 20:22 ` Mark Brown
  5 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2022-03-11 20:22 UTC (permalink / raw)
  To: alsa-devel, Pierre-Louis Bossart; +Cc: tiwai

On Thu, 10 Mar 2022 11:16:46 -0600, Pierre-Louis Bossart wrote:
> One important fix from Kai to restore DM1 L1 functionality, one
> important update from Peter to use DMA trace buffers as capture-only
> and sync them and a couple of minor updates for Intel/SOF platforms.
> 
> Brent Lu (1):
>   ASoC: SOF: Intel: add topology overwrite for Taniks
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/5] ASoC: SOF: Intel: enable DMI L1 for playback streams
      commit: a174e72e2355b9025205b4b6727bf43047eac6c6
[2/5] ASoC: SOF: compress: fix null check after dereference
      commit: 7e4bfcf10a03981cb3056d723bb2f92eead5c0bb
[3/5] ASoC: SOF: trace: Use proper DMA direction for the trace data buffer
      commit: d8b502a7c353a63269d5ac3cfa7e5a04308df6a1
[4/5] ASoC: SOF: Intel: add topology overwrite for Taniks
      commit: 24320c55566138426ee0f9ec866dd3d656071799
[5/5] ASoC: Intel: soc-acpi: Add entry for rt711-sdca-sdw in ADL match table
      commit: d7be9e33c4ad71c299fd58c5d46d4407c0b42d86

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-11 20:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-10 17:16 [PATCH 0/5] ASoC: SOF/Intel: small fixes and updates for 5.18 Pierre-Louis Bossart
2022-03-10 17:16 ` [PATCH 1/5] ASoC: SOF: Intel: enable DMI L1 for playback streams Pierre-Louis Bossart
2022-03-10 17:16 ` [PATCH 2/5] ASoC: SOF: compress: fix null check after dereference Pierre-Louis Bossart
2022-03-10 17:16 ` [PATCH 3/5] ASoC: SOF: trace: Use proper DMA direction for the trace data buffer Pierre-Louis Bossart
2022-03-10 17:16 ` [PATCH 4/5] ASoC: SOF: Intel: add topology overwrite for Taniks Pierre-Louis Bossart
2022-03-10 17:16 ` [PATCH 5/5] ASoC: Intel: soc-acpi: Add entry for rt711-sdca-sdw in ADL match table Pierre-Louis Bossart
2022-03-11 20:22 ` [PATCH 0/5] ASoC: SOF/Intel: small fixes and updates for 5.18 Mark Brown

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.