From: Eric Curtin <ericcurtin17@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Ryan Roberts <ryan.roberts@arm.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
Thierry Reding <thierry.reding@kernel.org>,
Jonathan Hunter <jonathanh@nvidia.com>,
linux-sound@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: [RFC PATCH v2 2/3] ASoC: tegra: Initialise PCM hardware limits at boot for page size
Date: Wed, 2 Dec 2026 03:17:28 +0000 [thread overview]
Message-ID: <20261202031733.1704898-3-ericcurtin17@gmail.com> (raw)
In-Reply-To: <20261202031733.1704898-1-ericcurtin17@gmail.com>
From: Ryan Roberts <ryan.roberts@arm.com>
tegra_pcm_hardware and tegra_dmaengine_pcm_config use PAGE_SIZE in their
initialisers, which is not a constant expression with arm64 boot-time
page size selection.
Define both with DEFINE_GLOBAL_PAGE_SIZE_VAR_CONST(), which keeps a
normal const initialiser for a fixed page size and otherwise fills them
in once the page size is known at boot.
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Signed-off-by: Eric Curtin <eric.curtin@docker.com>
---
sound/soc/tegra/tegra_pcm.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
index c490a9e66858..4fe019433f9a 100644
--- a/sound/soc/tegra/tegra_pcm.c
+++ b/sound/soc/tegra/tegra_pcm.c
@@ -24,7 +24,8 @@
#include <sound/dmaengine_pcm.h>
#include "tegra_pcm.h"
-static const struct snd_pcm_hardware tegra_pcm_hardware = {
+static DEFINE_GLOBAL_PAGE_SIZE_VAR_CONST(struct snd_pcm_hardware,
+ tegra_pcm_hardware, {
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED,
@@ -34,13 +35,14 @@ static const struct snd_pcm_hardware tegra_pcm_hardware = {
.periods_max = 8,
.buffer_bytes_max = PAGE_SIZE * 8,
.fifo_size = 4,
-};
+});
-static const struct snd_dmaengine_pcm_config tegra_dmaengine_pcm_config = {
+static DEFINE_GLOBAL_PAGE_SIZE_VAR_CONST(struct snd_dmaengine_pcm_config,
+ tegra_dmaengine_pcm_config, {
.pcm_hardware = &tegra_pcm_hardware,
.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
.prealloc_buffer_size = PAGE_SIZE * 8,
-};
+});
int tegra_pcm_platform_register(struct device *dev)
{
next prev parent reply other threads:[~2026-12-02 3:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20261202031733.1704898-1-ericcurtin17@gmail.com>
2026-12-02 3:17 ` [RFC PATCH v2 1/3] ALSA: Handle run-time PAGE_SIZE in PCM hardware tables and #if checks Eric Curtin
2026-12-02 3:31 ` sashiko-bot
2026-12-02 3:17 ` Eric Curtin [this message]
2026-12-02 3:27 ` [RFC PATCH v2 2/3] ASoC: tegra: Initialise PCM hardware limits at boot for page size sashiko-bot
2026-12-02 3:17 ` [RFC PATCH v2 3/3] ASoC: codecs: Initialise PCM hardware tables " Eric Curtin
2026-12-02 3:28 ` sashiko-bot
2026-12-02 4:56 ` Tzung-Bi Shih
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=20261202031733.1704898-3-ericcurtin17@gmail.com \
--to=ericcurtin17@gmail.com \
--cc=broonie@kernel.org \
--cc=jonathanh@nvidia.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=perex@perex.cz \
--cc=ryan.roberts@arm.com \
--cc=thierry.reding@kernel.org \
--cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox