From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 372BBC4360C for ; Fri, 27 Sep 2019 00:27:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A93C20835 for ; Fri, 27 Sep 2019 00:27:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bJYLKInf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A93C20835 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=m/BNuD9cUmYm3hrX/NF9YrB2B+QvCvt/owzz0SpiQj0=; b=bJYLKInfTfQLBD ivlACJ2+Wjr6k3LNF5VWU5jeUPaSsWiMjpJ3bDlKuhowqJxIUdxrH1kNL3Uz9Mw9dJXzw1/Q4eVZw uuFc2cJoFLfjyERynHsL1tNSWBbsQ/yBGiXY4RyWWVt6mDdeMZa6jS+u27WuQrZ+vN0qB1AcaVyLe oBzk+TkdEl7/4EEgqfYgzXzMWEmSGe4bjDgxCrW+K72InELwIB+Lm7OoATCbgXUxWMobs/oyGVCBH lO8PSxzzLudkgBA4WwZgB8c3zjSK0pDA8Xq3G9PLnVCVxiAXi+aWKPGGw0Ilyl6RlGX6fkMratgEE DF32eP7HIiQ5IbaOW5Iw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iDe6o-0007WL-F6; Fri, 27 Sep 2019 00:27:42 +0000 Received: from mail-ot1-f65.google.com ([209.85.210.65]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iDe4O-00058w-IL for linux-arm-kernel@lists.infradead.org; Fri, 27 Sep 2019 00:25:14 +0000 Received: by mail-ot1-f65.google.com with SMTP id s22so777179otr.6 for ; Thu, 26 Sep 2019 17:25:12 -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=JSIM/mVNAQUFTI8poYL0tbeVsabT6n06A8LUKfKixqE=; b=bsnUgHRBMdrBuXxmkcpIw9TCZ7+ZkPqRoQcZ8y+62OyIf6xHwycIlidxu4cloUOCjt KkjGpJM7aL0nFYZkDJU0LaUxeffY2q/iyLItzSgxjU1j7QaFFkcT5dyHvd2tLLkZmUTW Mkn3PYOVD6i7oIAmeYWZk9npKGGvC2TvpQOl6Q7woQhfcGZGPGfVs44XqLVz8E+i8w8J sX8/lgo7QIF+MGOlSH3B46SLe9jD8z+fnAFJnvHkUzlS4XUsUZWHS3NNTaqfl8N6VSp0 qweyYfUOFEG/OcfG9sMhvwj6bb3i6qkzJNROHyDnqBtJjQ0kIz95hcADXGpnCJl/exU4 CKvQ== X-Gm-Message-State: APjAAAWcCf2xq0HUmvQGnVDouhKD0NYB8Qf1smi7uPwwYab888pFvuZw g9JUl+s1e9IHwWlnygwxvQ== X-Google-Smtp-Source: APXvYqz+gt7zD0g7DVclnrzC6AFnTepOJfcgHAqg8BRkcLS/bgxsfuL2h2LiMFlwEq9ILoaJHvmz+w== X-Received: by 2002:a9d:6d0a:: with SMTP id o10mr991391otp.221.1569543911563; Thu, 26 Sep 2019 17:25:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 17:25:11 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/11] of/address: Translate 'dma-ranges' for parent nodes missing 'dma-ranges' Date: Thu, 26 Sep 2019 19:24:54 -0500 Message-Id: <20190927002455.13169-11-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190926_172512_765015_0994F990 X-CRM114-Status: GOOD ( 13.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Fainelli , Arnd Bergmann , Frank Rowand , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Marek Vasut , Lorenzo Pieralisi , Oza Pawandeep , Stefan Wahren , Simon Horman , Geert Uytterhoeven , Robin Murphy , Nicolas Saenz Julienne Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 'dma-ranges' frequently exists without parent nodes having 'dma-ranges'. While this is an error for 'ranges', this is fine because DMA capable devices always have a translatable DMA address. Also, with no 'dma-ranges' at all, the assumption is that DMA addresses are 1:1 with no restrictions unless perhaps the device itself has implicit restrictions. Cc: Robin Murphy Signed-off-by: Rob Herring --- drivers/of/address.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/of/address.c b/drivers/of/address.c index e918001c7798..5b835d332709 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -519,9 +519,13 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus, * * As far as we know, this damage only exists on Apple machines, so * This code is only enabled on powerpc. --gcl + * + * This quirk also applies for 'dma-ranges' which frequently exist in + * child nodes without 'dma-ranges' in the parent nodes. --RobH */ ranges = of_get_property(parent, rprop, &rlen); - if (ranges == NULL && !of_empty_ranges_quirk(parent)) { + if (ranges == NULL && !of_empty_ranges_quirk(parent) && + strcmp(rprop, "dma-ranges")) { pr_debug("no ranges; cannot translate\n"); return 1; } -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel