From patchwork Thu Aug 4 09:56:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 9263215 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C0B946048F for ; Thu, 4 Aug 2016 09:57:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B03152832B for ; Thu, 4 Aug 2016 09:57:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A428928395; Thu, 4 Aug 2016 09:57:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14B622832B for ; Thu, 4 Aug 2016 09:57:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751030AbcHDJ46 (ORCPT ); Thu, 4 Aug 2016 05:56:58 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:51025 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750894AbcHDJ45 (ORCPT ); Thu, 4 Aug 2016 05:56:57 -0400 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OBD00XYKQAEW860@mailout2.samsung.com> for linux-samsung-soc@vger.kernel.org; Thu, 04 Aug 2016 18:56:39 +0900 (KST) X-AuditID: cbfee61b-f79466d000001e3c-fb-57a31157d5fe Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 25.5A.07740.75113A75; Thu, 4 Aug 2016 02:56:39 -0700 (MST) Received: from AMDC1344.digital.local ([106.116.147.32]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OBD00982Q9W4V40@mmp1.samsung.com>; Thu, 04 Aug 2016 18:56:39 +0900 (KST) From: Sylwester Nawrocki To: krzk@kernel.org Cc: linux-arm-kernel@lists.infradead.org, b.zolnierkie@samsung.com, linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki Subject: [PATCH] ARM: S3C24XX: Add dma_mask assignments for DMA devices Date: Thu, 04 Aug 2016 11:56:12 +0200 Message-id: <1470304572-14937-1-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPJMWRmVeSWpSXmKPExsVy+t9jAd1wwcXhBgcvKltsnLGe1eL8+Q3s FpseX2O1mHF+H5PF4TftrA6sHptWdbJ5bF5S79G3ZRWjx+dNcgEsUVw2Kak5mWWpRfp2CVwZ h49NZC34IF7xYNMD1gbGRpEuRk4OCQETiYV/etkgbDGJC/fWA9lcHEICSxklptyYDeX8YpTY fGQDK0gVm4ChRO/RPkYQW0RAWOLe0uXsIDazwBRGiSVby0FsYQF3iZOrdrOA2CwCqhJXPx8D q+cVcAPa9pIRYpucxMljk1knMHIvYGRYxSiRWpBcUJyUnmuUl1quV5yYW1yal66XnJ+7iREc DM+kdzAe3uV+iFGAg1GJh9di4qJwIdbEsuLK3EOMEhzMSiK8yvyLw4V4UxIrq1KL8uOLSnNS iw8xSnOwKInzPv6/LkxIID2xJDU7NbUgtQgmy8TBKdXAuE770pqpk1v751kd/tAcvdHQ8HGe 5et/v+turHTulf/BPZPpzHWpfzX8Hp1ha+aLXrTJXs9aLv7FUVpJcQ5zusHJVUuT1/HP5EkN 4PoS4vWu8Ivms9sX9i+4u/qkOS+j9hyJW23FdYcX3Xd7ldXwSnbO5BN2nzkXp2XMnrOldv+m nyms3v5/OZRYijMSDbWYi4oTAWCLR54CAgAA Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The dma_mask assignments seem to be missed during refactoring of arch/arm/mach-s3c24xx. Add them to avoid DMA allocation failures. Without this patch sound is broken on s3c24xx with errors reported like: s3c24xx-dma s3c2410-dma.0: coherent DMA mask is unset ALSA pcmC0D0p,0:: cannot preallocate for size 524288 s3c24xx-iis s3c24xx-iis: Failed to get DMA channel capabilities, falling back to period counting: -6 s3c24xx-dma s3c2410-dma.0: coherent DMA mask is unset ... ALSA pcmC0D0c,0:: cannot preallocate for size 524288 s3c24xx-iis s3c24xx-iis: Failed to get DMA channel capabilities, falling back to period counting: -6 Signed-off-by: Sylwester Nawrocki --- arch/arm/mach-s3c24xx/common.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c index bf50328..fe7485d 100644 --- a/arch/arm/mach-s3c24xx/common.c +++ b/arch/arm/mach-s3c24xx/common.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - +#include #include #include #include @@ -304,6 +304,8 @@ struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = { }, }; +#define s3c24xx_device_dma_mask (*((u64[]) { DMA_BIT_MASK(32) })) + #if defined(CONFIG_CPU_S3C2410) || defined(CONFIG_CPU_S3C2412) || \ defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2442) static struct resource s3c2410_dma_resource[] = { @@ -354,7 +356,9 @@ struct platform_device s3c2410_device_dma = { .num_resources = ARRAY_SIZE(s3c2410_dma_resource), .resource = s3c2410_dma_resource, .dev = { - .platform_data = &s3c2410_dma_platdata, + .dma_mask = &s3c24xx_device_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), + .platform_data = &s3c2410_dma_platdata, }, }; #endif @@ -395,7 +399,9 @@ struct platform_device s3c2412_device_dma = { .num_resources = ARRAY_SIZE(s3c2410_dma_resource), .resource = s3c2410_dma_resource, .dev = { - .platform_data = &s3c2412_dma_platdata, + .dma_mask = &s3c24xx_device_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), + .platform_data = &s3c2412_dma_platdata, }, }; #endif @@ -451,7 +457,9 @@ struct platform_device s3c2440_device_dma = { .num_resources = ARRAY_SIZE(s3c2410_dma_resource), .resource = s3c2410_dma_resource, .dev = { - .platform_data = &s3c2440_dma_platdata, + .dma_mask = &s3c24xx_device_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), + .platform_data = &s3c2440_dma_platdata, }, }; #endif @@ -503,7 +511,9 @@ struct platform_device s3c2443_device_dma = { .num_resources = ARRAY_SIZE(s3c2443_dma_resource), .resource = s3c2443_dma_resource, .dev = { - .platform_data = &s3c2443_dma_platdata, + .dma_mask = &s3c24xx_device_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), + .platform_data = &s3c2443_dma_platdata, }, }; #endif