From patchwork Fri Feb 6 13:45:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhilash Kesavan X-Patchwork-Id: 5791841 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 05425BF440 for ; Fri, 6 Feb 2015 13:47:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A290201DD for ; Fri, 6 Feb 2015 13:47:54 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id DD6D8201BC for ; Fri, 6 Feb 2015 13:47:52 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E923226512A; Fri, 6 Feb 2015 14:47:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, NO_DNS_FOR_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 4283B26527F; Fri, 6 Feb 2015 14:46:46 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2CD672652AD; Fri, 6 Feb 2015 14:46:45 +0100 (CET) Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by alsa0.perex.cz (Postfix) with ESMTP id BDA5D2605EC for ; Fri, 6 Feb 2015 14:45:58 +0100 (CET) Received: by pdbfp1 with SMTP id fp1so14850567pdb.2 for ; Fri, 06 Feb 2015 05:45:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Cum63D9in5A/61jzghcsQ/t0MjDfem4KqL0FRDBwPog=; b=FhK/tFC7eIkryc/JvCE/HaAAUcJgor/j9iEzVkEArzbjSJosxL8wXxSCM+i76Vnmya FHHxvsxf0Au57obb0d3DoN9YftnuYLkYwY0yzmKApwFynw2uGTnTw02SPexEIbf/47DY T2NPLVBqSYq+82F2ydvTPO4A579ujkCcfIuzOcuSjOkSfdcMQwUV36gQSdtuxttMUfbS UA/tQS7dl1szs3jUJ6MoT4DS7aQ7vpp09qugalvUJHH2moNZ9X3hs7szUZxVyf+axocd m/UNs3IqXe0z+TV7eauAEyOL9naU2ePabV8cd3sD0oQeBpBXX0gAOPh3naDbOrdbRm1n Vizw== X-Received: by 10.70.134.97 with SMTP id pj1mr5915758pdb.125.1423230357629; Fri, 06 Feb 2015 05:45:57 -0800 (PST) Received: from localhost.localdomain ([122.172.209.203]) by mx.google.com with ESMTPSA id c9sm8173942pdm.51.2015.02.06.05.45.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Feb 2015 05:45:57 -0800 (PST) From: Abhilash Kesavan To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, hirokazu.takata.wj@renesas.com Date: Fri, 6 Feb 2015 19:15:28 +0530 Message-Id: <1423230328-6721-4-git-send-email-a.kesavan@samsung.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1423230328-6721-1-git-send-email-a.kesavan@samsung.com> References: <1423230328-6721-1-git-send-email-a.kesavan@samsung.com> Cc: alsa-devel@alsa-project.org, heiko@sntech.de, shc_work@mail.ru, padma.v@samsung.com, tony@atomide.com, catalin.marinas@arm.com, Will.Deacon@arm.com, nicoleotsuka@gmail.com, kgene@kernel.org, arnd@arndb.de, p.zabel@pengutronix.de, bcousson@baylibre.com, shawn.guo@linaro.org, kernel@pengutronix.de Subject: [alsa-devel] [PATCH v2 3/3] misc: sram: switch to ioremap_wc from ioremap X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, the SRAM allocator returns device memory via ioremap. This causes issues on ARM64 when the internal SoC SRAM allocated by the generic sram driver is used for audio playback. The destination buffer address (which is ioremapped SRAM) is not 64-bit aligned for certain streams (e.g. 44.1k sampling rate). In such cases we get unhandled alignment faults. Use ioremap_wc in place of ioremap which gives us normal non-cacheable memory instead of device memory. Signed-off-by: Abhilash Kesavan Tested-by: Tony Lindgren Tested-by: Heiko Stuebner Acked-by: Philipp Zabel --- drivers/misc/sram.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c index 21181fa..15b4d4e 100644 --- a/drivers/misc/sram.c +++ b/drivers/misc/sram.c @@ -69,12 +69,23 @@ static int sram_probe(struct platform_device *pdev) INIT_LIST_HEAD(&reserve_list); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - virt_base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(virt_base)) - return PTR_ERR(virt_base); + if (!res) { + dev_err(&pdev->dev, "found no memory resource\n"); + return -EINVAL; + } size = resource_size(res); + if (!devm_request_mem_region(&pdev->dev, + res->start, size, pdev->name)) { + dev_err(&pdev->dev, "could not request region for resource\n"); + return -EBUSY; + } + + virt_base = devm_ioremap_wc(&pdev->dev, res->start, size); + if (IS_ERR(virt_base)) + return PTR_ERR(virt_base); + sram = devm_kzalloc(&pdev->dev, sizeof(*sram), GFP_KERNEL); if (!sram) return -ENOMEM;