Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2187734pxb; Mon, 11 Jan 2021 03:23:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxg6CeUjj7LVP1wD+PbsjyqycXIENSZwQaVv4o//ae8WmnI2s20p+5kkTdR7uRJLd60k3Xo X-Received: by 2002:a50:b5c5:: with SMTP id a63mr13928441ede.227.1610364236473; Mon, 11 Jan 2021 03:23:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610364236; cv=none; d=google.com; s=arc-20160816; b=ee7nGn8IrWj6DUQGjlCHBPyrZ3gkw1iF9qH3wptRFdC2jSTDgIgmO8wTB9CBe+kpnY 8XpvPqiorFo90UnIaxzDwrdPMRcMY+NW7TfUp3s2QPX86aN+Vd38aXokGYrRUuf2dw3v PAEKsx91HwdvIwFuu0ApKDKilq3j2S241CtBqgsB0Mn/oFlTduM8Cmxh1YGxTEs8/Wu+ BnbjIrQTVGFqcYltqO+WE2vyQjgIdlz1tAW8kr783uXyvmPb4gx/QHUBngqy3f2CC7gF HxJd/NV2nb1FMrnbhGCSMZZeDp/IrhDnhoomRtfOqX9lklSA2b9YD8nZl/wea583v6qv 7SyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=lNA7XwyaYc2XGULYFw4x41uyXpx3fp/IpT7xciFkBLs=; b=ysASO7rVe7DIu94L/cXWRyhrVjCin0XN7wNTL6wHQh9RvB132FFysalTUf21mhKRGD QW9Lve6rdgc6VA8Tyxru+57A+8KfX0MEKOQuqM8QElmzQadSUciQuZtUt5XbdkdPP7HR orctYClrzEo0XBGQztidceqOBc6BBvr0zkFfAhRiTTvfrjx2pp1hoPOVodOwghZGk54b WT4nx3Uer3sHHb+t3RJmjkopmW101qPJlCDGC2xDb7w1TMGtzLb8/6Skl6Ek9clQSMAY V0KHFtuuvZKJe5Q7YbRci+qjGnRDcaQ/8uY4eCU+RAj4UeB9q6eeCL157n8nfpyyCW7O XTJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m3si6426921ejn.166.2021.01.11.03.23.32; Mon, 11 Jan 2021 03:23:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729705AbhAKLVS (ORCPT + 99 others); Mon, 11 Jan 2021 06:21:18 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:44470 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726753AbhAKLVR (ORCPT ); Mon, 11 Jan 2021 06:21:17 -0500 X-UUID: 4fdcbdf3c18c43f0939b23679b1d26ce-20210111 X-UUID: 4fdcbdf3c18c43f0939b23679b1d26ce-20210111 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2051502511; Mon, 11 Jan 2021 19:20:32 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 11 Jan 2021 19:20:30 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 11 Jan 2021 19:20:30 +0800 From: Yong Wu To: Joerg Roedel , Rob Herring , Matthias Brugger , Will Deacon , Robin Murphy CC: Krzysztof Kozlowski , Evan Green , Tomasz Figa , , , , , , , , , Nicolas Boichat , , , Frank Rowand Subject: [PATCH v6 06/33] of/device: Move dma_range_map before of_iommu_configure Date: Mon, 11 Jan 2021 19:18:47 +0800 Message-ID: <20210111111914.22211-7-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210111111914.22211-1-yong.wu@mediatek.com> References: <20210111111914.22211-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "dev->dma_range_map" contains the devices' dma_ranges information, This patch moves dma_range_map before of_iommu_configure. The iommu driver may need to know the dma_address requirements of its iommu consumer devices. CC: Rob Herring CC: Frank Rowand Signed-off-by: Yong Wu --- drivers/of/device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/of/device.c b/drivers/of/device.c index aedfaaafd3e7..1d84636149df 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -170,9 +170,11 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, dev_dbg(dev, "device is%sdma coherent\n", coherent ? " " : " not "); + dev->dma_range_map = map; iommu = of_iommu_configure(dev, np, id); if (PTR_ERR(iommu) == -EPROBE_DEFER) { kfree(map); + dev->dma_range_map = NULL; return -EPROBE_DEFER; } @@ -181,7 +183,6 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, arch_setup_dma_ops(dev, dma_start, size, iommu, coherent); - dev->dma_range_map = map; return 0; } EXPORT_SYMBOL_GPL(of_dma_configure_id); -- 2.18.0