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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 10 Mar 2008 23:43:06 +0900 (JST)
From:	Atsushi Nemoto <anemo@....ocn.ne.jp>
To:	linux-kernel@...r.kernel.org
Cc:	Hans-Christian Egtvedt <hcegtvedt@...el.com>,
	Haavard Skinnemoen <hskinnemoen@...el.com>,
	Andrew Victor <avictor.za@...il.com>
Subject: [PATCH] at73c213: Fix DMA size at the end of DMA buffer

The interrupt handler always provide runtime->period_size data, but it
should provide additional residual data when the pointer back to zero.

This patch fixes periodic click noise when runtime->buffer_size was
not multiple of runtime->period_size.

Signed-off-by: Atsushi Nemoto <anemo@....ocn.ne.jp>
---
This patch depends on a patch titled "at73c213: Monaural support".

diff --git a/sound/spi/at73c213.c b/sound/spi/at73c213.c
index 7c077c6..d614a8c 100644
--- a/sound/spi/at73c213.c
+++ b/sound/spi/at73c213.c
@@ -355,6 +355,7 @@ static irqreturn_t snd_at73c213_interrupt(int irq, void *dev_id)
 	u32 status;
 	int offset;
 	int block_size;
+	int size;
 	int next_period;
 	int retval = IRQ_NONE;
 
@@ -372,11 +373,14 @@ static irqreturn_t snd_at73c213_interrupt(int irq, void *dev_id)
 			next_period = 0;
 
 		offset = block_size * next_period;
+		size = runtime->period_size * runtime->channels;
+		if (next_period == runtime->periods - 1)
+			size += (runtime->buffer_size % runtime->period_size)
+				* runtime->channels;
 
 		ssc_writel(chip->ssc->regs, PDC_TNPR,
 				(long)runtime->dma_addr + offset);
-		ssc_writel(chip->ssc->regs, PDC_TNCR,
-				runtime->period_size * runtime->channels);
+		ssc_writel(chip->ssc->regs, PDC_TNCR, size);
 		retval = IRQ_HANDLED;
 	}
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