Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp955189pxp; Wed, 16 Mar 2022 22:33:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKxY90Ideuf12ohbKBOkKW8A2bqLYibr1ZepMlIk98viRSkUbiC73/xtPYmfdhwzDPa7Ew X-Received: by 2002:a17:90a:7f84:b0:1bc:aba8:f281 with SMTP id m4-20020a17090a7f8400b001bcaba8f281mr3382443pjl.101.1647495185537; Wed, 16 Mar 2022 22:33:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647495185; cv=none; d=google.com; s=arc-20160816; b=eY2qeWEyKquX8NsGRqYOQKi0fpfMGyv55jfuE91aMHY9EXohqvd2phn6TL2SHZTguh Ddf5+fE9FpoCdj9vhKCkmFJqUctwkOxo4HDP1WaE9ZepdQRsI60apJdBCHVlVcvA/WdB PsSrHijm0iWMFL0DTK2qukJ9ykpWgJhtmEntc8/mapcZBEu1ookcjPzrfTcIf4AmZ2km t//lIe6EcFcKkP2/ux6HIxZ7/QsAOL+EBs3p0JnV1GxOlM7PWzs+Z6vUhA98phw9IiAS d4o30pBLKZ7c5yCW+5ZUzC9p6KVYRbER+Ns0810bTlHEiQHz+ylvK34/AbpL2FRgfMq9 KHfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=M+vNh9LURBn+X5jUnyNcWeTbJ6pHiQL9Kq5EiXUMlRI=; b=ywCnQZV7XmAOehvHMwqjbB+N0a9d2UrTGo88eORW+pVOKjzr43EoD0KPfkqkgHtTfN lIwFK9opVQz4iH8MtHBqRA66amrvVVSPYjUKYaGj+XS/KLDdHyr4pIskc6K1QCDpecOG 3yavCP7lQXS9W0AyXZjwRmZHGXgehJy+IwowhO+iqpOwJLaG+voiYuRmQrg/ltB1fEir x63Rd01Vi6WirErrF/tKVHiw7zWrlM/MWAEVEtJ8FQj2knowt5za3N2sGulx468SIkEO PSJOvE5PZ/2YlBYGYoqW2L8IrK974I0GxhBK2lGgpWkNPLeniI+PQan0lqEVidQnMJnC g6bQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u145-20020a627997000000b004f6f7198719si3836138pfc.81.2022.03.16.22.33.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 22:33:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 30DAA27F4EF; Wed, 16 Mar 2022 21:35:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354785AbiCPJOx (ORCPT + 99 others); Wed, 16 Mar 2022 05:14:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243385AbiCPJOw (ORCPT ); Wed, 16 Mar 2022 05:14:52 -0400 Received: from smtpbgjp3.qq.com (smtpbgjp3.qq.com [54.92.39.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A2395DE73 for ; Wed, 16 Mar 2022 02:13:34 -0700 (PDT) X-QQ-mid: bizesmtp91t1647421990t37qmosd Received: from localhost.localdomain ( [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 16 Mar 2022 17:13:04 +0800 (CST) X-QQ-SSF: 01400000002000D0H000000A0000000 X-QQ-FEAT: TskX/GkkryCtF3MMUU7WGeLJerz6JGDXThH7VyNE/T3DPVypoS4JBKwYguSjL +o/qFTpdpmvQ3QQU3Gz/AceDwgtpxI+JZtqgzzOtVSmIxSSJrqn6tmzQqom790x5nUVNb7M ZcSHX6rwVMb+ihYHEpvAulQr2lQLyiPPsL0c9UjaxqDYDLE6nQLLJy2gxife7F3/zTaBIxG QAeP+/gFa9KsRCvJMAZj+K8qJcPuRLwnjKRhq2erjDI/x+51xCTLgDDn6UEc4AOwrxAyfov gnfnZ2maK3fRBEb1R0zdy2bI4w/aUbKy+J3lGQVtp7IARXgO1stlJ2Huqp8qZB8lRb7olhF fkBx8mARx+DLFcYbmfcgG+RoDvTZtHbyENf86t2 X-QQ-GoodBg: 1 From: Meng Tang To: perex@perex.cz, tiwai@suse.com, broonie@kernel.org, lgirdwood@gmail.com, Vijendar.Mukunda@amd.com Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Meng Tang Subject: [PATCH] ASoC: amd: Fix reference to PCM buffer address Date: Wed, 16 Mar 2022 17:13:03 +0800 Message-Id: <20220316091303.9745-1-tangmeng@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign8 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org PCM buffers might be allocated dynamically when the buffer preallocation failed or a larger buffer is requested, and it's not guaranteed that substream->dma_buffer points to the actually used buffer. The driver needs to refer to substream->runtime->dma_addr instead for the buffer address. Fixes: cab396d8b22c1 ("ASoC: amd: add ACP5x pcm dma driver ops") Signed-off-by: Meng Tang --- sound/soc/amd/vangogh/acp5x-pcm-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/amd/vangogh/acp5x-pcm-dma.c b/sound/soc/amd/vangogh/acp5x-pcm-dma.c index 31fa166df98a..d36bb718370f 100644 --- a/sound/soc/amd/vangogh/acp5x-pcm-dma.c +++ b/sound/soc/amd/vangogh/acp5x-pcm-dma.c @@ -281,7 +281,7 @@ static int acp5x_dma_hw_params(struct snd_soc_component *component, return -EINVAL; } size = params_buffer_bytes(params); - rtd->dma_addr = substream->dma_buffer.addr; + rtd->dma_addr = substream->runtime->dma_addr; rtd->num_pages = (PAGE_ALIGN(size) >> PAGE_SHIFT); config_acp5x_dma(rtd, substream->stream); return 0; -- 2.20.1