From patchwork Fri Jul 27 14:14:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Murphy X-Patchwork-Id: 10547231 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38E8B14BC for ; Fri, 27 Jul 2018 14:14:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 261D422ADC for ; Fri, 27 Jul 2018 14:14:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18FEF2BCA6; Fri, 27 Jul 2018 14:14:42 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B5BC522ADC for ; Fri, 27 Jul 2018 14:14:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=THSlYwyu7yUnNcKVFROk8ht2w9Kqf/2rSuJftOIphq8=; b=eDI 2Et2qP+pVqnvVzaQc6RVvDkCCTQXi+lP5rjYOzjTbELJV5zDkc64xlbW4vtiXvA9pHPYs2r9qvxpE Ny5D3TBM4jlpYnhqzisUvTbRh6uGTntSRviJwJLfUr0HV2Q432yI4h7A+XB+IlWLKkNOnxkRxb58J HtC44p//wyzPQE/LuJkchiFJL/U6NTeDfRtrg0PWeRdDVV5B5BKL+1M8G02TyHvG40xcpXWKYn9/F jLA4u4pue+U+AfmXyyuTxCK1vRAoP1oG5oIgzOxDpAkfQMaeolwiTQ79J1Nz0XMYB7eYWzA8UqCbI TkjH31dR/C3h3aYh26Oqp8AmxmwjUDQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fj3Vt-0004Hd-Uc; Fri, 27 Jul 2018 14:14:37 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fj3Vr-0004Gh-VJ for linux-arm-kernel@lists.infradead.org; Fri, 27 Jul 2018 14:14:37 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8002BED1; Fri, 27 Jul 2018 07:14:25 -0700 (PDT) Received: from e110467-lin.cambridge.arm.com (e110467-lin.Emea.Arm.com [10.4.12.131]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D6DA33F6A8; Fri, 27 Jul 2018 07:14:23 -0700 (PDT) From: Robin Murphy To: robh+dt@kernel.org, frowand.list@gmail.com Subject: [PATCH] of/platform: Initialise default DMA masks Date: Fri, 27 Jul 2018 15:14:15 +0100 Message-Id: <9ffa7f2676c25adf39e85ec8114b26500b5680f6.1532699305.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.17.1.dirty X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180727_071436_015200_A080BDD8 X-CRM114-Status: GOOD ( 14.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, grygorii.strashko@ti.com, krzk@kernel.org, iommu@lists.linux-foundation.org, hch@lst.de, linux-arm-kernel@lists.infradead.org, m.szyprowski@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 When of_dma_configure() was first born in 591c1ee465ce ("of: configure the platform device dma parameters"), everything DMA-related was factored out of of_platform_device_create_pdata() as seemed appropriate at the time. However, now that of_dma_configure() has grown into the generic handler for processing DMA-related properties from DT for all kinds of devices, it is no longer an appropriate place to be doing OF-platform-specific business. Since there are still plenty of platform drivers not setting their own masks and depending on the bus default, let's reinstate that inialisation in the OF-platform code itself, and restore the long-standing status quo from 0589342c2794 ("of: set dma_mask to point to coherent_dma_mask") CC: Rob Herring CC: Frank Rowand Signed-off-by: Robin Murphy Acked-by: Rob Herring --- This shouldn't strictly depend on the changes currently queued in the dma-mapping tree, so should be OK to go through the DT tree in parallel. Ideally we'd fix all DMA-capable drivers to set their masks correctly, but in the short term everyone's going to get cross about -rc1 not booting... Robin. drivers/of/platform.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 6925d993e1f0..7ba90c290a42 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -185,6 +185,9 @@ static struct platform_device *of_platform_device_create_pdata( if (!dev) goto err_clear_flag; + dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); + if (!dev->dev.dma_mask) + dev->dev.dma_mask = &dev->dev.coherent_dma_mask; dev->dev.bus = &platform_bus_type; dev->dev.platform_data = platform_data; of_msi_configure(&dev->dev, dev->dev.of_node);