Skip to contentSkip to conversation

ALSA: Set max DMA segment size

PATCH In review Takashi Iwai 3 participants 8 messages Feb 15, 2022 – Feb 17, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover ALSA: Set max DMA segment size

Hi,

this is a oneliner patches to address the spurious kernel WARNING from DMA debug code for the missing setup of DMA segment size for SG pages.

Takashi

===

Takashi Iwai (3):
ALSA: hda: Set max DMA segment size
ASoC: SOF: hda: Set max DMA segment size
ASoC: intel: skylake: Set max DMA segment size

 sound/pci/hda/hda_intel.c     | 1 +
 sound/soc/intel/skylake/skl.c | 1 +
 sound/soc/sof/intel/hda.c     | 1 +
 3 files changed, 3 insertions(+)
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/3 ALSA: hda: Set max DMA segment size

The recent code refactoring to use the standard DMA helper requires
the max DMA segment size setup for SG list management. Without it,
the kernel may spew warnings when a large buffer is allocated.

This patch sets up dma_set_max_seg_size() for avoiding spurious
warnings.

Fixes 2c95b92ecd92 ("ALSA: memalloc: Unify x86 SG-buffer handling (take#3)")
---
 sound/pci/hda/hda_intel.c | 1 +
 1 file changed, 1 insertion(+)
sound/pci/hda/hda_intel.c +1 -0
index 917ad9d375b1..572ff0d1fafe 100644
@@ -1941,6 +1941,7 @@ static int azx_first_init(struct azx *chip)
 		dma_bits = 32;
 	if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(dma_bits)))
 		dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(32));
+	dma_set_max_seg_size(&pci->dev, UINT_MAX);
 
 	/* read number of streams from GCAP register instead of using
 	 * hardcoded value
Signature · 1 line
2.31.1
#2 lore raw

PATCH 2/3 ASoC: SOF: hda: Set max DMA segment size

In reply to Takashi Iwai

The recent code refactoring to use the standard DMA helper requires
the max DMA segment size setup for SG list management. Without it,
the kernel may spew warnings when a large buffer is allocated.

This patch sets up dma_set_max_seg_size() for avoiding spurious
warnings.

Fixes 2c95b92ecd92 ("ALSA: memalloc: Unify x86 SG-buffer handling (take#3)")
---
 sound/soc/sof/intel/hda.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/sof/intel/hda.c +1 -0
index c8fb082209ce..1385695d7745 100644
@@ -956,6 +956,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
 		dev_dbg(sdev->dev, "DMA mask is 32 bit\n");
 		dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(32));
 	}
+	dma_set_max_seg_size(&pci->dev, UINT_MAX);
 
 	/* init streams */
 	ret = hda_dsp_stream_init(sdev);
Signature · 1 line
2.31.1
maintainer Acked-by on v1 2/3
#3 lore raw

Re: [PATCH 2/3] ASoC: SOF: hda: Set max DMA segment size

Quoted 3 lines · Takashi Iwai

The recent code refactoring to use the standard DMA helper requires
the max DMA segment size setup for SG list management. Without it,
the kernel may spew warnings when a large buffer is allocated.

#4 lore raw

PATCH 3/3 ASoC: intel: skylake: Set max DMA segment size

In reply to Takashi Iwai

The recent code refactoring to use the standard DMA helper requires the max DMA segment size setup for SG list management. Without it, the kernel may spew warnings when a large buffer is allocated.

This patch sets up dma_set_max_seg_size() for avoiding spurious warnings.

Fixes 2c95b92ecd92 ("ALSA: memalloc: Unify x86 SG-buffer handling (take#3)")
---
 sound/soc/intel/skylake/skl.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/intel/skylake/skl.c +1 -0
index 148ddf4cace0..aeca58246fc7 100644
@@ -952,6 +952,7 @@ static int skl_first_init(struct hdac_bus *bus)
 	/* allow 64bit DMA address if supported by H/W */
 	if (dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(64)))
 		dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(32));
+	dma_set_max_seg_size(bus->dev, UINT_MAX);
 
 	/* initialize streams */
 	snd_hdac_ext_stream_init_all
Signature · 1 line
2.31.1
maintainer Acked-by on v1 3/3
#5 lore raw

Re: [PATCH 3/3] ASoC: intel: skylake: Set max DMA segment size

Quoted 6 lines · Takashi Iwai

The recent code refactoring to use the standard DMA helper requires the max DMA segment size setup for SG list management. Without it, the kernel may spew warnings when a large buffer is allocated.

This patch sets up dma_set_max_seg_size() for avoiding spurious warnings.

Thanks for accounting for skylake-driver when providing fixes.

Quoted 20 lines
Fixes 2c95b92ecd92 ("ALSA: memalloc: Unify x86 SG-buffer handling (take#3)")
---
  sound/soc/intel/skylake/skl.c | 1 +
  1 file changed, 1 insertion(+)
sound/soc/intel/skylake/skl.c +1 -0
index 148ddf4cace0..aeca58246fc7 100644
@@ -952,6 +952,7 @@ static int skl_first_init(struct hdac_bus *bus)
  	/* allow 64bit DMA address if supported by H/W */
  	if (dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(64)))
  		dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(32));
+	dma_set_max_seg_size(bus->dev, UINT_MAX);
 
  	/* initialize streams */
  	snd_hdac_ext_stream_init_all
maintainer Acked-by on v1 3/3
#6 lore raw

Re: [PATCH 3/3] ASoC: intel: skylake: Set max DMA segment size

In reply to Takashi Iwai
Quoted 3 lines · Takashi Iwai

The recent code refactoring to use the standard DMA helper requires the max DMA segment size setup for SG list management. Without it, the kernel may spew warnings when a large buffer is allocated.

#7 lore raw
In reply to Takashi Iwai
Quoted 7 lines · Takashi Iwai

Hi,

this is a oneliner patches to address the spurious kernel WARNING from DMA debug code for the missing setup of DMA segment size for SG pages.

Quoted 8 lines

Takashi

===

Takashi Iwai (3):
ALSA: hda: Set max DMA segment size
ASoC: SOF: hda: Set max DMA segment size
ASoC: intel: skylake: Set max DMA segment size

Merged now to for-linus branch.

Takashi