All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 8699/10823] sound/soc/sdca/sdca_interrupts.c:220:1: warning: the frame size of 1264 bytes is larger than 1024 bytes
@ 2025-07-18 14:43 kernel test robot
  2025-07-18 15:50 ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2025-07-18 14:43 UTC (permalink / raw)
  To: Charles Keepax; +Cc: oe-kbuild-all, Mark Brown, Arnd Bergmann

Hi 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/202507182222.OLgOy9fX-lkp@intel.com/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/202507182222.OLgOy9fX-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507182222.OLgOy9fX-lkp@intel.com/

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 <ckeepax@opensource.cirrus.com>
:::::: CC: Mark Brown <broonie@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-next:master 8699/10823] sound/soc/sdca/sdca_interrupts.c:220:1: warning: the frame size of 1264 bytes is larger than 1024 bytes
  2025-07-18 14:43 [linux-next:master 8699/10823] sound/soc/sdca/sdca_interrupts.c:220:1: warning: the frame size of 1264 bytes is larger than 1024 bytes kernel test robot
@ 2025-07-18 15:50 ` Arnd Bergmann
  2025-07-21  8:58   ` Charles Keepax
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2025-07-18 15:50 UTC (permalink / raw)
  To: kernel test robot, Charles Keepax; +Cc: oe-kbuild-all, Mark Brown

On Fri, Jul 18, 2025, at 16:43, kernel test robot wrote:
> 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.

> 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 <lkp@intel.com>
> | Closes: 
> https://lore.kernel.org/oe-kbuild-all/202507182222.OLgOy9fX-lkp@intel.com/
>
> 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 | }
>          | ^

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-next:master 8699/10823] sound/soc/sdca/sdca_interrupts.c:220:1: warning: the frame size of 1264 bytes is larger than 1024 bytes
  2025-07-18 15:50 ` Arnd Bergmann
@ 2025-07-21  8:58   ` Charles Keepax
  0 siblings, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2025-07-21  8:58 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: kernel test robot, oe-kbuild-all, Mark Brown

On Fri, Jul 18, 2025 at 05:50:23PM +0200, Arnd Bergmann wrote:
> On Fri, Jul 18, 2025, at 16:43, kernel test robot wrote:
> > 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.
> 
> > 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 <lkp@intel.com>
> > | Closes: 
> > https://lore.kernel.org/oe-kbuild-all/202507182222.OLgOy9fX-lkp@intel.com/
> >
> > 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 | }
> >          | ^
> 
> 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.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-21  8:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-18 14:43 [linux-next:master 8699/10823] sound/soc/sdca/sdca_interrupts.c:220:1: warning: the frame size of 1264 bytes is larger than 1024 bytes kernel test robot
2025-07-18 15:50 ` Arnd Bergmann
2025-07-21  8:58   ` Charles Keepax

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.