From patchwork Wed Jul 20 03:02:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?WW9uZyBXdSAo5ZC05YuHKQ==?= X-Patchwork-Id: 9238713 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0D089602F0 for ; Wed, 20 Jul 2016 03:04:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0029326E81 for ; Wed, 20 Jul 2016 03:04:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E867F26B4A; Wed, 20 Jul 2016 03:04:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 77AA226B4A for ; Wed, 20 Jul 2016 03:04:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bPhmj-0004ZL-9w; Wed, 20 Jul 2016 03:02:57 +0000 Received: from [210.61.82.183] (helo=mailgw01.mediatek.com) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bPhmW-0004P1-75; Wed, 20 Jul 2016 03:02:45 +0000 Received: from mtkhts09.mediatek.inc [(172.21.101.70)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1233169539; Wed, 20 Jul 2016 11:02:22 +0800 Received: from mhfsdcap03.mhfswrd (10.17.3.153) by mtkhts09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 14.3.266.1; Wed, 20 Jul 2016 11:02:21 +0800 From: Yong Wu To: Matthias Brugger , David Airlie , Philipp Zabel , Hans Verkuil Subject: [PATCH 2/3] drm/mediatek: Add probe-defer for MTK IOMMU and SMI Date: Wed, 20 Jul 2016 11:02:00 +0800 Message-ID: <1468983721-3627-2-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1468983721-3627-1-git-send-email-yong.wu@mediatek.com> References: <1468983721-3627-1-git-send-email-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-20160719_200244_658334_0264DA54 X-CRM114-Status: GOOD ( 10.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: youlin.pei@mediatek.com, srv_heupstream@mediatek.com, Arnd Bergmann , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, CK Hu , Tomasz Figa , Daniel Kurtz , Yong Wu , Bibby Hsieh , Honghui Zhang , YT Shen , linux-mediatek@lists.infradead.org, Tiffany Lin , linux-arm-kernel@lists.infradead.org, Lucas Stach Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP If DRM begin to probe before SMI probe done. It will hang: [ 7.832359] Call trace: [ 7.834778] [] mtk_smi_larb_get+0x24/0xa8 [ 7.840300] [] mtk_drm_crtc_enable+0x6c/0x450 Use the new interface(mtk_smi_larb_is_ready) to wait for IOMMU and SMI probe done. Signed-off-by: Yong Wu --- drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c index 3970fcf..3ef3124 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "mtk_drm_drv.h" #include "mtk_drm_plane.h" #include "mtk_drm_ddp_comp.h" @@ -201,6 +202,10 @@ int mtk_ddp_comp_init(struct device *dev, struct device_node *node, } of_node_put(larb_node); + /* Wait until MTK IOMMU and SMI probe done.*/ + if (!mtk_smi_larb_is_ready(&larb_pdev->dev)) + return -EPROBE_DEFER; + comp->larb_dev = &larb_pdev->dev; return 0;