From patchwork Tue Jul 3 15:34:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 140987 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1309328ljj; Tue, 3 Jul 2018 08:35:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcIQ+msxFQk1f4ZFUrG4dTf00k5s+F5RvTVeyHFrA+/yHvdxwZjcqscrFo+jPUQk6mVHz87 X-Received: by 2002:a1c:8d15:: with SMTP id p21-v6mr10433143wmd.145.1530632129924; Tue, 03 Jul 2018 08:35:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530632129; cv=none; d=google.com; s=arc-20160816; b=RsDLQVudQ2Fb0xtTZA5KOgjI4gClnjkklxb5qoToFcnUerno46ttNSjysuBu6lzTuf 8gMAQrtp1gbScTUpHbMXwHO7JmALko5VEpIBUl1z6MJx/iz2C9WtyEm/nXRwvarU8pu4 lA6MOGAFH4lx7XX+WjAA+6urWb4oZUvbJ2gO9TQd2rNyAVvEitjmBJR/fwUW8eHpK6Lt f4H81u/5I9ugIY7TWo8ENd0fcrzGYRGq5DwQlrmeS9B5xoYZ7k/rmtDtstESHHcdtIkY WvEhEL4yl0nLjOvjR0qCZmtu/B5QdhT56i2joDWF2rsg3TUwh5jKDcWDsegzLhxQ6HlU ZGfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=8Lk1L5nluBu9sQTIkB1vLTpl4D9Vohvmnm32ErXTwAE=; b=g3yS+rkfKPC7ar9uHUOtQ5nBYHlRnm96U59UBbTHPm3TD4xs/tZx/kuztDyo1kq19b Skl5AsJu9HSUvWa3+YuC9TrISKKxqLTQc07QhvCI2kpc1gmQ74zVKWYrPwlcYQ1YExve zTp7jhZVk0KDVbTgxqf2VmU8pMZdsj9sehNdPcfxkxQqf85suSqf8h54oSDTbgOo2P6H R7nge+atrhB8Yr55iHNWoSteR57kQUldF6owAwQ9Tf8sXPYRq+HmR7/TiGj54oZ7/Vxa xITxgrB4gYYFL2weVEu2XMabtYQ0phgu7UI8wHf4sLI21WwPUrC9jG9Igm4v3r/uv2Cw +BJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=lUH6aQjD; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id i18-v6si1247576wmh.50.2018.07.03.08.35.29; Tue, 03 Jul 2018 08:35:29 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=lUH6aQjD; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 069E4267795; Tue, 3 Jul 2018 17:34:42 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id BE6572677AD; Tue, 3 Jul 2018 17:34:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, PRX_BODY_35, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 9AC3126779F for ; Tue, 3 Jul 2018 17:34:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=Bl04FEFAJaip5H0dVFAs4XEo+w09yICtQW6QN1qhmes=; b=lUH6aQjDNqAm xdrQcq05RtDkYnpB0qb/19Vpo2CsUOr54yoJUVTwFPW/sYt9sOlOAYSqXhUSnhTXZrJrmjunlz6Ho DAZYRBJrzT+QNom/qEgA8hm4apsKvvbWN+lXhtkODlBda0f2BacAS3nLUt4bCO4R/eDEEabMZZsGi 234Zg=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1faNJs-0006B1-8j; Tue, 03 Jul 2018 15:34:20 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1faNJr-0003nQ-Qt; Tue, 03 Jul 2018 16:34:19 +0100 From: Mark Brown To: Daniel Kurtz In-Reply-To: <20180702211956.149355-3-djkurtz@chromium.org> Message-Id: Date: Tue, 03 Jul 2018 16:34:19 +0100 Cc: , alsa-devel@alsa-project.org, Takashi Iwai , Liam Girdwood , open list , Mark Brown , "Mukunda, Vijendar" , Alex Deucher , Akshu Agrawal , Guenter Roeck Subject: [alsa-devel] Applied "ASoC: AMD: Always subtract bytescount" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: AMD: Always subtract bytescount 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 715cdce04487fb23d5c10693b3bc01309fea955a Mon Sep 17 00:00:00 2001 From: Daniel Kurtz Date: Mon, 2 Jul 2018 15:19:52 -0600 Subject: [PATCH] ASoC: AMD: Always subtract bytescount It is always correct to subtract out the starting bytescount value. Even in the case of 2^64 byte rollover (292 Million Years in the future @ 48000 Hz) the math still works out. Signed-off-by: Daniel Kurtz Signed-off-by: Mark Brown --- sound/soc/amd/acp-pcm-dma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.18.0.rc2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 4665ae12e74e..034fac3de037 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -995,8 +995,7 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_pcm_substream *substream) buffersize = frames_to_bytes(runtime, runtime->buffer_size); bytescount = acp_get_byte_count(rtd); - if (bytescount > rtd->bytescount) - bytescount -= rtd->bytescount; + bytescount -= rtd->bytescount; pos = do_div(bytescount, buffersize); return bytes_to_frames(runtime, pos); }