From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796182270; b=AhpsSc5MxccMcTe8f14l3bakudReaznp7jdlxnor9EqruaitxNYFQt3NeGtFLvreraqj bhWdGSTtV86Rd+2emG4qZUrB5IlbzhEdrB2M9L/qaJuTJDvplbyiCiavpdGPX393z6CND 8ijozZEUfL2rnuJgvytPCCjHI9/PBW9pwc01V1vRTnag+VTVf+x/BvLeDDnu/nGCtas0+ bv9vhcsXCUqFnvlZSaCK1V+pOQkk4X1K9NE6CMf2zr/SmdjThpuTgYcPuPimcv42lCEyr fByWkiOqvU0dZ4vRwuEhYgetwww3rnQnv027Q1uzHaW7blg7YDv25suxti5EKw/6UxA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796182270; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=fYVRgl3lLgWNUfXHuY7gXnckQaIn75gejwX4Nq22cTM=; b=03X5CoK/VoulDkoQ9dIX4Q1thQ+gohEuH7grHxgTU2WnB31/EMaXZPWQgUIkbDl610vV /6X0XFv6C/dUZt15WNjlsRNzz99vhUq1PmKsKM0wK2gHUCWFPFJQU3mzrmAWBxeLqtCd/ ldv53FWAlUHcbnZawCAwc9mzOOIsl9T7sYDlsdwnwtsZGqShWw0JkH9ya2oOk4MDTOTb4 NpahFMlO5Ac93j8McyvtzKmYw1pPgvi01mqTNBvR5JPZgmxDioohLqtcGqOdLM3Ow+R9a EvwWWteNQDRda7ob4FYhmqbaDEbj0MPhr+YzrHC7JQR7RcpQf+xQnQfeWvh+g2wwqMg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jBKN1CwW; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E98D7606A31A for ; Wed, 2 Dec 2026 03:31:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jBKN1CwW Received: by smtp.kernel.org (Postfix) with ESMTPSA id B439C1F000C1; Wed, 2 Dec 2026 03:31:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796182269; bh=fYVRgl3lLgWNUfXHuY7gXnckQaIn75gejwX4Nq22cTM=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=jBKN1CwWC/ij7OJRwFpvpwMHdS6TUF6OZT1LJ1YN9ibZh+FbbRxEPzqYX9b3welgE FYrqZl63MIWAmg8Pnz+EHY44rVtxgPR15rMhuS80m1HIUBbfvHpXs4uyGKcAQncS1u Zq2wR9BLKL/yzZqX8gXwc0u5Ant+ytYEENtmmw8xaR0ESzoBNiTk5RL0QbH4+v/WHa FxF28TAdq5+X+tjmmN/8h9LyptZbbTeueJe9LyF05Ao8RAXR4D/i2bi+nsGu5Q0bP8 in+7kH1eSKSGT+TIJiS9dUIIANxmhs96zNZl7Xed2zcUr63+CNKF6cL1waWzCBLkJv x83k+G+rFhR3Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RFC PATCH v2 1/3] ALSA: Handle run-time PAGE_SIZE in PCM hardware tables and #if checks Reply-To: sashiko-reviews@lists.linux.dev To: "Eric Curtin" Cc: linux-sound@vger.kernel.org In-Reply-To: <20261202031733.1704898-2-ericcurtin17@gmail.com> References: <20261202031733.1704898-1-ericcurtin17@gmail.com> <20261202031733.1704898-2-ericcurtin17@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 03:31:09 +0000 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [High] ALSA: undefined PAGE_SIZE_MIN/MAX and DEFINE_GLOBAL_PAGE_SIZE_VAR macros - [High] ALSA: seq_midi: DEFINE_GLOBAL_PAGE_SIZE_VAR incompatible with module_param() - [High] ASoC: stm32: non-constant PCM hardware addresses in static const configs -- commit d082150f9e50604189f172c34889dabc193b0410 Author: Eric Curtin ALSA: Handle run-time PAGE_SIZE in PCM hardware tables and #if checks This commit converts ALSA module parameters, static PCM hardware and DMA configuration tables, and preprocessor page size checks to use DEFINE_GLOBAL_PAGE_SIZE_VAR, DEFINE_GLOBAL_PAGE_SIZE_VAR_CONST, PAGE_SIZE_MIN, and PAGE_SIZE_MAX for boot-time page size selection. > diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c > index a16a5debf3391..7e03e55392d62 100644 > --- a/sound/core/seq/seq_midi.c > +++ b/sound/core/seq/seq_midi.c > @@ -29,10 +29,10 @@ Possible options for midisynth module: > MODULE_AUTHOR("Frank van de Pol , Jaroslav Kysela = "); > MODULE_DESCRIPTION("Advanced Linux Sound Architecture sequencer MIDI syn= th."); > MODULE_LICENSE("GPL"); > -static int output_buffer_size =3D PAGE_SIZE; > +static DEFINE_GLOBAL_PAGE_SIZE_VAR(int, output_buffer_size, PAGE_SIZE); > module_param(output_buffer_size, int, 0644); > MODULE_PARM_DESC(output_buffer_size, "Output buffer size in bytes."); > -static int input_buffer_size =3D PAGE_SIZE; > +static DEFINE_GLOBAL_PAGE_SIZE_VAR(int, input_buffer_size, PAGE_SIZE); > module_param(input_buffer_size, int, 0644); > MODULE_PARM_DESC(input_buffer_size, "Input buffer size in bytes."); [Severity: High] Can output_buffer_size and input_buffer_size be defined with DEFINE_GLOBAL_PAGE_SIZE_VAR() when they are passed to module_param()? With boot-time PAGE_SIZE, DEFINE_GLOBAL_PAGE_SIZE_VAR() defines the variable name as a macro expanding to a dereferenced accessor call. module_param() expands its first argument before passing it to module_param_named(), breaking token pasting on __param_str_##name and failing to compile because &(value) in the static struct kernel_param initializer is no longer a compile-time constant address. In addition, the module parameter code reads and writes the underlying storage directly without running the lazy initializer, so sysfs reads before first access would see 0 and user-supplied parameter values would be overwritten on first lazy initialization. > diff --git a/sound/pci/echoaudio/echoaudio_dsp.c b/sound/pci/echoaudio/ec= hoaudio_dsp.c > index 4dd494508c9b1..4ccf4e7de5640 100644 > --- a/sound/pci/echoaudio/echoaudio_dsp.c > +++ b/sound/pci/echoaudio/echoaudio_dsp.c > @@ -13,7 +13,7 @@ > =20 > ************************************************************************= ****/ > =20 > -#if PAGE_SIZE < 4096 > +#if PAGE_SIZE_MIN < 4096 > #error PAGE_SIZE is < 4k > #endif [Severity: High] Are the prerequisite definitions for PAGE_SIZE_MIN, PAGE_SIZE_MAX, DEFINE_GLOBAL_PAGE_SIZE_VAR(), and DEFINE_GLOBAL_PAGE_SIZE_VAR_CONST() missing from this tree? None of these macros are defined in include/vdso/page.h or anywhere else, causing build failures across all 13 modified drivers. In preprocessor directives, undefined PAGE_SIZE_MIN and PAGE_SIZE_MAX evaluate to 0 (with -Wundef warnings), triggering this #error unconditionally in echoaudio_dsp.c and disabling the 4 KiB and 8 KiB fast paths in sound/pci/emu10k1/memory.c and sound/pci/trident/trident_memory.c. [ ... ] > diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c > index 5d88507b4d0f0..0f34f27041cbd 100644 > --- a/sound/soc/stm/stm32_sai_sub.c > +++ b/sound/soc/stm/stm32_sai_sub.c > @@ -1433,23 +1433,25 @@ static int stm32_sai_pcm_process_spdif(struct snd= _pcm_substream *substream, > } > =20 > /* No support of mmap in S/PDIF mode */ > -static const struct snd_pcm_hardware stm32_sai_pcm_hw_spdif =3D { > +static DEFINE_GLOBAL_PAGE_SIZE_VAR_CONST(struct snd_pcm_hardware, > + stm32_sai_pcm_hw_spdif, { > .info =3D SNDRV_PCM_INFO_INTERLEAVED, > .buffer_bytes_max =3D 8 * PAGE_SIZE, > .period_bytes_min =3D 1024, > .period_bytes_max =3D PAGE_SIZE, > .periods_min =3D 2, > .periods_max =3D 8, > -}; > +}); > =20 > -static const struct snd_pcm_hardware stm32_sai_pcm_hw =3D { > +static DEFINE_GLOBAL_PAGE_SIZE_VAR_CONST(struct snd_pcm_hardware, > + stm32_sai_pcm_hw, { > .info =3D SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP, > .buffer_bytes_max =3D 8 * PAGE_SIZE, > .period_bytes_min =3D 1024, /* 5ms at 48kHz */ > .period_bytes_max =3D PAGE_SIZE, > .periods_min =3D 2, > .periods_max =3D 8, > -}; > +}); [Severity: High] Does converting stm32_sai_pcm_hw_spdif, stm32_sai_pcm_hw, and stm32_spdifrx_pcm_hw to DEFINE_GLOBAL_PAGE_SIZE_VAR_CONST() break the static initializers of stm32_sai_pcm_config, stm32_sai_pcm_config_spdif, and stm32_spdifrx_pcm_config when PAGE_SIZE is not a compile-time constant? Unlike stm32_i2s_pcm_config in sound/soc/stm/stm32_i2s.c, those three struct snd_dmaengine_pcm_config tables remain plain static const variables: sound/soc/stm/stm32_sai_sub.c: static const struct snd_dmaengine_pcm_config stm32_sai_pcm_config =3D { .pcm_hardware =3D &stm32_sai_pcm_hw, .prepare_slave_config =3D snd_dmaengine_pcm_prepare_slave_config, }; static const struct snd_dmaengine_pcm_config stm32_sai_pcm_config_spdif =3D= { .pcm_hardware =3D &stm32_sai_pcm_hw_spdif, .prepare_slave_config =3D snd_dmaengine_pcm_prepare_slave_config, .process =3D stm32_sai_pcm_process_spdif, }; When boot-time page size selection is enabled, &stm32_sai_pcm_hw, &stm32_sai_pcm_hw_spdif, and &stm32_spdifrx_pcm_hw expand to the address of a dereferenced accessor call rather than a compile-time constant address, failing compilation. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202031733.1704= 898-1-ericcurtin17@gmail.com?part=3D1