Re: [ 35/73] ASoC: dapm: Fix locking during codec shutdown

2012-07-31 Thread Ben Hutchings
On Tue, 2012-07-31 at 17:13 +0100, Mark Brown wrote:
> On Tue, Jul 31, 2012 at 01:11:01PM -0300, Herton Ronaldo Krzesinski wrote:
> 
> > Hi, this doesn't build on 3.2:
> 
> > linux-stable/sound/soc/soc-dapm.c: In function 'soc_dapm_shutdown_codec':
> > linux-stable/sound/soc/soc-dapm.c:2982:18: error: 'struct snd_soc_card' has 
> > no member named 'dapm_mutex'
> > linux-stable/sound/soc/soc-dapm.c:3007:20: error: 'struct snd_soc_card' has 
> > no member named 'dapm_mutex'
> 
> > Looking at it, I'm not sure the fix is needed on 3.2, and introducing
> > dapm_mutex would be several changes.
> 
> Yes, this is irrelevant on v3.2.

OK, I've dropped this.

Ben.

-- 
Ben Hutchings
Experience is directly proportional to the value of equipment destroyed.
 - Carolyn Scheppner


signature.asc
Description: This is a digitally signed message part


Re: [ 35/73] ASoC: dapm: Fix locking during codec shutdown

2012-07-31 Thread Mark Brown
On Tue, Jul 31, 2012 at 01:11:01PM -0300, Herton Ronaldo Krzesinski wrote:

> Hi, this doesn't build on 3.2:

> linux-stable/sound/soc/soc-dapm.c: In function 'soc_dapm_shutdown_codec':
> linux-stable/sound/soc/soc-dapm.c:2982:18: error: 'struct snd_soc_card' has 
> no member named 'dapm_mutex'
> linux-stable/sound/soc/soc-dapm.c:3007:20: error: 'struct snd_soc_card' has 
> no member named 'dapm_mutex'

> Looking at it, I'm not sure the fix is needed on 3.2, and introducing
> dapm_mutex would be several changes.

Yes, this is irrelevant on v3.2.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [ 35/73] ASoC: dapm: Fix locking during codec shutdown

