Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp409968yba; Thu, 18 Apr 2019 03:28:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyaOXu+aayNW8mC23IwQ4x0vzaDsLrx5y4oCfxbyrP7jX0KyCtLFY4dwMduKd9muij8qz7Y X-Received: by 2002:a17:902:9884:: with SMTP id s4mr7840852plp.179.1555583311788; Thu, 18 Apr 2019 03:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555583311; cv=none; d=google.com; s=arc-20160816; b=FBCMPrpkLdCRTXkfTCHIva+LPEEre5ENroEoSG+eYb+HRtAJjZq9fVsA4V+pDNO/fA 09H3S1hRbD/GlWP2/W+nbCmp6X+62BlFIPdqdzMgD6uFlmyMg5A5grMBxEh3mwRjuzZe naSVAocR9wE8RvOWFyFPnZmYbc8LlohEpTmwZBIz9yUAsRIqE1E/rTGcLPR3TrlUXEw+ Ldx7aAd1Bq/brUtPrh8Z6QJxRffEIkO7GzkY2T/ac+0CyzGs+ldzC3u4Ob9sOMzRe5j/ bJkmfN7Q8wJvwceBhoH+btm0U5Sg6weMm8UtWsCPxZg/Dqi6B3221HoLqXN4pBMCgT2Z VUnQ== 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=4i1wz0+hDHyXvG9MYVIMKr5rG0BDsWVAErtStvBHo6w=; b=W25K2F4GvWpHz1BLM+M5rkvHCvmOXL/asadxD2r3KhIxdvurvheQ0W8sQkB+cHeC1k S7H6rkpHB7rzPFvhmQ8/gIYCn2T7ZX9w0KkH4+VmccVU5JyeJoD3sh2bMCVcyg5rBg7J XFAhfNAnW3dWI4nN1W1PBDWgQC2+VawvZbTqR7t+EcAPOIp+bsjpT+wSLJBf/9InKwVG fZX/lJEhinBjBKrIS5tTRuXT3JXoRI+gk0Wr5IFDriJgYxQAlkJKIXhbiIrsgukckLyw id117SnkXidP6REknI2YY9xipZoRoYqFtTQDRMfqmZjzVf2/NvJACl9z3T7gprrAm5OU NL/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=hzHHJ6x7; 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 v21si1702232plo.34.2019.04.18.03.28.16; Thu, 18 Apr 2019 03:28:31 -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=hzHHJ6x7; 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 S2388724AbfDRK0p (ORCPT + 99 others); Thu, 18 Apr 2019 06:26:45 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:44730 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388244AbfDRK0p (ORCPT ); Thu, 18 Apr 2019 06:26:45 -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=4i1wz0+hDHyXvG9MYVIMKr5rG0BDsWVAErtStvBHo6w=; b=hzHHJ6x7y2Fn sIrF/o4QTODvjsoTroKnq6iOJTaWEMnZLU2fOJQqkKX4J7bCqVgzqENfiewMIDKT30yJmf1v7SXws wSbf8ty9+QUnaDjVAtl56kk6Vs1dhMPgHZakJxr96vjtpjN3g6qFamAf7aHN9mQKY0jjaeLiCBAtl T2Euk=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1hH4F5-0001TF-He; Thu, 18 Apr 2019 10:26:07 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id AE0181126DA9; Thu, 18 Apr 2019 11:26:06 +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: <20190418102606.AE0181126DA9@debutante.sirena.org.uk> Date: Thu, 18 Apr 2019 11:26:06 +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 for-5.2 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 25a073bb9ceda91b8bf731b20ac01b68cc8877a9 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