alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ASoC: Simplify with dma_set_mask_and_coherent()
@ 2021-01-14 13:33 Takashi Iwai
  2021-01-14 13:33 ` [PATCH 1/3] ASoC: intel: skl: " Takashi Iwai
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Takashi Iwai @ 2021-01-14 13:33 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown

Simple conversions from two dma_set_mask*() calls into the single
dma_set_mask_and_coherent().

Just a minor code refactoring, no functional changes.


Takashi

===

Takashi Iwai (3):
  ASoC: intel: skl: Simplify with dma_set_mask_and_coherent()
  ASoC: SOF: intel: Simplify with dma_set_mask_and_coherent()
  ASoC: tegra: Simplify with dma_set_mask_and_coherent()

 sound/soc/intel/skylake/skl.c | 8 ++------
 sound/soc/sof/intel/hda.c     | 8 ++------
 sound/soc/tegra/tegra_pcm.c   | 6 +-----
 3 files changed, 5 insertions(+), 17 deletions(-)

-- 
2.26.2


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

* [PATCH 1/3] ASoC: intel: skl: Simplify with dma_set_mask_and_coherent()
  2021-01-14 13:33 [PATCH 0/3] ASoC: Simplify with dma_set_mask_and_coherent() Takashi Iwai
@ 2021-01-14 13:33 ` Takashi Iwai
  2021-01-20 16:12   ` Rojewski, Cezary
  2021-01-14 13:33 ` [PATCH 2/3] ASoC: SOF: intel: " Takashi Iwai
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2021-01-14 13:33 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown

ASoC Intel Skylake driver still has explicit calls of dma_set_mask()
and dma_set_coherent_mask().

Let's simplify with dma_set_mask_and_coherent().

Cc: Cezary Rojewski <cezary.rojewski@intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/intel/skylake/skl.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index 8b993722f74e..5b1a15e39912 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -950,12 +950,8 @@ static int skl_first_init(struct hdac_bus *bus)
 	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));
-	}
+	if (dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(64)))
+		dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(32));
 
 	/* initialize streams */
 	snd_hdac_ext_stream_init_all
-- 
2.26.2


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

* [PATCH 2/3] ASoC: SOF: intel: Simplify with dma_set_mask_and_coherent()
  2021-01-14 13:33 [PATCH 0/3] ASoC: Simplify with dma_set_mask_and_coherent() Takashi Iwai
  2021-01-14 13:33 ` [PATCH 1/3] ASoC: intel: skl: " Takashi Iwai
@ 2021-01-14 13:33 ` Takashi Iwai
  2021-01-14 13:33 ` [PATCH 3/3] ASoC: tegra: " Takashi Iwai
  2021-01-21  0:05 ` [PATCH 0/3] ASoC: " Mark Brown
  3 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2021-01-14 13:33 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown

ASoC Intel SOF driver still has explicit calls of dma_set_mask() and
dma_set_coherent_mask().

Let's simplify with dma_set_mask_and_coherent().

Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/sof/intel/hda.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index 509a9b256423..7e703ce22fcd 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -809,13 +809,9 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
 	sdev->mailbox_bar = HDA_DSP_BAR;
 
 	/* allow 64bit DMA address if supported by H/W */
-	if (!dma_set_mask(&pci->dev, DMA_BIT_MASK(64))) {
-		dev_dbg(sdev->dev, "DMA mask is 64 bit\n");
-		dma_set_coherent_mask(&pci->dev, DMA_BIT_MASK(64));
-	} else {
+	if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(64))) {
 		dev_dbg(sdev->dev, "DMA mask is 32 bit\n");
-		dma_set_mask(&pci->dev, DMA_BIT_MASK(32));
-		dma_set_coherent_mask(&pci->dev, DMA_BIT_MASK(32));
+		dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(32));
 	}
 
 	/* init streams */
-- 
2.26.2


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

* [PATCH 3/3] ASoC: tegra: Simplify with dma_set_mask_and_coherent()
  2021-01-14 13:33 [PATCH 0/3] ASoC: Simplify with dma_set_mask_and_coherent() Takashi Iwai
  2021-01-14 13:33 ` [PATCH 1/3] ASoC: intel: skl: " Takashi Iwai
  2021-01-14 13:33 ` [PATCH 2/3] ASoC: SOF: intel: " Takashi Iwai
