linux-next: semantic conflict between the tip and sound-asoc trees

Stephen Rothwell posted 1 patch 2 months, 2 weeks ago
sound/soc/sdca/sdca_interrupts.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
linux-next: semantic conflict between the tip and sound-asoc trees
Posted by Stephen Rothwell 2 months, 2 weeks ago
Hi all,

After merging the tip tree, today's linux-next build (x86_64 allmodconfig)
failed like this:

In file included from include/linux/kernfs.h:11,
                 from include/linux/sysfs.h:16,
                 from include/linux/kobject.h:20,
                 from include/linux/energy_model.h:7,
                 from include/linux/device.h:16,
                 from sound/soc/sdca/sdca_interrupts.c:13:
sound/soc/sdca/sdca_interrupts.c: In function 'sdca_irq_allocate':
include/linux/mutex.h:153:9: error: ignoring return value of '__devm_mutex_init' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  153 |         __devm_mutex_init(dev, __mutex_init_ret(mutex))
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/sdca/sdca_interrupts.c:422:9: note: in expansion of macro 'devm_mutex_init'
  422 |         devm_mutex_init(dev, &info->irq_lock);
      |         ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Caused by commit

  daec29dcc873 ("locking/mutex: Mark devm_mutex_init() as __must_check")

interacting with commit

  b126394d9ec6 ("ASoC: SDCA: Generic interrupt support")

from the sound-asoc tree.

I have applied the following merge fix patch (just a hack, something
better needs to be done).

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 22 Jul 2025 12:26:10 +1000
Subject: [PATCH] fix up for "ASoC: SDCA: Generic interrupt support"

