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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_RED, USER_AGENT_SANE_2 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 9A3E2C433E0 for ; Tue, 19 Jan 2021 09:20:32 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 E356E20867 for ; Tue, 19 Jan 2021 09:20:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E356E20867 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4E0DD203B4; Tue, 19 Jan 2021 09:20:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WbbPNHEYi10K; Tue, 19 Jan 2021 09:20:30 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 8058B20029; Tue, 19 Jan 2021 09:20:29 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5190CC088B; Tue, 19 Jan 2021 09:20:29 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id B0267C013A for ; Tue, 19 Jan 2021 09:20:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8881C86418 for ; Tue, 19 Jan 2021 09:20:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WiT9fL09zD4O for ; Tue, 19 Jan 2021 09:20:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mailgw02.mediatek.com (unknown [1.203.163.81]) by whitealder.osuosl.org (Postfix) with ESMTP id 8A76E863CC for ; Tue, 19 Jan 2021 09:20:23 +0000 (UTC) X-UUID: 6882229557a9407083bf28f726eeb973-20210119 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=giToPo/p/3LJytE3l2ogQIfAO4f4TZp/+5aQlKOr25k=; b=Q4PPqmPnYGluQfcENozOFI7ipi/dEF+cpBdSMBJRpT1MvfNM6GQPKN/LpzQwqRQW9w3OPLs3dV02NjDc2kgg1Or0dNjVE9qsA473HidhbMe2i2tS2nBnHwVhhu4oL+CGCUE+saC0SaOQMVgHN3iA8wl6Z4voPXz3JpLXjOfuUPI=; X-UUID: 6882229557a9407083bf28f726eeb973-20210119 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1959994727; Tue, 19 Jan 2021 17:20:15 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 19 Jan 2021 17:20:12 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 19 Jan 2021 17:20:11 +0800 Message-ID: <1611048011.14702.6.camel@mhfsdcap03> Subject: Re: [PATCH v6 06/33] of/device: Move dma_range_map before of_iommu_configure From: Yong Wu To: Robin Murphy , Paul Kocialkowski Date: Tue, 19 Jan 2021 17:20:11 +0800 In-Reply-To: <1853732d-0efd-171e-9e1f-7ee7ed72a98f@arm.com> References: <20210111111914.22211-1-yong.wu@mediatek.com> <20210111111914.22211-7-yong.wu@mediatek.com> <20210114192732.GA3401278@robh.at.kernel.org> <1610688626.4578.1.camel@mhfsdcap03> <1853732d-0efd-171e-9e1f-7ee7ed72a98f@arm.com> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 20BEF15089BCBF56838670AF738616419DD03D4DB65FFC4A7D6595AC154756AB2000:8 X-MTK: N Cc: youlin.pei@mediatek.com, Rob Herring , Nicolas Boichat , srv_heupstream@mediatek.com, devicetree@vger.kernel.org, Frank Rowand , linux-kernel@vger.kernel.org, Evan Green , chao.hao@mediatek.com, Tomasz Figa , iommu@lists.linux-foundation.org, linux-mediatek@lists.infradead.org, Krzysztof Kozlowski , Matthias Brugger , anan.sun@mediatek.com, Will Deacon , linux-arm-kernel@lists.infradead.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Mon, 2021-01-18 at 15:49 +0000, Robin Murphy wrote: > On 2021-01-15 05:30, Yong Wu wrote: > > On Thu, 2021-01-14 at 13:27 -0600, Rob Herring wrote: > >> On Mon, Jan 11, 2021 at 07:18:47PM +0800, Yong Wu wrote: > >>> "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; > >> > >> Not really going to matter, but you should probably clear dma_range_map > >> before what it points to is freed. > >> > >> With that, > >> > >> Reviewed-by: Rob Herring > > > > Thanks for the review. I will move it before "kfree(map)" in next > > version. > > Paul noticed that we already have a bug in assigning to this > unconditionally[1] - I'd totally forgotten about this series when I > theorised about IOMMU drivers wanting the information earlier, but > sweeping my inbox now only goes to show I was right to think of it :) > > We should really get something in as a fix independent of this series, > taking both angles into account. Thanks this info. Following your suggestion, Move this into the "if (! ret)". Then it is like this: --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -163,8 +163,10 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, dev->coherent_dma_mask &= mask; *dev->dma_mask &= mask; /* ...but only set bus limit if we found valid dma-ranges earlier */ - if (!ret) + if (!ret) { dev->bus_dma_limit = end; + dev->dma_range_map = map; + } coherent = of_dma_is_coherent(np); dev_dbg(dev, "device is%sdma coherent\n", @@ -172,6 +174,8 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, iommu = of_iommu_configure(dev, np, id); if (PTR_ERR(iommu) == -EPROBE_DEFER) { + if (!ret) + dev->dma_range_map = NULL; kfree(map); return -EPROBE_DEFER; } @@ -181,7 +185,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); If this is ok, I will send this as a independent patch. > > Robin. > > [1] > https://lore.kernel.org/linux-arm-kernel/5c7946f3-b56e-da00-a750-be097c7ceb32@arm.com/ > > >> > >>> 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 > >>> > > > > _______________________________________________ > > iommu mailing list > > iommu@lists.linux-foundation.org > > https://lists.linuxfoundation.org/mailman/listinfo/iommu > > _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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=-15.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_RED,USER_AGENT_SANE_2 autolearn=unavailable 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 CA4EAC433DB for ; Tue, 19 Jan 2021 09:20:50 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 4B48E20867 for ; Tue, 19 Jan 2021 09:20:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B48E20867 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.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:Date:To:From: Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ah/oIhkveuJPUSTNLm5gGrjrV2EjsLiAhGv/sJJ7/ok=; b=AMHrMxT+zM5KkRQGEarnYB5Hg fsfKGoA9S2JaRazXilZ1eHfm5Rs+wKa7bGa/lRA7YdbKq9aAN0RauO9J8OJGAKnUiUZOXhkJRjSxO WfljVeKz485aguFB4kBeKbI6wBxAQ50FJTel7QQO5rnkv/3iLfEj+x34NAFysxIRUapsf/JaPOcXN PvysuNhtkPQgi6NYfuR/HybaMMLO3EGNrbb43IhQpdl1BKO/TV4uAHmDxDFG3L/CD2hCS4PECk+ud 02DmZE34w1eeN6v2VaEw7uDTWxSKlz5rvtBRZGe1+nog1ak6/9odehYT9xuRnOcgsKt0d55Nr/Cib pePk8Js7g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1nBl-0007hF-ML; Tue, 19 Jan 2021 09:20:37 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1nBd-0007ek-QC; Tue, 19 Jan 2021 09:20:31 +0000 X-UUID: a7ef86c4cf2c4546aa24ae2ea1b62ef1-20210119 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=giToPo/p/3LJytE3l2ogQIfAO4f4TZp/+5aQlKOr25k=; b=Q4PPqmPnYGluQfcENozOFI7ipi/dEF+cpBdSMBJRpT1MvfNM6GQPKN/LpzQwqRQW9w3OPLs3dV02NjDc2kgg1Or0dNjVE9qsA473HidhbMe2i2tS2nBnHwVhhu4oL+CGCUE+saC0SaOQMVgHN3iA8wl6Z4voPXz3JpLXjOfuUPI=; X-UUID: a7ef86c4cf2c4546aa24ae2ea1b62ef1-20210119 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1655187712; Tue, 19 Jan 2021 01:20:17 -0800 Received: from MTKMBS31N1.mediatek.inc (172.27.4.69) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 19 Jan 2021 01:20:16 -0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 19 Jan 2021 17:20:12 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 19 Jan 2021 17:20:11 +0800 Message-ID: <1611048011.14702.6.camel@mhfsdcap03> Subject: Re: [PATCH v6 06/33] of/device: Move dma_range_map before of_iommu_configure From: Yong Wu To: Robin Murphy , Paul Kocialkowski Date: Tue, 19 Jan 2021 17:20:11 +0800 In-Reply-To: <1853732d-0efd-171e-9e1f-7ee7ed72a98f@arm.com> References: <20210111111914.22211-1-yong.wu@mediatek.com> <20210111111914.22211-7-yong.wu@mediatek.com> <20210114192732.GA3401278@robh.at.kernel.org> <1610688626.4578.1.camel@mhfsdcap03> <1853732d-0efd-171e-9e1f-7ee7ed72a98f@arm.com> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 20BEF15089BCBF56838670AF738616419DD03D4DB65FFC4A7D6595AC154756AB2000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210119_042030_047812_0FCA47D4 X-CRM114-Status: GOOD ( 27.09 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: youlin.pei@mediatek.com, Rob Herring , Nicolas Boichat , srv_heupstream@mediatek.com, devicetree@vger.kernel.org, Frank Rowand , linux-kernel@vger.kernel.org, Evan Green , chao.hao@mediatek.com, Tomasz Figa , iommu@lists.linux-foundation.org, linux-mediatek@lists.infradead.org, Krzysztof Kozlowski , Matthias Brugger , anan.sun@mediatek.com, Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Mon, 2021-01-18 at 15:49 +0000, Robin Murphy wrote: > On 2021-01-15 05:30, Yong Wu wrote: > > On Thu, 2021-01-14 at 13:27 -0600, Rob Herring wrote: > >> On Mon, Jan 11, 2021 at 07:18:47PM +0800, Yong Wu wrote: > >>> "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; > >> > >> Not really going to matter, but you should probably clear dma_range_map > >> before what it points to is freed. > >> > >> With that, > >> > >> Reviewed-by: Rob Herring > > > > Thanks for the review. I will move it before "kfree(map)" in next > > version. > > Paul noticed that we already have a bug in assigning to this > unconditionally[1] - I'd totally forgotten about this series when I > theorised about IOMMU drivers wanting the information earlier, but > sweeping my inbox now only goes to show I was right to think of it :) > > We should really get something in as a fix independent of this series, > taking both angles into account. Thanks this info. Following your suggestion, Move this into the "if (! ret)". Then it is like this: --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -163,8 +163,10 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, dev->coherent_dma_mask &= mask; *dev->dma_mask &= mask; /* ...but only set bus limit if we found valid dma-ranges earlier */ - if (!ret) + if (!ret) { dev->bus_dma_limit = end; + dev->dma_range_map = map; + } coherent = of_dma_is_coherent(np); dev_dbg(dev, "device is%sdma coherent\n", @@ -172,6 +174,8 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, iommu = of_iommu_configure(dev, np, id); if (PTR_ERR(iommu) == -EPROBE_DEFER) { + if (!ret) + dev->dma_range_map = NULL; kfree(map); return -EPROBE_DEFER; } @@ -181,7 +185,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); If this is ok, I will send this as a independent patch. > > Robin. > > [1] > https://lore.kernel.org/linux-arm-kernel/5c7946f3-b56e-da00-a750-be097c7ceb32@arm.com/ > > >> > >>> 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 > >>> > > > > _______________________________________________ > > iommu mailing list > > iommu@lists.linux-foundation.org > > https://lists.linuxfoundation.org/mailman/listinfo/iommu > > _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek 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=-15.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_RED,USER_AGENT_SANE_2 autolearn=unavailable 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 2D347C433E0 for ; Tue, 19 Jan 2021 09:21:58 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 B7DCC20867 for ; Tue, 19 Jan 2021 09:21:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7DCC20867 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.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:Date:To:From: Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=F+MZFhqmQaUyQ6LAvR8pgVvljBciBuS0/q9kQ3IudXs=; b=QGvnFZHcnwk3qIJh8ARbxupxB XisK2QMZbvWZq0lL6O9lUm8cENYfuzcM5xTMMbMZQaRbroHkdEFm3W54NVi47z6qrCKEN+swIIhx3 R1EZiJlefRXqafuAN4ON3pF/rP4MpSVmzBZuSd2QQuj5yxSjucfN1sUSd1MehlXm4zPJlGzsK2iE8 GJMiK2kIGf0/lp6ph39F8UmPRyV5uJHKM4qm5VzJUiN6vmKMzno24sizzikSEjgHairZ5va39qMTp MRqhYVftd1u2QSYTfT4NZL5OodSRD1l7rGtOcu8+MECO+6AIfD5B2zamkNLtaIHitlLUqa+HewSHk 8iNv6Zzsw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1nBk-0007gw-51; Tue, 19 Jan 2021 09:20:36 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1nBd-0007ek-QC; Tue, 19 Jan 2021 09:20:31 +0000 X-UUID: a7ef86c4cf2c4546aa24ae2ea1b62ef1-20210119 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=giToPo/p/3LJytE3l2ogQIfAO4f4TZp/+5aQlKOr25k=; b=Q4PPqmPnYGluQfcENozOFI7ipi/dEF+cpBdSMBJRpT1MvfNM6GQPKN/LpzQwqRQW9w3OPLs3dV02NjDc2kgg1Or0dNjVE9qsA473HidhbMe2i2tS2nBnHwVhhu4oL+CGCUE+saC0SaOQMVgHN3iA8wl6Z4voPXz3JpLXjOfuUPI=; X-UUID: a7ef86c4cf2c4546aa24ae2ea1b62ef1-20210119 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1655187712; Tue, 19 Jan 2021 01:20:17 -0800 Received: from MTKMBS31N1.mediatek.inc (172.27.4.69) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 19 Jan 2021 01:20:16 -0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 19 Jan 2021 17:20:12 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 19 Jan 2021 17:20:11 +0800 Message-ID: <1611048011.14702.6.camel@mhfsdcap03> Subject: Re: [PATCH v6 06/33] of/device: Move dma_range_map before of_iommu_configure From: Yong Wu To: Robin Murphy , Paul Kocialkowski Date: Tue, 19 Jan 2021 17:20:11 +0800 In-Reply-To: <1853732d-0efd-171e-9e1f-7ee7ed72a98f@arm.com> References: <20210111111914.22211-1-yong.wu@mediatek.com> <20210111111914.22211-7-yong.wu@mediatek.com> <20210114192732.GA3401278@robh.at.kernel.org> <1610688626.4578.1.camel@mhfsdcap03> <1853732d-0efd-171e-9e1f-7ee7ed72a98f@arm.com> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 20BEF15089BCBF56838670AF738616419DD03D4DB65FFC4A7D6595AC154756AB2000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210119_042030_047812_0FCA47D4 X-CRM114-Status: GOOD ( 27.09 ) 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: youlin.pei@mediatek.com, Nicolas Boichat , srv_heupstream@mediatek.com, devicetree@vger.kernel.org, Frank Rowand , linux-kernel@vger.kernel.org, Evan Green , chao.hao@mediatek.com, Tomasz Figa , iommu@lists.linux-foundation.org, linux-mediatek@lists.infradead.org, Krzysztof Kozlowski , Matthias Brugger , anan.sun@mediatek.com, Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 2021-01-18 at 15:49 +0000, Robin Murphy wrote: > On 2021-01-15 05:30, Yong Wu wrote: > > On Thu, 2021-01-14 at 13:27 -0600, Rob Herring wrote: > >> On Mon, Jan 11, 2021 at 07:18:47PM +0800, Yong Wu wrote: > >>> "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; > >> > >> Not really going to matter, but you should probably clear dma_range_map > >> before what it points to is freed. > >> > >> With that, > >> > >> Reviewed-by: Rob Herring > > > > Thanks for the review. I will move it before "kfree(map)" in next > > version. > > Paul noticed that we already have a bug in assigning to this > unconditionally[1] - I'd totally forgotten about this series when I > theorised about IOMMU drivers wanting the information earlier, but > sweeping my inbox now only goes to show I was right to think of it :) > > We should really get something in as a fix independent of this series, > taking both angles into account. Thanks this info. Following your suggestion, Move this into the "if (! ret)". Then it is like this: --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -163,8 +163,10 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, dev->coherent_dma_mask &= mask; *dev->dma_mask &= mask; /* ...but only set bus limit if we found valid dma-ranges earlier */ - if (!ret) + if (!ret) { dev->bus_dma_limit = end; + dev->dma_range_map = map; + } coherent = of_dma_is_coherent(np); dev_dbg(dev, "device is%sdma coherent\n", @@ -172,6 +174,8 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, iommu = of_iommu_configure(dev, np, id); if (PTR_ERR(iommu) == -EPROBE_DEFER) { + if (!ret) + dev->dma_range_map = NULL; kfree(map); return -EPROBE_DEFER; } @@ -181,7 +185,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); If this is ok, I will send this as a independent patch. > > Robin. > > [1] > https://lore.kernel.org/linux-arm-kernel/5c7946f3-b56e-da00-a750-be097c7ceb32@arm.com/ > > >> > >>> 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 > >>> > > > > _______________________________________________ > > iommu mailing list > > iommu@lists.linux-foundation.org > > https://lists.linuxfoundation.org/mailman/listinfo/iommu > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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=-17.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_RED,USER_AGENT_SANE_2 autolearn=unavailable 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 D4DD9C4332E for ; Tue, 19 Jan 2021 11:39:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AEFD122DD3 for ; Tue, 19 Jan 2021 11:39:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389394AbhASLaX (ORCPT ); Tue, 19 Jan 2021 06:30:23 -0500 Received: from mailgw02.mediatek.com ([1.203.163.81]:49137 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1732408AbhASJVO (ORCPT ); Tue, 19 Jan 2021 04:21:14 -0500 X-UUID: 6882229557a9407083bf28f726eeb973-20210119 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=giToPo/p/3LJytE3l2ogQIfAO4f4TZp/+5aQlKOr25k=; b=Q4PPqmPnYGluQfcENozOFI7ipi/dEF+cpBdSMBJRpT1MvfNM6GQPKN/LpzQwqRQW9w3OPLs3dV02NjDc2kgg1Or0dNjVE9qsA473HidhbMe2i2tS2nBnHwVhhu4oL+CGCUE+saC0SaOQMVgHN3iA8wl6Z4voPXz3JpLXjOfuUPI=; X-UUID: 6882229557a9407083bf28f726eeb973-20210119 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1959994727; Tue, 19 Jan 2021 17:20:15 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 19 Jan 2021 17:20:12 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 19 Jan 2021 17:20:11 +0800 Message-ID: <1611048011.14702.6.camel@mhfsdcap03> Subject: Re: [PATCH v6 06/33] of/device: Move dma_range_map before of_iommu_configure From: Yong Wu To: Robin Murphy , Paul Kocialkowski CC: Rob Herring , , , Nicolas Boichat , , , Will Deacon , Frank Rowand , , Evan Green , "Tomasz Figa" , , , Krzysztof Kozlowski , Matthias Brugger , , Date: Tue, 19 Jan 2021 17:20:11 +0800 In-Reply-To: <1853732d-0efd-171e-9e1f-7ee7ed72a98f@arm.com> References: <20210111111914.22211-1-yong.wu@mediatek.com> <20210111111914.22211-7-yong.wu@mediatek.com> <20210114192732.GA3401278@robh.at.kernel.org> <1610688626.4578.1.camel@mhfsdcap03> <1853732d-0efd-171e-9e1f-7ee7ed72a98f@arm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 20BEF15089BCBF56838670AF738616419DD03D4DB65FFC4A7D6595AC154756AB2000:8 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org T24gTW9uLCAyMDIxLTAxLTE4IGF0IDE1OjQ5ICswMDAwLCBSb2JpbiBNdXJwaHkgd3JvdGU6DQo+ IE9uIDIwMjEtMDEtMTUgMDU6MzAsIFlvbmcgV3Ugd3JvdGU6DQo+ID4gT24gVGh1LCAyMDIxLTAx LTE0IGF0IDEzOjI3IC0wNjAwLCBSb2IgSGVycmluZyB3cm90ZToNCj4gPj4gT24gTW9uLCBKYW4g MTEsIDIwMjEgYXQgMDc6MTg6NDdQTSArMDgwMCwgWW9uZyBXdSB3cm90ZToNCj4gPj4+ICJkZXYt PmRtYV9yYW5nZV9tYXAiIGNvbnRhaW5zIHRoZSBkZXZpY2VzJyBkbWFfcmFuZ2VzIGluZm9ybWF0 aW9uLA0KPiA+Pj4gVGhpcyBwYXRjaCBtb3ZlcyBkbWFfcmFuZ2VfbWFwIGJlZm9yZSBvZl9pb21t dV9jb25maWd1cmUuIFRoZSBpb21tdQ0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