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: 9263217 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 815996048F for ; Thu, 4 Aug 2016 09:58:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70B552832B for ; Thu, 4 Aug 2016 09:58:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6321B28395; Thu, 4 Aug 2016 09:58:26 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B6FBA2832B for ; Thu, 4 Aug 2016 09:58:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bVFOl-0007Sf-DK; Thu, 04 Aug 2016 09:57:07 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bVFOh-0007Lt-JV for linux-arm-kernel@lists.infradead.org; Thu, 04 Aug 2016 09:57:04 +0000 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-arm-kernel@lists.infradead.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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160804_025703_875961_03B0972C X-CRM114-Status: GOOD ( 12.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki , linux-arm-kernel@lists.infradead.org, b.zolnierkie@samsung.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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