Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2923949pxb; Tue, 24 Aug 2021 10:42:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/VBniGBe1RRv0XQl5SMl8ymDTg/iLTZjjGUHyX8J44eAxhh091G4G4LB8vBawy1m8wNc7 X-Received: by 2002:a92:6a05:: with SMTP id f5mr20682845ilc.140.1629826960709; Tue, 24 Aug 2021 10:42:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629826960; cv=none; d=google.com; s=arc-20160816; b=Z3c5+HvCxTiGPfxRBHKc0zcosYsSvPoGuqI11RIZfCekYLzAAy1FduW9rp/Gp+9oCz /NTlt823syFcr1qcPsna8/zmFhOVbnejlRbAtRPkVblG/R15tHwKMec8dHvhtMnv6pSz pnT6NiDkqejhTo/9FPhcExhVwOnKM37zqob2tmOp7x3APXKYAnSU117UsE7oBFAOPd5N bIzs0u33jOaqjjyT/BntFYq59vI0JxlXfz0MM+gEQT9HFiX5asbNlns9f/3eUqH1cgBX VcPNpsN5Y8UBTgsu70tFh7P66MYY+BDgrTiU2g5Yl/5PsNwUjIqco0108t7zD+AMkCZG X+Hw== 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=qVzB69sJlS/ofBffcr7zU9b2NaDFRH7E/pcdCZxPWJI=; b=pz1eKPIYUWNmtVoCyN/BZYZBAZ66C60ML7DSbKbEjYYG1oV8hJaIA+uV6C4weeSodr j0INQvhiuiscMoUkE3dsvo2+0ZawfroNQ0jgt1qvgYxlO0xfduNC/J02vYsHiYahyTof jZEYYj+2IQhzV+3qPBguXIY6cZMik/94DozWpXGQUk0FPWtXpw4xsuwUDj6pKRAoz7nW J1kpXLKLQxhKuWLtoMCmpab+o6Yf7xGBZfu2MEBO3Oq/Jl+RfVQdV/AymlAjwahOpmJe vWKszMYTBLbWA3oyt6mJ2JECjhgCOb1BKiFdyesF8+ZwfUwfRV7d5na960NCI3GBnYSt +o7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="VFwbTt1/"; 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 az39si9830809jab.112.2021.08.24.10.42.29; Tue, 24 Aug 2021 10:42:40 -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="VFwbTt1/"; 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 S241829AbhHXRmU (ORCPT + 99 others); Tue, 24 Aug 2021 13:42:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:43370 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242183AbhHXRjN (ORCPT ); Tue, 24 Aug 2021 13:39:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BA80361C19; Tue, 24 Aug 2021 17:08:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824893; bh=se+5fgDFCQfliRd5kTVVSLcwHheMUVocoAYKKW6p5qg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VFwbTt1/snrQLIllEB7TpeqH1TW9toY9XjTtTzSRNB6V/8GPK79eWeFW+rsQioRzl Fn0dTVOyJW8RRnLH2Si1s8M5XNyHpmONXLV8fjhZGiCQXqsWW41PN4/vTNYf4Ixp4W oWq/Ep3MoVcsv6Wf8+svkKD3ot+HA4UdGSUs620Rf5XIBDKRHJSdKSl14swZ+e6iN0 cCybiYCUsbSAdQm45vy+DYfjSo3RZpcmoxOww/4+34kb63KoLxTjwRecG22Py7ECEL MKJBNcfK/bOPx+etfV/UUCDcTddwUXlQDBLV0CdaxUVeXvSD3x+AKav3tOYFwSVeNf zVOD4I1K4kDFA== 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.4 30/31] ASoC: intel: atom: Fix breakage for PCM buffer address setup Date: Tue, 24 Aug 2021 13:07:42 -0400 Message-Id: <20210824170743.710957-31-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824170743.710957-1-sashal@kernel.org> References: <20210824170743.710957-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.4.282-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.4.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.4.282-rc1 X-KernelTest-Deadline: 2021-08-26T17:07+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 64079423b298..d0d338533eb6 100644 --- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c +++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c @@ -134,7 +134,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