All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Jarkko Nikula <jarkko.nikula@bitmer.com>,
	Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	tony@atomide.com
Cc: kernel@pyra-handheld.com, hns@goldelico.com,
	alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
	matt@ranostay.consulting
Subject: Re: [PATCH 1/3] ASoC: omap-mcbsp: Fix latency value calculation for pm_qos
Date: Mon, 19 Nov 2018 16:14:13 +0200	[thread overview]
Message-ID: <c26c055f-5f7a-46b5-a409-6b60f0657f56@ti.com> (raw)
In-Reply-To: <d1e6e9df-3893-7c2d-acbb-05b59011a364@bitmer.com>



On 2018-11-18 19:04, Jarkko Nikula wrote:
> On 11/14/18 1:06 PM, Peter Ujfalusi wrote:
>> The latency number is in usec for the pm_qos. Correct the calculation to
>> give us the time in usec
>>
>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
>> ---
>>  sound/soc/omap/omap-mcbsp.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
>> index e0ef4774c710..a395598f1f20 100644
>> --- a/sound/soc/omap/omap-mcbsp.c
>> +++ b/sound/soc/omap/omap-mcbsp.c
>> @@ -999,9 +999,9 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
>>  			pkt_size = channels;
>>  		}
>>  
>> -		latency = ((((buffer_size - pkt_size) / channels) * 1000)
>> -				 / (params->rate_num / params->rate_den));
>> -
>> +		latency = (buffer_size - pkt_size) / channels;
>> +		latency = latency * USEC_PER_SEC /
>> +			  (params->rate_num / params->rate_den);
> 
> Did I understand correctly this doesn't fix any audio issue but allows
> CPU sleep longer or reach deeper sleep?

PM core will block any power state from where the wake-up would take
longer than the latency value.

The latency is in usec, this patch just fixing the calculation to get
the time in usec.

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2018-11-19 14:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 11:06 [PATCH 0/3] ASoC: omap: Fix and add pm_qos configuration Peter Ujfalusi
2018-11-14 11:06 ` [PATCH 1/3] ASoC: omap-mcbsp: Fix latency value calculation for pm_qos Peter Ujfalusi
2018-11-18 17:04   ` Jarkko Nikula
2018-11-19 14:14     ` Peter Ujfalusi [this message]
2018-11-23 14:11   ` Applied "ASoC: omap-mcbsp: Fix latency value calculation for pm_qos" to the asoc tree Mark Brown
2018-11-14 11:06 ` [PATCH 2/3] ASoC: omap-mcpdm: Add pm_qos handling to avoid under/overruns with CPU_IDLE Peter Ujfalusi
2018-11-23 14:11   ` Applied "ASoC: omap-mcpdm: Add pm_qos handling to avoid under/overruns with CPU_IDLE" to the asoc tree Mark Brown
2018-11-14 11:06 ` [PATCH 3/3] ASoC: omap-dmic: Add pm_qos handling to avoid overruns with CPU_IDLE Peter Ujfalusi
2018-11-23 14:10   ` Applied "ASoC: omap-dmic: Add pm_qos handling to avoid overruns with CPU_IDLE" to the asoc tree Mark Brown
2018-11-14 12:45 ` [PATCH 0/3] ASoC: omap: Fix and add pm_qos configuration H. Nikolaus Schaller
2018-11-15 12:26   ` H. Nikolaus Schaller
2018-11-15 14:29     ` Peter Ujfalusi
2018-11-16  8:00       ` Peter Ujfalusi
2018-11-18 17:04     ` Jarkko Nikula
2018-11-19 14:17       ` Peter Ujfalusi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c26c055f-5f7a-46b5-a409-6b60f0657f56@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=hns@goldelico.com \
    --cc=jarkko.nikula@bitmer.com \
    --cc=kernel@pyra-handheld.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=matt@ranostay.consulting \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.