* [PATCH RESEND] ASoC: dont call dapm_sync while reporting jack always
@ 2013-10-21 13:37 Vinod Koul
2013-10-22 8:32 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Vinod Koul @ 2013-10-21 13:37 UTC (permalink / raw)
To: alsa-devel; +Cc: Vinod Koul, broonie, lgirdwood
While reporting the jack status snd_soc_jack_report() invokes snd_soc_dapm_sync()
always. This should be required when we have pins associated with jack and
reporting enables or disables these.
So add a check for this case
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
Sorry previous one had some non upstream cruft
sound/soc/soc-jack.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index c9f7953..9fd4ed8 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -65,6 +65,7 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
struct snd_soc_codec *codec;
struct snd_soc_dapm_context *dapm;
struct snd_soc_jack_pin *pin;
+ unsigned int sync = 0;
int enable;
trace_snd_soc_jack_report(jack, mask, status);
@@ -92,12 +93,16 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask)
snd_soc_dapm_enable_pin(dapm, pin->pin);
else
snd_soc_dapm_disable_pin(dapm, pin->pin);
+
+ /* we need to sync for this case only */
+ sync = 1;
}
/* Report before the DAPM sync to help users updating micbias status */
blocking_notifier_call_chain(&jack->notifier, jack->status, jack);
- snd_soc_dapm_sync(dapm);
+ if (sync)
+ snd_soc_dapm_sync(dapm);
snd_jack_report(jack->jack, jack->status);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] ASoC: dont call dapm_sync while reporting jack always
2013-10-21 13:37 [PATCH RESEND] ASoC: dont call dapm_sync while reporting jack always Vinod Koul
@ 2013-10-22 8:32 ` Mark Brown
2013-10-22 15:36 ` Vinod Koul
0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2013-10-22 8:32 UTC (permalink / raw)
To: Vinod Koul; +Cc: alsa-devel, lgirdwood
[-- Attachment #1.1: Type: text/plain, Size: 494 bytes --]
On Mon, Oct 21, 2013 at 07:07:34PM +0530, Vinod Koul wrote:
> While reporting the jack status snd_soc_jack_report() invokes snd_soc_dapm_sync()
> always. This should be required when we have pins associated with jack and
> reporting enables or disables these.
> So add a check for this case
Applied, thanks. It'd be good when doing things like this to say what
the advantage is; with DAPM the general thing is that it gets called a
lot so it should be cheap enough to just call all the time.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] ASoC: dont call dapm_sync while reporting jack always
2013-10-22 8:32 ` Mark Brown
@ 2013-10-22 15:36 ` Vinod Koul
2013-10-23 2:45 ` Patrick Lai
2013-10-23 8:25 ` Mark Brown
0 siblings, 2 replies; 5+ messages in thread
From: Vinod Koul @ 2013-10-22 15:36 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, lgirdwood
[-- Attachment #1.1: Type: text/plain, Size: 890 bytes --]
On Tue, Oct 22, 2013 at 09:32:23AM +0100, Mark Brown wrote:
> On Mon, Oct 21, 2013 at 07:07:34PM +0530, Vinod Koul wrote:
> > While reporting the jack status snd_soc_jack_report() invokes snd_soc_dapm_sync()
> > always. This should be required when we have pins associated with jack and
> > reporting enables or disables these.
> > So add a check for this case
>
> Applied, thanks. It'd be good when doing things like this to say what
> the advantage is; with DAPM the general thing is that it gets called a
> lot so it should be cheap enough to just call all the time.
Okay, my thoughts were that it was obvious. We saw an issue when monkey testing
with jack, bunch of dapm_sync's got triggered (insertion, reroute from usermode,
removal, again reroute from usermode, and so on). The insertion and removal ones
were quite not required for cases with no pins
--
~Vinod
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] ASoC: dont call dapm_sync while reporting jack always
2013-10-22 15:36 ` Vinod Koul
@ 2013-10-23 2:45 ` Patrick Lai
2013-10-23 8:25 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Patrick Lai @ 2013-10-23 2:45 UTC (permalink / raw)
To: Vinod Koul, Mark Brown; +Cc: alsa-devel, lgirdwood
On 10/22/2013 8:36 AM, Vinod Koul wrote:
> On Tue, Oct 22, 2013 at 09:32:23AM +0100, Mark Brown wrote:
>> On Mon, Oct 21, 2013 at 07:07:34PM +0530, Vinod Koul wrote:
>>> While reporting the jack status snd_soc_jack_report() invokes snd_soc_dapm_sync()
>>> always. This should be required when we have pins associated with jack and
>>> reporting enables or disables these.
>>> So add a check for this case
>>
>> Applied, thanks. It'd be good when doing things like this to say what
>> the advantage is; with DAPM the general thing is that it gets called a
>> lot so it should be cheap enough to just call all the time.
> Okay, my thoughts were that it was obvious. We saw an issue when monkey testing
> with jack, bunch of dapm_sync's got triggered (insertion, reroute from usermode,
> removal, again reroute from usermode, and so on). The insertion and removal ones
> were quite not required for cases with no pins
>
We observed the same thing on our side and create another report API
which does not call snd_soc_dapm_sync() :)
Thanks for working out a better solution
Thanks
Patrick
>
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] ASoC: dont call dapm_sync while reporting jack always
2013-10-22 15:36 ` Vinod Koul
2013-10-23 2:45 ` Patrick Lai
@ 2013-10-23 8:25 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2013-10-23 8:25 UTC (permalink / raw)
To: Vinod Koul; +Cc: alsa-devel, lgirdwood
[-- Attachment #1.1: Type: text/plain, Size: 769 bytes --]
On Tue, Oct 22, 2013 at 09:06:54PM +0530, Vinod Koul wrote:
> On Tue, Oct 22, 2013 at 09:32:23AM +0100, Mark Brown wrote:
> > Applied, thanks. It'd be good when doing things like this to say what
> > the advantage is; with DAPM the general thing is that it gets called a
> > lot so it should be cheap enough to just call all the time.
> Okay, my thoughts were that it was obvious. We saw an issue when monkey testing
> with jack, bunch of dapm_sync's got triggered (insertion, reroute from usermode,
> removal, again reroute from usermode, and so on). The insertion and removal ones
> were quite not required for cases with no pins
It's obvious what it's saving but what's not obvious is what the benefit
of those savings is. That's the bit it'd be good to cover.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-10-23 8:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-21 13:37 [PATCH RESEND] ASoC: dont call dapm_sync while reporting jack always Vinod Koul
2013-10-22 8:32 ` Mark Brown
2013-10-22 15:36 ` Vinod Koul
2013-10-23 2:45 ` Patrick Lai
2013-10-23 8:25 ` Mark Brown
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.