sound/soc/sdca/sdca_interrupts.c:220:1: warning: the frame size of 1264 bytes is larger than 1024 bytes
kernel test robot
build botHi Charles,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 024e09e444bd2b06aee9d1f3fe7b313c7a2df1bb commit: 6894e49b7b62cdb0edbcaaa23ea0218edb3b02dd [8699/10823] ASoC: SDCA: Kconfig/Makefile fixups config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20250718/[email protected]/config) compiler: gcc-11 (Debian 11.3.0-12) 11.3.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250718/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
sound/soc/sdca/sdca_interrupts.c: In function 'detected_mode_handler':
>> sound/soc/sdca/sdca_interrupts.c:220:1: warning: the frame size of 1264 bytes is larger than 1024 bytes [-Wframe-larger-than=]
220 | }
| ^vim +220 sound/soc/sdca/sdca_interrupts.c
b9ab3b61824190b Charles Keepax 2025-06-24 138
b9ab3b61824190b Charles Keepax 2025-06-24 139 static irqreturn_t detected_mode_handler(int irq, void *data)
b9ab3b61824190b Charles Keepax 2025-06-24 140 {
b9ab3b61824190b Charles Keepax 2025-06-24 141 struct sdca_interrupt *interrupt = data;
b9ab3b61824190b Charles Keepax 2025-06-24 142 struct snd_soc_component *component = interrupt->component;
b9ab3b61824190b Charles Keepax 2025-06-24 143 struct device *dev = component->dev;
b9ab3b61824190b Charles Keepax 2025-06-24 144 struct snd_soc_card *card = component->card;
b9ab3b61824190b Charles Keepax 2025-06-24 145 struct rw_semaphore *rwsem = &card->snd_card->controls_rwsem;
b9ab3b61824190b Charles Keepax 2025-06-24 146 struct snd_kcontrol *kctl = interrupt->priv;
b9ab3b61824190b Charles Keepax 2025-06-24 147 struct snd_ctl_elem_value ucontrol;
b9ab3b61824190b Charles Keepax 2025-06-24 148 struct soc_enum *soc_enum;
b9ab3b61824190b Charles Keepax 2025-06-24 149 unsigned int reg, val;
b9ab3b61824190b Charles Keepax 2025-06-24 150 int ret;
b9ab3b61824190b Charles Keepax 2025-06-24 151
b9ab3b61824190b Charles Keepax 2025-06-24 152 if (!kctl) {
b9ab3b61824190b Charles Keepax 2025-06-24 153 const char *name __free(kfree) = kasprintf(GFP_KERNEL, "%s %s",
b9ab3b61824190b Charles Keepax 2025-06-24 154 interrupt->entity->label,
b9ab3b61824190b Charles Keepax 2025-06-24 155 SDCA_CTL_SELECTED_MODE_NAME);
b9ab3b61824190b Charles Keepax 2025-06-24 156
b9ab3b61824190b Charles Keepax 2025-06-24 157 if (!name)
b9ab3b61824190b Charles Keepax 2025-06-24 158 return -ENOMEM;
b9ab3b61824190b Charles Keepax 2025-06-24 159
b9ab3b61824190b Charles Keepax 2025-06-24 160 kctl = snd_soc_component_get_kcontrol(component, name);
b9ab3b61824190b Charles Keepax 2025-06-24 161 if (!kctl) {
b9ab3b61824190b Charles Keepax 2025-06-24 162 dev_dbg(dev, "control not found: %s\n", name);
b9ab3b61824190b Charles Keepax 2025-06-24 163 return IRQ_NONE;
b9ab3b61824190b Charles Keepax 2025-06-24 164 }
b9ab3b61824190b Charles Keepax 2025-06-24 165
b9ab3b61824190b Charles Keepax 2025-06-24 166 interrupt->priv = kctl;
b9ab3b61824190b Charles Keepax 2025-06-24 167 }
b9ab3b61824190b Charles Keepax 2025-06-24 168
b9ab3b61824190b Charles Keepax 2025-06-24 169 soc_enum = (struct soc_enum *)kctl->private_value;
b9ab3b61824190b Charles Keepax 2025-06-24 170
b9ab3b61824190b Charles Keepax 2025-06-24 171 reg = SDW_SDCA_CTL(interrupt->function->desc->adr, interrupt->entity->id,
b9ab3b61824190b Charles Keepax 2025-06-24 172 interrupt->control->sel, 0);
b9ab3b61824190b Charles Keepax 2025-06-24 173
b9ab3b61824190b Charles Keepax 2025-06-24 174 ret = regmap_read(component->regmap, reg, &val);
b9ab3b61824190b Charles Keepax 2025-06-24 175 if (ret < 0) {
b9ab3b61824190b Charles Keepax 2025-06-24 176 dev_err(dev, "failed to read detected mode: %d\n", ret);
b9ab3b61824190b Charles Keepax 2025-06-24 177 return IRQ_NONE;
b9ab3b61824190b Charles Keepax 2025-06-24 178 }
b9ab3b61824190b Charles Keepax 2025-06-24 179
b9ab3b61824190b Charles Keepax 2025-06-24 180 switch (val) {
b9ab3b61824190b Charles Keepax 2025-06-24 181 case SDCA_DETECTED_MODE_DETECTION_IN_PROGRESS:
b9ab3b61824190b Charles Keepax 2025-06-24 182 case SDCA_DETECTED_MODE_JACK_UNKNOWN:
b9ab3b61824190b Charles Keepax 2025-06-24 183 reg = SDW_SDCA_CTL(interrupt->function->desc->adr,
b9ab3b61824190b Charles Keepax 2025-06-24 184 interrupt->entity->id,
b9ab3b61824190b Charles Keepax 2025-06-24 185 SDCA_CTL_GE_SELECTED_MODE, 0);
b9ab3b61824190b Charles Keepax 2025-06-24 186
b9ab3b61824190b Charles Keepax 2025-06-24 187 /*
b9ab3b61824190b Charles Keepax 2025-06-24 188 * Selected mode is not normally marked as volatile register
b9ab3b61824190b Charles Keepax 2025-06-24 189 * (RW), but here force a read from the hardware. If the
b9ab3b61824190b Charles Keepax 2025-06-24 190 * detected mode is unknown we need to see what the device
b9ab3b61824190b Charles Keepax 2025-06-24 191 * selected as a "safe" option.
b9ab3b61824190b Charles Keepax 2025-06-24 192 */
b9ab3b61824190b Charles Keepax 2025-06-24 193 regcache_drop_region(component->regmap, reg, reg);
b9ab3b61824190b Charles Keepax 2025-06-24 194
b9ab3b61824190b Charles Keepax 2025-06-24 195 ret = regmap_read(component->regmap, reg, &val);
b9ab3b61824190b Charles Keepax 2025-06-24 196 if (ret) {
b9ab3b61824190b Charles Keepax 2025-06-24 197 dev_err(dev, "failed to re-check selected mode: %d\n", ret);
b9ab3b61824190b Charles Keepax 2025-06-24 198 return IRQ_NONE;
b9ab3b61824190b Charles Keepax 2025-06-24 199 }
b9ab3b61824190b Charles Keepax 2025-06-24 200 break;
b9ab3b61824190b Charles Keepax 2025-06-24 201 default:
b9ab3b61824190b Charles Keepax 2025-06-24 202 break;
b9ab3b61824190b Charles Keepax 2025-06-24 203 }
b9ab3b61824190b Charles Keepax 2025-06-24 204
b9ab3b61824190b Charles Keepax 2025-06-24 205 dev_dbg(dev, "%s: %#x\n", interrupt->name, val);
b9ab3b61824190b Charles Keepax 2025-06-24 206
b9ab3b61824190b Charles Keepax 2025-06-24 207 ucontrol.value.enumerated.item[0] = snd_soc_enum_val_to_item(soc_enum, val);
b9ab3b61824190b Charles Keepax 2025-06-24 208
b9ab3b61824190b Charles Keepax 2025-06-24 209 down_write(rwsem);
b9ab3b61824190b Charles Keepax 2025-06-24 210 ret = kctl->put(kctl, &ucontrol);
b9ab3b61824190b Charles Keepax 2025-06-24 211 up_write(rwsem);
b9ab3b61824190b Charles Keepax 2025-06-24 212 if (ret < 0) {
b9ab3b61824190b Charles Keepax 2025-06-24 213 dev_err(dev, "failed to update selected mode: %d\n", ret);
b9ab3b61824190b Charles Keepax 2025-06-24 214 return IRQ_NONE;
b9ab3b61824190b Charles Keepax 2025-06-24 215 }
b9ab3b61824190b Charles Keepax 2025-06-24 216
b9ab3b61824190b Charles Keepax 2025-06-24 217 snd_ctl_notify(card->snd_card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id);
b9ab3b61824190b Charles Keepax 2025-06-24 218
b9ab3b61824190b Charles Keepax 2025-06-24 219 return IRQ_HANDLED;b9ab3b61824190b Charles Keepax 2025-06-24 @220 }b9ab3b61824190b Charles Keepax 2025-06-24 221
:::::: The code at line 220 was first introduced by commit
:::::: b9ab3b61824190b1c6b2c59e7ba4de591f24eb92 ASoC: SDCA: Add some initial IRQ handlers
:::::: TO: Charles Keepax <[email protected]> :::::: CC: Mark Brown <[email protected]>
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Quoted 5 lines · kernel test robot
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 024e09e444bd2b06aee9d1f3fe7b313c7a2df1bb commit: 6894e49b7b62cdb0edbcaaa23ea0218edb3b02dd [8699/10823] ASoC: SDCA: Kconfig Makefile fixups
The actual root cause was commit b9ab3b618241 ("ASoC: SDCA: Add some initial IRQ handlers"), which introduced the new interrupt handler.
Quoted 7 lines
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes:
https://lore.kernel.org/oe-kbuild-all/[email protected]/
Quoted 6 lines
All warnings (new ones prefixed by >>):
sound/soc/sdca/sdca_interrupts.c: In function 'detected_mode_handler':Quoted 1 line
Quoted 1 line
sound/soc/sdca/sdca_interrupts.c:220:1: warning: the frame size of 1264 bytes is larger than 1024 bytes [-Wframe-larger-than=]220 | } | ^
I have not seen this one in my testing, but I have looked at a lot of similar issues recently.
The first thing I see is the "struct snd_ctl_elem_value" structure on the stack, which is about 700 bytes long. This is probably too big for the stack, but doesn't explain the warning by itself.
Seeing that only a single integer (ucontrol.value.enumerated.item[0]) is actually initialized in the structure that gets passed down, I wonder if it could just call a different interface instead that takes a u32 argument instead of the full ucontrol.
Alternatively, the ucontrol could be preallocated, e.g. in struct sdca_interrupt, as there should be no concurrent callers of detect_mode_handler for a single sdca_interrupt.
Arnd
Quoted 32 lines · Arnd Bergmann
Quoted 5 lines · kernel test robot
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 024e09e444bd2b06aee9d1f3fe7b313c7a2df1bb commit: 6894e49b7b62cdb0edbcaaa23ea0218edb3b02dd [8699/10823] ASoC: SDCA: Kconfig Makefile fixupsThe actual root cause was commit
b9ab3b618241("ASoC: SDCA: Add some initial IRQ handlers"), which introduced the new interrupt handler.Quoted 7 lines
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes:
https://lore.kernel.org/oe-kbuild-all/[email protected]/Quoted 6 lines
All warnings (new ones prefixed by >>):
sound/soc/sdca/sdca_interrupts.c: In function 'detected_mode_handler':Quoted 1 line
Quoted 1 line
sound/soc/sdca/sdca_interrupts.c:220:1: warning: the frame size of 1264 bytes is larger than 1024 bytes [-Wframe-larger-than=]220 | } | ^I have not seen this one in my testing, but I have looked at a lot of similar issues recently.
The first thing I see is the "struct
snd_ctl_elem_value" structure on the stack, which is about 700 bytes long. This is probably too big for the stack, but doesn't explain the warning by itself.
Quoted 8 lines
Seeing that only a single integer (ucontrol.value.enumerated.item[0]) is actually initialized in the structure that gets passed down, I wonder if it could just call a different interface instead that takes a u32 argument instead of the full ucontrol.
Alternatively, the ucontrol could be preallocated, e.g. in struct
sdca_interrupt, as there should be no concurrent callers ofdetect_mode_handlerfor a singlesdca_interrupt.
I have a patch I will send out shortly, although I have just gone for the lazy allocate it locally approach. The jack detect is hardly a critical path since it only runs when someone plugs in/out a jack, so keeping it simple seemed best.
Thanks,
Charles