* [PATCH] ASoC: SDCA: Shrink detected_mode_handler() stack frame
@ 2025-07-22 10:23 Charles Keepax
2025-07-22 10:49 ` Arnd Bergmann
2025-07-22 14:33 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Charles Keepax @ 2025-07-22 10:23 UTC (permalink / raw)
To: broonie
Cc: lgirdwood, yung-chuan.liao, pierre-louis.bossart, peter.ujfalusi,
arnd, linux-sound, patches
The stack frame for detected_mode_handler() is a bit large. Dynamically
allocate the control value struct, which is most of the size, to avoid
this.
Fixes: b9ab3b618241 ("ASoC: SDCA: Add some initial IRQ handlers")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202507182222.OLgOy9fX-lkp@intel.com/
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
sound/soc/sdca/sdca_interrupts.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/sound/soc/sdca/sdca_interrupts.c b/sound/soc/sdca/sdca_interrupts.c
index b76512732af8..a5b2adaac312 100644
--- a/sound/soc/sdca/sdca_interrupts.c
+++ b/sound/soc/sdca/sdca_interrupts.c
@@ -144,7 +144,7 @@ static irqreturn_t detected_mode_handler(int irq, void *data)
struct snd_soc_card *card = component->card;
struct rw_semaphore *rwsem = &card->snd_card->controls_rwsem;
struct snd_kcontrol *kctl = interrupt->priv;
- struct snd_ctl_elem_value ucontrol;
+ struct snd_ctl_elem_value *ucontrol __free(kfree) = NULL;
struct soc_enum *soc_enum;
unsigned int reg, val;
int ret;
@@ -204,10 +204,14 @@ static irqreturn_t detected_mode_handler(int irq, void *data)
dev_dbg(dev, "%s: %#x\n", interrupt->name, val);
- ucontrol.value.enumerated.item[0] = snd_soc_enum_val_to_item(soc_enum, val);
+ ucontrol = kzalloc(sizeof(*ucontrol), GFP_KERNEL);
+ if (!ucontrol)
+ return IRQ_NONE;
+
+ ucontrol->value.enumerated.item[0] = snd_soc_enum_val_to_item(soc_enum, val);
down_write(rwsem);
- ret = kctl->put(kctl, &ucontrol);
+ ret = kctl->put(kctl, ucontrol);
up_write(rwsem);
if (ret < 0) {
dev_err(dev, "failed to update selected mode: %d\n", ret);
--
2.39.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: SDCA: Shrink detected_mode_handler() stack frame
2025-07-22 10:23 [PATCH] ASoC: SDCA: Shrink detected_mode_handler() stack frame Charles Keepax
@ 2025-07-22 10:49 ` Arnd Bergmann
2025-07-22 14:33 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2025-07-22 10:49 UTC (permalink / raw)
To: Charles Keepax, Mark Brown
Cc: lgirdwood, Bard Liao, Pierre-Louis Bossart, Peter Ujfalusi,
linux-sound, patches
On Tue, Jul 22, 2025, at 12:23, Charles Keepax wrote:
> The stack frame for detected_mode_handler() is a bit large. Dynamically
> allocate the control value struct, which is most of the size, to avoid
> this.
>
> Fixes: b9ab3b618241 ("ASoC: SDCA: Add some initial IRQ handlers")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes:
> https://lore.kernel.org/oe-kbuild-all/202507182222.OLgOy9fX-lkp@intel.com/
> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: SDCA: Shrink detected_mode_handler() stack frame
2025-07-22 10:23 [PATCH] ASoC: SDCA: Shrink detected_mode_handler() stack frame Charles Keepax
2025-07-22 10:49 ` Arnd Bergmann
@ 2025-07-22 14:33 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-07-22 14:33 UTC (permalink / raw)
To: Charles Keepax
Cc: lgirdwood, yung-chuan.liao, pierre-louis.bossart, peter.ujfalusi,
arnd, linux-sound, patches
On Tue, 22 Jul 2025 11:23:05 +0100, Charles Keepax wrote:
> The stack frame for detected_mode_handler() is a bit large. Dynamically
> allocate the control value struct, which is most of the size, to avoid
> this.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: SDCA: Shrink detected_mode_handler() stack frame
commit: 59c5dbd585a0bee70e51fcdf36185f7602b9c285
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] 3+ messages in thread
end of thread, other threads:[~2025-07-22 14:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-22 10:23 [PATCH] ASoC: SDCA: Shrink detected_mode_handler() stack frame Charles Keepax
2025-07-22 10:49 ` Arnd Bergmann
2025-07-22 14:33 ` 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).