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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <409b73fe04f1bd5155a8e6be701370a4594edc52.1459875048.git.joabreu@synopsys.com>
Date:	Tue,  5 Apr 2016 18:08:02 +0100
From:	Jose Abreu <Jose.Abreu@...opsys.com>
To:	linux-snps-arc@...ts.infradead.org, linux-kernel@...r.kernel.org,
	dri-devel@...ts.freedesktop.org, alsa-devel@...a-project.org
Cc:	broonie@...nel.org, CARLOS.PALMINHA@...opsys.com,
	Alexey.Brodkin@...opsys.com, Vineet.Gupta1@...opsys.com,
	architt@...eaurora.org, airlied@...ux.ie, lgirdwood@...il.com,
	perex@...ex.cz, tiwai@...e.com,
	Jose Abreu <Jose.Abreu@...opsys.com>
Subject: [PATCH 3/3 v3] ASoC: dwc: Unmask I2S interrupts only for enabled channels

There is no need to unmask all interrupts at I2S start. This
can cause performance issues in slower platforms.

Unmask only the interrupts for the used channels.

Signed-off-by: Jose Abreu <joabreu@...opsys.com>
---

Changes v2 -> v3:
* Dropped custom platform driver, using now ALSA DMA engine
* Dropped IRQ handler for I2S
* Removed pll_config functions (as suggested by Alexey Brodkin)

No changes v1 -> v2.

 sound/soc/dwc/designware_i2s.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c
index bff258d..3effcd1 100644
--- a/sound/soc/dwc/designware_i2s.c
+++ b/sound/soc/dwc/designware_i2s.c
@@ -147,17 +147,18 @@ static inline void i2s_clear_irqs(struct dw_i2s_dev *dev, u32 stream)
 static void i2s_start(struct dw_i2s_dev *dev,
 		      struct snd_pcm_substream *substream)
 {
+	struct i2s_clk_config_data *config = &dev->config;
 	u32 i, irq;
 	i2s_write_reg(dev->i2s_base, IER, 1);
 
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-		for (i = 0; i < 4; i++) {
+		for (i = 0; i < (config->chan_nr / 2); i++) {
 			irq = i2s_read_reg(dev->i2s_base, IMR(i));
 			i2s_write_reg(dev->i2s_base, IMR(i), irq & ~0x30);
 		}
 		i2s_write_reg(dev->i2s_base, ITER, 1);
 	} else {
-		for (i = 0; i < 4; i++) {
+		for (i = 0; i < (config->chan_nr / 2); i++) {
 			irq = i2s_read_reg(dev->i2s_base, IMR(i));
 			i2s_write_reg(dev->i2s_base, IMR(i), irq & ~0x03);
 		}
-- 
1.9.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