All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: alsa-devel@alsa-project.org, matt@ranostay.consulting,
	tony@atomide.com, hns@goldelico.com,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	kernel@pyra-handheld.com, linux-omap@vger.kernel.org,
	jarkko.nikula@bitmer.com
Subject: Applied "ASoC: omap-dmic: Add pm_qos handling to avoid overruns with CPU_IDLE" to the asoc tree
Date: Fri, 23 Nov 2018 14:10:49 +0000 (GMT)	[thread overview]
Message-ID: <20181123141049.29479440078@finisterre.ee.mobilebroadband> (raw)
In-Reply-To: <20181114110623.30932-4-peter.ujfalusi@ti.com>

The patch

   ASoC: omap-dmic: Add pm_qos handling to avoid overruns with CPU_IDLE

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From ffdcc3638c58d55a6fa68b6e5dfd4fb4109652eb Mon Sep 17 00:00:00 2001
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
Date: Wed, 14 Nov 2018 13:06:23 +0200
Subject: [PATCH] ASoC: omap-dmic: Add pm_qos handling to avoid overruns with
 CPU_IDLE

We need to block sleep states which would require longer time to leave than
the time the DMA must react to the DMA request in order to keep the FIFO
serviced without overrun.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/omap/omap-dmic.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c
index fe966272bd0c..cba9645b6487 100644
--- a/sound/soc/omap/omap-dmic.c
+++ b/sound/soc/omap/omap-dmic.c
@@ -48,6 +48,8 @@ struct omap_dmic {
 	struct device *dev;
 	void __iomem *io_base;
 	struct clk *fclk;
+	struct pm_qos_request pm_qos_req;
+	int latency;
 	int fclk_freq;
 	int out_freq;
 	int clk_div;
@@ -124,6 +126,8 @@ static void omap_dmic_dai_shutdown(struct snd_pcm_substream *substream,
 
 	mutex_lock(&dmic->mutex);
 
+	pm_qos_remove_request(&dmic->pm_qos_req);
+
 	if (!dai->active)
 		dmic->active = 0;
 
@@ -228,6 +232,8 @@ static int omap_dmic_dai_hw_params(struct snd_pcm_substream *substream,
 	/* packet size is threshold * channels */
 	dma_data = snd_soc_dai_get_dma_data(dai, substream);
 	dma_data->maxburst = dmic->threshold * channels;
+	dmic->latency = (OMAP_DMIC_THRES_MAX - dmic->threshold) * USEC_PER_SEC /
+			params_rate(params);
 
 	return 0;
 }
@@ -238,6 +244,9 @@ static int omap_dmic_dai_prepare(struct snd_pcm_substream *substream,
 	struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai);
 	u32 ctrl;
 
+	if (pm_qos_request_active(&dmic->pm_qos_req))
+		pm_qos_update_request(&dmic->pm_qos_req, dmic->latency);
+
 	/* Configure uplink threshold */
 	omap_dmic_write(dmic, OMAP_DMIC_FIFO_CTRL_REG, dmic->threshold);
 
-- 
2.19.1

  reply	other threads:[~2018-11-23 14:10 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
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   ` Mark Brown [this message]
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=20181123141049.29479440078@finisterre.ee.mobilebroadband \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.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=peter.ujfalusi@ti.com \
    --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.