From patchwork Wed Nov 8 21:34:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 10049599 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 DF212601EB for ; Wed, 8 Nov 2017 22:53:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFAD52A75B for ; Wed, 8 Nov 2017 22:53:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C49782A776; Wed, 8 Nov 2017 22:53:24 +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=0.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM, RCVD_IN_SORBS_WEB,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 0E6252A75B for ; Wed, 8 Nov 2017 22:53:23 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0966C2677BD; Wed, 8 Nov 2017 23:40:52 +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 EDF7E2676AF; Wed, 8 Nov 2017 22:40:33 +0100 (CET) Received: from mail-it0-f68.google.com (mail-it0-f68.google.com [209.85.214.68]) by alsa0.perex.cz (Postfix) with ESMTP id 0F56826768E for ; Wed, 8 Nov 2017 22:38:19 +0100 (CET) Received: by mail-it0-f68.google.com with SMTP id r127so8244247itb.5 for ; Wed, 08 Nov 2017 13:38:19 -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=Y3bOwpOjkwjUG5z4wmMup8yPk+zHPZXbo7wM02c0ZVA=; b=J+976KJi6aXbPwP3QdCj/e5lDDyATPLQhw0JrueIB+swQEAmdFDfvuQmwSkdw35ALN /6mwMh0aoGUFckWZ6wfhM3canCA36D/vMIDa2yrupetyVWqa0hNyu9+zloJL618y7HsZ V3hred8EPgn1T/5097300MVdp03Ed6JLt0X9WwMzQnhUkfeODShbG3WqrWevJncN5SrF Lc7o8IX3QmwkfWsk8t+CCNik+tQe93r/gM52wWAKnOS0Si/a+O2K1fPCbdVuvOtAc05P JENHjudBH/u9W2R0b8AlCp0DJNkw9i/0tD7loCaeIWHLy3X8nSF/rnqvfEWcjwH75LUg igpw== 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=Y3bOwpOjkwjUG5z4wmMup8yPk+zHPZXbo7wM02c0ZVA=; b=CPu6Dl4Mzd7GQCJxNtzbx+4eeGQxHOS397Obty3PvILRjjgrTCT/ZPS6QbP2eJZfFS GJv/5plDeO0Jh3PEwQ/R2vSGWrSZXDNhHVC1cY8Qywyt9jDzth/eiCTyJUHJcBmF3le9 6VfvzyXTcCx+PMaGqT0yKkERV3w+cPXXnD6G55Tv7pX2i64l/j76YvmPc2aSO+j/GB6h cCb7LC9igfg4fbLjwP1BRagxSLw/fxVM6FH7TQ1wrFJsh6H8YT4Ijw+UO1+NBUwf2RKP 8LZncR+lnUL5e/PUA1xTHJs4jgkIFUs2iVWn9JkeUsKy4bIrfQRwYRujBf1ADMTMsO0d Kn4Q== X-Gm-Message-State: AJaThX7vvS9V0azCSs279ukFCfZIJ8alhJul2E0yz57RfWwmDGjsDNzj WQ+5QuGo0Km0Adb9Pmn8QY0ADA== X-Google-Smtp-Source: ABhQp+QDkVzqDfrZJDLAAtiRF0+fJ/dUkALsYQ24geQP87o+U9RU+QtF7sJ9QjFXP/dadHdkyGbbkQ== X-Received: by 10.36.117.6 with SMTP id y6mr2757369itc.74.1510176907653; Wed, 08 Nov 2017 13:35:07 -0800 (PST) Received: from crucial.amd.com ([165.204.55.251]) by smtp.gmail.com with ESMTPSA id 133sm2640101itw.24.2017.11.08.13.35.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Nov 2017 13:35:07 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: alsa-devel@alsa-project.org, broonie@kernel.org, Vijendar.Mukunda@amd.com Date: Wed, 8 Nov 2017 16:34:54 -0500 Message-Id: <20171108213454.7048-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: use do_div rather than 64 bit division to fix 32 bit builds 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. [Reword the commit message to make it clearer - Alex] 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 --- 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); }