From patchwork Fri Sep 27 00:24:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 174555 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2787350ill; Thu, 26 Sep 2019 17:25:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1QERHTZJvr/WgOhivqz0vKc8JIK+hZOBsdaB8AoN1Z7864pxV+9Hl0pyE6Pua/nxt9yjj X-Received: by 2002:a50:fa98:: with SMTP id w24mr1725019edr.47.1569543906281; Thu, 26 Sep 2019 17:25:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569543906; cv=none; d=google.com; s=arc-20160816; b=KdEGyJNF/Q9DUmT6PBFiLWlrFIpqI3FqbVd64Wogc3Cm8QZvOfUErl7dw1REhuKoVn /GK6iPb64/n1ST52ZTTpMnD3qMBB4cffErK1Avzm6EJRlJghQLFd3b2UqXV7vSFkDbh9 aSiqYUzhuyXNDgreeTKpsMPW/d74+zLIMsjrlMgWoFP1LlNZnBd8ZyutrQ5By2448y7p VkNWxOTVmHpnP1IlA7J1qK/k9bUZEyHkOFG3x7NzwqIMU9IHbO25xf0kkAzVa354h/KF yZcmxPl46hrNT0RCwTVX03K7bGUATD4qjJqW1mvL2Y3Po+JF5uNT6zB9URdQXKpdqVZE 8blg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=bFnIODxLI07lEZcLoD/U0DfHP6ZA4NBNR5sSatiO5f0=; b=ns0KPiwRyn7NY+Ax2NM6NIVUypyQcY+L7USyUq2116M2NSZoh7Xa+PqR9c6INy/MO2 3O9WEOqKeeIVNpaGrO66Na+Q+x72wZAY9QlC8I7+2H2YXbEeAeYXZ/gafki2/y+bg/Ga B46gpIdUt8q2gLlw1XymDqPScyCTYyCc86S7Xv54oUo91PhfBinkw2J6qtTxmNHfIsfN oR6nvpBR7k8t24AVa7E+ViE7NHykU52PdbFbKplA9VpLCNsbazIkdrTQFmH1kccUKTKx MtAMPJZgr+dMofCaBft7CLGcKxAxH4mvV9fntxowfBAvm2ih+h71IoMO912N3+wVu6dY 1jgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h17si1905166ejt.173.2019.09.26.17.25.05; Thu, 26 Sep 2019 17:25:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727591AbfI0AZD (ORCPT + 26 others); Thu, 26 Sep 2019 20:25:03 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:36434 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726664AbfI0AZB (ORCPT ); Thu, 26 Sep 2019 20:25:01 -0400 Received: by mail-oi1-f193.google.com with SMTP id k20so3749633oih.3; Thu, 26 Sep 2019 17:25:01 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=bFnIODxLI07lEZcLoD/U0DfHP6ZA4NBNR5sSatiO5f0=; b=Tmp8sZoJpBkcnHybmmcyW9scGfrjYcXWPKB3fPk7Z1CEjJmIqYcSfkIsjsbi8XF242 5+5D+I4vbRglrv6ibY+memPOOUuReLDH68qtGiqob8jld5UT6enlWGY7c8YSrBWs7JHh K2qd7x+E6n5pVBId6aLpjk1EAPbM0PPHgzxdRlh89WeQRP4Wym3avv77ZZwon0ZFZJiJ 9ATxEUHxn1Slt0SG5xU0tV97eeyY1cuSyypQNqq7FTMqgB7cvS0myTWqCfU7SkLp/c/Y p2fyQ8FKB6nQzDbfMUxndD2+zTGoo++aK+RKnH4mLSkCnKnSZlNA520nc6IKhsYQMUc+ dXcg== X-Gm-Message-State: APjAAAU2mSG9Sg7lJ9s8NL6OxVH7j1f0dUuAC0kanzh2ydCARKMpAwFZ I7Ap0zcQjk/1VbfjyXpiYFgm9/w= X-Received: by 2002:aca:3ed7:: with SMTP id l206mr4922395oia.25.1569543900588; Thu, 26 Sep 2019 17:25:00 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id j11sm339866otk.80.2019.09.26.17.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 17:24:59 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Robin Murphy , Florian Fainelli , Stefan Wahren , Frank Rowand , Arnd Bergmann , Marek Vasut , Geert Uytterhoeven , Simon Horman , Lorenzo Pieralisi , Oza Pawandeep Subject: [PATCH 02/11] of: Make of_dma_get_range() private Date: Thu, 26 Sep 2019 19:24:46 -0500 Message-Id: <20190927002455.13169-3-robh@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190927002455.13169-1-robh@kernel.org> References: <20190927002455.13169-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org of_dma_get_range() is only used within the DT core code, so remove the export and move the header declaration to the private header. Cc: Robin Murphy Signed-off-by: Rob Herring --- drivers/of/address.c | 1 - drivers/of/of_private.h | 11 +++++++++++ include/linux/of_address.h | 8 -------- 3 files changed, 11 insertions(+), 9 deletions(-) -- 2.20.1 Reviewed-by: Christoph Hellwig diff --git a/drivers/of/address.c b/drivers/of/address.c index 0c3cf515c510..8e354d12fb04 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -972,7 +972,6 @@ int of_dma_get_range(struct device_node *np, u64 *dma_addr, u64 *paddr, u64 *siz return ret; } -EXPORT_SYMBOL_GPL(of_dma_get_range); /** * of_dma_is_coherent - Check if device is coherent diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h index 24786818e32e..f8c58615c393 100644 --- a/drivers/of/of_private.h +++ b/drivers/of/of_private.h @@ -158,4 +158,15 @@ extern void __of_sysfs_remove_bin_file(struct device_node *np, #define for_each_transaction_entry_reverse(_oft, _te) \ list_for_each_entry_reverse(_te, &(_oft)->te_list, node) +#ifdef CONFIG_OF_ADDRESS +extern int of_dma_get_range(struct device_node *np, u64 *dma_addr, + u64 *paddr, u64 *size); +#else +static inline int of_dma_get_range(struct device_node *np, u64 *dma_addr, + u64 *paddr, u64 *size) +{ + return -ENODEV; +} +#endif + #endif /* _LINUX_OF_PRIVATE_H */ diff --git a/include/linux/of_address.h b/include/linux/of_address.h index e317f375374a..ddda3936039c 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h @@ -51,8 +51,6 @@ extern int of_pci_dma_range_parser_init(struct of_pci_range_parser *parser, extern struct of_pci_range *of_pci_range_parser_one( struct of_pci_range_parser *parser, struct of_pci_range *range); -extern int of_dma_get_range(struct device_node *np, u64 *dma_addr, - u64 *paddr, u64 *size); extern bool of_dma_is_coherent(struct device_node *np); #else /* CONFIG_OF_ADDRESS */ static inline void __iomem *of_io_request_and_map(struct device_node *device, @@ -92,12 +90,6 @@ static inline struct of_pci_range *of_pci_range_parser_one( return NULL; } -static inline int of_dma_get_range(struct device_node *np, u64 *dma_addr, - u64 *paddr, u64 *size) -{ - return -ENODEV; -} - static inline bool of_dma_is_coherent(struct device_node *np) { return false; From patchwork Fri Sep 27 00:24:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 174556 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2787368ill; Thu, 26 Sep 2019 17:25:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwewRjsyQ5AyD9/HOj0K1cLxmA8st3jSCxITRZOLz4NtxOTDMZ0ibE7rtKect/TXBjSuKpo X-Received: by 2002:a05:6402:2022:: with SMTP id ay2mr1688319edb.109.1569543907092; Thu, 26 Sep 2019 17:25:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569543907; cv=none; d=google.com; s=arc-20160816; b=A1xJzGpWHH97Q0gxZh0D5vuklsFwIqz7mT70wpPMtEbYGohjJGNiB08PX2mSMx+cgs XrZVS5mc7cvlPqnJ6ynefIn431/dz2sQAjWMI7dXim4NXhnnEErayy/28bzoIyTPvNWy 4QNXt3JIyyAZ6GaU9HIF9itMBAIJEtIaLd+5wlZ1+3QJSDzqeHtQlLDsZZRSKWCbMGgg yWuC4A7Ibu47iLuV2JKTzEIMMfJnYLkxAYBSTSEGNfZFq59wmqKpAIANFK8cEi4IEEUb 9u4/UIcst26ZrukLwtlFn8OZMDHa5VI2N0CcH1pLExnOYmzxsxhHSaE3aEk8ZFyXsMc1 fLBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JkoxCwhnPe0SFeKySMCtF/hXJiLiKDyHZ2P8cGCAjJ4=; b=O5KNdBxGVh1D5uitnLYB54/YvupcnqFyzKJUxGxHndm8AkVuq6KQE3UzmFX6cobSoN P2r8gZh34y3Ea0GPdVf4+pYoObaCZJ9CuoQ5dVu/K1Wf9KTRUExbAcdCkRSUulpaUYry xqZ6Bc3W8b/AZdgpgVfwUS4oD1HDwJnQkwUV3h3t8juZIvaNTgvb7839koKf92pDgwYx aLg+fHMsutGy585I7bfBQMe11xvbxB0ic0cdmH3tGJwm4ZHCR797HRMmeNRyiMCb1PVM h/h+4mQm8KUgkAfEmWxBjR3Q2IKt7WMciNnsFp20w+o7LA7AtVXwuCLV6Wh/JlRGEzM3 0lhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h17si1905166ejt.173.2019.09.26.17.25.06; Thu, 26 Sep 2019 17:25:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727678AbfI0AZE (ORCPT + 26 others); Thu, 26 Sep 2019 20:25:04 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:32868 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727502AbfI0AZD (ORCPT ); Thu, 26 Sep 2019 20:25:03 -0400 Received: by mail-ot1-f65.google.com with SMTP id o9so6809otl.0; Thu, 26 Sep 2019 17:25:02 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=JkoxCwhnPe0SFeKySMCtF/hXJiLiKDyHZ2P8cGCAjJ4=; b=Z2umiizmy2F46GCtFv/rEpEMlzwFe4iMjl99d8mFPgLtZElqsGJ3hLucgRPEPlM/Z3 sipX8quj6lthD2Yi1H62hcOvO/jLTw3mxdzleNGnGPSFKqCJR3jVUbmei+wd3BfjNdBr xyUs11VC1J7lhUQMP1WVJHLwhHKpcy25xBoSudrRPfwGCxzg9Z3nUcrzCtbKrfXso1hw S68umZSleNs/xnYUq6t0+xGS68xMexG2COiBY2Fvz4iv6bz8tB5OZvL9RPrFyFDAT9jW Q9Hj5MHynHYAhAo3iU1Bcgb4xR9yYBVZZlv6e1p2WPxbGa82if6Aiw269/+nRhNmkN7t FIpQ== X-Gm-Message-State: APjAAAWydiRvx8Li8EBnz0Q1XTNfTznFEQ1HbWnGcWSjU760Vwli/6cT sxgOEyX3oQQd1ZR8OtdcCjhkkSM= X-Received: by 2002:a9d:4e0b:: with SMTP id p11mr1184024otf.280.1569543901894; Thu, 26 Sep 2019 17:25:01 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id j11sm339866otk.80.2019.09.26.17.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 17:25:01 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Robin Murphy , Florian Fainelli , Stefan Wahren , Frank Rowand , Arnd Bergmann , Marek Vasut , Geert Uytterhoeven , Simon Horman , Lorenzo Pieralisi , Oza Pawandeep Subject: [PATCH 03/11] of: address: Report of_dma_get_range() errors meaningfully Date: Thu, 26 Sep 2019 19:24:47 -0500 Message-Id: <20190927002455.13169-4-robh@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190927002455.13169-1-robh@kernel.org> References: <20190927002455.13169-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Robin Murphy If we failed to translate a DMA address, at least show the offending address rather than the uninitialised contents of the destination argument. Signed-off-by: Robin Murphy Signed-off-by: Rob Herring --- drivers/of/address.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 Reviewed-by: Geert Uytterhoeven diff --git a/drivers/of/address.c b/drivers/of/address.c index 8e354d12fb04..53d2656c2269 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -955,8 +955,8 @@ int of_dma_get_range(struct device_node *np, u64 *dma_addr, u64 *paddr, u64 *siz dmaaddr = of_read_number(ranges, naddr); *paddr = of_translate_dma_address(np, ranges); if (*paddr == OF_BAD_ADDR) { - pr_err("translation of DMA address(%pad) to CPU address failed node(%pOF)\n", - dma_addr, np); + pr_err("translation of DMA address(%llx) to CPU address failed node(%pOF)\n", + dmaaddr, np); ret = -EINVAL; goto out; } From patchwork Fri Sep 27 00:24:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 174558 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2787558ill; Thu, 26 Sep 2019 17:25:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqywehp7kv0nSZ+De04wCyb5/XM9G7e77FGfOL6IK0HEQZifon2YtSMV/YnK0DLxxcypAiNB X-Received: by 2002:a50:bb22:: with SMTP id y31mr1783766ede.58.1569543920409; Thu, 26 Sep 2019 17:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569543920; cv=none; d=google.com; s=arc-20160816; b=VwdoRcfiBJXSJPaMdXY2XZAD8nQsneM7cXj5kVJClgmoYMKQLQKStjdQGtk6mQ7EfN Nx6r5jTuGOzrmxHk2if7l2HUOF3P43ogt5cU8lSZQ4ghXs1jBylL2KrjJPlFJqWOCy50 VfUeL5VNJCibWBdjNQgiKGBBcWDZFIfpH9ewzfm3sOdTcX/QN+NidlDP2ekfUFiIFJ21 K/0L7gES3C5jmMVfB5yyDeUBkLxlis7JxlrsIPXfo/7TlJYcsEhdeiOlatyNUoDShz7+ PFKx2WmVuB5SVvPVSL/XImXY32u/+qkBpcBUoc1qTdlH127wEt5mISB5ryL8ZaA80kes bCog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=80wnyFMJy45OToJ2Qn6gUBxEzekXteJX990/5YkKFnw=; b=C63wDtJ5wefiCWSEUljyEJtd0zv48v/ERx1cBaj1aoRoOFGZ9l+iopbsztUqqfGAZl 2F7ZR4kIHWmHnGqhKKFsfzDLMeULer4AWzQbi/EFFAS9GmUQxB/eXKqK4b275VRVbWcN N1fT208GXVEdM5F1YVUftPBRMaZbreWNXmJbnLl4YzIjutlVlxLqWGezfZySsxQEdCIl PQ12FLLLoAlUCQcwFf4JCAD05cyQNmaxZngLhj07Oyw+GTAesa8vAv0gE0+qCh3fU0Ty +1uZNDOzqNOY8xDHqKEFw+yr4+VTxVGp/mQwGGc9BY42NrYsJv+JsQszoxu2c6nc7MLO B8uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r2si1932925ejj.90.2019.09.26.17.25.20; Thu, 26 Sep 2019 17:25:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727919AbfI0AZK (ORCPT + 26 others); Thu, 26 Sep 2019 20:25:10 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:42539 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727502AbfI0AZG (ORCPT ); Thu, 26 Sep 2019 20:25:06 -0400 Received: by mail-oi1-f194.google.com with SMTP id i185so3713856oif.9; Thu, 26 Sep 2019 17:25:04 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=80wnyFMJy45OToJ2Qn6gUBxEzekXteJX990/5YkKFnw=; b=DuBvgH3/DdWz5nwPfeHrshqEdOV7Fq/nE4r/ReqI0VnM63P6OD3ZH+2X4gZgIrH+m6 yHSiiKbsSPqJYNpqEHsv3FK/ubzztuox3axKh/F+Fetj1BjFsm2Er3TUhq3hYtEQbb8f j2EX5Lq0VQMVASmGEOGXUv/ywQpqyT6eK11pTLIl3pDw0LPC5Yl3MRv3+oFnTxj0W4e8 l1X6W17BuJpMjV9q+JFDF7xs3beBdM6GINlHywG50tgeMc6NztLzPzmyQ1YvAPFehPnm pmBvDNB6/IDSz/TLhewSyUSxH4R2a1Xptyo5X/uN3XnyEbP/Co+kxt3yawTaZ1VPO+Gl Zf9Q== X-Gm-Message-State: APjAAAVhUD4868Pd9ZPgrfenRdTyghBh9Oa5QhKw/l/ssHqTDQlztxe4 gjy6U0sqekPbEoDvVy9V7p/ghCk= X-Received: by 2002:aca:703:: with SMTP id 3mr4647438oih.118.1569543903216; Thu, 26 Sep 2019 17:25:03 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id j11sm339866otk.80.2019.09.26.17.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 17:25:02 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Robin Murphy , Florian Fainelli , Stefan Wahren , Frank Rowand , Arnd Bergmann , Marek Vasut , Geert Uytterhoeven , Simon Horman , Lorenzo Pieralisi , Oza Pawandeep Subject: [PATCH 04/11] of/unittest: Add dma-ranges address translation tests Date: Thu, 26 Sep 2019 19:24:48 -0500 Message-Id: <20190927002455.13169-5-robh@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190927002455.13169-1-robh@kernel.org> References: <20190927002455.13169-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The functions for parsing 'dma-ranges' ranges are buggy and fail to handle several conditions. Add new tests for of_dma_get_range() and for_each_of_pci_range(). With this test, we get 5 new failures which are fixed in subsequent commits: OF: translation of DMA address(0) to CPU address failed node(/testcase-data/address-tests/device@70000000) FAIL of_unittest_dma_ranges_one():798 of_dma_get_range failed on node /testcase-data/address-tests/device@70000000 rc=-22 OF: translation of DMA address(10000000) to CPU address failed node(/testcase-data/address-tests/bus@80000000/device@1000) FAIL of_unittest_dma_ranges_one():798 of_dma_get_range failed on node /testcase-data/address-tests/bus@80000000/device@1000 rc=-22 OF: translation of DMA address(0) to CPU address failed node(/testcase-data/address-tests/pci@90000000) FAIL of_unittest_dma_ranges_one():798 of_dma_get_range failed on node /testcase-data/address-tests/pci@90000000 rc=-22 FAIL of_unittest_pci_dma_ranges():851 for_each_of_pci_range wrong CPU addr (d0000000) on node /testcase-data/address-tests/pci@90000000 FAIL of_unittest_pci_dma_ranges():861 for_each_of_pci_range wrong CPU addr (ffffffffffffffff) on node /testcase-data/address-tests/pci@90000000 Cc: Robin Murphy Signed-off-by: Rob Herring --- drivers/of/unittest-data/testcases.dts | 1 + drivers/of/unittest-data/tests-address.dtsi | 48 +++++++++++ drivers/of/unittest.c | 92 +++++++++++++++++++++ 3 files changed, 141 insertions(+) create mode 100644 drivers/of/unittest-data/tests-address.dtsi -- 2.20.1 diff --git a/drivers/of/unittest-data/testcases.dts b/drivers/of/unittest-data/testcases.dts index 55fe0ee20109..a85b5e1c381a 100644 --- a/drivers/of/unittest-data/testcases.dts +++ b/drivers/of/unittest-data/testcases.dts @@ -15,5 +15,6 @@ #include "tests-phandle.dtsi" #include "tests-interrupts.dtsi" #include "tests-match.dtsi" +#include "tests-address.dtsi" #include "tests-platform.dtsi" #include "tests-overlay.dtsi" diff --git a/drivers/of/unittest-data/tests-address.dtsi b/drivers/of/unittest-data/tests-address.dtsi new file mode 100644 index 000000000000..3fe5d3987beb --- /dev/null +++ b/drivers/of/unittest-data/tests-address.dtsi @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: GPL-2.0 + +/ { + #address-cells = <1>; + #size-cells = <1>; + + testcase-data { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + address-tests { + #address-cells = <1>; + #size-cells = <1>; + /* ranges here is to make sure we don't use it for + * dma-ranges translation */ + ranges = <0x70000000 0x70000000 0x40000000>, + <0x00000000 0xd0000000 0x20000000>; + dma-ranges = <0x0 0x20000000 0x40000000>; + + device@70000000 { + reg = <0x70000000 0x1000>; + }; + + bus@80000000 { + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x80000000 0x100000>; + dma-ranges = <0x10000000 0x0 0x40000000>; + + device@1000 { + reg = <0x1000 0x1000>; + }; + }; + + pci@90000000 { + device_type = "pci"; + #address-cells = <3>; + #size-cells = <2>; + reg = <0x90000000 0x1000>; + ranges = <0x42000000 0x0 0x40000000 0x40000000 0x0 0x10000000>; + dma-ranges = <0x42000000 0x0 0x80000000 0x00000000 0x0 0x10000000>, + <0x42000000 0x0 0xc0000000 0x20000000 0x0 0x10000000>; + }; + + }; + }; +}; diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index e6b175370f2e..3969075194c5 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -779,6 +780,95 @@ static void __init of_unittest_changeset(void) #endif } +static void __init of_unittest_dma_ranges_one(const char *path, + u64 expect_dma_addr, u64 expect_paddr, u64 expect_size) +{ + struct device_node *np; + u64 dma_addr, paddr, size; + int rc; + + np = of_find_node_by_path(path); + if (!np) { + pr_err("missing testcase data\n"); + return; + } + + rc = of_dma_get_range(np, &dma_addr, &paddr, &size); + + unittest(!rc, "of_dma_get_range failed on node %pOF rc=%i\n", np, rc); + if (!rc) { + unittest(size == expect_size, + "of_dma_get_range wrong size on node %pOF size=%llx\n", np, size); + unittest(paddr == expect_paddr, + "of_dma_get_range wrong phys addr (%llx) on node %pOF", paddr, np); + unittest(dma_addr == expect_dma_addr, + "of_dma_get_range wrong DMA addr (%llx) on node %pOF", dma_addr, np); + } + of_node_put(np); +} + +static void __init of_unittest_parse_dma_ranges(void) +{ + of_unittest_dma_ranges_one("/testcase-data/address-tests/device@70000000", + 0x0, 0x20000000, 0x40000000); + of_unittest_dma_ranges_one("/testcase-data/address-tests/bus@80000000/device@1000", + 0x10000000, 0x20000000, 0x40000000); + of_unittest_dma_ranges_one("/testcase-data/address-tests/pci@90000000", + 0x80000000, 0x20000000, 0x10000000); +} + +static void __init of_unittest_pci_dma_ranges(void) +{ + struct device_node *np; + struct of_pci_range range; + struct of_pci_range_parser parser; + int i = 0; + + if (!IS_ENABLED(CONFIG_PCI)) + return; + + np = of_find_node_by_path("/testcase-data/address-tests/pci@90000000"); + if (!np) { + pr_err("missing testcase data\n"); + return; + } + + if (of_pci_dma_range_parser_init(&parser, np)) { + pr_err("missing dma-ranges property\n"); + return; + } + + /* + * Get the dma-ranges from the device tree + */ + for_each_of_pci_range(&parser, &range) { + if (!i) { + unittest(range.size == 0x10000000, + "for_each_of_pci_range wrong size on node %pOF size=%llx\n", + np, range.size); + unittest(range.cpu_addr == 0x20000000, + "for_each_of_pci_range wrong CPU addr (%llx) on node %pOF", + range.cpu_addr, np); + unittest(range.pci_addr == 0x80000000, + "for_each_of_pci_range wrong DMA addr (%llx) on node %pOF", + range.pci_addr, np); + } else { + unittest(range.size == 0x10000000, + "for_each_of_pci_range wrong size on node %pOF size=%llx\n", + np, range.size); + unittest(range.cpu_addr == 0x40000000, + "for_each_of_pci_range wrong CPU addr (%llx) on node %pOF", + range.cpu_addr, np); + unittest(range.pci_addr == 0xc0000000, + "for_each_of_pci_range wrong DMA addr (%llx) on node %pOF", + range.pci_addr, np); + } + i++; + } + + of_node_put(np); +} + static void __init of_unittest_parse_interrupts(void) { struct device_node *np; @@ -2552,6 +2642,8 @@ static int __init of_unittest(void) of_unittest_changeset(); of_unittest_parse_interrupts(); of_unittest_parse_interrupts_extended(); + of_unittest_parse_dma_ranges(); + of_unittest_pci_dma_ranges(); of_unittest_match_node(); of_unittest_platform_populate(); of_unittest_overlay(); From patchwork Fri Sep 27 00:24:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 174564 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2787911ill; Thu, 26 Sep 2019 17:25:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZSgsFJdotS5vaYweOsKj7XkfJ60tpi2X/RB0EUW6hOcoOP/X/OU+MnXNumK/Ufsejb2JE X-Received: by 2002:a17:906:3485:: with SMTP id g5mr5404989ejb.76.1569543943091; Thu, 26 Sep 2019 17:25:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569543943; cv=none; d=google.com; s=arc-20160816; b=tF6OC4AWwqqKUl6ZamI7V3jfIIOuVpKf+7qR1YcC8VYni1kxwWnJCYTBHQjKEzlCUA PyDreFb17msOYmk6uRd9pGusZC85b8KmnJEWIqxjQLsziqVWSAbf93NsvJEUhqYVjSjr Gl+HGOM4lcS4fFIMZDRMHW0yZ1JtLfO59c7xb+9DUOJxWOy03T+xGzasOXSnsyAQ7Lud bdhecwTWbM+BiPoFfBouk1BFjU+Smvc0vzUyfKKqiHLn0Y+NvPVDLw0sZsqA7DnRhIF5 4U2TuCU82qcj5xJFn4cgkafC62CZJVEaVxE79YQISu/CE6mCo0LRbTSOS1W2ffRITYjP kMxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/FdaUd4Foou3uzALlTE4nuHwXAnVOybAVTlMM/NfMxM=; b=xyh4qnb0EsIXmoKd4kdDMKDA3HnLv+mHClamfLPjoRgdo5AshOdNfz8InWqotOcnji dDAW7xg9r21M8SUNnRTAu64YdGHrYQrPKBCVf+LaCHbzx2y9k2b7ZWIvD5Y7Q40u1NAV EH7id/IOllyCq/z3UdYhdV3GlZng7sJOoAJtVLv22zFIUWGZeNrWV5VDx3zG48rvQSP6 4oAFGBLnCO9aHkRQscyPleHBBEZxv7DE5evprxCXhO5nAGchGU5BkFWYzX+s9zUYrecX MXFL4P1DAN3r/kb/2w+BCn5AA+RyoOCD3kz8CbLx7d0qG1n8N7ayO0VbeKY1A0SUjmAK jCUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g9si568595edg.58.2019.09.26.17.25.42; Thu, 26 Sep 2019 17:25:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727839AbfI0AZI (ORCPT + 26 others); Thu, 26 Sep 2019 20:25:08 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:40575 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727682AbfI0AZF (ORCPT ); Thu, 26 Sep 2019 20:25:05 -0400 Received: by mail-oi1-f195.google.com with SMTP id k9so3726634oib.7; Thu, 26 Sep 2019 17:25:05 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=/FdaUd4Foou3uzALlTE4nuHwXAnVOybAVTlMM/NfMxM=; b=MWof7LvYsCAN8OEjOTq0UogPE5mr2Nw/a5/2+XNVhQQ1p4gBJhJFekeCHLO0zbfXbI ajIJX8wi+NBFVaWA6DnPoW1X2B8RkbQ4fJAeWGvxaZQW0M7qWQ5sVJtbikqgs65Nj5xe LP6hfOVbPmjuUGzy4VF9qimsU04Fp/A9E6b9vlZUD2lNNb9gu16dHzUoq+nQxL8WbqbZ Mq7bQ6sX/O1iPVLDTmfkwQrZXspFgWURIAWRyNHLOfjcy69/xlkU4SLaToGmlA41Sh2C Gd/NcYHFwFA4WFKJYwG7JunSyx/ullo11nQHPCXsHY2rUqTw5YTgbUxmneS7h14gXmqc CdQw== X-Gm-Message-State: APjAAAWuZlaWQZ510DQMXW77zAVbnaC75LNjWR0JFpQzQT1MgEkqG635 hjnei1f3UaK4WmLvz6bR+K/Tjz4= X-Received: by 2002:aca:fdc9:: with SMTP id b192mr4641000oii.50.1569543904799; Thu, 26 Sep 2019 17:25:04 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id j11sm339866otk.80.2019.09.26.17.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 17:25:04 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Robin Murphy , Florian Fainelli , Stefan Wahren , Frank Rowand , Arnd Bergmann , Marek Vasut , Geert Uytterhoeven , Simon Horman , Lorenzo Pieralisi , Oza Pawandeep Subject: [PATCH 05/11] of: Ratify of_dma_configure() interface Date: Thu, 26 Sep 2019 19:24:49 -0500 Message-Id: <20190927002455.13169-6-robh@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190927002455.13169-1-robh@kernel.org> References: <20190927002455.13169-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Robin Murphy For various DMA masters not directly represented in DT, we pass the OF node of their parent or bridge device as the master_np argument to of_dma_configure(), such that they can inherit the appropriate DMA configuration from whatever is described there. This creates an ambiguity for properties which are not valid for a device itself but only for its parent bus, since we don't know whether to start looking for those at master_np or master_np->parent. Fortunately, the de-facto interface since the prototype change in 1f5c69aa51f9 ("of: Move of_dma_configure() to device.c to help re-use") is pretty clear-cut: either master_np is redundant with dev->of_node, or dev->of_node is NULL and master_np is already the relevant parent. Let's formally ratify that so we can start relying on it. Signed-off-by: Robin Murphy Signed-off-by: Rob Herring --- drivers/of/device.c | 12 ++++++++++-- include/linux/of_device.h | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/drivers/of/device.c b/drivers/of/device.c index da8158392010..a45261e21144 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -75,7 +75,8 @@ int of_device_add(struct platform_device *ofdev) /** * of_dma_configure - Setup DMA configuration * @dev: Device to apply DMA configuration - * @np: Pointer to OF node having DMA configuration + * @parent: OF node of parent device having DMA configuration, if + * @dev->of_node is NULL (ignored otherwise) * @force_dma: Whether device is to be set up by of_dma_configure() even if * DMA capability is not explicitly described by firmware. * @@ -86,15 +87,22 @@ int of_device_add(struct platform_device *ofdev) * can use a platform bus notifier and handle BUS_NOTIFY_ADD_DEVICE events * to fix up DMA configuration. */ -int of_dma_configure(struct device *dev, struct device_node *np, bool force_dma) +int of_dma_configure(struct device *dev, struct device_node *parent, bool force_dma) { u64 dma_addr, paddr, size = 0; int ret; bool coherent; unsigned long offset; const struct iommu_ops *iommu; + struct device_node *np; u64 mask; + np = dev->of_node; + if (!np) + np = parent; + if (!np) + return -ENODEV; + ret = of_dma_get_range(np, &dma_addr, &paddr, &size); if (ret < 0) { /* diff --git a/include/linux/of_device.h b/include/linux/of_device.h index 8d31e39dd564..a4fe418e57f6 100644 --- a/include/linux/of_device.h +++ b/include/linux/of_device.h @@ -56,7 +56,7 @@ static inline struct device_node *of_cpu_device_node_get(int cpu) } int of_dma_configure(struct device *dev, - struct device_node *np, + struct device_node *parent, bool force_dma); #else /* CONFIG_OF */ @@ -107,7 +107,7 @@ static inline struct device_node *of_cpu_device_node_get(int cpu) } static inline int of_dma_configure(struct device *dev, - struct device_node *np, + struct device_node *parent, bool force_dma) { return 0; From patchwork Fri Sep 27 00:24:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 174560 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2787617ill; Thu, 26 Sep 2019 17:25:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDI9nLQK23OK6luSDZ1mw90WLCI7U3YyjWyeqPEYuVirlFpIoPZ6yW58Djt6a6KadkpyGL X-Received: by 2002:a17:906:35c2:: with SMTP id p2mr5431011ejb.241.1569543923423; Thu, 26 Sep 2019 17:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569543923; cv=none; d=google.com; s=arc-20160816; b=xd/OB6ciOxIcvbdjbh/IqR5VteGYfiTMRaLZP3356R38VdXHsYFHPJRQVRY95lK7GD JD2iHU2T+A4VC46/c0rFRu2X7EP3uAMI/8XUz8le8rU4Vl3GQ/dQRVRsieAbcW1Vb+TU I6D1D00pHQNgUhF6IYw2fP3wZCr/UClAUQJtMdw+k5Y6yUyjG6BDR6RVU2HZ1hw0Wtpr TbwxGepFNBUMne5RnRIkYH/7fOr2GRWGBOueLEMUFQ5fR1Ia3fKcT9pQQs77/9R7PFMG DnYVOnQn9IT9YqCd254TSKfvUCx4MiHkSdA24O9/ncoIY7qlIuUDHfEAa3r2Nmlbo+oC zSyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=2eJmO98TJvWjef7NL2xv0z4jdHs/rDOAySInsQ51HYo=; b=SxfNbcmjZSvHpSTTyE8YBPvIqcUN0uKw26XBVc2mj3IPA+tjg/65Znh4w5ftMrKgmT UirWxn6EDNnpVEMiSY3iFaXTr5YyORdcF/5V5/KgTwL8NYDart/MLK2DfqZYzIMeFL6W c0f1lwBhv6VBsxIHm5xIo+OU+kV+SsYMR/4wxM0FW7rCTnUeheRLn+iBRjawO1s40P0T lAFHVEuEqkSMmxvTfYxQGHP0erTEgR0YuaLb9JlL4eCvmCSumfmy/Th5jmEXPz4xAnkM 2ogtNnDlceVwiIf3M2aejXuiAnlkBYcz+To+HJFYRxPAvAmBOWwBGsLl95z5fk90Krxt 5ntg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r2si1932925ejj.90.2019.09.26.17.25.22; Thu, 26 Sep 2019 17:25:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728110AbfI0AZR (ORCPT + 26 others); Thu, 26 Sep 2019 20:25:17 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:38700 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727862AbfI0AZI (ORCPT ); Thu, 26 Sep 2019 20:25:08 -0400 Received: by mail-oi1-f195.google.com with SMTP id m16so3747063oic.5; Thu, 26 Sep 2019 17:25:08 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=2eJmO98TJvWjef7NL2xv0z4jdHs/rDOAySInsQ51HYo=; b=qvhDAxBAoQbm3dv5rQzxbn/qYzKGe8M9Q8bRLb1NFqcCmGIreODiyDFEQhX9QBXu03 k8mnioCWIxWn3N1Hponxx0o49k3m1IPao1UKyYUYcmUkdGJG6oUsErr6jkg4DRTSDk+B YSy+hiPm2eqiuoF2QEbEE1KkAhixZKy1F1c17IH8/1Bz023JjY8lQlGqzME+PMUzxUqu 2ZkOXfhu1cRGDXMCwB116cyUuYcm358yoBv8vQp/OSBeqE/PTLcl6slgqWghwTaOjOSW bT3p2KGcxoscq01EMRp1Yzig/pS+Gc72JiOO0u38A9NQgBBcdd0n5UkiBc/j8hn7gq3x Qolg== X-Gm-Message-State: APjAAAWfW33ukipWuz5cmvm3nBsPPsoXjTYni3uUE7tnrUo+nnW/hDg6 8cwV4MwoyfhtI2iRk7Z8m+N3sOA= X-Received: by 2002:aca:4890:: with SMTP id v138mr5031090oia.57.1569543907590; Thu, 26 Sep 2019 17:25:07 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id j11sm339866otk.80.2019.09.26.17.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 17:25:07 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Robin Murphy , Florian Fainelli , Stefan Wahren , Frank Rowand , Arnd Bergmann , Marek Vasut , Geert Uytterhoeven , Simon Horman , Lorenzo Pieralisi , Oza Pawandeep Subject: [PATCH 07/11] of: address: Follow DMA parent for "dma-coherent" Date: Thu, 26 Sep 2019 19:24:51 -0500 Message-Id: <20190927002455.13169-8-robh@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190927002455.13169-1-robh@kernel.org> References: <20190927002455.13169-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Robin Murphy Much like for address translation, when checking for DMA coherence we should be sure to walk up the DMA hierarchy, rather than the MMIO one, now that we can accommodate them being different. Signed-off-by: Robin Murphy Signed-off-by: Rob Herring --- drivers/of/address.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/of/address.c b/drivers/of/address.c index e9188c82fdae..3fd34f7ad772 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -999,7 +999,7 @@ bool of_dma_is_coherent(struct device_node *np) of_node_put(node); return true; } - node = of_get_next_parent(node); + node = of_get_next_dma_parent(node); } of_node_put(node); return false;