Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1446917

[PATCH 2/3] drm/mediatek: Add probe-defer for MTK IOMMU and SMI

From Yong Wu <yong.wu@mediatek.com>
Newsgroups linux.kernel
Subject [PATCH 2/3] drm/mediatek: Add probe-defer for MTK IOMMU and SMI
Date 2016-07-20 05:10 +0200
Message-ID <rWQ3v-4jO-13@gated-at.bofh.it> (permalink)
References <rWQ3v-4jO-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


If DRM begin to probe before SMI probe done. It will hang:

[    7.832359] Call trace:
[    7.834778] [<ffffffc000764424>] mtk_smi_larb_get+0x24/0xa8
[    7.840300] [<ffffffc0005a1390>] 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 <yong.wu@mediatek.com>
---
 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 <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <drm/drmP.h>
+#include <soc/mediatek/smi.h>
 #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;
-- 
1.8.1.1.dirty

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] memory: mediatek: Add a new interface mtk_smi_larb_is_ready Yong Wu <yong.wu@mediatek.com> - 2016-07-20 05:10 +0200
  [PATCH 3/3] vcodec: mediatek: Add probe-defer for MTK IOMMU and SMI Yong Wu <yong.wu@mediatek.com> - 2016-07-20 05:10 +0200
  [PATCH 2/3] drm/mediatek: Add probe-defer for MTK IOMMU and SMI Yong Wu <yong.wu@mediatek.com> - 2016-07-20 05:10 +0200
  Re: [PATCH 1/3] memory: mediatek: Add a new interface  mtk_smi_larb_is_ready Matthias Brugger <matthias.bgg@gmail.com> - 2016-07-25 10:50 +0200

csiph-web