2012-07-31 Thread Herton Ronaldo Krzesinski
On Tue, Jul 31, 2012 at 05:43:45AM +0100, Ben Hutchings wrote:
> 3.2-stable review patch.  If anyone has any objections, please let me know.
> 
> --
> 
> From: Liam Girdwood 
> 
> commit 01005a729a17ab419f61a366e22f3419e7a2c3fe upstream.
> 
> Codec shutdown performs a DAPM power sequence that might cause conflicts
> and/or race conditions if another stream power event is running 
> simultaneously.
> Use card's dapm mutex to protect any potential race condition between them.
> 
> Signed-off-by: Misael Lopez Cruz 
> Signed-off-by: Liam Girdwood 
> Signed-off-by: Mark Brown 
> Signed-off-by: Ben Hutchings 
> ---
>  sound/soc/soc-dapm.c |5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
> index 5be4f9a..114f2af 100644
> --- a/sound/soc/soc-dapm.c
> +++ b/sound/soc/soc-dapm.c
> @@ -3537,10 +3537,13 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_free);
>  
>  static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm)
>  {
> + struct snd_soc_card *card = dapm->card;
>   struct snd_soc_dapm_widget *w;
>   LIST_HEAD(down_list);
>   int powerdown = 0;
>  
> + mutex_lock(>dapm_mutex);
> +

Hi, this doesn't build on 3.2:

linux-stable/sound/soc/soc-dapm.c: In function 'soc_dapm_shutdown_codec':
linux-stable/sound/soc/soc-dapm.c:2982:18: error: 'struct snd_soc_card' has no 
member named 'dapm_mutex'
linux-stable/sound/soc/soc-dapm.c:3007:20: error: 'struct snd_soc_card' has no 
member named 'dapm_mutex'

Looking at it, I'm not sure the fix is needed on 3.2, and introducing
dapm_mutex would be several changes.

>   list_for_each_entry(w, >card->widgets, list) {
>   if (w->dapm != dapm)
>   continue;
> @@ -3563,6 +3566,8 @@ static void soc_dapm_shutdown_codec(struct 
> snd_soc_dapm_context *dapm)
>   snd_soc_dapm_set_bias_level(dapm,
>   SND_SOC_BIAS_STANDBY);
>   }
> +
> + mutex_unlock(>dapm_mutex);
>  }
>  
>  /*
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
[]'s
Herton
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [ 35/73] ASoC: dapm: Fix locking during codec shutdown

2012-07-31 Thread Herton Ronaldo Krzesinski
On Tue, Jul 31, 2012 at 05:43:45AM +0100, Ben Hutchings wrote:
 3.2-stable review patch.  If anyone has any objections, please let me know.
 
 --
 
 From: Liam Girdwood l...@ti.com
 
 commit 01005a729a17ab419f61a366e22f3419e7a2c3fe upstream.
 
 Codec shutdown performs a DAPM power sequence that might cause conflicts
 and/or race conditions if another stream power event is running 
 simultaneously.
 Use card's dapm mutex to protect any potential race condition between them.
 
 Signed-off-by: Misael Lopez Cruz misael.lo...@ti.com
 Signed-off-by: Liam Girdwood l...@ti.com
 Signed-off-by: Mark Brown broo...@opensource.wolfsonmicro.com
 Signed-off-by: Ben Hutchings b...@decadent.org.uk
 ---
  sound/soc/soc-dapm.c |5 +
  1 file changed, 5 insertions(+)
 
 diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
 index 5be4f9a..114f2af 100644
 --- a/sound/soc/soc-dapm.c
 +++ b/sound/soc/soc-dapm.c
 @@ -3537,10 +3537,13 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_free);
  
  static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm)
  {
 + struct snd_soc_card *card = dapm-card;
   struct snd_soc_dapm_widget *w;
   LIST_HEAD(down_list);
   int powerdown = 0;
  
 + mutex_lock(card-dapm_mutex);
 +

Hi, this doesn't build on 3.2:

linux-stable/sound/soc/soc-dapm.c: In function 'soc_dapm_shutdown_codec':
linux-stable/sound/soc/soc-dapm.c:2982:18: error: 'struct snd_soc_card' has no 
member named 'dapm_mutex'
linux-stable/sound/soc/soc-dapm.c:3007:20: error: 'struct snd_soc_card' has no 
member named 'dapm_mutex'

Looking at it, I'm not sure the fix is needed on 3.2, and introducing
dapm_mutex would be several changes.

   list_for_each_entry(w, dapm-card-widgets, list) {
   if (w-dapm != dapm)
   continue;
 @@ -3563,6 +3566,8 @@ static void soc_dapm_shutdown_codec(struct 
 snd_soc_dapm_context *dapm)
   snd_soc_dapm_set_bias_level(dapm,
   SND_SOC_BIAS_STANDBY);
   }
 +
 + mutex_unlock(card-dapm_mutex);
  }
  
  /*
 
 
 --
 To unsubscribe from this list: send the line unsubscribe stable in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 

-- 
[]'s
Herton
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [ 35/73] ASoC: dapm: Fix locking during codec shutdown

2012-07-31 Thread Mark Brown
On Tue, Jul 31, 2012 at 01:11:01PM -0300, Herton Ronaldo Krzesinski wrote:

 Hi, this doesn't build on 3.2:

 linux-stable/sound/soc/soc-dapm.c: In function 'soc_dapm_shutdown_codec':
 linux-stable/sound/soc/soc-dapm.c:2982:18: error: 'struct snd_soc_card' has 
 no member named 'dapm_mutex'
 linux-stable/sound/soc/soc-dapm.c:3007:20: error: 'struct snd_soc_card' has 
 no member named 'dapm_mutex'

 Looking at it, I'm not sure the fix is needed on 3.2, and introducing
 dapm_mutex would be several changes.

Yes, this is irrelevant on v3.2.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [ 35/73] ASoC: dapm: Fix locking during codec shutdown

2012-07-31 Thread Ben Hutchings
On Tue, 2012-07-31 at 17:13 +0100, Mark Brown wrote:
 On Tue, Jul 31, 2012 at 01:11:01PM -0300, Herton Ronaldo Krzesinski wrote:
 
  Hi, this doesn't build on 3.2:
 
  linux-stable/sound/soc/soc-dapm.c: In function 'soc_dapm_shutdown_codec':
  linux-stable/sound/soc/soc-dapm.c:2982:18: error: 'struct snd_soc_card' has 
  no member named 'dapm_mutex'
  linux-stable/sound/soc/soc-dapm.c:3007:20: error: 'struct snd_soc_card' has 
  no member named 'dapm_mutex'
 
  Looking at it, I'm not sure the fix is needed on 3.2, and introducing
  dapm_mutex would be several changes.
 
 Yes, this is irrelevant on v3.2.

OK, I've dropped this.

Ben.

-- 
Ben Hutchings
Experience is directly proportional to the value of equipment destroyed.
 - Carolyn Scheppner


signature.asc
Description: This is a digitally signed message part


[ 35/73] ASoC: dapm: Fix locking during codec shutdown

2012-07-30 Thread Ben Hutchings
3.2-stable review patch.  If anyone has any objections, please let me know.

--

From: Liam Girdwood 

commit 01005a729a17ab419f61a366e22f3419e7a2c3fe upstream.

Codec shutdown performs a DAPM power sequence that might cause conflicts
and/or race conditions if another stream power event is running simultaneously.
Use card's dapm mutex to protect any potential race condition between them.

Signed-off-by: Misael Lopez Cruz 
Signed-off-by: Liam Girdwood 
Signed-off-by: Mark Brown 
Signed-off-by: Ben Hutchings 
---
 sound/soc/soc-dapm.c |5 +
 1 file changed, 5 insertions(+)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 5be4f9a..114f2af 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3537,10 +3537,13 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_free);
 
 static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm)
 {
+   struct snd_soc_card *card = dapm->card;
struct snd_soc_dapm_widget *w;
LIST_HEAD(down_list);
int powerdown = 0;
 
+   mutex_lock(>dapm_mutex);
+
list_for_each_entry(w, >card->widgets, list) {
if (w->dapm != dapm)
continue;
@@ -3563,6 +3566,8 @@ static void soc_dapm_shutdown_codec(struct 
snd_soc_dapm_context *dapm)
snd_soc_dapm_set_bias_level(dapm,
SND_SOC_BIAS_STANDBY);
}
+
+   mutex_unlock(>dapm_mutex);
 }
 
 /*


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 35/73] ASoC: dapm: Fix locking during codec shutdown

2012-07-30 Thread Ben Hutchings
3.2-stable review patch.  If anyone has any objections, please let me know.

--

From: Liam Girdwood l...@ti.com

commit 01005a729a17ab419f61a366e22f3419e7a2c3fe upstream.

Codec shutdown performs a DAPM power sequence that might cause conflicts
and/or race conditions if another stream power event is running simultaneously.
Use card's dapm mutex to protect any potential race condition between them.

Signed-off-by: Misael Lopez Cruz misael.lo...@ti.com
Signed-off-by: Liam Girdwood l...@ti.com
Signed-off-by: Mark Brown broo...@opensource.wolfsonmicro.com
Signed-off-by: Ben Hutchings b...@decadent.org.uk
---
 sound/soc/soc-dapm.c |5 +
 1 file changed, 5 insertions(+)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 5be4f9a..114f2af 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3537,10 +3537,13 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_free);
 
 static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm)
 {
+   struct snd_soc_card *card = dapm-card;
struct snd_soc_dapm_widget *w;
LIST_HEAD(down_list);
int powerdown = 0;
 
+   mutex_lock(card-dapm_mutex);
+
list_for_each_entry(w, dapm-card-widgets, list) {
if (w-dapm != dapm)
continue;
@@ -3563,6 +3566,8 @@ static void soc_dapm_shutdown_codec(struct 
snd_soc_dapm_context *dapm)
snd_soc_dapm_set_bias_level(dapm,
SND_SOC_BIAS_STANDBY);
}
+
+   mutex_unlock(card-dapm_mutex);
 }
 
 /*


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/