From patchwork Thu Dec 29 20:45:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Yushchenko X-Patchwork-Id: 9491397 X-Patchwork-Delegate: geert@linux-m68k.org 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 C1F6562AB8 for ; Thu, 29 Dec 2016 20:45:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF3211FFD6 for ; Thu, 29 Dec 2016 20:45:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1F1D25D9E; Thu, 29 Dec 2016 20:45:41 +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,DKIM_SIGNED, DKIM_VALID,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 05F511FFD6 for ; Thu, 29 Dec 2016 20:45:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751284AbcL2UpW (ORCPT ); Thu, 29 Dec 2016 15:45:22 -0500 Received: from mail-lf0-f47.google.com ([209.85.215.47]:34609 "EHLO mail-lf0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751232AbcL2UpU (ORCPT ); Thu, 29 Dec 2016 15:45:20 -0500 Received: by mail-lf0-f47.google.com with SMTP id y21so227075116lfa.1 for ; Thu, 29 Dec 2016 12:45:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vmEkUoFm55ZCUg1FIOxmaAJ3IJZfcBxa6loNvMv6z8s=; b=Y+5zzOIBVVc6NUPqzIVJFJFR2B2N41eYCHGg88ghsnkesWQHi7xwYycsOJi5AhMWp1 cMKdN44RoToJlRNUdDuydGOuEg4SZxdn7LTfShiCs0b0I2xiqij5qPacrq7kECY6poon 8jKHBUazZwOe9Cv5AjvCtTutOjch8grpmFFnD3IXbYf3FbJeCejJd61A8worGsi1gUty qWb5Pgx+F/ln6W8EF7yxWnjogHRiPk+8G5U26XJnas84eFU/sE240mvGE9k0rmY4bMFE d/Ube+bHB5pqMP1EF+swUucdnSkq6Ah8k9SfyaLzrix0XFgdEc5jUuUyv1ymNi/5qnff dF4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vmEkUoFm55ZCUg1FIOxmaAJ3IJZfcBxa6loNvMv6z8s=; b=bGbRu8ZsAVIv7pCzFfpWC0H6nEHY3fOG30VsConuOt1Q6Wh7Ig2vWTmwjA1LRPw6X5 HFQ1KOoL68XYanQ+tWfVAYDurb7pYUA4eQrG37+B8DftrvRk5C5NxoVXk2f0Ux50nnOD pHW89ffOyP4tct5w+a80xsTrOgVme/EGp4VQvFabaGRVqJ8TbpSn+uwgKpqgQragyCbo C0gLOGyQrfzvCfblultBALOutm1DVgHbos5NkyL6XkRiD0Wyn+QptAAVpSG5TiTjszyW fbVVX3klWhSOz8UyxfFemglzx+nzvf6zlGigL9pOFFB1o8Ys/qI895cYlOoIjBpbTa6R I5sQ== X-Gm-Message-State: AIkVDXL8gRJfZYvVJgX+dhik4ZpoodlO3jgCR/X2B+nd0QEHCz/g+bgvnIqflyzkNouvkA== X-Received: by 10.25.215.212 with SMTP id q81mr15728133lfi.126.1483044318349; Thu, 29 Dec 2016 12:45:18 -0800 (PST) Received: from hugenb.home (nikaet.starlink.ru. [94.141.168.29]) by smtp.gmail.com with ESMTPSA id d2sm3338104lfe.13.2016.12.29.12.45.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Dec 2016 12:45:16 -0800 (PST) From: Nikita Yushchenko To: Catalin Marinas , Will Deacon , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, Simon Horman , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: artemi.ivanov@cogentembedded.com, linux-kernel@vger.kernel.org, Nikita Yushchenko Subject: [PATCH 2/2] rcar-pcie: set host bridge's DMA mask Date: Thu, 29 Dec 2016 23:45:04 +0300 Message-Id: <1483044304-2085-2-git-send-email-nikita.yoush@cogentembedded.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1483044304-2085-1-git-send-email-nikita.yoush@cogentembedded.com> References: <1483044304-2085-1-git-send-email-nikita.yoush@cogentembedded.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This gives platform DMA mapping code a chance to disallow setting device DMA mask to something that host bridge can't support. Signed-off-by: Nikita Yushchenko --- drivers/pci/host/pcie-rcar.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c index aca85be..b1edc3c 100644 --- a/drivers/pci/host/pcie-rcar.c +++ b/drivers/pci/host/pcie-rcar.c @@ -451,6 +451,7 @@ static int rcar_pcie_enable(struct rcar_pcie *pcie) { struct device *dev = pcie->dev; struct pci_bus *bus, *child; + struct pci_host_bridge *bridge; LIST_HEAD(res); /* Try setting 5 GT/s link speed */ @@ -480,6 +481,10 @@ static int rcar_pcie_enable(struct rcar_pcie *pcie) list_for_each_entry(child, &bus->children, node) pcie_bus_configure_settings(child); + bridge = pci_find_host_bridge(bus); + bridge->dev.coherent_dma_mask = DMA_BIT_MASK(32); + bridge->dev.dma_mask = &bridge->dev.coherent_dma_mask; + pci_bus_add_devices(bus); return 0;