Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2484638yba; Mon, 6 May 2019 06:54:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIJbDQBie83yXUJvHOLThKjrV616kWHzj121360m2ltEdbqETu7cjVpHaHzrrLGE01adAA X-Received: by 2002:aa7:9203:: with SMTP id 3mr1248262pfo.123.1557150859185; Mon, 06 May 2019 06:54:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557150859; cv=none; d=google.com; s=arc-20160816; b=za8DajmgBa0Az2K8/3JHlNPWvmWs4RTrE4qxywgIONNrNlylyFCp3vad65eZQquRB5 xyZqWncXWKB05eiUuHPI/W2wSFhn+QY7nora+afVtr82QCy3JtVBBztNl5GtwiChpnPt myJiFJ0j1R0SUimehAsbW7UhODjHSQUFY2Tfx7ESosGsNsdDnu3XGbxX8f+448/gLMwH E5+8GXK2Ex5Lkre0XW5GbNfWr+5AzcU4Vx5kVcLXf6iHuvyDiDL4kKovjhXfcwt+ZY/g bJXBuEWDb2cPzZgpoaW4LyRIHYTqP1T0NShf5hrmaPzw2fD32WdyRAlX2QGrT8wmPqcd i/gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=foLRJ95fVzlyBOYQo4XCM1XGFmZlXrGXPccu2GVICFA=; b=DAXHHzI16dFDxbRbWBEQkK1GJG4CqMiJNRcVPMeAZVeNF+5WPy5qT09dFOlCUVvli5 pvsp+s/Pv+03hkvKRZruS409WmCHEm8JaVV6VS9ldetljXlv+4j3UjF1VWvmWexT0XTZ eYG5x2NAkE/rZ3JAbeJKfoIt7JsDGmtvvJnXmAuzAljQdubcUHIlVPTKAS3i6QIg2f/d Ja1anW1ti6i+QUJOx9ZEnlO+pbPblpl/it9jqN1zOYA519mvyWNy2exFInmukhlOd9Jv AOIpST884zXP6KZ1BIGfPI+Xq+bV/2StD7rSj2qJul2uUGjOGaxr6p2cBfVKHE029h+R TkVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=AepfxQ0p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2si14445995pls.279.2019.05.06.06.54.00; Mon, 06 May 2019 06:54:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=AepfxQ0p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726270AbfEFNvx (ORCPT + 99 others); Mon, 6 May 2019 09:51:53 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:45712 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726046AbfEFNvw (ORCPT ); Mon, 6 May 2019 09:51:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=foLRJ95fVzlyBOYQo4XCM1XGFmZlXrGXPccu2GVICFA=; b=AepfxQ0pUAJC cMqeDbM5pyH2X53QKpSIIK1cr/ijcg7KRroVelwnQ6fWTwgtR9jL//dUICL5IY9CGnU1kpjAvNF97 EPL2KkGdlbCxl85+m4ucbwJNhBv5q0Tm//KHBCsQUtyVd+X9bqgXj7ILQYlcG6eByO1IbSdTkj9X+ Ytxvo=; Received: from [2001:268:c0e6:658d:8f3d:d90b:c4e4:2fdf] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hNe1u-0001jB-U5; Mon, 06 May 2019 13:51:43 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id E96D944000C; Mon, 6 May 2019 14:51:36 +0100 (BST) From: Mark Brown To: Baolin Wang Cc: alsa-devel@alsa-project.org, baolin.wang@linaro.org, broonie@kernel.org, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, Mark Brown , orsonzhai@gmail.com, perex@perex.cz, tiwai@suse.com, zhang.lyra@gmail.com Subject: Applied "ASoC: sprd: Add reserved DMA memory support" to the asoc tree In-Reply-To: X-Patchwork-Hint: ignore Message-Id: <20190506135136.E96D944000C@finisterre.ee.mobilebroadband> Date: Mon, 6 May 2019 14:51:36 +0100 (BST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: sprd: Add reserved DMA memory support has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 1587a061ef562de0d97c82a95863e191bcd69d63 Mon Sep 17 00:00:00 2001 From: Baolin Wang Date: Fri, 12 Apr 2019 14:40:17 +0800 Subject: [PATCH] ASoC: sprd: Add reserved DMA memory support For Spreadtrum audio platform driver, it need allocate a larger DMA buffer dynamically to copy audio data between userspace and kernel space, but that will increase the risk of memory allocation failure especially the system is under heavy load situation. To make sure the audio can work in this scenario, we usually reserve one region of memory to be used as a shared pool of DMA buffers for the platform component. So add of_reserved_mem_device_init_by_idx() function to initialize the shared pool of DMA buffers to be used by the platform component. Signed-off-by: Baolin Wang Signed-off-by: Mark Brown --- sound/soc/sprd/sprd-pcm-dma.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/sprd/sprd-pcm-dma.c b/sound/soc/sprd/sprd-pcm-dma.c index 9be6d4b2bf74..d38ebbbbf169 100644 --- a/sound/soc/sprd/sprd-pcm-dma.c +++ b/sound/soc/sprd/sprd-pcm-dma.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -530,8 +531,14 @@ static const struct snd_soc_component_driver sprd_soc_component = { static int sprd_soc_platform_probe(struct platform_device *pdev) { + struct device_node *np = pdev->dev.of_node; int ret; + ret = of_reserved_mem_device_init_by_idx(&pdev->dev, np, 0); + if (ret) + dev_warn(&pdev->dev, + "no reserved DMA memory for audio platform device\n"); + ret = devm_snd_soc_register_component(&pdev->dev, &sprd_soc_component, NULL, 0); if (ret) -- 2.20.1