interacting with "locking/mutex: Mark devm_mutex_init() as
__must_check".

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 sound/soc/sdca/sdca_interrupts.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sdca/sdca_interrupts.c b/sound/soc/sdca/sdca_interrupts.c
index b76512732af8..b393471e9760 100644
--- a/sound/soc/sdca/sdca_interrupts.c
+++ b/sound/soc/sdca/sdca_interrupts.c
@@ -419,7 +419,11 @@ struct sdca_interrupt_info *sdca_irq_allocate(struct device *dev,
 
 	info->irq_chip = sdca_irq_chip;
 
-	devm_mutex_init(dev, &info->irq_lock);
+	ret = devm_mutex_init(dev, &info->irq_lock);
+	if (ret) {
+		/* do some error recovery */
+		return ERR_PTR(ret);
+	}
 
 	ret = devm_regmap_add_irq_chip(dev, regmap, irq, IRQF_ONESHOT, 0,
 				       &info->irq_chip, &info->irq_data);
-- 
2.50.1

-- 
Cheers,
Stephen Rothwell
Re: linux-next: semantic conflict between the tip and sound-asoc trees
Posted by Boqun Feng 2 months, 2 weeks ago
On Tue, Jul 22, 2025 at 01:01:40PM +1000, Stephen Rothwell wrote:
> Hi all,
> 

Hi Stephen,

> After merging the tip tree, today's linux-next build (x86_64 allmodconfig)
> failed like this:
> 
> In file included from include/linux/kernfs.h:11,
>                  from include/linux/sysfs.h:16,
>                  from include/linux/kobject.h:20,
>                  from include/linux/energy_model.h:7,
>                  from include/linux/device.h:16,
>                  from sound/soc/sdca/sdca_interrupts.c:13:
> sound/soc/sdca/sdca_interrupts.c: In function 'sdca_irq_allocate':
> include/linux/mutex.h:153:9: error: ignoring return value of '__devm_mutex_init' declared with attribute 'warn_unused_result' [-Werror=unused-result]
>   153 |         __devm_mutex_init(dev, __mutex_init_ret(mutex))
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> sound/soc/sdca/sdca_interrupts.c:422:9: note: in expansion of macro 'devm_mutex_init'
>   422 |         devm_mutex_init(dev, &info->irq_lock);
>       |         ^~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> 
> Caused by commit
> 
>   daec29dcc873 ("locking/mutex: Mark devm_mutex_init() as __must_check")
> 
> interacting with commit
> 
>   b126394d9ec6 ("ASoC: SDCA: Generic interrupt support")
> 
> from the sound-asoc tree.
> 
> I have applied the following merge fix patch (just a hack, something
> better needs to be done).
> 

Thanks for spotting this, I think it'll be easier if sound-asoc tree
could apply this change (with proper error handling). Maciej, Charles
and Mark, does it sound good? Apologies that I was a bit late for
locking changes in this cycle. Thanks!

Regards,
Boqun

> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Tue, 22 Jul 2025 12:26:10 +1000
> Subject: [PATCH] fix up for "ASoC: SDCA: Generic interrupt support"
> 
> interacting with "locking/mutex: Mark devm_mutex_init() as
> __must_check".
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  sound/soc/sdca/sdca_interrupts.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/sdca/sdca_interrupts.c b/sound/soc/sdca/sdca_interrupts.c
> index b76512732af8..b393471e9760 100644
> --- a/sound/soc/sdca/sdca_interrupts.c
> +++ b/sound/soc/sdca/sdca_interrupts.c
> @@ -419,7 +419,11 @@ struct sdca_interrupt_info *sdca_irq_allocate(struct device *dev,
>  
>  	info->irq_chip = sdca_irq_chip;
>  
> -	devm_mutex_init(dev, &info->irq_lock);
> +	ret = devm_mutex_init(dev, &info->irq_lock);
> +	if (ret) {
> +		/* do some error recovery */
> +		return ERR_PTR(ret);
> +	}
>  
>  	ret = devm_regmap_add_irq_chip(dev, regmap, irq, IRQF_ONESHOT, 0,
>  				       &info->irq_chip, &info->irq_data);
> -- 
> 2.50.1
> 
> -- 
> Cheers,
> Stephen Rothwell
Re: linux-next: semantic conflict between the tip and sound-asoc trees
Posted by Charles Keepax 2 months, 2 weeks ago
On Mon, Jul 21, 2025 at 08:15:50PM -0700, Boqun Feng wrote:
> On Tue, Jul 22, 2025 at 01:01:40PM +1000, Stephen Rothwell wrote:
> > Hi all,
> > 
> 
> Hi Stephen,
> 
> > After merging the tip tree, today's linux-next build (x86_64 allmodconfig)
> > failed like this:
> > 
> > In file included from include/linux/kernfs.h:11,
> >                  from include/linux/sysfs.h:16,
> >                  from include/linux/kobject.h:20,
> >                  from include/linux/energy_model.h:7,
> >                  from include/linux/device.h:16,
> >                  from sound/soc/sdca/sdca_interrupts.c:13:
> > sound/soc/sdca/sdca_interrupts.c: In function 'sdca_irq_allocate':
> > include/linux/mutex.h:153:9: error: ignoring return value of '__devm_mutex_init' declared with attribute 'warn_unused_result' [-Werror=unused-result]
> >   153 |         __devm_mutex_init(dev, __mutex_init_ret(mutex))
> >       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > sound/soc/sdca/sdca_interrupts.c:422:9: note: in expansion of macro 'devm_mutex_init'
> >   422 |         devm_mutex_init(dev, &info->irq_lock);
> >       |         ^~~~~~~~~~~~~~~
> > cc1: all warnings being treated as errors
> > 
> > Caused by commit
> > 
> >   daec29dcc873 ("locking/mutex: Mark devm_mutex_init() as __must_check")
> > 
> > interacting with commit
> > 
> >   b126394d9ec6 ("ASoC: SDCA: Generic interrupt support")
> > 
> > from the sound-asoc tree.
> > 
> > I have applied the following merge fix patch (just a hack, something
> > better needs to be done).
> > 
> 
> Thanks for spotting this, I think it'll be easier if sound-asoc tree
> could apply this change (with proper error handling). Maciej, Charles
> and Mark, does it sound good? Apologies that I was a bit late for
> locking changes in this cycle. Thanks!
> 

I am happy enough to do a patch for this, will look at it today.

Thanks,
Charles