From patchwork Wed Nov 8 18:18:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 10048919 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 37E91603FA for ; Wed, 8 Nov 2017 18:19:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 318EF2A696 for ; Wed, 8 Nov 2017 18:19:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 265072A6E1; Wed, 8 Nov 2017 18:19:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AB8D2A696 for ; Wed, 8 Nov 2017 18:19:05 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6A60C267549; Wed, 8 Nov 2017 19:19:03 +0100 (CET) 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 E04B926754C; Wed, 8 Nov 2017 19:19:01 +0100 (CET) Received: from mail-qk0-f193.google.com (mail-qk0-f193.google.com [209.85.220.193]) by alsa0.perex.cz (Postfix) with ESMTP id 53BE62674F8 for ; Wed, 8 Nov 2017 19:18:57 +0100 (CET) Received: by mail-qk0-f193.google.com with SMTP id 78so4518200qkz.0 for ; Wed, 08 Nov 2017 10:18:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=cuyM1dkytEtgwPuHrG87wB5AbhvFB9kJ8xL4URbBqKA=; b=bf5u02Q9bV6oIpxsRtbyu7zw5UD/cAPBwocBLWXvFA6gT6LW5lyqD4YXJkDZ0so8gq SEcL/vnieSsU2yO+q6/qVa1krujwSUXR77i71WAlYHunZ08lxJh5Fn6XJxFPxTv3pvsV zSyPhfN2LABSR7iDAdDRclmUHGDPuZZCOBdyp9Uo3bPqkeQ0y4HynkvAgtUPyCr5TcSZ UYoMRoyeH0LqcOR2cwk5up30wxQVR4RXobkawIaLMRYdHk+fWNj5ZJr7oyRF7fZK6rwB o3vsYgVnHY7AiGv9Gqap0ajxWjuV7AEvJZ7bl1VSno8ukWnMT90a44AL+TeNk25xKTYN sWDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=cuyM1dkytEtgwPuHrG87wB5AbhvFB9kJ8xL4URbBqKA=; b=Y1m86xgPP/ae2xmtTusp+97d2ULbEjhLSPt5oGnb3Xz2yQZ/vou0nR1oPy9HlvlMof +Y7j3hKni4kn74R4jLkSQgueLynrAiG+wxpIkczGADYPpRgCinwy6vFOQcTqtrVkkdoU oV/hd9z0knM2U2s1q1vAFxG6ITlDadk6MkCD5SfzZ3yaTdOmkXuAjdU/nQ72iksBlYAV GlTd2QDXnqsU2nY0j/Bz1q3NYxZxgPlgMq6eQG70wQVEcHrXeW8X7riNuOI3eQjJIfm8 LGHi2XnOagPs83TQsKKWi7ArpwVzAn6eb2r6dPA47aM9ADbjwLT55R58yDFPv019qg+j DoFw== X-Gm-Message-State: AJaThX6YsEgM+vEE+DQW+/FGQ6QQTlzJq4v2VI2qVnaft+C5ZjJN2WWO 9V36KwgHTyldnTyaQ2n8grs= X-Google-Smtp-Source: ABhQp+TJZB1tP5wRmC0OKZvpJ8Vd4dvmlt7yOu6HxfRZ4HDbR0vjElbUbIfUKAanvoGXabbSg8X/hQ== X-Received: by 10.55.154.84 with SMTP id c81mr2055514qke.43.1510165136356; Wed, 08 Nov 2017 10:18:56 -0800 (PST) Received: from localhost.localdomain (va-67-233-122-109.dhcp.embarqhsd.net. [67.233.122.109]) by smtp.gmail.com with ESMTPSA id q21sm3202628qta.82.2017.11.08.10.18.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Nov 2017 10:18:55 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, alsa-devel@alsa-project.org, dri-devel@lists.freedesktop.org, broonie@kernel.org, Vijendar.Mukunda@amd.com Date: Wed, 8 Nov 2017 13:18:41 -0500 Message-Id: <20171108181841.29332-1-alexander.deucher@amd.com> X-Mailer: git-send-email 2.13.6 Cc: tiwai@suse.de, Guenter Roeck , Alex Deucher , lgirdwood@gmail.com Subject: [alsa-devel] [PATCH] ASoC: amd: fix report accurate hw_ptr during dma 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 X-Virus-Scanned: ClamAV using ClamSMTP From: Guenter Roeck ERROR: "__aeabi_uldivmod" [sound/soc/amd/snd-soc-acp-pcm.ko] undefined! 64-bit divides require special operations to avoid build errors on 32-bit systems. fixes: 61add8147942 (ASoC: amd: Report accurate hw_ptr during dma) Signed-off-by: Guenter Roeck Reviewed-on: https://chromium-review.googlesource.com/678919 Reviewed-by: Jason Clinton (cherry picked from commit 7ca726e80f21abdbaed9a5a70def1c33a26f8533) Reviewed-on: https://chromium-review.googlesource.com/681618 Signed-off-by: Alex Deucher --- v2: resend with the Chromium tags removed and the subject updated. sound/soc/amd/acp-pcm-dma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index 13d040a4d26f..ef7e98ad960c 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -856,12 +856,11 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_pcm_substream *substream) if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { if (bytescount > rtd->renderbytescount) bytescount = bytescount - rtd->renderbytescount; - pos = bytescount % buffersize; } else { if (bytescount > rtd->capturebytescount) bytescount = bytescount - rtd->capturebytescount; - pos = bytescount % buffersize; } + pos = do_div(bytescount, buffersize); return bytes_to_frames(runtime, pos); }