From patchwork Fri Sep 27 00:24:54 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: 174561 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2787588ill; Thu, 26 Sep 2019 17:25:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOw7+KJE9kkbo1xx22sGUpD9LoxjAOUkLoB+M0kY94+g/v+EknzHjVDN7pHaGx46XFvGlx X-Received: by 2002:a50:9f42:: with SMTP id b60mr1754686edf.192.1569543921728; Thu, 26 Sep 2019 17:25:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569543921; cv=none; d=google.com; s=arc-20160816; b=KrJJO/9IQhckr5nYLhDw0/mj2zRqOb3TOpom3ZLcZ51mcnK6ixs0sDDDfhi095nEUf nDk3Ovm8Nn2PRl1ZCcaXVR+tj52YDARmfz+pJgp4+12b8XUfVAHMsH6JpPRg5lZMahLh 4qykO8/GmZXtMaRq266Hi52U3LqGEL2eo4I9m4p3PTRgeeRFSHfNMZv92gI9Z0oa+JGH OnYNrZ2rw+IQXDZCUhXgmIF/U/q3q9BYHX92XiKkzanMICKXEs3mB0FPgG7zqwuZk0Dx daPxKK0UX79eUC0nTZNkD5CQDblmNK6eriYbtQCDduBPswPknmw8YTo98CVgw26Bk0YN sQ2g== 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=JSIM/mVNAQUFTI8poYL0tbeVsabT6n06A8LUKfKixqE=; b=YDk5UcGTgEnbAOwSe9ZAcDge76dCHyrDP2wKHJvAIU7sO+tjMjyGKHtIAmiXQS2S6G fm2JHkjaVdouCIyWA2G/pFDtLEH7A1KBNnqrRyBZw74xpGVij+WUwfVhjBy4e/p+EI0i KS1a68AhwW/FfsvsMUtB6zq8RxdmTGc8pZESMUC1vmSFwHwselCSY0A6MzirLaccZ8VR siOExdt957Gsyba2++73nXjBvjE8p1zrWoyKTl/sDLBkq+atrPkkcDaX39sP648yuVae V84uJDv3r0djXV4Q192b2sKmRT7lU7XObIVeH8ANNgIdtVcngoImJRjhhDwfnkl2Zsw7 2whw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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.21; Thu, 26 Sep 2019 17:25:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 S1728078AbfI0AZP (ORCPT + 8 others); Thu, 26 Sep 2019 20:25:15 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:45140 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727999AbfI0AZO (ORCPT ); Thu, 26 Sep 2019 20:25:14 -0400 Received: by mail-ot1-f68.google.com with SMTP id 41so745907oti.12; 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=UwbwatXpaojKG2T+EF0sCiKPxLZzbRNJCRU/1l4Hdor8K7puYEzz/EjhB7MA6hB/Vb ReCpYSa12FvcLXDltZ458bNPHiGhEJ60H7BzzDWz7/VbBISP0kKMDqtaHQDL+CYjSnEx CfG1OhLDFNtj0XErLDT8KuDFudbktd1zwRaDwS7TwRsaJKMaVxXlgBFdCCQ+gFUwxUIX a2EcA1dMw8jmt8OkSkfgzLGNfUfyiidQRMFzXg7aCORwIRV5ynfL1byMsDfSLwbgffJg PrZqSH7tRcNwks6UQx+iWY6mmluHTHmJH3dsilME2nj3vR+wx56WlNOuSMP8eHRpNux/ sE0g== X-Gm-Message-State: APjAAAUy1TlVx2uo3KNBAj+rUIhzBoC3oIn7MeXs57P+5B3928O1fBYU /kG3dRY49RfZzU4+92MeJMfS6Xs= 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 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 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 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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(-) -- 2.20.1 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; }