Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2919952pxb; Tue, 24 Aug 2021 10:36:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytxK4QIUUeDDpXnMEp3GAJ1MEGl8BWIFEE4xxbY/3BoYQKs5vqKMktY0tH0yA7yamry1Fg X-Received: by 2002:a92:d311:: with SMTP id x17mr1708090ila.19.1629826610286; Tue, 24 Aug 2021 10:36:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629826610; cv=none; d=google.com; s=arc-20160816; b=0+WALHK3vkcdGVttGGooluVAEE+BuszSMyZfQQecKakiSDo9Q1tC5JSL81H9rBJ9Js HHey1ut+TeyX8ETnaMEiemuIlY876ccxaMpxd62TcjSJyqhzbQCBxWjfQJyOdZa0OOmk /m1B/FSW0aTHsY3RPBWvezTKBmUdT9KRxC3aTV5Ng4m5i7hbhhIrBG5PhrUDwTzhE2fD mKxNJl6ICDvAWqkK/KBVG1F195Yin1TQ0bYlhc9DINf7w67l+z1dX9m99XffcobISqhu GGyD+R5XbKE0AIyFa41a8T/4n+498rziFeAbXhz2BXMChrozyfNHC+1LK5ka3LPTD2bo H52g== 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=Kwr/GqczOgZg1fZyPrGIK5ZIyaZS2COozcO+Q/8KEKk=; b=pph8nMHfNcwhaexEQdlsD60s70yL8NrnwwOMjEcQOZ8UC5l7qRzIQhnBslUUzwqEG8 38+PKBU+aDZUtmcYSvWp6kg9U0adyiogAzanRXyIXLIVFmt86rIbR3ADKE7MdMZH7fAU omQp1kvYk4t5ozyKWFGrPYCTXGtBy/uXkQJwVMWv8HLFWknfi+lDN2fNAPKRyiIPPVpt O3njT+IKAWcCZiXKc6INFsH+vSCCWToSZvKIBEBSQ4Zdwr/vC2t11JDCL8w0FEi5kmYO cGtMIw0UKFOcjI+ayjgcXAJIf3t9rNl9ia5yCITifofQUPhpZuLo6Zzu5tw8Lw3eoM6V Lh2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TVSoSU6m; 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 c18si19479713iod.38.2021.08.24.10.36.38; Tue, 24 Aug 2021 10:36:50 -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=TVSoSU6m; 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 S239797AbhHXRg1 (ORCPT + 99 others); Tue, 24 Aug 2021 13:36:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:39992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239823AbhHXRcE (ORCPT ); Tue, 24 Aug 2021 13:32:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2E3E960E93; Tue, 24 Aug 2021 17:05:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824756; bh=hNWlP+0qUPtuVXmKVbXyYhh60Skkm67G3kzeejUuD7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TVSoSU6mzOdsSCAGoTTpXGKJUG5WNmn0+DAvN5loBTksoA7q9u9MS+s49EsuN9n6y XWMWeAqcv1+2IBF7QAdIBnYgRLw2KRZGpzjhEEvHA+kwU6fVIZiAMciUFHbDLlTTlO /+NZgvMYrbRUB31V2J/pJSdUOk1/G4ulWkjfUI4vVWVqUEpjNpwMlX5kDbydOa5k5P jXi0VBZrq4MWAG91++GLaWRQcPKsMdAHi5sY6KQOW896o9GlmN4emb1HP7Q5GivMlc UbeQ8ot6BcH3oV0FNR5ZCV12cNUw8bqg2wyxAMG9Sz05l7jF1KrCYu9CZOvavWrODp Z/3tdbj1nmyqA== 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 4.14 60/64] ASoC: intel: atom: Fix breakage for PCM buffer address setup Date: Tue, 24 Aug 2021 13:04:53 -0400 Message-Id: <20210824170457.710623-61-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824170457.710623-1-sashal@kernel.org> References: <20210824170457.710623-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.14.245-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.14.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.14.245-rc1 X-KernelTest-Deadline: 2021-08-26T17:04+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 c877326cb0a6..96f7facd0fa0 100644 --- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c +++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c @@ -135,7 +135,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