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: 10048917 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 780A6603FA for ; Wed, 8 Nov 2017 18:19:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 724BA2A696 for ; Wed, 8 Nov 2017 18:19:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 660642A6C1; Wed, 8 Nov 2017 18:19:01 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 04A892A696 for ; Wed, 8 Nov 2017 18:19:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 482546E74C; Wed, 8 Nov 2017 18:19:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x244.google.com (mail-qk0-x244.google.com [IPv6:2607:f8b0:400d:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 583FB6E74B; Wed, 8 Nov 2017 18:18:58 +0000 (UTC) Received: by mail-qk0-x244.google.com with SMTP id c16so4507183qke.2; Wed, 08 Nov 2017 10:18:58 -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=QD2ccarqDo90v+SZ6Zp9rPPMd1v7yaQt2Z1tG9bmi1xszr3243ACKzfGd8rpy0+s7g LfPG630MTfihY1GgQ7IoPT/okpSmiIzyZfTdoUAWnLWcqpdt4ZbV+nx6reSlc6BPVJQq JY+DPq3SVfg0YBQ+Ug/gIGnmB0SB7BexI976/iDv0SiduGj6iFLJr+soX4xOZfFbRQao L1GSdfA0d7v/PcX6SxWLx0+w4TqhZe2uzoSh/9FCofBwyv22OQIHxK/i84i8nxYwyWds H1ude95hjkx7l5MwD0zXG8+5VH55kGF3Gg1y72f9kazN6cu90O5ImqRyF5oSDk9bNMvH OMoQ== X-Gm-Message-State: AJaThX587vvDiT6EOUf1P40k/qJer50K+T+RkEoK5a2LivRxtDAn4SOQ w15YNQdvqWtr5hoVq7V/8uqHkA== 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 Subject: [PATCH] ASoC: amd: fix report accurate hw_ptr during dma 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: Guenter Roeck , Alex Deucher , lgirdwood@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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); }