Message ID | 20210410091128.31823-3-yong.wu@mediatek.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=+aVJ=JH=lists.infradead.org=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@kernel.org> 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=-16.8 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, 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 32ADDC433ED for <linux-mediatek@archiver.kernel.org>; Sat, 10 Apr 2021 09:12:51 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 D07CD61165 for <linux-mediatek@archiver.kernel.org>; Sat, 10 Apr 2021 09:12:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D07CD61165 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=te4XL4EIRuFH3J0tYBa/cbyYn5VqVCsVbQqeotGlq2o=; b=MTC6QwJzADPtTK2hzW8hxuinZ L1Gcw0CdJRoozQ69JDAmMajAAHVMH0hbBJ9WW5a9seREvbA3XtaYfMDjkreZatfgZQK9WGNFlAqtv UId9x7R0UtUkKsK4LZ79coN53Y/Ur90wkXSgSzhaR98M2Qp3UEEiao4tXijJQ1jfFQ4Uvb/JQ/qVE WzUVlp0L/tgFqF44+uEW1R+hBEek6sPTNAFiz2d/YHnJRpohCA1T5eMq1hTcCbO0ertSgHSmBxXUx 0ubm9gie0X2+C+E4Uyer7b8tuk6+AlBSSwf67TkbdIUchQbsQ8CU8ocQM+O2u9o99EgHQ8lZ1HbUD 0rJpe6gVg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lV9fS-002UjF-Bk; Sat, 10 Apr 2021 09:12:38 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lV9f9-002UfV-BM; Sat, 10 Apr 2021 09:12:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=qaH47nyMzzG1QTuecXrM3ezYDjF5g/yb7z4e2GR1bhs=; b=fpXYiqZdin0USlatsEjQbYBcLs dvcmfAFTrUAs2CGmtxH9xEx3x6OUBmpdyrrmq5o3ApG3fuaymHxkKQFlNEc/lZJLefcchTgzYlGBY grZf+GP5VJmloNWTv+dCYrBrLYqek5A3jhvDONgOL8i5hfZNxmp8oBplo2a9zrrLUeV7zgG8FKaAZ PdFCRnhnRFPq9nOaLGOQMAjrGbCf+XAU85R/Z8XkDzkZlh4NjI5f7eo6zP278uVIPyCik5vC0Rbov QoatnLtTPLqr2nU91e/D0DgBysG5h+Jz3GN6MSl59kvu38f5Tbet6IRgEHXbpJw2vra+8CXgxLli4 UQz8PlZg==; Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lV9f6-0050FQ-Nz; Sat, 10 Apr 2021 09:12:18 +0000 X-UUID: 3c3a29d78c9b432aae0691ddc1a1f785-20210410 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=qaH47nyMzzG1QTuecXrM3ezYDjF5g/yb7z4e2GR1bhs=; b=UcZsftW8/wFJN+z+aAs3p9spYkCBwh4PtHipdU8P+A3A7ulkv2dUICFEokMlbHzw/LqT0Lutr2ZO3abBTauUqbjcp1arx9gHQ3U9/kTMmhGr5hRgOz71ByA53xxln4dhif+12Sq27trZgYMyxP8Bvd3kXPCjJYImik1TfZim1ds=; X-UUID: 3c3a29d78c9b432aae0691ddc1a1f785-20210410 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from <yong.wu@mediatek.com>) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 908168846; Sat, 10 Apr 2021 02:12:14 -0700 Received: from mtkmbs07n1.mediatek.inc (172.21.101.16) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 10 Apr 2021 02:12:12 -0700 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 10 Apr 2021 17:12:11 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 10 Apr 2021 17:12:04 +0800 From: Yong Wu <yong.wu@mediatek.com> To: Matthias Brugger <matthias.bgg@gmail.com>, Joerg Roedel <joro@8bytes.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzk@kernel.org> CC: Evan Green <evgreen@chromium.org>, Robin Murphy <robin.murphy@arm.com>, Tomasz Figa <tfiga@chromium.org>, Will Deacon <will.deacon@arm.com>, <linux-mediatek@lists.infradead.org>, <srv_heupstream@mediatek.com>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <iommu@lists.linux-foundation.org>, <yong.wu@mediatek.com>, <youlin.pei@mediatek.com>, Nicolas Boichat <drinkcat@chromium.org>, Matthias Kaehlcke <mka@chromium.org>, <anan.sun@mediatek.com>, <chao.hao@mediatek.com>, <ming-fan.chen@mediatek.com>, <yi.kuo@mediatek.com>, <eizan@chromium.org>, <acourbot@chromium.org> Subject: [PATCH v5 02/16] iommu/mediatek: Add probe_defer for smi-larb Date: Sat, 10 Apr 2021 17:11:14 +0800 Message-ID: <20210410091128.31823-3-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210410091128.31823-1-yong.wu@mediatek.com> References: <20210410091128.31823-1-yong.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210410_021216_803502_29BA0A92 X-CRM114-Status: GOOD ( 17.44 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-mediatek.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-mediatek>, <mailto:linux-mediatek-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-mediatek/> List-Post: <mailto:linux-mediatek@lists.infradead.org> List-Help: <mailto:linux-mediatek-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mediatek>, <mailto:linux-mediatek-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" <linux-mediatek-bounces@lists.infradead.org> Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org |
Series |
Clean up "mediatek,larb"
|
expand
|
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 6ecc007f07cd..7a7b8260d308 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -862,7 +862,7 @@ static int mtk_iommu_probe(struct platform_device *pdev) id = i; plarbdev = of_find_device_by_node(larbnode); - if (!plarbdev) { + if (!plarbdev || !plarbdev->dev.driver) { of_node_put(larbnode); return -EPROBE_DEFER; } diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index 82ddfe9170d4..a82466e4046e 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -597,7 +597,7 @@ static int mtk_iommu_probe(struct platform_device *pdev) plarbdev = of_platform_device_create( larb_spec.np, NULL, platform_bus_type.dev_root); - if (!plarbdev) { + if (!plarbdev || !plarbdev->dev.driver) { of_node_put(larb_spec.np); return -EPROBE_DEFER; }
The iommu consumer should use device_link to connect with the smi-larb(supplier). then the smi-larb should run before the iommu consumer. Here we delay the iommu driver until the smi driver is ready, then all the iommu consumer always is after the smi driver. When there is no this patch, if some consumer drivers run before smi-larb, the supplier link_status is DL_DEV_NO_DRIVER(0) in the device_link_add, then device_links_driver_bound will use WARN_ON to complain that the link_status of supplier is not right. This is a preparing patch for adding device_link. Signed-off-by: Yong Wu <yong.wu@mediatek.com> --- To Matthias, In v2, You suggested use device_is_bound here. But from [1], this interface is not allowed to be EXPORT. It will affect this driver built as module. thus I still use dev.driver to check here. [1] https://lore.kernel.org/patchwork/patch/1334670/ --- drivers/iommu/mtk_iommu.c | 2 +- drivers/iommu/mtk_iommu_v1.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)