From patchwork Thu Dec 11 02:58:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhilash Kesavan X-Patchwork-Id: 5474731 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 36C9D9F1D4 for ; Thu, 11 Dec 2014 08:46:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6B6F02018E for ; Thu, 11 Dec 2014 08:46:12 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3EACB20172 for ; Thu, 11 Dec 2014 08:46:11 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 43DC52650D7; Thu, 11 Dec 2014 09:46:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 7D8DF261543; Thu, 11 Dec 2014 09:44:51 +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 1E3EA2606E4; Thu, 11 Dec 2014 03:59:04 +0100 (CET) Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by alsa0.perex.cz (Postfix) with ESMTP id EBD5C2606FC for ; Thu, 11 Dec 2014 03:58:56 +0100 (CET) Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NGE00MTCDLP2KC0@mailout4.samsung.com> for alsa-devel@alsa-project.org; Thu, 11 Dec 2014 11:58:37 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.126]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 1B.C7.18484.D5809845; Thu, 11 Dec 2014 11:58:37 +0900 (KST) X-AuditID: cbfee68f-f791c6d000004834-77-5489085d6bc7 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 6D.47.09430.D5809845; Thu, 11 Dec 2014 11:58:37 +0900 (KST) Received: from abhilash-ubuntu.sisodomain.com ([107.108.73.92]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NGE00CKBDL82N00@mmp1.samsung.com>; Thu, 11 Dec 2014 11:58:37 +0900 (KST) From: Abhilash Kesavan To: catalin.marinas@arm.com, Will.Deacon@arm.com, heiko@sntech.de, Li.Xiubo@freescale.com, shc_work@mail.ru, p.zabel@pengutronix.de, nicoleotsuka@gmail.com, arnd@arndb.de, gregkh@linuxfoundation.org, robh+dt@kernel.org, grant.likely@linaro.org, linux-kernel@vger.kernel.org, corbet@lwn.net Date: Thu, 11 Dec 2014 08:28:46 +0530 Message-id: <1418266726-12004-2-git-send-email-a.kesavan@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1418266726-12004-1-git-send-email-a.kesavan@samsung.com> References: <1418266726-12004-1-git-send-email-a.kesavan@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzVSa0hTYRju2zk752gKH/P2tUhylKDV2rz1lZImGid/ZKA/QkpbdlDLG9u0 +mOjMi+Ul5lWoqYTry2my8xrrmliGWU5RcEpXUGtJEwzTW1r9O953+d5n+eF92UIwSQpZJJS lZw8VZYsouxJrbNf1r7TTF60ZKBpOza9NfLwunqQxlP31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y5tofNY//cNewei/sm s3pMmXuE1aP/r4FH35ZVjB7br81j9vi8SS5AIKqB0SYjNTEltUghNS85PyUzL91WyTs43jne 1MzAUNfQ0sJcSSEvMTfVVsnFJ0DXLTMHGApKCmWJOaVAoYDE4mIlfTtME0JD3HQtYBojdH1D guB6jAzQQMIaxoynG+exF2zkrbi7Nb6BcRJ3FyMnh4SAicTE8ytZIGwxiQv31rN1MXJxCAks YpTYs/crE0hCSKCPSWL1IkUQm01AT2LBv6/MIEUiAiuZJF69+8cI4jALXGaU6Fj0kBWkSljA SeLcj1lsIDaLgKrEt6l7GUFsXgFXifuL5rJ3MXIArVOQmDPJBiTMKeAmcWnTf0aIZa4SPxo2 ME9g5F3AyLCKUTS1ILmgOCk910ivODG3uDQvXS85P3cTIziBPJPewbiqweIQowAHoxIPb8Dl 9hAh1sSy4srcQ4wSHMxKIrxJNzpChHhTEiurUovy44tKc1KLDzGaAh01kVlKNDkfmNzySuIN jU3MTY1NLU0sTMwslcR5lezbQoQE0hNLUrNTUwtSi2D6mDg4pYAh5/Fq0Ze4qu+tu7g741Yx FTSz33D+d2vVljxbxobXLE93bfcUieCpDNi068Pu+F/CU+SaE9y/HOZYId9oGHbY6ATTvR+v 2Z/29D3dJ3SzoO7JIp7k8Mnn9FdGbV3czRKyWMj55OqFt8QT3hb82xJUsHbzVbvv/7d9eP1/ UcXB07WXfKw+8C6RU2Ipzkg01GIuKk4EAJXHYRo2AwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Mailman-Approved-At: Thu, 11 Dec 2014 09:44:49 +0100 Cc: alsa-devel@alsa-project.org, bcousson@baylibre.com, pawel.moll@arm.com, padma.v@samsung.com, tony@atomide.com, kesavan.abhilash@gmail.com, kgene@kernel.org, kernel@pengutronix.de, shawn.guo@freescale.com Subject: [alsa-devel] [PATCH 2/2] 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 --- This is based on the discussion about the crash here: http://www.spinics.net/lists/arm-kernel/msg384647.html 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;