lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 23 Jul 2012 15:05:19 +0100
From:	Lee Jones <lee.jones@...aro.org>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
CC:	Liam Girdwood <lrg@...com>, alsa-devel@...a-project.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Help request - ASoC recursion issue

Hi Mark,

I was wondering if I may bother you for some help. I've been having 
serious issues with testing the new mop500 sound system you have in your 
ASoC for-next branch. I've fixed a few issues and will be submitting 
patches shortly. The most serious issue I came across was with 
recursion. Let me show you:

So here we setup the power_check function pointer with 
'dapm_supply_check_power()'.

> static struct snd_soc_dapm_widget *
> snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
> 			 const struct snd_soc_dapm_widget *widget)
> {
<snip>
> 	case snd_soc_dapm_regulator_supply:
> 	case snd_soc_dapm_clock_supply:
> 		w->power_check = dapm_supply_check_power;
> 		break;
<snip>
> }

Later we call 'dapm_widget_power_check()' which calls into the function 
pointer we know to be 'dapm_supply_check_power()'.

 > static int dapm_widget_power_check(struct snd_soc_dapm_widget *w)
 > {
 > 	if (w->power_checked)
 > 		return w->new_power;
 >
 > 	if (w->force)
 > 		w->new_power = 1;
 > 	else
 > 		w->new_power = w->power_check(w);
 >
 > 	w->power_checked = true;
 >
 > 	return w->new_power;
 > }

The problem seems to be that 'dapm_supply_check_power()' then calls back 
into 'dapm_widget_power_check()'. Then round and round we go!

> /* Check to see if a power supply is needed */
> static int dapm_supply_check_power(struct snd_soc_dapm_widget *w)
> {
<snip>
> 	/* Check if one of our outputs is connected */
> 	list_for_each_entry(path, &w->sinks, list_source) {
> 		DAPM_UPDATE_STAT(w, neighbour_checks);
>
> 		if (path->weak)
> 			continue;
>
> 		if (path->connected &&
> 		    !path->connected(path->source, path->sink))
> 			continue;
>
> 		if (!path->sink)
> 			continue;
>
> 		if (dapm_widget_power_check(path->sink))     /* <-- Doh! */
> 			return 1;
> 	}
<snip>
> }

Can you shed some light on what the correct solution might be?

Any help would be gratefully received.

Kind regards,
Lee

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