ALSA: hda: Revert "ALSA: hda: Allow setting preallocation again for x86"

This reverts commit f8e4ae10de ("ALSA: hda: Allow setting
preallocation again for x86").

The reverted commit itself is a revert of c31427d0d2 ("ALSA: hda: No
preallocation on x86 platforms"). It was needed because HDA allowed very
big allocations, up to 1GB per stream. However as previous commit in
this series changes maximum allowed allocation per stream to 4MB, we can
safely revert it back.

On systems where there are a lot of FrontEnds, when
CONFIG_SND_HDA_PREALLOC_SIZE != 0  ALSA core allocates memory for each
FE, which may cause out of memory problems due to per card limit. Force
config to 0 on X86, so memory will be allocated on as needed basis.

Bug: https://bugzilla.kernel.org/show_bug.cgi?id=201251#c322
Suggested-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20210318160618.2504068-4-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Amadeusz Sławiński 2021-03-18 17:06:18 +01:00 committed by Takashi Iwai
parent 12b2b50830
commit f4b4bdf29a
1 changed files with 3 additions and 4 deletions

View File

@ -21,17 +21,16 @@ config SND_HDA_EXT_CORE
select SND_HDA_CORE select SND_HDA_CORE
config SND_HDA_PREALLOC_SIZE config SND_HDA_PREALLOC_SIZE
int "Pre-allocated buffer size for HD-audio driver" int "Pre-allocated buffer size for HD-audio driver" if !SND_DMA_SGBUF
range 0 32768 range 0 32768
default 2048 if SND_DMA_SGBUF default 0 if SND_DMA_SGBUF
default 64 if !SND_DMA_SGBUF default 64 if !SND_DMA_SGBUF
help help
Specifies the default pre-allocated buffer-size in kB for the Specifies the default pre-allocated buffer-size in kB for the
HD-audio driver. A larger buffer (e.g. 2048) is preferred HD-audio driver. A larger buffer (e.g. 2048) is preferred
for systems using PulseAudio. The default 64 is chosen just for systems using PulseAudio. The default 64 is chosen just
for compatibility reasons. for compatibility reasons.
On x86 systems, the default is 2048 as a reasonable value for On x86 systems, the default is zero as we need no preallocation.
most of modern systems.
Note that the pre-allocation size can be changed dynamically Note that the pre-allocation size can be changed dynamically
via a proc file (/proc/asound/card*/pcm*/sub*/prealloc), too. via a proc file (/proc/asound/card*/pcm*/sub*/prealloc), too.