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: 9491405 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 B4A3862AB8 for ; Thu, 29 Dec 2016 20:47:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A311C1FFD6 for ; Thu, 29 Dec 2016 20:47:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96FB122BF1; Thu, 29 Dec 2016 20:47: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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham 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 4DBF41FFD6 for ; Thu, 29 Dec 2016 20:47:26 +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 1cMhaH-0000Pr-Q6; Thu, 29 Dec 2016 20:45:57 +0000 Received: from mail-lf0-x229.google.com ([2a00:1450:4010:c07::229]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cMha0-0000Gk-Ir for linux-arm-kernel@lists.infradead.org; Thu, 29 Dec 2016 20:45:41 +0000 Received: by mail-lf0-x229.google.com with SMTP id y21so227075117lfa.1 for ; Thu, 29 Dec 2016 12:45:20 -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=N5LT93+BZzaAlYLewvuiHP5tV0WGiTblejWHDy7v4XgVw/Yi2JrHir5IOqaRnxFm/S Ozz+3qbbtOO/EXVSw8mHGSEAccybjrDsQCr/9/nCBYxTtrgyhKmKJsMdZ0R4/DoeLdlP rljEDC5PfNIN2N6HYWwDl3rU9N/QtSMr48Xz/DKCDCSJ7mxhS2TAmsNNpRTlNLcCkgEo hTXjp9OdZGB3giXUpDUyVbpZPz6NuplPmpMDP2RR1aoxaZFGGNeTF44OJDT9yy6+zDMF EBQw7dy4Aw103AihGNV5ElsG0V8ugmb1wFEYgOgAyb8Bs1ODrR9I6uVNmp9eYWx1sCYw 115g== X-Gm-Message-State: AIkVDXIGYNXxHD6iez9fpHg4fGibnk+1cnlTFTxt+DI7JG/lOqwFyNNBZcE9Vv7XPyg61g== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161229_124540_926483_567DB220 X-CRM114-Status: UNSURE ( 9.78 ) X-CRM114-Notice: Please train this message. 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: Nikita Yushchenko , artemi.ivanov@cogentembedded.com, linux-kernel@vger.kernel.org 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 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;