Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2896706pxb; Tue, 24 Aug 2021 10:06:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+pz70ze5VOiCC0OQ1wpKj97uIIw+aKorfBv7rp/ETHMgTDeRCaWOe+mljgo7ExVV3mMgA X-Received: by 2002:a1c:e904:: with SMTP id q4mr5181444wmc.26.1629824763978; Tue, 24 Aug 2021 10:06:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629824763; cv=none; d=google.com; s=arc-20160816; b=ByZXK/NWUcNd6qf2MsbQhIPQzIOuvcPceGfm8xSdaS5o+GivWUaGmVS9YOH7ESuXol hvaqtIrfM5oR6XuwI3+RV78OwYVwWCE0lGuGS2sc6HGJE0a8r6rS3rbHpt1ADTWUkEAl IDw45jem0rkkh1yiojTciuX5hGKs/rk71e0/uJIpU5XXm3F2ZjhpIOMfdVfz4mk6HKzZ D42EdoNpN8PWY5xJbSSvp6dNgjvJP6SeEkUOrIj05js898grIYZ9T1E+2UiGj3hU/9Pd l91bzpsJ4eh+6tmZN5STcoFUiS9ywnE+AnOtHBWNrO4tkBnVfQsZkMUebfZbchR/3a2G 3log== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R8vXrcnsR4LCRtQ67YVunHvLiz+7V49mNNLQo+H2P/c=; b=ehMnwC6fwI3ve5jT6f++J2inP3Zl49CjNYV1qeBJJxgU3p1OuO8unuAnSYfDq5A6k2 eO7ivi8yWQDRgT8FUW2iKmwmWwDX/IgfJ+fRMPAQ4K3QGPp4juZ4NwzYlMtc7B/qlSS4 2GkdnUGcYQUxUa5PZqVaAmoTVixcf2pyscW5nEbhhQWgWr7r5JGKaIR7ZLYi173DA4bn RlW7b+BhjkEicDvFXtUhYPlCXKvkvA/00kBlwdD7GEyVCQ7T6o7jKA/Ed9i2Q/vH2qt5 eLXtWPOWMiluP7B6TGtm/FkemrKdPyxLXas9bkr0eb/kkJODH7vxr/IBgPcsQyTajZf7 +BwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XlnvjtuO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s1si17727469edt.182.2021.08.24.10.05.39; Tue, 24 Aug 2021 10:06:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XlnvjtuO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239694AbhHXREn (ORCPT + 99 others); Tue, 24 Aug 2021 13:04:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:39664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239076AbhHXRBi (ORCPT ); Tue, 24 Aug 2021 13:01:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BB4AC617E4; Tue, 24 Aug 2021 16:58:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824283; bh=OcO8yAZNXs7wijWO0GFhnaotokAY+Ii9xQkj1Vcm1Yo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XlnvjtuOBZs75wg5jlYvVLbMzTWHIrF8Kf8v+86RTJw1VPD2pGWKTYVQLCa90Xeqh 9jz5UaI4Tud93DwiTORxKaoi2jULdMtVIpGYGlkWtH5RZGx4KNsZZp3Ez3AJfZEfOj tK96cnek9+Jlh4YHMZyYeGMM/4xJy+dPK6kSZa2OBeGo1p1tZoCVvJNIADZQLOGUWS T9H/2fMlDCswdZs2Wil6DlyKkA/JEjEqoCdczGYyPbcoa11In0rx2KSTLQnA30D/qb MnFoZV26tiqeSs83/i5qzbtaVBNQRx7U8Bc8EAc4cNdVMBPDoejn3VAEVPP2uHltsy P7kSvza5cu8qA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Takashi Iwai , Hans de Goede , Mark Brown , Sasha Levin Subject: [PATCH 5.13 118/127] ASoC: intel: atom: Fix breakage for PCM buffer address setup Date: Tue, 24 Aug 2021 12:55:58 -0400 Message-Id: <20210824165607.709387-119-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824165607.709387-1-sashal@kernel.org> References: <20210824165607.709387-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.13.13-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.13.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.13.13-rc1 X-KernelTest-Deadline: 2021-08-26T16:55+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai [ Upstream commit 65ca89c2b12cca0d473f3dd54267568ad3af55cc ] The commit 2e6b836312a4 ("ASoC: intel: atom: Fix reference to PCM buffer address") changed the reference of PCM buffer address to substream->runtime->dma_addr as the buffer address may change dynamically. However, I forgot that the dma_addr field is still not set up for the CONTINUOUS buffer type (that this driver uses) yet in 5.14 and earlier kernels, and it resulted in garbage I/O. The problem will be fixed in 5.15, but we need to address it quickly for now. The fix is to deduce the address again from the DMA pointer with virt_to_phys(), but from the right one, substream->runtime->dma_area. Fixes: 2e6b836312a4 ("ASoC: intel: atom: Fix reference to PCM buffer address") Reported-and-tested-by: Hans de Goede Cc: Acked-by: Mark Brown Link: https://lore.kernel.org/r/2048c6aa-2187-46bd-6772-36a4fb3c5aeb@redhat.com Link: https://lore.kernel.org/r/20210819152945.8510-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/soc/intel/atom/sst-mfld-platform-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c index 5db2f4865bbb..905c7965f653 100644 --- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c +++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c @@ -127,7 +127,7 @@ static void sst_fill_alloc_params(struct snd_pcm_substream *substream, snd_pcm_uframes_t period_size; ssize_t periodbytes; ssize_t buffer_bytes = snd_pcm_lib_buffer_bytes(substream); - u32 buffer_addr = substream->runtime->dma_addr; + u32 buffer_addr = virt_to_phys(substream->runtime->dma_area); channels = substream->runtime->channels; period_size = substream->runtime->period_size; -- 2.30.2