Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9105792pxu; Mon, 28 Dec 2020 06:47:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzksIpKcvSze/JLB4oiGDGUfvIlCc0BZ7v9E+U1QPnAZ6PEX6/1YTBGfHfSOg4xInw2BV4g X-Received: by 2002:a17:907:2070:: with SMTP id qp16mr41431737ejb.503.1609166829531; Mon, 28 Dec 2020 06:47:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609166829; cv=none; d=google.com; s=arc-20160816; b=fK1Dj3USkkRqfcBbeJdgElBUbUVaTvyrXFH6myPawbI+IhT+/8iFdJr8MkGtC9cTFg Wlv91Wrv8C3u0dBbDXeeo6Y633DpMJ5fuivLwAoXOpvxCb1MiRo7lEr0jDX/CJju1Tuw rNDiDgMjTVtndkq2Ccn0yA724BDwt9YHrwYSJTZTWE3Hr2AXpVyTQ2LqKDRN6wGHO0WN O5kHAeBpE2hG2XxQd8Z2XaYwSKiy5r8OCgh2ZML+dcYXjGPa/ytkxl8TqsbP7qB3HtmJ 5JHM/hm3YdoPvLOiP4quaoeY5pEFGOOoXVPtKhQ5R6EFuuDhEUvHzA46EQWcQ2ZaGrRh Kjqw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Pg4se10nEtjZ/eLM27ZG177FwgFR/02gbHBcLbm/cJU=; b=tCTjwPUJI5+o+VAZO19TciL3Xu+s2ja2C2e6Bo21ykctRwC9CWcOWxWZX/lEMGkBo/ 4MQkBgd2dwL/axSlBFTX1ePm70x+CN2Wq+HtwVke/x5Ae5ERSR99YZLrJ75yEQv7CuaV DoCOSB2fywUqw1kA1yZuzPYPDodTwICyuET1ePt6TPljaMEZ03MCCLoV2OebmVmV1XsT 95mZ99VMTVbqU37AI8XTmfi3sqN/HnbyNyE5/Q5OkrqWkmP4p8gzeyHypv9eXqkvKjhH WZMrW9BVke2Ih8TPI9L6OMBdhinIEEugg8yAtSZFKhfh8fA+uFL9qdzg0u/EVm7s2l0N GDCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X+6eFEsh; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s5si19012954ejz.284.2020.12.28.06.46.47; Mon, 28 Dec 2020 06:47:09 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=X+6eFEsh; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2506377AbgL1OnX (ORCPT + 99 others); Mon, 28 Dec 2020 09:43:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:34806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2503923AbgL1O05 (ORCPT ); Mon, 28 Dec 2020 09:26:57 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 74A5720715; Mon, 28 Dec 2020 14:26:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165577; bh=nBYK6x9kWnsIhtwZ0HyQfAepw952HoVPfPhFSHKERfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X+6eFEshz6DyWIiEKJc5G5nfNEzcoyPy0vMmBO5eoBGetQEZho4CHzsEsoL7sZF+J hYs50TEgyHPSsbYoXKnrGV67agQjxijy+XBs6KH+kAVkhYVh0LTGMdORCz9gcrARm+ Vs4ro1vcA7U02bqaypwirLeuvaj857iFSgbNAKfw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robin Gong , Takashi Iwai Subject: [PATCH 5.10 550/717] ALSA: core: memalloc: add page alignment for iram Date: Mon, 28 Dec 2020 13:49:08 +0100 Message-Id: <20201228125047.284493116@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Robin Gong commit 74c64efa1557fef731b59eb813f115436d18078e upstream. Since mmap for userspace is based on page alignment, add page alignment for iram alloc from pool, otherwise, some good data located in the same page of dmab->area maybe touched wrongly by userspace like pulseaudio. Signed-off-by: Robin Gong Cc: Link: https://lore.kernel.org/r/1608221747-3474-1-git-send-email-yibin.gong@nxp.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/core/memalloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c @@ -77,7 +77,8 @@ static void snd_malloc_dev_iram(struct s /* Assign the pool into private_data field */ dmab->private_data = pool; - dmab->area = gen_pool_dma_alloc(pool, size, &dmab->addr); + dmab->area = gen_pool_dma_alloc_align(pool, size, &dmab->addr, + PAGE_SIZE); } /**