@ 2021-01-14 13:33 ` Takashi Iwai
  2021-01-21  0:05 ` [PATCH 0/3] ASoC: " Mark Brown
  3 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2021-01-14 13:33 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown

ASoC tegra PCM code still has explicit calls of dma_set_mask() and
dma_set_coherent_mask().

Let's simplify with dma_set_mask_and_coherent().

Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/tegra/tegra_pcm.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
index b3f36515cbc1..573374b89b10 100644
--- a/sound/soc/tegra/tegra_pcm.c
+++ b/sound/soc/tegra/tegra_pcm.c
@@ -255,11 +255,7 @@ static int tegra_pcm_dma_allocate(struct snd_soc_pcm_runtime *rtd,
 	struct snd_pcm *pcm = rtd->pcm;
 	int ret;
 
-	ret = dma_set_mask(card->dev, DMA_BIT_MASK(32));
-	if (ret < 0)
-		return ret;
-
-	ret = dma_set_coherent_mask(card->dev, DMA_BIT_MASK(32));
+	ret = dma_set_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
 	if (ret < 0)
 		return ret;
 
-- 
2.26.2


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

* RE: [PATCH 1/3] ASoC: intel: skl: Simplify with dma_set_mask_and_coherent()
  2021-01-14 13:33 ` [PATCH 1/3] ASoC: intel: skl: " Takashi Iwai
@ 2021-01-20 16:12   ` Rojewski, Cezary
  0 siblings, 0 replies; 6+ messages in thread
From: Rojewski, Cezary @ 2021-01-20 16:12 UTC (permalink / raw)
  To: Takashi Iwai, alsa-devel; +Cc: Mark Brown

On 2021-01-14 2:33 PM, Takashi Iwai wrote:
> ASoC Intel Skylake driver still has explicit calls of dma_set_mask()
> and dma_set_coherent_mask().
> 
> Let's simplify with dma_set_mask_and_coherent().
> 
> Cc: Cezary Rojewski <cezary.rojewski@intel.com>
> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>

Somehow CC did not get to me.

Thanks for the patch, Takashi. Small nitpick: s/skl/Skylake/ in
commit's title. No need for resend if that's the only missing piece
found.

Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>


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

* Re: [PATCH 0/3] ASoC: Simplify with dma_set_mask_and_coherent()
  2021-01-14 13:33 [PATCH 0/3] ASoC: Simplify with dma_set_mask_and_coherent() Takashi Iwai
                   ` (2 preceding siblings ...)
  2021-01-14 13:33 ` [PATCH 3/3] ASoC: tegra: " Takashi Iwai
@ 2021-01-21  0:05 ` Mark Brown
  3 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2021-01-21  0:05 UTC (permalink / raw)
  To: Takashi Iwai, alsa-devel

On Thu, 14 Jan 2021 14:33:34 +0100, Takashi Iwai wrote:
> Simple conversions from two dma_set_mask*() calls into the single
> dma_set_mask_and_coherent().
> 
> Just a minor code refactoring, no functional changes.
> 
> 
> Takashi
> 
> [...]

Applied to

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

Thanks!

[1/3] ASoC: intel: skl: Simplify with dma_set_mask_and_coherent()
      commit: d3afb00220becf81bc2d9016f04e05949dfd5bb2
[2/3] ASoC: SOF: intel: Simplify with dma_set_mask_and_coherent()
      commit: ab152afa2427bb3e4eea7c9f21c4393287838774
[3/3] ASoC: tegra: Simplify with dma_set_mask_and_coherent()
      commit: 7cc206bff69b52be24fa13ee2c9afde3320c6cf6

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] 6+ messages in thread

end of thread, other threads:[~2021-01-21  0:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14 13:33 [PATCH 0/3] ASoC: Simplify with dma_set_mask_and_coherent() Takashi Iwai
2021-01-14 13:33 ` [PATCH 1/3] ASoC: intel: skl: " Takashi Iwai
2021-01-20 16:12   ` Rojewski, Cezary
2021-01-14 13:33 ` [PATCH 2/3] ASoC: SOF: intel: " Takashi Iwai
2021-01-14 13:33 ` [PATCH 3/3] ASoC: tegra: " Takashi Iwai
2021-01-21  0:05 ` [PATCH 0/3] ASoC: " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).