From: Yong Wu <yong.wu@mediatek.com>
To: Matthias Brugger <matthias.bgg@gmail.com>,
David Airlie <airlied@linux.ie>,
Philipp Zabel <p.zabel@pengutronix.de>,
Hans Verkuil <hans.verkuil@cisco.com>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
Tiffany Lin <tiffany.lin@mediatek.com>,
Honghui Zhang <honghui.zhang@mediatek.com>,
Bibby Hsieh <bibby.hsieh@mediatek.com>,
YT Shen <yt.shen@mediatek.com>, CK Hu <ck.hu@mediatek.com>,
Daniel Kurtz <djkurtz@google.com>, Tomasz Figa <tfiga@google.com>,
Arnd Bergmann <arnd@arndb.de>,
Lucas Stach <l.stach@pengutronix.de>, <youlin.pei@mediatek.com>,
<linux-mediatek@lists.infradead.org>,
<srv_heupstream@mediatek.com>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<iommu@lists.linux-foundation.org>,
Yong Wu <yong.wu@mediatek.com>
Subject: [PATCH 2/3] drm/mediatek: Add probe-defer for MTK IOMMU and SMI
Date: Wed, 20 Jul 2016 11:02:00 +0800 [thread overview]
Message-ID: <1468983721-3627-2-git-send-email-yong.wu@mediatek.com> (raw)
In-Reply-To: <1468983721-3627-1-git-send-email-yong.wu@mediatek.com>
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
next prev parent reply other threads:[~2016-07-20 3:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-20 3:01 [PATCH 1/3] memory: mediatek: Add a new interface mtk_smi_larb_is_ready Yong Wu
2016-07-20 3:02 ` Yong Wu [this message]
2016-07-20 3:02 ` [PATCH 3/3] vcodec: mediatek: Add probe-defer for MTK IOMMU and SMI Yong Wu
2016-07-25 8:39 ` [PATCH 1/3] memory: mediatek: Add a new interface mtk_smi_larb_is_ready Matthias Brugger
2016-07-26 1:31 ` Yong Wu
2016-07-26 2:30 ` Tomasz Figa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1468983721-3627-2-git-send-email-yong.wu@mediatek.com \
--to=yong.wu@mediatek.com \
--cc=airlied@linux.ie \
--cc=arnd@arndb.de \
--cc=bibby.hsieh@mediatek.com \
--cc=ck.hu@mediatek.com \
--cc=djkurtz@google.com \
--cc=hans.verkuil@cisco.com \
--cc=honghui.zhang@mediatek.com \
--cc=iommu@lists.linux-foundation.org \
--cc=l.stach@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@osg.samsung.com \
--cc=p.zabel@pengutronix.de \
--cc=srv_heupstream@mediatek.com \
--cc=tfiga@google.com \
--cc=tiffany.lin@mediatek.com \
--cc=youlin.pei@mediatek.com \
--cc=yt.shen@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®