Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2904316pxb; Tue, 24 Aug 2021 10:15:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBq5CSRhYcxOWP1oJSM8EC5YZIogZ7vxlTyFo+Caz52CVq1wk7HyccPtGwWyBMJOFOYgHx X-Received: by 2002:a17:906:909:: with SMTP id i9mr40547183ejd.16.1629825348364; Tue, 24 Aug 2021 10:15:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629825348; cv=none; d=google.com; s=arc-20160816; b=iJIqU+CcVEMF/kVFJBWe81vZpidHS+OuZJb6sqMukNQNMDV11J6NfZ/daSLWyLD/qM Wv6e5v/IyFR0FF7iHJcxc2hpvnKcS4uiMfNbeX0sUXs8O3IJxdgGGyueC7IZKCqbvhtz IKPE+piiJNHwJTC3Xr3APpSS1zRMZixuHx3NSK2auAa0hkP7tSTEyas/Ug6m/NacrACq 0Mcy5JGGO4dBdP44XHorOqw7f3mAOXebfMF2o2HCBoPDcwjQ6zt0Jjb9Fwb0uT8osaLc e7RucNV0E4Z8tU2qCdL3KztVwP7eqG3MItYnq++lvP/Qy+PsJiWOCKDgxOUfUY0qxeca 6HlA== 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=CA+LKEVvWZwc9aW3f9HZfW55NOFr3PQ7FWCXMxFajhs=; b=Tg3SyYUZ9uzjzyU97W6vJImClUrbzxKysEJ/3EeaQjQflIiPLWPlP2E2pLYVAzTkI/ 2Yu6PUEsYULrYp7lqK3MbmHW9DU9P1SDxCtHxdL3ww2wIEdo8QIeApLmzwkb11OaDh7h UFALnGVkiUP6XEFxNKHLSvxx22xT90dvUcNBsRHz7i02nmNhTYk0V4c7y3Mg3pYXTkaQ CXoES22PURUeSEkXLHAR6QCQdWNGz36ZUMHaV9g+D1AW+qa8ZW0WDEHY90RHjLv4LpqZ /g1tFKcRO2qk7LKIZafXaDTzQPJI+dQ7+FzIzwarfNjQrfH1e52u7BEcYTsuqvuGRvIA RwmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uVVHHn+Z; 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 v1si5077654edc.71.2021.08.24.10.15.24; Tue, 24 Aug 2021 10:15:48 -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=uVVHHn+Z; 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 S240046AbhHXRON (ORCPT + 99 others); Tue, 24 Aug 2021 13:14:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:52374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237940AbhHXRKi (ORCPT ); Tue, 24 Aug 2021 13:10:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1AF3E61A60; Tue, 24 Aug 2021 17:00:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824441; bh=tbmbAVywz5CQGJQHUDGRrD1Mb92jE9EMWZlJEgmYovA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uVVHHn+Zf3j7N5IljgROtSPaWZ4oaVhuiJ8z5J0KqCDy1kMobDL8b5utOTajU2L6A Dg0oVMMRq3VfaS/mUD8WM1IKD0kqe9ftIOC+cTq4F205+WCodxeayf1yWQRwJgGzMe ltr3yvXE7Qm2oaKN199Vrwvfw6vbQXeD2IqNhz00joRYqXKPjdZLX5ecU5IHK11m8W DRLIWk3VmXvmg/23DgF7Y27QgZTZSK5wqyIpwPt+87bIPyT/8gSYSoOgX3cPjHaNEw wxhVN40yfQ2Kqv0Rsch+LnicoFPXE/CrsYCtLh+RAkNiAFijxp/gdUXOA/uvftk769 3rDYazvI0fnnw== 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.10 93/98] ASoC: intel: atom: Fix breakage for PCM buffer address setup Date: Tue, 24 Aug 2021 12:59:03 -0400 Message-Id: <20210824165908.709932-94-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824165908.709932-1-sashal@kernel.org> References: <20210824165908.709932-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.61-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.10.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.10.61-rc1 X-KernelTest-Deadline: 2021-08-26T16:58+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 2784611196f0..255b4d528a66 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